WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-110952-20210820113850.patch (text/plain), 7.98 KB, created by
Tim Nguyen (:ntim)
on 2021-08-20 02:38:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Nguyen (:ntim)
Created:
2021-08-20 02:38:52 PDT
Size:
7.98 KB
patch
obsolete
>Subversion Revision: 281300 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3e44428ce57d24625aba792ffcaceea3d5c5aa4c..e530df74404ba73716e53b80887ce9f0c97fa0da 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2021-08-20 Tim Nguyen <ntim@apple.com> >+ >+ Initial implementation of inert subtrees >+ https://bugs.webkit.org/show_bug.cgi?id=110952 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Currently covers: >+ - Blocking focus, editing, selecting >+ - aria-hidden like behaviour >+ >+ Hit testing/event retargeting will be covered by https://bugs.webkit.org/show_bug.cgi?id=229330 pending a spec issue >+ >+ Relevant WPT enabled. More testing coverage will be provided with the inert attribute. >+ >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::isAXHidden const): >+ * dom/Element.cpp: >+ (WebCore::Element::isFocusable const): >+ * dom/Node.cpp: >+ (WebCore::Node::computeEditability const): >+ (WebCore::Node::canStartSelection const): >+ (WebCore::Node::isInert const): >+ * dom/Node.h: >+ > 2021-08-20 Myles C. Maxfield <mmaxfield@apple.com> > > GlyphBuffer can become inconsistent with its backing string >diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp >index 8b41347014a99f8c69c65d265670cb76e3e4108d..50d205f45a351e2d8dca48f10fea7300cca1dee8 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp >@@ -3227,6 +3227,9 @@ bool AccessibilityObject::accessibilityIsIgnoredByDefault() const > // http://www.w3.org/TR/wai-aria/terms#def_hidden > bool AccessibilityObject::isAXHidden() const > { >+ if (node() && node()->isInert()) >+ return true; >+ > if (isFocused()) > return false; > >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index f4154a1ddb6f20d4eb11419cbd4abc256f9927aa..dc755037d7dcb28acb57c9ddefbe8dbe110ddc37 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -644,7 +644,7 @@ Vector<String> Element::getAttributeNames() const > > bool Element::isFocusable() const > { >- if (!isConnected() || !supportsFocus()) >+ if (!isConnected() || !supportsFocus() || isInert()) > return false; > > if (!renderer()) { >diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp >index 6924cf36a1229a3435d78e0b7d4c5d3f63a6fe14..e79169d7f6211f67e28b25d0c1adc8b850c0157f 100644 >--- a/Source/WebCore/dom/Node.cpp >+++ b/Source/WebCore/dom/Node.cpp >@@ -44,6 +44,7 @@ > #include "FrameView.h" > #include "HTMLAreaElement.h" > #include "HTMLBodyElement.h" >+#include "HTMLDialogElement.h" > #include "HTMLElement.h" > #include "HTMLImageElement.h" > #include "HTMLSlotElement.h" >@@ -780,7 +781,7 @@ static Node::Editability computeEditabilityFromComputedStyle(const Node& startNo > > Node::Editability Node::computeEditability(UserSelectAllTreatment treatment, ShouldUpdateStyle shouldUpdateStyle) const > { >- if (!document().hasLivingRenderTree() || isPseudoElement()) >+ if (!document().hasLivingRenderTree() || isPseudoElement() || isInert()) > return Editability::ReadOnly; > > if (isInShadowTree()) >@@ -1126,6 +1127,9 @@ bool Node::canStartSelection() const > if (hasEditableStyle()) > return true; > >+ if (isInert()) >+ return false; >+ > if (renderer()) { > const RenderStyle& style = renderer()->style(); > // We allow selections to begin within an element that has -webkit-user-select: none set, >@@ -2617,6 +2621,23 @@ void* Node::opaqueRootSlow() const > return const_cast<void*>(static_cast<const void*>(node)); > } > >+bool Node::isInert() const >+{ >+ if (!isConnected()) >+ return true; >+ >+ if (this != &document() && this != document().documentElement()) { >+ Node* activeModalDialog = document().activeModalDialog(); >+ if (activeModalDialog && !activeModalDialog->containsIncludingShadowDOM(this)) >+ return true; >+ } >+ >+ if (!document().frame() || !document().frame()->ownerElement()) >+ return false; >+ >+ return document().frame()->ownerElement()->isInert(); >+} >+ > template<> ContainerNode* parent<Tree>(const Node& node) > { > return node.parentNode(); >diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h >index e5560c428549ffde71cec18fd0ee97f114f8bef3..daf6bd92e0a3400a2e04ea9ca7dbf609b0fdf758 100644 >--- a/Source/WebCore/dom/Node.h >+++ b/Source/WebCore/dom/Node.h >@@ -524,6 +524,13 @@ public: > static int32_t flagIsParsingChildrenFinished() { return static_cast<int32_t>(NodeFlag::IsParsingChildrenFinished); } > #endif // ENABLE(JIT) > >+ // Whether the node is inert: >+ // https://html.spec.whatwg.org/multipage/interaction.html#inert >+ // https://github.com/WICG/inert/blob/master/README.md >+ // This can't be in Element because text nodes must be recognized as >+ // inert to prevent text selection. >+ bool isInert() const; >+ > protected: > enum class NodeFlag : uint32_t { > IsCharacterData = 1 << 0, >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 786ccebbeff69441f4c1beb398346675c8292999..c34146798da500f89a063a73982cd3299caf4e0e 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,21 @@ >+2021-08-20 Tim Nguyen <ntim@apple.com> >+ >+ Initial implementation of inert subtrees >+ https://bugs.webkit.org/show_bug.cgi?id=110952 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Currently covers: >+ - Blocking focus, editing, selecting >+ - aria-hidden like behaviour >+ >+ Hit testing/event retargeting will be covered by https://bugs.webkit.org/show_bug.cgi?id=229330 pending a spec issue >+ >+ Relevant WPT enabled. More testing coverage will be provided with the inert attribute. >+ >+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt: >+ * web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt: >+ > 2021-08-20 Tim Nguyen <ntim@apple.com> > > Ensure ancestors with opacity don't affect top layer elements >diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt >index 0ba7838087085564679f0011a44423adbf4c30f0..fe2c42220bbc43f25137533b43b82cc12d483096 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt >@@ -4,5 +4,5 @@ I'm editable > I'm tabindexed. > Link > >-FAIL Test that inert nodes are not focusable. assert_equals: body expected false but got true >+PASS Test that inert nodes are not focusable. > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt >index b1c1d8d47a97f373e46fdb5b4d5eb0992b2c5a66..4e42c03a541e789766e1e782757bed32724595b5 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt >@@ -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. >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 110952
:
190459
|
192181
|
435961
|
435967