Ignore:
Timestamp:
Aug 30, 2013, 7:30:12 AM (12 years ago)
Author:
[email protected]
Message:

Node::document() should return a reference.
<https://webkit.org/b/120496>

Reviewed by Antti Koivisto.

Now that orphan DocumentType nodes also have document pointers, it's no longer
possible to have a null Node::document().

Cement this by making document() return a reference, and remove the various
null checks exposed by this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/xml/XMLSerializer.cpp

    r152685 r154877  
    2828namespace WebCore {
    2929
    30 String XMLSerializer::serializeToString(Node* node, ExceptionCode& ec)
     30String XMLSerializer::serializeToString(Node* node, ExceptionCode&)
    3131{
    3232    if (!node)
    3333        return String();
    34 
    35     if (!node->document()) {
    36         // Due to the fact that DocumentType nodes are created by the DOMImplementation
    37         // and not the Document, it is possible for it to not have a Document associated
    38         // with it.  It should be the only type of node where this is possible.
    39         ASSERT(node->nodeType() == Node::DOCUMENT_TYPE_NODE);
    40 
    41         ec = INVALID_ACCESS_ERR;
    42         return String();
    43     }
    44 
    4534    return createMarkup(node, IncludeNode, 0, DoNotResolveURLs, 0, XMLFragmentSerialization);
    4635}
Note: See TracChangeset for help on using the changeset viewer.