Diff
Modified: branches/safari-613-branch/LayoutTests/ChangeLog (290940 => 290941)
--- branches/safari-613-branch/LayoutTests/ChangeLog 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/LayoutTests/ChangeLog 2022-03-07 22:10:35 UTC (rev 290941)
@@ -1,5 +1,65 @@
2022-03-07 Russell Epstein <[email protected]>
+ Cherry-pick r290554. rdar://problem/83757966
+
+ Remove Node::deprecatedIsInert
+ https://bugs.webkit.org/show_bug.cgi?id=230845
+
+ Reviewed by Antti Koivisto.
+
+ LayoutTests/imported/w3c:
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt:
+ * web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt:
+ * web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt:
+
+ Source/WebCore:
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * dom/Element.cpp:
+ (WebCore::Element::isFocusable const):
+ (WebCore::Element::isFocusableWithoutResolvingFullStyle const):
+ (WebCore::Element::isVisibleWithoutResolvingFullStyle const): Deleted.
+ * dom/Element.h:
+ * dom/Node.cpp:
+ (WebCore::Node::deprecatedIsInert const): Deleted.
+ * dom/Node.h:
+ * html/HTMLAreaElement.cpp:
+ (WebCore::HTMLAreaElement::isFocusable const):
+
+ LayoutTests:
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt: Added.
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt: Added.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-26 Tim Nguyen <[email protected]>
+
+ Remove Node::deprecatedIsInert
+ https://bugs.webkit.org/show_bug.cgi?id=230845
+
+ Reviewed by Antti Koivisto.
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt: Added.
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt: Added.
+
+2022-03-07 Russell Epstein <[email protected]>
+
Cherry-pick r290430. rdar://problem/87713597
RELEASE_ASSERT(!renderer()); in WebCore::Node::~Node() + 479 (Node.cpp:366)
Modified: branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog (290940 => 290941)
--- branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog 2022-03-07 22:10:35 UTC (rev 290941)
@@ -1,5 +1,73 @@
2022-03-07 Russell Epstein <[email protected]>
+ Cherry-pick r290554. rdar://problem/83757966
+
+ Remove Node::deprecatedIsInert
+ https://bugs.webkit.org/show_bug.cgi?id=230845
+
+ Reviewed by Antti Koivisto.
+
+ LayoutTests/imported/w3c:
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt:
+ * web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt:
+ * web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt:
+
+ Source/WebCore:
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * dom/Element.cpp:
+ (WebCore::Element::isFocusable const):
+ (WebCore::Element::isFocusableWithoutResolvingFullStyle const):
+ (WebCore::Element::isVisibleWithoutResolvingFullStyle const): Deleted.
+ * dom/Element.h:
+ * dom/Node.cpp:
+ (WebCore::Node::deprecatedIsInert const): Deleted.
+ * dom/Node.h:
+ * html/HTMLAreaElement.cpp:
+ (WebCore::HTMLAreaElement::isFocusable const):
+
+ LayoutTests:
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt: Added.
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt: Added.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-26 Tim Nguyen <[email protected]>
+
+ Remove Node::deprecatedIsInert
+ https://bugs.webkit.org/show_bug.cgi?id=230845
+
+ Reviewed by Antti Koivisto.
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt:
+ * web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt:
+ * web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt:
+
+2022-03-07 Russell Epstein <[email protected]>
+
Cherry-pick r290306. rdar://problem/88352589
Make pointer-events checks for SVG take in account inert subtrees
Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt (290940 => 290941)
--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt 2022-03-07 22:10:35 UTC (rev 290941)
@@ -1,4 +1,4 @@
+This is a dialog
+FAIL Test that removing dialog unblocks the document. assert_equals: expected false but got true
-PASS Test that removing dialog unblocks the document.
-
Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt (290940 => 290941)
--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt 2022-03-07 22:10:35 UTC (rev 290941)
@@ -20,22 +20,29 @@
`a` in `display: none`
assert_not_equals: got disallowed value Element node <a href="" data-focusable="false">
`a` in `display...
-PASS
+FAIL
inert `div`
-
-PASS
+ assert_not_equals: got disallowed value Element node <div tabindex="-1" data-focusable="false">
+ inert `d...
+FAIL
inert `span`
-
-PASS
+ assert_not_equals: got disallowed value Element node <span tabindex="-1" data-focusable="false">
+ inert `...
+FAIL
inert `a`
-
-PASS
+ assert_not_equals: got disallowed value Element node <a href="" data-focusable="false">
+ inert `a`
+ </a>
+FAIL
inert `div` in `display: none`
-
-PASS
+ assert_not_equals: got disallowed value Element node <div tabindex="-1" data-focusable="false">
+ inert `d...
+FAIL
inert `span` in `display: none`
-
-PASS
+ assert_not_equals: got disallowed value Element node <span tabindex="-1" data-focusable="false">
+ inert `...
+FAIL
inert `a` in `display: none`
+ assert_not_equals: got disallowed value Element node <a href="" data-focusable="false">
+ inert `a` in `d...
-
Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt (290940 => 290941)
--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt 2022-03-07 22:10:35 UTC (rev 290941)
@@ -9,5 +9,5 @@
PASS All focusable elements inside inert subtree are unfocusable
PASS Can get inert via property
PASS Elements inside of inert subtrees return false when getting 'inert'
-PASS Setting inert via property correctly modifies inert state
+FAIL Setting inert via property correctly modifies inert state assert_equals: expected true but got false
Added: branches/safari-613-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt (0 => 290941)
--- branches/safari-613-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt (rev 0)
+++ branches/safari-613-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt 2022-03-07 22:10:35 UTC (rev 290941)
@@ -0,0 +1,7 @@
+
+
+FAIL dialog.show(): focusing steps should not change focus when dialog is inert assert_equals: dialog.show(): focusing steps should not change focus when dialog is inert expected Element node <input id="outer-input"></input> but got Element node <input autofocus=""></input>
+FAIL dialog.showModal(): focusing steps should apply focus fixup rule when dialog is inert assert_equals: dialog.showModal(): focusing steps should apply focus fixup rule when dialog is inert expected Element node <body>
+<input id="outer-input">
+<dialog inert="" open="">... but got Element node <input autofocus=""></input>
+
Added: branches/safari-613-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt (0 => 290941)
--- branches/safari-613-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt (rev 0)
+++ branches/safari-613-branch/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt 2022-03-07 22:10:35 UTC (rev 290941)
@@ -0,0 +1,13 @@
+
+PASS dialog element: showModal()
+PASS showModal() on a <dialog> that already has an open attribute throws an InvalidStateError exception
+PASS showModal() on a <dialog> after initial showModal() and removing the open attribute
+PASS showModal() on a <dialog> not in a Document throws an InvalidStateError exception
+PASS when opening multiple dialogs, only the newest one is non-inert
+PASS opening dialog without focusable children
+PASS opening dialog with multiple focusable children
+FAIL opening dialog with multiple focusable children, one having the autofocus attribute assert_equals: expected Element node <input id="i82" value="foobar" autofocus=""></input> but got Element node <body><div id="log"></div>
+<button id="b0">OK</button>
+<d...
+PASS when opening multiple dialogs, the most recently opened is rendered on top
+OK
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (290940 => 290941)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-03-07 22:10:35 UTC (rev 290941)
@@ -1,5 +1,80 @@
2022-03-07 Russell Epstein <[email protected]>
+ Cherry-pick r290554. rdar://problem/83757966
+
+ Remove Node::deprecatedIsInert
+ https://bugs.webkit.org/show_bug.cgi?id=230845
+
+ Reviewed by Antti Koivisto.
+
+ LayoutTests/imported/w3c:
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt:
+ * web-platform-tests/inert/inert-canvas-fallback-content.tentative-expected.txt:
+ * web-platform-tests/inert/inert-node-is-unfocusable.tentative-expected.txt:
+
+ Source/WebCore:
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * dom/Element.cpp:
+ (WebCore::Element::isFocusable const):
+ (WebCore::Element::isFocusableWithoutResolvingFullStyle const):
+ (WebCore::Element::isVisibleWithoutResolvingFullStyle const): Deleted.
+ * dom/Element.h:
+ * dom/Node.cpp:
+ (WebCore::Node::deprecatedIsInert const): Deleted.
+ * dom/Node.h:
+ * html/HTMLAreaElement.cpp:
+ (WebCore::HTMLAreaElement::isFocusable const):
+
+ LayoutTests:
+
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focusing-steps-inert-expected.txt: Added.
+ * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-showModal-expected.txt: Added.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-26 Tim Nguyen <[email protected]>
+
+ Remove Node::deprecatedIsInert
+ https://bugs.webkit.org/show_bug.cgi?id=230845
+
+ Reviewed by Antti Koivisto.
+
+ This change unfortunately regresses focusability state when dynamically setting inert, due to a cached
+ computed style invalidation bug. This is minor in practice, since focusability usually gets queried in
+ user-initiated ways, when style already has fully been updated.
+
+ However, making this change will improve performance by avoiding a full DOM ancestor walk when there
+ is no inert attribute on the page, since we will only check a style bit after this patch.
+
+ * dom/Element.cpp:
+ (WebCore::Element::isFocusable const):
+ (WebCore::Element::isFocusableWithoutResolvingFullStyle const):
+ (WebCore::Element::isVisibleWithoutResolvingFullStyle const): Deleted.
+ * dom/Element.h:
+ * dom/Node.cpp:
+ (WebCore::Node::deprecatedIsInert const): Deleted.
+ * dom/Node.h:
+ * html/HTMLAreaElement.cpp:
+ (WebCore::HTMLAreaElement::isFocusable const):
+
+2022-03-07 Russell Epstein <[email protected]>
+
Cherry-pick r290537. rdar://problem/89239935
Do not trigger didFail during FileReaderLoader Destruction
Modified: branches/safari-613-branch/Source/WebCore/dom/Element.cpp (290940 => 290941)
--- branches/safari-613-branch/Source/WebCore/dom/Element.cpp 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/Source/WebCore/dom/Element.cpp 2022-03-07 22:10:35 UTC (rev 290941)
@@ -736,7 +736,7 @@
bool Element::isFocusable() const
{
- if (!isConnected() || !supportsFocus() || deprecatedIsInert())
+ if (!isConnected() || !supportsFocus())
return false;
if (!renderer()) {
@@ -743,10 +743,10 @@
// Elements in canvas fallback content are not rendered, but they are allowed to be
// focusable as long as their canvas is displayed and visible.
if (auto* canvas = ancestorsOfType<HTMLCanvasElement>(*this).first())
- return canvas->isVisibleWithoutResolvingFullStyle();
+ return canvas->isFocusableWithoutResolvingFullStyle();
}
- return isVisibleWithoutResolvingFullStyle();
+ return isFocusableWithoutResolvingFullStyle();
}
bool Element::isUserActionElementInActiveChain() const
@@ -3545,11 +3545,10 @@
return true;
}
-bool Element::isVisibleWithoutResolvingFullStyle() const
+bool Element::isFocusableWithoutResolvingFullStyle() const
{
-
if (renderStyle() || hasValidStyle())
- return renderStyle() && renderStyle()->visibility() == Visibility::Visible;
+ return renderStyle() && renderStyle()->visibility() == Visibility::Visible && !renderStyle()->effectiveInert();
auto computedStyleForElement = [](Element& element) -> const RenderStyle* {
auto* style = element.hasNodeFlag(NodeFlag::IsComputedStyleInvalidFlag) ? nullptr : element.existingComputedStyle();
@@ -3564,7 +3563,7 @@
if (style->display() == DisplayType::None || style->display() == DisplayType::Contents)
return false;
- if (style->visibility() != Visibility::Visible)
+ if (style->visibility() != Visibility::Visible || style->effectiveInert())
return false;
for (auto& element : composedTreeAncestors(const_cast<Element&>(*this))) {
Modified: branches/safari-613-branch/Source/WebCore/dom/Element.h (290940 => 290941)
--- branches/safari-613-branch/Source/WebCore/dom/Element.h 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/Source/WebCore/dom/Element.h 2022-03-07 22:10:35 UTC (rev 290941)
@@ -377,7 +377,7 @@
bool needsStyleInvalidation() const;
bool hasValidStyle() const;
- bool isVisibleWithoutResolvingFullStyle() const;
+ bool isFocusableWithoutResolvingFullStyle() const;
// Methods for indicating the style is affected by dynamic updates (e.g., children changing, our position changing in our sibling list, etc.)
bool styleAffectedByEmpty() const { return hasStyleFlag(NodeStyleFlag::StyleAffectedByEmpty); }
Modified: branches/safari-613-branch/Source/WebCore/dom/Node.cpp (290940 => 290941)
--- branches/safari-613-branch/Source/WebCore/dom/Node.cpp 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/Source/WebCore/dom/Node.cpp 2022-03-07 22:10:35 UTC (rev 290941)
@@ -2622,28 +2622,6 @@
return const_cast<void*>(static_cast<const void*>(node));
}
-// Please use RenderStyle::effectiveInert instead!
-bool Node::deprecatedIsInert() const
-{
- if (!isConnected())
- return true;
-
- if (this != &document()) {
- Node* activeModalDialog = document().activeModalDialog();
- if (activeModalDialog && !activeModalDialog->containsIncludingShadowDOM(this))
- return true;
- }
-
- if (document().settings().inertAttributeEnabled()) {
- for (RefPtr element = this; element; element = element->parentElementInComposedTree()) {
- if (is<HTMLElement>(*element) && downcast<HTMLElement>(*element).hasAttribute(HTMLNames::inertAttr))
- return true;
- }
- }
-
- return false;
-}
-
template<> ContainerNode* parent<Tree>(const Node& node)
{
return node.parentNode();
Modified: branches/safari-613-branch/Source/WebCore/dom/Node.h (290940 => 290941)
--- branches/safari-613-branch/Source/WebCore/dom/Node.h 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/Source/WebCore/dom/Node.h 2022-03-07 22:10:35 UTC (rev 290941)
@@ -530,9 +530,6 @@
static int32_t flagIsParsingChildrenFinished() { return static_cast<int32_t>(NodeFlag::IsParsingChildrenFinished); }
#endif // ENABLE(JIT)
- // Whether a node is inert, please use RenderStyle::effectiveInert instead!
- bool deprecatedIsInert() const;
-
protected:
enum class NodeFlag : uint32_t {
IsCharacterData = 1 << 0,
Modified: branches/safari-613-branch/Source/WebCore/html/HTMLAreaElement.cpp (290940 => 290941)
--- branches/safari-613-branch/Source/WebCore/html/HTMLAreaElement.cpp 2022-03-07 22:10:29 UTC (rev 290940)
+++ branches/safari-613-branch/Source/WebCore/html/HTMLAreaElement.cpp 2022-03-07 22:10:35 UTC (rev 290941)
@@ -211,7 +211,7 @@
bool HTMLAreaElement::isFocusable() const
{
RefPtr<HTMLImageElement> image = imageElement();
- if (!image || !image->isVisibleWithoutResolvingFullStyle())
+ if (!image || !image->isFocusableWithoutResolvingFullStyle())
return false;
return supportsFocus() && tabIndexSetExplicitly().value_or(0) >= 0;