Skip to content

Commit 03bb60a

Browse files
remove imports
1 parent 9303dc3 commit 03bb60a

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ type RadialGradientValue = {
777777
}>,
778778
};
779779

780-
export type URLBackgroundImageValue = {
780+
type URLBackgroundImageValue = {
781781
type: 'url',
782782
uri: string | number,
783783
};

packages/react-native/Libraries/StyleSheet/__tests__/processBackgroundImage-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ describe('processBackgroundImage', () => {
11621162
expect(result2).toEqual([]);
11631163
});
11641164

1165-
it('should parse url basic unquoted', () => {
1165+
it('should parse url unquoted', () => {
11661166
const result = processBackgroundImage('url(https://example.com/image.png)');
11671167
expect(result).toEqual([
11681168
{type: 'url', uri: 'https://example.com/image.png'},
@@ -1188,7 +1188,7 @@ describe('processBackgroundImage', () => {
11881188
});
11891189

11901190
it('should parse url case insensitive', () => {
1191-
const result = processBackgroundImage('URL(https://example.com/image.png)');
1191+
const result = processBackgroundImage('UrL(https://example.com/image.png)');
11921192
expect(result).toEqual([
11931193
{type: 'url', uri: 'https://example.com/image.png'},
11941194
]);

packages/react-native/Libraries/StyleSheet/processBackgroundImage.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,16 +283,12 @@ function parseBackgroundImageCSSString(
283283
const bgImageStrings = splitGradients(cssString);
284284

285285
for (const bgImageString of bgImageStrings) {
286-
// url syntax supports - url(x), url("x"), url('x')
287286
const urlRegex = /^url\((.*)\)$/i;
288287
const urlMatch = urlRegex.exec(bgImageString);
289288
if (urlMatch) {
290289
let uri = urlMatch[1].trim();
291-
// string single or double quotes
292-
if (
293-
(uri.startsWith('"') && uri.endsWith('"')) ||
294-
(uri.startsWith("'") && uri.endsWith("'"))
295-
) {
290+
const first = uri[0];
291+
if ((first === '"' || first === "'") && uri.endsWith(first)) {
296292
uri = uri.slice(1, -1);
297293
}
298294
if (uri.length > 0) {

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTUrlBackgroundImageLoader.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import <UIKit/UIKit.h>
98

109
#import <react/renderer/components/view/ViewShadowNode.h>
1110

packages/react-native/ReactCommon/react/renderer/css/tests/CSSBackgroundImageTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ TEST_F(CSSBackgroundImageTest, URLSingleQuoted) {
580580

581581
TEST_F(CSSBackgroundImageTest, URLCaseInsensitive) {
582582
auto result =
583-
parseCSSProperty<CSSBackgroundImage>("URL(https://example.com/image.png)");
583+
parseCSSProperty<CSSBackgroundImage>("UrL(https://example.com/image.png)");
584584
decltype(result) expected = CSSURLFunction{.url = "https://example.com/image.png"};
585585
ASSERT_EQ(result, expected);
586586
}

0 commit comments

Comments
 (0)