Changeset 20066 in webkit


Ignore:
Timestamp:
Mar 8, 2007 2:00:53 PM (17 years ago)
Author:
justing
Message:

LayoutTests:

Reviewed by harrison


<http://bugs.webkit.org/show_bug.cgi?id=13000>
Range.createContextualFragment is not supported

  • fast/dom/Range/13000-expected.txt: Added.
  • fast/dom/Range/13000.html: Added.

WebCore:

Reviewed by harrison


<http://bugs.webkit.org/show_bug.cgi?id=13000>
Range.createContextualFragment is not supported

  • dom/Range.cpp: (WebCore::Range::createContextualFragment): The "startContainer" may not be a container, if the range starts inside text. In that case, look to the parent of the start node for an HTMLElement.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r20065 r20066  
     12007-03-08  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by harrison
     4       
     5        <http://bugs.webkit.org/show_bug.cgi?id=13000>
     6        Range.createContextualFragment is not supported
     7
     8        * fast/dom/Range/13000-expected.txt: Added.
     9        * fast/dom/Range/13000.html: Added.
     10
    1112007-03-08  Justin Garcia  <justin.garcia@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r20065 r20066  
     12007-03-08  Justin Garcia  <justin.garcia@apple.com>
     2
     3        Reviewed by harrison
     4       
     5        <http://bugs.webkit.org/show_bug.cgi?id=13000>
     6        Range.createContextualFragment is not supported
     7
     8        * dom/Range.cpp:
     9        (WebCore::Range::createContextualFragment): The
     10        "startContainer" may not be a container, if the
     11        range starts inside text.  In that case, look
     12        to the parent of the start node for an HTMLElement.
     13
    1142007-03-08  Justin Garcia  <justin.garcia@apple.com>
    215
  • trunk/WebCore/dom/Range.cpp

    r19925 r20066  
    10841084    }
    10851085
    1086     if (! m_startContainer->isHTMLElement()) {
     1086    Node* htmlElement = m_startContainer->isHTMLElement() ? m_startContainer.get() : m_startContainer->parentNode();
     1087   
     1088    if (!htmlElement->isHTMLElement()) {
    10871089        ec = NOT_SUPPORTED_ERR;
    10881090        return 0;
    10891091    }
    10901092
    1091     RefPtr<DocumentFragment> fragment = static_cast<HTMLElement*>(m_startContainer.get())->createContextualFragment(html);
     1093    RefPtr<DocumentFragment> fragment = static_cast<HTMLElement*>(htmlElement)->createContextualFragment(html);
    10921094    if (!fragment) {
    10931095        ec = NOT_SUPPORTED_ERR;
Note: See TracChangeset for help on using the changeset viewer.