Changeset 286949 in webkit
- Timestamp:
- Dec 13, 2021, 8:50:00 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-statement-before-import-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-statement-before-import.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/StyleSheetContents.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286948 r286949 1 2021-12-13 Antti Koivisto <antti@apple.com> 2 3 [CSS Cascade Layers] Unflake and fix web-platform-tests/css/css-cascade/layer-statement-before-import.html 4 https://bugs.webkit.org/show_bug.cgi?id=233944 5 6 Reviewed by Simon Fraser. 7 8 * TestExpectations: 9 1 10 2021-12-13 Tyler Wilcock <tyler_w@apple.com> 2 11 -
trunk/LayoutTests/TestExpectations
r286942 r286949 2186 2186 webkit.org/b/233937 imported/w3c/web-platform-tests/css/css-cascade/revert-layer-011.html [ ImageOnlyFailure ] 2187 2187 webkit.org/b/233937 imported/w3c/web-platform-tests/css/css-cascade/revert-layer-012.html [ ImageOnlyFailure ] 2188 webkit.org/b/233944 imported/w3c/web-platform-tests/css/css-cascade/layer-statement-before-import.html [ Pass Failure ]2189 2188 2190 2189 webkit.org/b/148801 imported/w3c/web-platform-tests/css/css-color/t422-rgba-onscreen-b.xht [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r286940 r286949 1 2021-12-13 Antti Koivisto <antti@apple.com> 2 3 [CSS Cascade Layers] Unflake and fix web-platform-tests/css/css-cascade/layer-statement-before-import.html 4 https://bugs.webkit.org/show_bug.cgi?id=233944 5 6 Reviewed by Simon Fraser. 7 8 * web-platform-tests/css/css-cascade/layer-statement-before-import-expected.txt: 9 * web-platform-tests/css/css-cascade/layer-statement-before-import.html: 10 11 Data URLs in @imports are not guaranteed to decode synchronously so make the test async. 12 Also catch exceptions from asserts for cleanup so failures don't affect other subtests. 13 1 14 2021-12-13 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-statement-before-import-expected.txt
r286647 r286949 1 CONSOLE MESSAGE: TypeError: Illegal constructor2 1 3 Harness Error (FAIL), message = TypeError: Illegal constructor 2 PASS length and item 3 PASS insertRule before imports 4 PASS insertRule after imports 5 PASS insert other rules to pre-import layer statements fails 6 PASS insert other rules before the first layer statement without imports 7 PASS deleteRule before imports 8 PASS deleteRule after imports 9 FAIL replaceSync clears stale layer statements promise_test: Unhandled rejection with value: object "TypeError: Illegal constructor" 4 10 5 FAIL length and item assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"6 FAIL insertRule before imports assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"7 FAIL insertRule after imports assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"8 FAIL insert other rules to pre-import layer statements fails assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"9 FAIL insert other rules before the first layer statement without imports The operation would yield an incorrect node tree.10 FAIL deleteRule before imports assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"11 FAIL deleteRule after imports assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-statement-before-import.html
r286647 r286949 160 160 161 161 for (let testCase of testCases) { 162 let styleElement; 163 let sheet; 164 if (!testCase.constructedStyleSheet) { 165 styleElement = document.createElement('style'); 166 styleElement.textContent = testCase.style; 167 document.head.append(styleElement); 168 sheet = styleElement.sheet; 169 } else { 170 sheet = new CSSStyleSheet(); 171 sheet.replaceSync(testCase.style); 172 document.adoptedStyleSheets = [sheet]; 173 } 162 promise_test(async t => { 163 let styleElement; 164 let sheet; 165 if (!testCase.constructedStyleSheet) { 166 styleElement = document.createElement('style'); 167 styleElement.textContent = testCase.style; 168 await new Promise(resolve => { 169 styleElement.onload = resolve; 170 styleElement.onerror = resolve; 171 document.head.append(styleElement); 172 }); 173 sheet = styleElement.sheet; 174 } else { 175 sheet = new CSSStyleSheet(); 176 sheet.replaceSync(testCase.style); 177 document.adoptedStyleSheets = [sheet]; 178 } 174 179 175 test(() => { 176 testCase.operations(sheet); 177 assert_equals(getComputedStyle(target).color, getComputedStyle(reference).color); 178 },testCase.title); 179 180 if (styleElement) 181 styleElement.remove(); 182 document.adoptedStyleSheets = []; 180 try { 181 testCase.operations(sheet); 182 assert_equals(getComputedStyle(target).color, getComputedStyle(reference).color); 183 } finally { 184 if (styleElement) 185 styleElement.remove(); 186 document.adoptedStyleSheets = []; 187 } 188 }, testCase.title); 183 189 } 184 190 </script> -
trunk/Source/WebCore/ChangeLog
r286945 r286949 1 2021-12-13 Antti Koivisto <antti@apple.com> 2 3 [CSS Cascade Layers] Unflake and fix web-platform-tests/css/css-cascade/layer-statement-before-import.html 4 https://bugs.webkit.org/show_bug.cgi?id=233944 5 6 Reviewed by Simon Fraser. 7 8 Inserting rules before early layer statements may be legal if they are moved to the regular rule list. 9 10 * css/StyleSheetContents.cpp: 11 (WebCore::StyleSheetContents::wrapperInsertRule): 12 1 13 2021-12-13 Adrian Perez de Castro <aperez@igalia.com> 2 14 -
trunk/Source/WebCore/css/StyleSheetContents.cpp
r286916 r286949 238 238 // Parser::parseRule doesn't currently allow @charset so we don't need to deal with it. 239 239 ASSERT(!rule->isCharsetRule()); 240 240 241 // Maybe the insert will be legal if we treat early layer statement rules as normal child rules? 242 auto shouldMoveLayerRulesBeforeImportToNormalChildRules = [&] { 243 if (index >= m_layerRulesBeforeImportRules.size()) 244 return false; 245 if (!m_importRules.isEmpty() || !m_namespaceRules.isEmpty()) 246 return false; 247 bool isLayerStatement = is<StyleRuleLayer>(rule) && downcast<StyleRuleLayer>(rule.get()).isStatement(); 248 return !rule->isImportRule() && !rule->isNamespaceRule() && !isLayerStatement; 249 }; 250 251 if (shouldMoveLayerRulesBeforeImportToNormalChildRules()) 252 m_childRules.insertVector(0, std::exchange(m_layerRulesBeforeImportRules, { })); 253 241 254 unsigned childVectorIndex = index; 242 255 if (childVectorIndex < m_layerRulesBeforeImportRules.size() || (childVectorIndex == m_layerRulesBeforeImportRules.size() && is<StyleRuleLayer>(rule))) { … … 269 282 270 283 if (childVectorIndex < m_namespaceRules.size() || (childVectorIndex == m_namespaceRules.size() && rule->isNamespaceRule())) { 271 // Inserting non-namespace rules other than import rulebefore @namespace is284 // Inserting non-namespace rules other than import and layer statement rules before @namespace is 272 285 // not allowed. 273 286 if (!is<StyleRuleNamespace>(rule))
Note:
See TracChangeset
for help on using the changeset viewer.