Skip to content

Commit

Permalink
Unreviewed, reverting 271040@main and 271042@main.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265283

Introduced flaky ASSERTs in WebInspector

Reverted changesets:

"[view-transitions] Implement parsing & checking for pseudo-elements"
https://bugs.webkit.org/show_bug.cgi?id=265167
https://commits.webkit.org/271040@main

"Include CSSSelectorParserContext.h instead of CSSSelectorParser.h"
https://bugs.webkit.org/show_bug.cgi?id=265234
https://commits.webkit.org/271042@main

Canonical link: https://commits.webkit.org/271077@main
  • Loading branch information
webkit-commit-queue authored and philn committed Nov 23, 2023
1 parent 6ca73eb commit c2f3cd7
Show file tree
Hide file tree
Showing 29 changed files with 41 additions and 728 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,20 @@
// we need the empty stylesheet to avoid default XSLT views of the XML
const style = iframe.contentDocument.createElementNS("http://www.w3.org/1999/xhtml", "style");
root.appendChild(style);

// Grab initial styles from a random element, as the root can get non-initial UA styling.
const div = iframe.contentDocument.createElementNS("http://www.w3.org/1999/xhtml", "div");
root.appendChild(div);
const cs = iframe.contentWindow.getComputedStyle(div);

const cs = iframe.contentWindow.getComputedStyle(root);
let actual_initial = Object.create(null);
for (let i = 0; i < cs.length; i++) {
let prop_name = cs[i];
actual_initial[prop_name] = cs[prop_name];
}
const rootCS = iframe.contentWindow.getComputedStyle(root);
test(() => {
style.textContent = ":root { color: blue }";
assert_equals(rootCS["color"], "rgb(0, 0, 255)");
assert_equals(cs["color"], "rgb(0, 0, 255)");
}, "stylesheet takes effect");
style.textContent = ":root { all: initial; direction: initial; unicode-bidi: initial; } style { display: none; }";
for (let prop_name in actual_initial) {
test(() => {
assert_equals(rootCS[prop_name], actual_initial[prop_name]);
assert_equals(cs[prop_name], actual_initial[prop_name]);
}, prop_name);
}
});
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@ PASS Property view-transition-name value 'none'
PASS Property view-transition-name value 'foo'
PASS Property view-transition-name value 'bar'
PASS Property view-transition-name value 'baz'
PASS Property view-transition-name value 'unset'
PASS Property view-transition-name value 'initial'
PASS Property view-transition-name value 'inherit'
PASS Property view-transition-name value 'revert'
PASS Property view-transition-name value 'revert-layer'

Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
</head>
<body>
<div id=target></div>
<div id=scratch></div>
<script>

test_computed_value("view-transition-name", "none");
test_computed_value("view-transition-name", "foo");
test_computed_value("view-transition-name", "bar");
test_computed_value("view-transition-name", "baz");
test_computed_value("view-transition-name", "unset", "none");
test_computed_value("view-transition-name", "initial", "none");
test_computed_value("view-transition-name", "inherit", "none");
test_computed_value("view-transition-name", "revert", "none");
test_computed_value("view-transition-name", "revert-layer", "none");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

PASS e.style['view-transition-name'] = "default" should not set the property value
PASS e.style['view-transition-name'] = "none none" should not set the property value
PASS e.style['view-transition-name'] = "\"none\"" should not set the property value
PASS e.style['view-transition-name'] = "\"foo\"" should not set the property value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</head>
<body>
<script>
test_invalid_value("view-transition-name", "default"); // `default` isn't allowed by the `<custom-ident>` syntax.
test_invalid_value("view-transition-name", "none none");
test_invalid_value("view-transition-name", `"none"`);
test_invalid_value("view-transition-name", `"foo"`);
Expand Down
7 changes: 1 addition & 6 deletions Source/WebCore/animation/WebAnimationUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
#include "AnimationPlaybackEvent.h"
#include "CSSAnimation.h"
#include "CSSAnimationEvent.h"
#include "CSSParserContext.h"
#include "CSSPropertyNames.h"
#include "CSSSelector.h"
#include "CSSSelectorParser.h"
#include "CSSTransition.h"
#include "CSSTransitionEvent.h"
#include "DeclarativeAnimation.h"
Expand Down Expand Up @@ -329,10 +327,7 @@ ExceptionOr<PseudoId> pseudoIdFromString(const String& pseudoElement)
auto isLegacy = pseudoElement == ":before"_s || pseudoElement == ":after"_s || pseudoElement == ":first-letter"_s || pseudoElement == ":first-line"_s;
if (!isLegacy && !pseudoElement.startsWith("::"_s))
return Exception { ExceptionCode::SyntaxError };

// FIXME: This parserContext should include a document to get the proper settings.
CSSSelectorParserContext parserContext { CSSParserContext { HTMLStandardMode } };
auto pseudoType = CSSSelector::parsePseudoElementType(StringView(pseudoElement).substring(isLegacy ? 1 : 2), parserContext);
auto pseudoType = CSSSelector::parsePseudoElementType(StringView(pseudoElement).substring(isLegacy ? 1 : 2));
if (pseudoType == CSSSelector::PseudoElementUnknown || pseudoType == CSSSelector::PseudoElementWebKitCustom)
return Exception { ExceptionCode::SyntaxError };
return CSSSelector::pseudoId(pseudoType);
Expand Down
3 changes: 1 addition & 2 deletions Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "CSSPropertyAnimation.h"
#include "CSSPropertyParser.h"
#include "CSSSelector.h"
#include "CSSSelectorParserContext.h"
#include "CSSValuePool.h"
#include "ComposedTreeAncestorIterator.h"
#include "ComputedStyleExtractor.h"
Expand All @@ -56,7 +55,7 @@ CSSComputedStyleDeclaration::CSSComputedStyleDeclaration(Element& element, bool
name = name.substring(1);
if (name.startsWith(':'))
name = name.substring(1);
m_pseudoElementSpecifier = CSSSelector::pseudoId(CSSSelector::parsePseudoElementType(name, CSSSelectorParserContext { element.document() }));
m_pseudoElementSpecifier = CSSSelector::pseudoId(CSSSelector::parsePseudoElementType(name));
}

CSSComputedStyleDeclaration::~CSSComputedStyleDeclaration() = default;
Expand Down
Loading

0 comments on commit c2f3cd7

Please sign in to comment.