Changeset 139962 in webkit


Ignore:
Timestamp:
Jan 16, 2013 9:13:00 PM (11 years ago)
Author:
shinyak@chromium.org
Message:

[Refactoring] HTMLTextFormControlElement should use shadowHost instead of shadowAncestorNode
https://bugs.webkit.org/show_bug.cgi?id=106533

Reviewed by Kent Tamura.

Since Node::shadowAncestorNode() is deprecated, we would like to use Node::shadowHost().

No new tests, simple refactoring.

  • html/HTMLTextFormControlElement.cpp:

(WebCore::HTMLTextFormControlElement::setSelectionRange): Here, startPosition and endPosition is in ShadowDOM,
converting shadowAncestorNode to shadowHost is safe.
(WebCore::enclosingTextFormControl): Actually ASSERT in this method is wrong since shadowAncestorNode() does not
return NULL. This should be shadowHost().

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139959 r139962  
     12013-01-16  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        [Refactoring] HTMLTextFormControlElement should use shadowHost instead of shadowAncestorNode
     4        https://bugs.webkit.org/show_bug.cgi?id=106533
     5
     6        Reviewed by Kent Tamura.
     7
     8        Since Node::shadowAncestorNode() is deprecated, we would like to use Node::shadowHost().
     9
     10        No new tests, simple refactoring.
     11
     12        * html/HTMLTextFormControlElement.cpp:
     13        (WebCore::HTMLTextFormControlElement::setSelectionRange): Here, startPosition and endPosition is in ShadowDOM,
     14        converting shadowAncestorNode to shadowHost is safe.
     15        (WebCore::enclosingTextFormControl): Actually ASSERT in this method is wrong since shadowAncestorNode() does not
     16        return NULL. This should be shadowHost().
     17
    1182013-01-16  Tony Gentilcore  <tonyg@chromium.org>
    219
  • trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp

    r137336 r139962  
    331331    // "-webkit-user-select: none" style attribute is specified.
    332332    if (startPosition.isNotNull() && endPosition.isNotNull()) {
    333         ASSERT(startPosition.deepEquivalent().deprecatedNode()->shadowAncestorNode() == this
    334             && endPosition.deepEquivalent().deprecatedNode()->shadowAncestorNode() == this);
     333        ASSERT(startPosition.deepEquivalent().deprecatedNode()->shadowHost() == this
     334            && endPosition.deepEquivalent().deprecatedNode()->shadowHost() == this);
    335335    }
    336336    VisibleSelection newSelection;
     
    640640{
    641641    ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOffsetInAnchor
    642            || position.containerNode() || !position.anchorNode()->shadowAncestorNode());
     642        || position.containerNode() || !position.anchorNode()->shadowHost());
    643643    Node* container = position.containerNode();
    644644    if (!container)
    645645        return 0;
    646     Node* ancestor = container->shadowAncestorNode();
    647     return ancestor != container ? toTextFormControl(ancestor) : 0;
     646    Node* ancestor = container->shadowHost();
     647    return ancestor ? toTextFormControl(ancestor) : 0;
    648648}
    649649
Note: See TracChangeset for help on using the changeset viewer.