Changeset 106298 in webkit


Ignore:
Timestamp:
Jan 30, 2012 4:18:19 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

Crash in previousLinePosition when moving into a root inline box without leaves
https://bugs.webkit.org/show_bug.cgi?id=76812

Reviewed by Enrica Casucci.

Source/WebCore:

The crash was caused by us assuming that every root inline box has at least one leaf,
which isn't true when we create inline boxes for an empty text run with margin, border, etc...

Test: editing/selection/move-into-empty-root-inline-box.html

  • editing/visible_units.cpp:

(WebCore::previousLinePosition):
(WebCore::nextLinePosition):

LayoutTests:

Add a regression test for the crash. Unfortunately, we can only test previousLinePosition.

  • editing/selection/move-into-empty-root-inline-box-expected.txt: Added.
  • editing/selection/move-into-empty-root-inline-box.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106297 r106298  
     12012-01-30  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Crash in previousLinePosition when moving into a root inline box without leaves
     4        https://bugs.webkit.org/show_bug.cgi?id=76812
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Add a regression test for the crash. Unfortunately, we can only test previousLinePosition.
     9
     10        * editing/selection/move-into-empty-root-inline-box-expected.txt: Added.
     11        * editing/selection/move-into-empty-root-inline-box.html: Added.
     12
    1132012-01-30  Oliver Hunt  <oliver@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r106291 r106298  
     12012-01-30  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Crash in previousLinePosition when moving into a root inline box without leaves
     4        https://bugs.webkit.org/show_bug.cgi?id=76812
     5
     6        Reviewed by Enrica Casucci.
     7
     8        The crash was caused by us assuming that every root inline box has at least one leaf,
     9        which isn't true when we create inline boxes for an empty text run with margin, border, etc...
     10
     11        Test: editing/selection/move-into-empty-root-inline-box.html
     12
     13        * editing/visible_units.cpp:
     14        (WebCore::previousLinePosition):
     15        (WebCore::nextLinePosition):
     16
    1172012-01-30  Levi Weintraub  <leviw@chromium.org>
    218
  • trunk/Source/WebCore/editing/visible_units.cpp

    r104350 r106298  
    577577        // We want to skip zero height boxes.
    578578        // This could happen in case it is a TrailingFloatsRootInlineBox.
    579         if (!root || !root->logicalHeight())
     579        if (!root || !root->logicalHeight() || !root->firstLeafChild())
    580580            root = 0;
    581581    }
     
    678678        // We want to skip zero height boxes.
    679679        // This could happen in case it is a TrailingFloatsRootInlineBox.
    680         if (!root || !root->logicalHeight())
     680        if (!root || !root->logicalHeight() || !root->firstLeafChild())
    681681            root = 0;
    682682    }
Note: See TracChangeset for help on using the changeset viewer.