⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 235485 in webkit


Ignore:
Timestamp:
Aug 29, 2018, 4:35:30 PM (8 years ago)
Author:
dbates@webkit.org
Message:

REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
https://bugs.webkit.org/show_bug.cgi?id=184390
<rdar://problem/41804994>
And
<rdar://problem/39771867>

Reviewed by Simon Fraser.

Source/WebCore:

Speculative fix for Epiphany.

In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a
result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide()
such that it returns an empty vector. One way this can happen is when subdividing an empty inline
text box associated with combined text (RenderCombineText). For now we add a check to bail out of
resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a
subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions.

Test: fast/text/text-combine-surroundContents-crash.html

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::subdivideAndResolveStyle):

LayoutTests:

Add a test to ensure that we do not crash when painting an empty inline text box associated
with combined text.

  • fast/text/text-combine-surroundContents-crash-expected.txt: Added.
  • fast/text/text-combine-surroundContents-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r235484 r235485  
     12018-08-29  Daniel Bates  <dabates@apple.com>
     2
     3        REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
     4        https://bugs.webkit.org/show_bug.cgi?id=184390
     5        <rdar://problem/41804994>
     6        And
     7        <rdar://problem/39771867>
     8
     9        Reviewed by Simon Fraser.
     10
     11        Add a test to ensure that we do not crash when painting an empty inline text box associated
     12        with combined text.
     13
     14        * fast/text/text-combine-surroundContents-crash-expected.txt: Added.
     15        * fast/text/text-combine-surroundContents-crash.html: Added.
     16
    1172018-08-29  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r235484 r235485  
     12018-08-29  Daniel Bates  <dabates@apple.com>
     2
     3        REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
     4        https://bugs.webkit.org/show_bug.cgi?id=184390
     5        <rdar://problem/41804994>
     6        And
     7        <rdar://problem/39771867>
     8
     9        Reviewed by Simon Fraser.
     10
     11        Speculative fix for Epiphany.
     12
     13        In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a
     14        result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide()
     15        such that it returns an empty vector. One way this can happen is when subdividing an empty inline
     16        text box associated with combined text (RenderCombineText). For now we add a check to bail out of
     17        resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a
     18        subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions.
     19
     20        Test: fast/text/text-combine-surroundContents-crash.html
     21
     22        * rendering/InlineTextBox.cpp:
     23        (WebCore::InlineTextBox::subdivideAndResolveStyle):
     24
    1252018-08-29  Youenn Fablet  <youenn@apple.com>
    226
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r235378 r235485  
    793793
    794794    auto markedTexts = subdivide(textsToSubdivide);
     795    if (markedTexts.isEmpty())
     796        return { };
    795797
    796798    // Compute frontmost overlapping styled marked texts.
Note: See TracChangeset for help on using the changeset viewer.