Title: [257846] trunk/Source/WebCore
Revision
257846
Author
an...@apple.com
Date
2020-03-04 08:34:41 -0800 (Wed, 04 Mar 2020)

Log Message

Avoid full style resolution on Element::focus()
https://bugs.webkit.org/show_bug.cgi?id=208504
<rdar://problem/60035288>

Unreviewed followup.


* dom/Element.cpp:
(WebCore::Element::resolveComputedStyle):
(WebCore::Element::isVisibleWithoutResolvingFullStyle const):

Emilio spotted that this neeeds to be a composed ancestor walk to match resolveComputedStyle.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (257845 => 257846)


--- trunk/Source/WebCore/ChangeLog	2020-03-04 16:31:59 UTC (rev 257845)
+++ trunk/Source/WebCore/ChangeLog	2020-03-04 16:34:41 UTC (rev 257846)
@@ -1,3 +1,17 @@
+2020-03-04  Antti Koivisto  <an...@apple.com>
+
+        Avoid full style resolution on Element::focus()
+        https://bugs.webkit.org/show_bug.cgi?id=208504
+        <rdar://problem/60035288>
+
+        Unreviewed followup.
+
+        * dom/Element.cpp:
+        (WebCore::Element::resolveComputedStyle):
+        (WebCore::Element::isVisibleWithoutResolvingFullStyle const):
+
+        Emilio spotted that this neeeds to be a composed ancestor walk to match resolveComputedStyle.
+
 2020-03-04  Simon Fraser  <simon.fra...@apple.com>
 
         (r256513) [ Mac ] fast/scrolling/programmatic-scroll-to-zero-zero.html is a flaky failure

Modified: trunk/Source/WebCore/dom/Element.cpp (257845 => 257846)


--- trunk/Source/WebCore/dom/Element.cpp	2020-03-04 16:31:59 UTC (rev 257845)
+++ trunk/Source/WebCore/dom/Element.cpp	2020-03-04 16:34:41 UTC (rev 257846)
@@ -3292,8 +3292,7 @@
     const RenderStyle* computedStyle = nullptr;
 
     // Collect ancestors until we find one that has style.
-    auto composedAncestors = composedTreeAncestors(*this);
-    for (auto& ancestor : composedAncestors) {
+    for (auto& ancestor : composedTreeAncestors(*this)) {
         if (auto* existingStyle = ancestor.existingComputedStyle()) {
             computedStyle = existingStyle;
             break;
@@ -3349,7 +3348,7 @@
     if (style->visibility() != Visibility::Visible)
         return false;
 
-    for (auto& element : ancestorsOfType<Element>(*this)) {
+    for (auto& element : composedTreeAncestors(const_cast<Element&>(*this))) {
         if (element.existingComputedStyle()->display() == DisplayType::None)
             return false;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to