Skip to content
  • eric@webkit.org's avatar
    Incorrect behaviour calling Range setStart or setEnd with boundary in different document · 774f7d40
    eric@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=42517
    
    Reviewed by Ojan Vafai.
    
    Source/WebCore:
    
    Added a new static inline "checkForDifferentRootContainer" to share some code
    and made setStart/setEnd do the right thing in the x-document case.  I removed
    the bogus checks in set*After/set*Before functions, and since they just call
    through to setStart/setEnd, they also now do the right thing.
    
    Test: fast/dom/Range/set-wrong-document-err.html
    
    * dom/Range.cpp:
    (WebCore::checkForDifferentRootContainer):
    (WebCore):
    (WebCore::Range::setStart):
    (WebCore::Range::setEnd):
    (WebCore::Range::setStartAfter):
    (WebCore::Range::setEndBefore):
    (WebCore::Range::setEndAfter):
    (WebCore::Range::setStartBefore):
    
    LayoutTests:
    
    Add a new test to cover this changed behavior, and correct a FIXME in an old test
    which was documenting our incorrect behavior.
    
    * fast/dom/Range/set-wrong-document-err-expected.txt: Added.
    * fast/dom/Range/set-wrong-document-err.html: Added.
    * fast/dom/move-nodes-across-documents.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    774f7d40