Changeset 64889 in webkit
- Timestamp:
- Aug 6, 2010 6:30:16 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64886 r64889 1 2010-08-06 Tony Gentilcore <tonyg@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 Fix style violations in Document 6 https://bugs.webkit.org/show_bug.cgi?id=43657 7 8 No new tests because no new functionality. 9 10 * dom/Document.cpp: 11 (WebCore::acceptsEditingFocus): 12 (WebCore::Document::Document): 13 (WebCore::Document::importNode): 14 (WebCore::Document::adoptNode): 15 (WebCore::Document::getElementById): 16 (WebCore::Document::readyState): 17 (WebCore::Document::createTreeWalker): 18 (WebCore::Document::shouldScheduleLayout): 19 (WebCore::Document::nextFocusableNode): 20 (WebCore::Document::previousFocusableNode): 21 (WebCore::Document::nodeAbsIndex): 22 (WebCore::Document::nodeWithAbsIndex): 23 (WebCore::Document::childTypeAllowed): 24 (WebCore::Document::canReplaceChild): 25 (WebCore::Document::recalcStyleSelector): 26 (WebCore::Document::setFocusedNode): 27 (WebCore::Document::attachNodeIterator): 28 (WebCore::Document::detachNodeIterator): 29 (WebCore::Document::parseQualifiedName): 30 (WebCore::Document::getImageMap): 31 (WebCore::Document::setInPageCache): 32 (WebCore::Document::addMarker): 33 (WebCore::Document::copyMarkers): 34 (WebCore::Document::shiftMarkers): 35 (WebCore::Document::setMarkersActive): 36 (WebCore::Document::parentDocument): 37 (WebCore::Document::topDocument): 38 (WebCore::FormElementKeyHash::hash): 39 (WebCore::Document::initSecurityContext): 40 * dom/Document.h: 41 (WebCore::Document::incDOMTreeVersion): 42 (WebCore::Document::domTreeVersion): 43 1 44 2010-08-06 Eric Carlson <eric.carlson@apple.com> 2 45 -
trunk/WebCore/dom/Document.cpp
r64873 r64889 80 80 #include "HTMLNameCollection.h" 81 81 #include "HTMLNames.h" 82 #include "LegacyHTMLTreeBuilder.h"83 82 #include "HTMLStyleElement.h" 84 83 #include "HTMLTitleElement.h" 85 #include "LegacyHTMLDocumentParser.h"86 84 #include "HTTPParsers.h" 87 85 #include "HistoryItem.h" … … 92 90 #include "InspectorTimelineAgent.h" 93 91 #include "KeyboardEvent.h" 92 #include "LegacyHTMLDocumentParser.h" 93 #include "LegacyHTMLTreeBuilder.h" 94 94 #include "Logging.h" 95 95 #include "MessageEvent.h" … … 137 137 #include "WebKitTransitionEvent.h" 138 138 #include "WheelEvent.h" 139 #include "XMLDocumentParser.h" 139 140 #include "XMLHttpRequest.h" 140 141 #include "XMLNSNames.h" 141 142 #include "XMLNames.h" 142 #include "XMLDocumentParser.h"143 143 #include "htmlediting.h" 144 144 #include <wtf/CurrentTime.h> … … 175 175 #include "SVGElementFactory.h" 176 176 #include "SVGNames.h" 177 #include "SVGStyleElement.h" 177 178 #include "SVGZoomEvent.h" 178 #include "SVGStyleElement.h"179 179 #endif 180 180 … … 304 304 } 305 305 306 static bool acceptsEditingFocus(Node *node)306 static bool acceptsEditingFocus(Node* node) 307 307 { 308 308 ASSERT(node); 309 309 ASSERT(node->isContentEditable()); 310 310 311 Node *root = node->rootEditableElement();311 Node* root = node->rootEditableElement(); 312 312 Frame* frame = node->document()->frame(); 313 313 if (!frame || !root) … … 361 361 Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) 362 362 : ContainerNode(0) 363 , m_dom tree_version(0)363 , m_domTreeVersion(0) 364 364 , m_styleSheets(StyleSheetList::create(this)) 365 365 , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) … … 726 726 727 727 switch (importedNode->nodeType()) { 728 case TEXT_NODE: 729 return createTextNode(importedNode->nodeValue()); 730 case CDATA_SECTION_NODE: 731 return createCDATASection(importedNode->nodeValue(), ec); 732 case ENTITY_REFERENCE_NODE: 733 return createEntityReference(importedNode->nodeName(), ec); 734 case PROCESSING_INSTRUCTION_NODE: 735 return createProcessingInstruction(importedNode->nodeName(), importedNode->nodeValue(), ec); 736 case COMMENT_NODE: 737 return createComment(importedNode->nodeValue()); 738 case ELEMENT_NODE: { 739 Element* oldElement = static_cast<Element*>(importedNode); 740 RefPtr<Element> newElement = createElementNS(oldElement->namespaceURI(), oldElement->tagQName().toString(), ec); 741 742 if (ec) 743 return 0; 744 745 NamedNodeMap* attrs = oldElement->attributes(true); 746 if (attrs) { 747 unsigned length = attrs->length(); 748 for (unsigned i = 0; i < length; i++) { 749 Attribute* attr = attrs->attributeItem(i); 750 newElement->setAttribute(attr->name(), attr->value().impl(), ec); 751 if (ec) 752 return 0; 753 } 728 case TEXT_NODE: 729 return createTextNode(importedNode->nodeValue()); 730 case CDATA_SECTION_NODE: 731 return createCDATASection(importedNode->nodeValue(), ec); 732 case ENTITY_REFERENCE_NODE: 733 return createEntityReference(importedNode->nodeName(), ec); 734 case PROCESSING_INSTRUCTION_NODE: 735 return createProcessingInstruction(importedNode->nodeName(), importedNode->nodeValue(), ec); 736 case COMMENT_NODE: 737 return createComment(importedNode->nodeValue()); 738 case ELEMENT_NODE: { 739 Element* oldElement = static_cast<Element*>(importedNode); 740 RefPtr<Element> newElement = createElementNS(oldElement->namespaceURI(), oldElement->tagQName().toString(), ec); 741 742 if (ec) 743 return 0; 744 745 NamedNodeMap* attrs = oldElement->attributes(true); 746 if (attrs) { 747 unsigned length = attrs->length(); 748 for (unsigned i = 0; i < length; i++) { 749 Attribute* attr = attrs->attributeItem(i); 750 newElement->setAttribute(attr->name(), attr->value().impl(), ec); 751 if (ec) 752 return 0; 754 753 } 755 756 newElement->copyNonAttributeProperties(oldElement); 757 758 if (deep) { 759 for (Node* oldChild = oldElement->firstChild(); oldChild; oldChild = oldChild->nextSibling()) {760 RefPtr<Node> newChild = importNode(oldChild, true, ec);761 if (ec)762 return 0;763 newElement->appendChild(newChild.release(), ec);764 if (ec)765 return 0;766 }754 } 755 756 newElement->copyNonAttributeProperties(oldElement); 757 758 if (deep) { 759 for (Node* oldChild = oldElement->firstChild(); oldChild; oldChild = oldChild->nextSibling()) { 760 RefPtr<Node> newChild = importNode(oldChild, true, ec); 761 if (ec) 762 return 0; 763 newElement->appendChild(newChild.release(), ec); 764 if (ec) 765 return 0; 767 766 } 768 769 return newElement.release();770 767 } 771 case ATTRIBUTE_NODE: 772 return Attr::create(0, this, static_cast<Attr*>(importedNode)->attr()->clone()); 773 case DOCUMENT_FRAGMENT_NODE: { 774 DocumentFragment* oldFragment = static_cast<DocumentFragment*>(importedNode); 775 RefPtr<DocumentFragment> newFragment = createDocumentFragment(); 776 if (deep) { 777 for (Node* oldChild = oldFragment->firstChild(); oldChild; oldChild = oldChild->nextSibling()) { 778 RefPtr<Node> newChild = importNode(oldChild, true, ec); 779 if (ec) 780 return 0; 781 newFragment->appendChild(newChild.release(), ec); 782 if (ec) 783 return 0; 784 } 768 769 return newElement.release(); 770 } 771 case ATTRIBUTE_NODE: 772 return Attr::create(0, this, static_cast<Attr*>(importedNode)->attr()->clone()); 773 case DOCUMENT_FRAGMENT_NODE: { 774 DocumentFragment* oldFragment = static_cast<DocumentFragment*>(importedNode); 775 RefPtr<DocumentFragment> newFragment = createDocumentFragment(); 776 if (deep) { 777 for (Node* oldChild = oldFragment->firstChild(); oldChild; oldChild = oldChild->nextSibling()) { 778 RefPtr<Node> newChild = importNode(oldChild, true, ec); 779 if (ec) 780 return 0; 781 newFragment->appendChild(newChild.release(), ec); 782 if (ec) 783 return 0; 785 784 } 786 787 return newFragment.release();788 785 } 789 case ENTITY_NODE: 790 case NOTATION_NODE: 791 // FIXME: It should be possible to import these node types, however in DOM3 the DocumentType is readonly, so there isn't much sense in doing that. 792 // Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM. 793 case DOCUMENT_NODE: 794 case DOCUMENT_TYPE_NODE: 795 case XPATH_NAMESPACE_NODE: 796 break; 786 787 return newFragment.release(); 788 } 789 case ENTITY_NODE: 790 case NOTATION_NODE: 791 // FIXME: It should be possible to import these node types, however in DOM3 the DocumentType is readonly, so there isn't much sense in doing that. 792 // Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM. 793 case DOCUMENT_NODE: 794 case DOCUMENT_TYPE_NODE: 795 case XPATH_NAMESPACE_NODE: 796 break; 797 797 } 798 798 … … 815 815 816 816 switch (source->nodeType()) { 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 817 case ENTITY_NODE: 818 case NOTATION_NODE: 819 case DOCUMENT_NODE: 820 case DOCUMENT_TYPE_NODE: 821 case XPATH_NAMESPACE_NODE: 822 ec = NOT_SUPPORTED_ERR; 823 return 0; 824 case ATTRIBUTE_NODE: { 825 Attr* attr = static_cast<Attr*>(source.get()); 826 if (attr->ownerElement()) 827 attr->ownerElement()->removeAttributeNode(attr, ec); 828 attr->setSpecified(true); 829 break; 830 } 831 default: 832 if (source->hasTagName(iframeTag)) 833 static_cast<HTMLIFrameElement*>(source.get())->setRemainsAliveOnRemovalFromTree(attached()); 834 835 if (source->parentNode()) 836 source->parentNode()->removeChild(source.get(), ec); 837 837 } 838 838 … … 924 924 if (m_duplicateIds.contains(elementId.impl())) { 925 925 // We know there's at least one node with this id, but we don't know what the first one is. 926 for (Node *n = traverseNextNode(); n != 0; n = n->traverseNextNode()) {926 for (Node* n = traverseNextNode(); n; n = n->traverseNextNode()) { 927 927 if (n->isElementNode()) { 928 928 element = static_cast<Element*>(n); … … 946 946 if (parsing()) 947 947 return "loading"; 948 return "loaded";949 // FIXME: What does "interactive" mean?950 // FIXME: Missing support for "uninitialized".948 return "loaded"; 949 // FIXME: What does "interactive" mean? 950 // FIXME: Missing support for "uninitialized". 951 951 } 952 952 return String(); … … 1353 1353 } 1354 1354 1355 PassRefPtr<TreeWalker> Document::createTreeWalker(Node *root, unsigned whatToShow,1355 PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToShow, 1356 1356 PassRefPtr<NodeFilter> filter, bool expandEntityReferences, ExceptionCode& ec) 1357 1357 { … … 2049 2049 // (b) Only schedule layout once we have a body element. 2050 2050 2051 return (haveStylesheetsLoaded() && body()) ||2052 (documentElement() && !documentElement()->hasTagName(htmlTag));2051 return (haveStylesheetsLoaded() && body()) 2052 || (documentElement() && !documentElement()->hasTagName(htmlTag)); 2053 2053 } 2054 2054 … … 2320 2320 return winner; 2321 2321 2322 if ( start->tabIndex() == 0)2322 if (!start->tabIndex()) 2323 2323 // We've reached the last node in the document with a tabindex of 0. This is the end of the tabbing order. 2324 2324 return 0; … … 2339 2339 { 2340 2340 Node* last; 2341 for (last = this; last->lastChild(); last = last->lastChild()) 2342 ; // Empty loop. 2341 for (last = this; last->lastChild(); last = last->lastChild()) { } 2343 2342 2344 2343 // First try to find the last node in the document that comes before start and has the same tabindex as start. … … 2376 2375 2377 2376 int absIndex = 0; 2378 for (Node *n = node; n && n != this; n = n->traversePreviousNode())2377 for (Node* n = node; n && n != this; n = n->traversePreviousNode()) 2379 2378 absIndex++; 2380 2379 return absIndex; 2381 2380 } 2382 2381 2383 Node *Document::nodeWithAbsIndex(int absIndex)2384 { 2385 Node *n = this;2386 for (int i = 0; n && (i < absIndex); i++) {2382 Node* Document::nodeWithAbsIndex(int absIndex) 2383 { 2384 Node* n = this; 2385 for (int i = 0; n && (i < absIndex); i++) 2387 2386 n = n->traverseNextNode(); 2388 }2389 2387 return n; 2390 2388 } … … 2531 2529 { 2532 2530 switch (type) { 2531 case ATTRIBUTE_NODE: 2532 case CDATA_SECTION_NODE: 2533 case DOCUMENT_FRAGMENT_NODE: 2534 case DOCUMENT_NODE: 2535 case ENTITY_NODE: 2536 case ENTITY_REFERENCE_NODE: 2537 case NOTATION_NODE: 2538 case TEXT_NODE: 2539 case XPATH_NAMESPACE_NODE: 2540 return false; 2541 case COMMENT_NODE: 2542 case PROCESSING_INSTRUCTION_NODE: 2543 return true; 2544 case DOCUMENT_TYPE_NODE: 2545 case ELEMENT_NODE: 2546 // Documents may contain no more than one of each of these. 2547 // (One Element and one DocumentType.) 2548 for (Node* c = firstChild(); c; c = c->nextSibling()) 2549 if (c->nodeType() == type) 2550 return false; 2551 return true; 2552 } 2553 return false; 2554 } 2555 2556 bool Document::canReplaceChild(Node* newChild, Node* oldChild) 2557 { 2558 if (!oldChild) 2559 // ContainerNode::replaceChild will raise a NOT_FOUND_ERR. 2560 return true; 2561 2562 if (oldChild->nodeType() == newChild->nodeType()) 2563 return true; 2564 2565 int numDoctypes = 0; 2566 int numElements = 0; 2567 2568 // First, check how many doctypes and elements we have, not counting 2569 // the child we're about to remove. 2570 for (Node* c = firstChild(); c; c = c->nextSibling()) { 2571 if (c == oldChild) 2572 continue; 2573 2574 switch (c->nodeType()) { 2575 case DOCUMENT_TYPE_NODE: 2576 numDoctypes++; 2577 break; 2578 case ELEMENT_NODE: 2579 numElements++; 2580 break; 2581 default: 2582 break; 2583 } 2584 } 2585 2586 // Then, see how many doctypes and elements might be added by the new child. 2587 if (newChild->nodeType() == DOCUMENT_FRAGMENT_NODE) { 2588 for (Node* c = firstChild(); c; c = c->nextSibling()) { 2589 switch (c->nodeType()) { 2590 case ATTRIBUTE_NODE: 2591 case CDATA_SECTION_NODE: 2592 case DOCUMENT_FRAGMENT_NODE: 2593 case DOCUMENT_NODE: 2594 case ENTITY_NODE: 2595 case ENTITY_REFERENCE_NODE: 2596 case NOTATION_NODE: 2597 case TEXT_NODE: 2598 case XPATH_NAMESPACE_NODE: 2599 return false; 2600 case COMMENT_NODE: 2601 case PROCESSING_INSTRUCTION_NODE: 2602 break; 2603 case DOCUMENT_TYPE_NODE: 2604 numDoctypes++; 2605 break; 2606 case ELEMENT_NODE: 2607 numElements++; 2608 break; 2609 } 2610 } 2611 } else { 2612 switch (newChild->nodeType()) { 2533 2613 case ATTRIBUTE_NODE: 2534 2614 case CDATA_SECTION_NODE: … … 2545 2625 return true; 2546 2626 case DOCUMENT_TYPE_NODE: 2627 numDoctypes++; 2628 break; 2547 2629 case ELEMENT_NODE: 2548 // Documents may contain no more than one of each of these. 2549 // (One Element and one DocumentType.) 2550 for (Node* c = firstChild(); c; c = c->nextSibling()) 2551 if (c->nodeType() == type) 2552 return false; 2553 return true; 2554 } 2555 return false; 2556 } 2557 2558 bool Document::canReplaceChild(Node* newChild, Node* oldChild) 2559 { 2560 if (!oldChild) 2561 // ContainerNode::replaceChild will raise a NOT_FOUND_ERR. 2562 return true; 2563 2564 if (oldChild->nodeType() == newChild->nodeType()) 2565 return true; 2566 2567 int numDoctypes = 0; 2568 int numElements = 0; 2569 2570 // First, check how many doctypes and elements we have, not counting 2571 // the child we're about to remove. 2572 for (Node* c = firstChild(); c; c = c->nextSibling()) { 2573 if (c == oldChild) 2574 continue; 2575 2576 switch (c->nodeType()) { 2577 case DOCUMENT_TYPE_NODE: 2578 numDoctypes++; 2579 break; 2580 case ELEMENT_NODE: 2581 numElements++; 2582 break; 2583 default: 2584 break; 2585 } 2586 } 2587 2588 // Then, see how many doctypes and elements might be added by the new child. 2589 if (newChild->nodeType() == DOCUMENT_FRAGMENT_NODE) { 2590 for (Node* c = firstChild(); c; c = c->nextSibling()) { 2591 switch (c->nodeType()) { 2592 case ATTRIBUTE_NODE: 2593 case CDATA_SECTION_NODE: 2594 case DOCUMENT_FRAGMENT_NODE: 2595 case DOCUMENT_NODE: 2596 case ENTITY_NODE: 2597 case ENTITY_REFERENCE_NODE: 2598 case NOTATION_NODE: 2599 case TEXT_NODE: 2600 case XPATH_NAMESPACE_NODE: 2601 return false; 2602 case COMMENT_NODE: 2603 case PROCESSING_INSTRUCTION_NODE: 2604 break; 2605 case DOCUMENT_TYPE_NODE: 2606 numDoctypes++; 2607 break; 2608 case ELEMENT_NODE: 2609 numElements++; 2610 break; 2611 } 2612 } 2613 } else { 2614 switch (newChild->nodeType()) { 2615 case ATTRIBUTE_NODE: 2616 case CDATA_SECTION_NODE: 2617 case DOCUMENT_FRAGMENT_NODE: 2618 case DOCUMENT_NODE: 2619 case ENTITY_NODE: 2620 case ENTITY_REFERENCE_NODE: 2621 case NOTATION_NODE: 2622 case TEXT_NODE: 2623 case XPATH_NAMESPACE_NODE: 2624 return false; 2625 case COMMENT_NODE: 2626 case PROCESSING_INSTRUCTION_NODE: 2627 return true; 2628 case DOCUMENT_TYPE_NODE: 2629 numDoctypes++; 2630 break; 2631 case ELEMENT_NODE: 2632 numElements++; 2633 break; 2630 numElements++; 2631 break; 2634 2632 } 2635 2633 } … … 2830 2828 if (e->hasLocalName(linkTag)) { 2831 2829 // <LINK> element 2832 HTMLLinkElement* l = static_cast<HTMLLinkElement*>(n);2833 if (l ->isDisabled())2830 HTMLLinkElement* linkElement = static_cast<HTMLLinkElement*>(n); 2831 if (linkElement->isDisabled()) 2834 2832 continue; 2835 enabledViaScript = l ->isEnabledViaScript();2836 if (l ->isLoading()) {2833 enabledViaScript = linkElement->isEnabledViaScript(); 2834 if (linkElement->isLoading()) { 2837 2835 // it is loading but we should still decide which style sheet set to use 2838 2836 if (!enabledViaScript && !title.isEmpty() && m_preferredStylesheetSet.isEmpty()) { … … 2845 2843 continue; 2846 2844 } 2847 if (!l ->sheet())2845 if (!linkElement->sheet()) 2848 2846 title = nullAtom; 2849 2847 } … … 3053 3051 // ### find a better place in the code for this 3054 3052 if (view()) { 3055 Widget *focusWidget = widgetForNode(m_focusedNode.get());3053 Widget* focusWidget = widgetForNode(m_focusedNode.get()); 3056 3054 if (focusWidget) { 3057 3055 // Make sure a widget has the right size before giving it focus. … … 3109 3107 } 3110 3108 3111 void Document::attachNodeIterator(NodeIterator *ni)3109 void Document::attachNodeIterator(NodeIterator* ni) 3112 3110 { 3113 3111 m_nodeIterators.add(ni); 3114 3112 } 3115 3113 3116 void Document::detachNodeIterator(NodeIterator *ni)3114 void Document::detachNodeIterator(NodeIterator* ni) 3117 3115 { 3118 3116 m_nodeIterators.remove(ni); … … 3564 3562 unsigned length = qualifiedName.length(); 3565 3563 3566 if ( length == 0) {3564 if (!length) { 3567 3565 ec = INVALID_CHARACTER_ERR; 3568 3566 return false; … … 3647 3645 } 3648 3646 3649 HTMLMapElement *Document::getImageMap(const String& url) const3647 HTMLMapElement* Document::getImageMap(const String& url) const 3650 3648 { 3651 3649 if (url.isNull()) … … 3683 3681 m_inPageCache = flag; 3684 3682 if (flag) { 3685 ASSERT( m_savedRenderer == 0);3683 ASSERT(!m_savedRenderer); 3686 3684 m_savedRenderer = renderer(); 3687 3685 if (FrameView* v = view()) … … 3689 3687 unscheduleStyleRecalc(); 3690 3688 } else { 3691 ASSERT( renderer() == 0|| renderer() == m_savedRenderer);3689 ASSERT(!renderer() || renderer() == m_savedRenderer); 3692 3690 ASSERT(m_renderArena); 3693 3691 setRenderer(m_savedRenderer); … … 3805 3803 } 3806 3804 3807 void Document::addMarker(Range *range, DocumentMarker::MarkerType type, String description)3805 void Document::addMarker(Range* range, DocumentMarker::MarkerType type, String description) 3808 3806 { 3809 3807 // Use a TextIterator to visit the potentially multiple nodes the range covers. … … 3902 3900 // copies markers from srcNode to dstNode, applying the specified shift delta to the copies. The shift is 3903 3901 // useful if, e.g., the caller has created the dstNode from a non-prefix substring of the srcNode. 3904 void Document::copyMarkers(Node *srcNode, unsigned startOffset, int length, Node *dstNode, int delta, DocumentMarker::MarkerType markerType)3902 void Document::copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta, DocumentMarker::MarkerType markerType) 3905 3903 { 3906 3904 if (length <= 0) … … 4207 4205 } 4208 4206 4209 void Document::shiftMarkers(Node *node, unsigned startOffset, int delta, DocumentMarker::MarkerType markerType)4207 void Document::shiftMarkers(Node* node, unsigned startOffset, int delta, DocumentMarker::MarkerType markerType) 4210 4208 { 4211 4209 MarkerMapVectorPair* vectorPair = m_markers.get(node); … … 4219 4217 bool docDirty = false; 4220 4218 for (size_t i = 0; i != markers.size(); ++i) { 4221 DocumentMarker &marker = markers[i];4219 DocumentMarker& marker = markers[i]; 4222 4220 if (marker.startOffset >= startOffset && (markerType == DocumentMarker::AllMarkers || marker.type == markerType)) { 4223 4221 ASSERT((int)marker.startOffset + delta >= 0); … … 4264 4262 bool docDirty = false; 4265 4263 for (size_t i = 0; i != markers.size(); ++i) { 4266 DocumentMarker &marker = markers[i];4264 DocumentMarker& marker = markers[i]; 4267 4265 4268 4266 // Markers are returned in order, so stop if we are now past the specified range. … … 4326 4324 } 4327 4325 4328 Document *Document::parentDocument() const4329 { 4330 Frame *childPart = frame();4326 Document* Document::parentDocument() const 4327 { 4328 Frame* childPart = frame(); 4331 4329 if (!childPart) 4332 4330 return 0; 4333 Frame *parent = childPart->tree()->parent();4331 Frame* parent = childPart->tree()->parent(); 4334 4332 if (!parent) 4335 4333 return 0; … … 4337 4335 } 4338 4336 4339 Document *Document::topDocument() const4340 { 4341 Document *doc = const_cast<Document *>(this);4342 Element *element;4337 Document* Document::topDocument() const 4338 { 4339 Document* doc = const_cast<Document *>(this); 4340 Element* element; 4343 4341 while ((element = doc->ownerElement())) 4344 4342 doc = element->document(); … … 4655 4653 // signal "hash not computed yet", using a value that is likely to be 4656 4654 // effectively the same as 0 when the low bits are masked 4657 if ( hash == 0)4655 if (!hash) 4658 4656 hash = 0x80000000; 4659 4657 … … 4689 4687 { 4690 4688 if (securityOrigin() && !securityOrigin()->isEmpty()) 4691 return; 4689 return; // m_securityOrigin has already been initialized. 4692 4690 4693 4691 if (!m_frame) { -
trunk/WebCore/dom/Document.h
r64873 r64889 29 29 #include "CachedResourceHandle.h" 30 30 #include "CheckedRadioButtons.h" 31 #include "ContainerNode.h"32 31 #include "CollectionCache.h" 33 32 #include "CollectionType.h" 34 33 #include "Color.h" 34 #include "ContainerNode.h" 35 35 #include "Document.h" 36 36 #include "DocumentMarker.h" … … 49 49 namespace WebCore { 50 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 51 class AsyncScriptRunner; 52 class Attr; 53 class AXObjectCache; 54 class CDATASection; 55 class CachedCSSStyleSheet; 56 class CachedScript; 57 class CanvasRenderingContext; 58 class CharacterData; 59 class CSSStyleDeclaration; 60 class CSSStyleSelector; 61 class CSSStyleSheet; 62 class Comment; 63 class Database; 64 class DOMImplementation; 65 class DOMSelection; 66 class DOMWindow; 67 class DatabaseThread; 68 class DocLoader; 69 class DocumentFragment; 70 class DocumentType; 71 class DocumentWeakReference; 72 class EditingText; 73 class Element; 74 class EntityReference; 75 class Event; 76 class EventListener; 77 class Frame; 78 class FrameView; 79 class HTMLCanvasElement; 80 class HTMLCollection; 81 class HTMLAllCollection; 82 class HTMLDocument; 83 class HTMLElement; 84 class HTMLFormElement; 85 class HTMLFrameOwnerElement; 86 class HTMLHeadElement; 87 class HTMLInputElement; 88 class HTMLMapElement; 89 class HistoryItem; 90 class HitTestRequest; 91 class HitTestResult; 92 class InspectorTimelineAgent; 93 class IntPoint; 94 class DOMWrapperWorld; 95 class JSNode; 96 class MediaCanStartListener; 97 class MouseEventWithHitTestResults; 98 class NodeFilter; 99 class NodeIterator; 100 class Page; 101 class PlatformMouseEvent; 102 class ProcessingInstruction; 103 class Range; 104 class RegisteredEventListener; 105 class RenderArena; 106 class RenderView; 107 class ScriptableDocumentParser; 108 class ScriptElementData; 109 class SecurityOrigin; 110 class SerializedScriptValue; 111 class SegmentedString; 112 class Settings; 113 class StyleSheet; 114 class StyleSheetList; 115 class Text; 116 class TextResourceDecoder; 117 class DocumentParser; 118 class TreeWalker; 119 class XMLHttpRequest; 120 120 121 121 #if ENABLE(SVG) 122 123 #endif 124 122 class SVGDocumentExtensions; 123 #endif 124 125 125 #if ENABLE(XSLT) 126 126 class TransformSource; 127 127 #endif 128 128 129 129 #if ENABLE(XBL) 130 130 class XBLBindingManager; 131 131 #endif 132 132 133 133 #if ENABLE(XPATH) 134 135 136 137 134 class XPathEvaluator; 135 class XPathExpression; 136 class XPathNSResolver; 137 class XPathResult; 138 138 #endif 139 139 140 140 #if ENABLE(DASHBOARD_SUPPORT) 141 142 #endif 143 144 141 struct DashboardRegionValue; 142 #endif 143 144 typedef int ExceptionCode; 145 145 146 146 class FormElementKey { … … 860 860 #endif 861 861 862 void incDOMTreeVersion() { ++m_dom tree_version; }863 unsigned domTreeVersion() const { return m_dom tree_version; }862 void incDOMTreeVersion() { ++m_domTreeVersion; } 863 unsigned domTreeVersion() const { return m_domTreeVersion; } 864 864 865 865 void setDocType(PassRefPtr<DocumentType>); … … 1071 1071 1072 1072 // Document URLs. 1073 KURL m_url; 1074 KURL m_baseURL; 1075 KURL m_baseElementURL; 1076 KURL m_cookieURL; 1073 KURL m_url; // Document.URL: The URL from which this document was retrieved. 1074 KURL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs. 1075 KURL m_baseElementURL; // The URL set by the <base> element. 1076 KURL m_cookieURL; // The URL to use for cookie access. 1077 1077 KURL m_firstPartyForCookies; // The policy URL for third-party cookie blocking. 1078 1078 … … 1125 1125 mutable RefPtr<Element> m_documentElement; 1126 1126 1127 unsigned m_dom tree_version;1127 unsigned m_domTreeVersion; 1128 1128 1129 1129 HashSet<NodeIterator*> m_nodeIterators;
Note: See TracChangeset
for help on using the changeset viewer.