Changeset 229505 in webkit


Ignore:
Timestamp:
Mar 10, 2018 11:31:14 AM (6 years ago)
Author:
Alan Bujtas
Message:

Turn off offset*/scroll* optimization for input elements with shadow content
https://bugs.webkit.org/show_bug.cgi?id=182383
<rdar://problem/37114190>

Reviewed by Antti Koivisto.

Source/WebCore:

We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width.
In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return
the previously computed values even when some part of the tree is dirty.
In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout)
for the root, while true (needs layout) for the shadow content.
This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result.

Test: fast/forms/scrollheight-with-mutation-crash.html

  • dom/Document.cpp:

(WebCore::Document::updateLayoutIfDimensionsOutOfDate):

LayoutTests:

  • fast/forms/scrollheight-with-mutation-crash-expected.txt: Added.
  • fast/forms/scrollheight-with-mutation-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r229503 r229505  
     12018-03-09  Zalan Bujtas  <zalan@apple.com>
     2
     3        Turn off offset*/scroll* optimization for input elements with shadow content
     4        https://bugs.webkit.org/show_bug.cgi?id=182383
     5        <rdar://problem/37114190>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/forms/scrollheight-with-mutation-crash-expected.txt: Added.
     10        * fast/forms/scrollheight-with-mutation-crash.html: Added.
     11
    1122018-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r229503 r229505  
     12018-03-09  Zalan Bujtas  <zalan@apple.com>
     2
     3        Turn off offset*/scroll* optimization for input elements with shadow content
     4        https://bugs.webkit.org/show_bug.cgi?id=182383
     5        <rdar://problem/37114190>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        We normally ensure clean tree before calling offsetHeight/Width, scrollHeight/Width.
     10        In certain cases (see updateLayoutIfDimensionsOutOfDate() for details), it's okay to return
     11        the previously computed values even when some part of the tree is dirty.
     12        In case of shadow content, updateLayoutIfDimensionsOutOfDate() might return false (no need to layout)
     13        for the root, while true (needs layout) for the shadow content.
     14        This could confuse the caller (Element::scrollWidth/Height etc) and lead to incorrect result.
     15
     16        Test: fast/forms/scrollheight-with-mutation-crash.html
     17
     18        * dom/Document.cpp:
     19        (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
     20
    1212018-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    222
  • trunk/Source/WebCore/dom/Document.cpp

    r229466 r229505  
    20752075    }
    20762076
     2077    // Turn off this optimization for input elements with shadow content.
     2078    if (is<HTMLInputElement>(element))
     2079        requireFullLayout = true;
     2080
    20772081    bool isVertical = renderer && !renderer->isHorizontalWritingMode();
    20782082    bool checkingLogicalWidth = ((dimensionsCheck & WidthDimensionsCheck) && !isVertical) || ((dimensionsCheck & HeightDimensionsCheck) && isVertical);
Note: See TracChangeset for help on using the changeset viewer.