Changeset 99886 in webkit


Ignore:
Timestamp:
Nov 10, 2011 11:51:58 AM (12 years ago)
Author:
xji@chromium.org
Message:

Source/WebCore: --webkit-visual-word crash when create legacy position for shadowRoot
https://bugs.webkit.org/show_bug.cgi?id=71600

Reviewed by Ryosuke Niwa.

Inside textarea, the shadowed text node's previous leaf node could be the
shadowRoot node, which cause assert exception in creating legacy position based
on such node. Exit previousRootInlineBox() when reach shadowRoot node.

It does not cause problem when looking for text node's next leaf node. Adding
the same checking in nextRootInlineBox just to be safe.

Test: editing/selection/move-by-word-visually-crash-test-textarea.html

  • editing/visible_units.cpp:

(WebCore::previousRootInlineBox):
(WebCore::nextRootInlineBox):

LayoutTests: --webkit-visual-word crash when create legacy position for shadowRoot
https://bugs.webkit.org/show_bug.cgi?id=71600

Reviewed by Ryosuke Niwa.

  • editing/selection/move-by-word-visually-crash-test-textarea-expected.txt: Added.
  • editing/selection/move-by-word-visually-crash-test-textarea.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r99884 r99886  
     12011-11-10  Xiaomei Ji  <xji@chromium.org>
     2
     3        --webkit-visual-word crash when create legacy position for shadowRoot
     4        https://bugs.webkit.org/show_bug.cgi?id=71600
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * editing/selection/move-by-word-visually-crash-test-textarea-expected.txt: Added.
     9        * editing/selection/move-by-word-visually-crash-test-textarea.html: Added.
     10
    1112011-11-10  Ojan Vafai  <ojan@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r99883 r99886  
     12011-11-10  Xiaomei Ji  <xji@chromium.org>
     2
     3        --webkit-visual-word crash when create legacy position for shadowRoot
     4        https://bugs.webkit.org/show_bug.cgi?id=71600
     5   
     6        Reviewed by Ryosuke Niwa.
     7
     8        Inside textarea, the shadowed text node's previous leaf node could be the
     9        shadowRoot node, which cause assert exception in creating legacy position based
     10        on such node. Exit previousRootInlineBox() when reach shadowRoot node.
     11
     12        It does not cause problem when looking for text node's next leaf node. Adding
     13        the same checking in nextRootInlineBox just to be safe.
     14
     15        Test: editing/selection/move-by-word-visually-crash-test-textarea.html
     16
     17        * editing/visible_units.cpp:
     18        (WebCore::previousRootInlineBox):
     19        (WebCore::nextRootInlineBox):
     20
    1212011-11-10  Dean Jackson  <dino@apple.com>
    222
  • trunk/Source/WebCore/editing/visible_units.cpp

    r98428 r99886  
    14351435        previousNode = previousNode->previousLeafNode();
    14361436 
    1437     while (previousNode) {
     1437    while (previousNode && !previousNode->isShadowRoot()) {
    14381438        Position pos = createLegacyEditingPosition(previousNode, caretMaxOffset(previousNode));
    14391439       
     
    14581458        nextNode = nextNode->nextLeafNode();
    14591459 
    1460     while (nextNode) {
     1460    while (nextNode && !nextNode->isShadowRoot()) {
    14611461        Position pos;
    14621462        pos = createLegacyEditingPosition(nextNode, caretMinOffset(nextNode));
Note: See TracChangeset for help on using the changeset viewer.