Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: sky/engine/core/dom/Document.h

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/ContainerNode.cpp ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void setModule(AbstractModule* module) { m_module = module; } 158 void setModule(AbstractModule* module) { m_module = module; }
159 159
160 // DOM methods & attributes for Document 160 // DOM methods & attributes for Document
161 161
162 Length viewportDefaultMinWidth() const { return m_viewportDefaultMinWidth; } 162 Length viewportDefaultMinWidth() const { return m_viewportDefaultMinWidth; }
163 163
164 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } 164 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
165 165
166 String outgoingReferrer(); 166 String outgoingReferrer();
167 167
168 Element* documentElement() const
169 {
170 return m_documentElement.get();
171 }
172
173 Location* location() const; 168 Location* location() const;
174 169
175 PassRefPtr<Element> createElement(const AtomicString& name, ExceptionState&) ; 170 PassRefPtr<Element> createElement(const AtomicString& name, ExceptionState&) ;
176 PassRefPtr<DocumentFragment> createDocumentFragment(); 171 PassRefPtr<DocumentFragment> createDocumentFragment();
177 PassRefPtr<Node> importNode(Node* importedNode, bool deep, ExceptionState&); 172 PassRefPtr<Node> importNode(Node* importedNode, bool deep, ExceptionState&);
178 PassRefPtr<Element> createElement(const QualifiedName&, bool createdByParser ); 173 PassRefPtr<Element> createElement(const QualifiedName&, bool createdByParser );
179 174
180 Element* elementFromPoint(int x, int y) const; 175 Element* elementFromPoint(int x, int y) const;
181 PassRefPtr<Range> caretRangeFromPoint(int x, int y); 176 PassRefPtr<Range> caretRangeFromPoint(int x, int y);
182 177
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // and make it sensitive to the type of document. 381 // and make it sensitive to the type of document.
387 static bool isValidName(const String&); 382 static bool isValidName(const String&);
388 383
389 // The following breaks a qualified name into a prefix and a local name. 384 // The following breaks a qualified name into a prefix and a local name.
390 // It also does a validity check, and returns false if the qualified name 385 // It also does a validity check, and returns false if the qualified name
391 // is invalid. It also sets ExceptionCode when name is invalid. 386 // is invalid. It also sets ExceptionCode when name is invalid.
392 static bool parseQualifiedName(const AtomicString& qualifiedName, AtomicStri ng& prefix, AtomicString& localName, ExceptionState&); 387 static bool parseQualifiedName(const AtomicString& qualifiedName, AtomicStri ng& prefix, AtomicString& localName, ExceptionState&);
393 388
394 DocumentMarkerController& markers() const { return *m_markers; } 389 DocumentMarkerController& markers() const { return *m_markers; }
395 390
396 bool directionSetOnDocumentElement() const { return m_directionSetOnDocument Element; }
397 void setDirectionSetOnDocumentElement(bool b) { m_directionSetOnDocumentElem ent = b; }
398
399 KURL openSearchDescriptionURL(); 391 KURL openSearchDescriptionURL();
400 392
401 Document& topDocument() const; 393 Document& topDocument() const;
402 WeakPtr<Document> contextDocument(); 394 WeakPtr<Document> contextDocument();
403 395
404 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm pty() ? m_currentScriptStack.last().get() : 0; } 396 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm pty() ? m_currentScriptStack.last().get() : 0; }
405 void pushCurrentScript(PassRefPtr<HTMLScriptElement>); 397 void pushCurrentScript(PassRefPtr<HTMLScriptElement>);
406 void popCurrentScript(); 398 void popCurrentScript();
407 399
408 void finishedParsing(); 400 void finishedParsing();
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 void updateDistributionIfNeeded(); 535 void updateDistributionIfNeeded();
544 void evaluateMediaQueryListIfNeeded(); 536 void evaluateMediaQueryListIfNeeded();
545 537
546 void updateRenderTree(StyleRecalcChange); 538 void updateRenderTree(StyleRecalcChange);
547 void updateStyle(StyleRecalcChange); 539 void updateStyle(StyleRecalcChange);
548 540
549 void detachParser(); 541 void detachParser();
550 542
551 virtual bool isDocument() const override final { return true; } 543 virtual bool isDocument() const override final { return true; }
552 544
553 virtual void childrenChanged(const ChildrenChange&) override;
554
555 virtual String nodeName() const override final; 545 virtual String nodeName() const override final;
556 virtual NodeType nodeType() const override final; 546 virtual NodeType nodeType() const override final;
557 virtual PassRefPtr<Node> cloneNode(bool deep = true) override final; 547 virtual PassRefPtr<Node> cloneNode(bool deep = true) override final;
558 548
559 #if !ENABLE(OILPAN) 549 #if !ENABLE(OILPAN)
560 virtual void refExecutionContext() override final { ref(); } 550 virtual void refExecutionContext() override final { ref(); }
561 virtual void derefExecutionContext() override final { deref(); } 551 virtual void derefExecutionContext() override final { deref(); }
562 #endif 552 #endif
563 553
564 virtual const KURL& virtualURL() const override final; // Same as url(), but needed for ExecutionContext to implement it without a performance loss for dire ct calls. 554 virtual const KURL& virtualURL() const override final; // Same as url(), but needed for ExecutionContext to implement it without a performance loss for dire ct calls.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 AtomicString m_mimeType; 605 AtomicString m_mimeType;
616 606
617 RefPtr<CSSStyleSheet> m_elemSheet; 607 RefPtr<CSSStyleSheet> m_elemSheet;
618 608
619 Timer<Document> m_resumeParserWaitingForResourcesTimer; 609 Timer<Document> m_resumeParserWaitingForResourcesTimer;
620 610
621 Timer<Document> m_clearFocusedElementTimer; 611 Timer<Document> m_clearFocusedElementTimer;
622 RefPtr<Element> m_focusedElement; 612 RefPtr<Element> m_focusedElement;
623 RefPtr<Node> m_hoverNode; 613 RefPtr<Node> m_hoverNode;
624 RefPtr<Element> m_activeHoverElement; 614 RefPtr<Element> m_activeHoverElement;
625 RefPtr<Element> m_documentElement;
626 UserActionElementSet m_userActionElements; 615 UserActionElementSet m_userActionElements;
627 616
628 typedef HashSet<RawPtr<Range> > AttachedRangeSet; 617 typedef HashSet<RawPtr<Range> > AttachedRangeSet;
629 AttachedRangeSet m_ranges; 618 AttachedRangeSet m_ranges;
630 619
631 unsigned short m_listenerTypes; 620 unsigned short m_listenerTypes;
632 621
633 MutationObserverOptions m_mutationObserverTypes; 622 MutationObserverOptions m_mutationObserverTypes;
634 623
635 OwnPtr<StyleEngine> m_styleEngine; 624 OwnPtr<StyleEngine> m_styleEngine;
(...skipping 29 matching lines...) Expand all
665 WeakPtr<Document> m_contextDocument; 654 WeakPtr<Document> m_contextDocument;
666 655
667 int m_loadEventDelayCount; 656 int m_loadEventDelayCount;
668 Timer<Document> m_loadEventDelayTimer; 657 Timer<Document> m_loadEventDelayTimer;
669 658
670 Length m_viewportDefaultMinWidth; 659 Length m_viewportDefaultMinWidth;
671 660
672 bool m_didSetReferrerPolicy; 661 bool m_didSetReferrerPolicy;
673 ReferrerPolicy m_referrerPolicy; 662 ReferrerPolicy m_referrerPolicy;
674 663
675 bool m_directionSetOnDocumentElement;
676
677 RefPtr<MediaQueryMatcher> m_mediaQueryMatcher; 664 RefPtr<MediaQueryMatcher> m_mediaQueryMatcher;
678 665
679 RefPtr<ScriptedAnimationController> m_scriptedAnimationController; 666 RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
680 667
681 RefPtr<CustomElementRegistrationContext> m_registrationContext; 668 RefPtr<CustomElementRegistrationContext> m_registrationContext;
682 RefPtr<CustomElementMicrotaskRunQueue> m_customElementMicrotaskRunQueue; 669 RefPtr<CustomElementMicrotaskRunQueue> m_customElementMicrotaskRunQueue;
683 670
684 void elementDataCacheClearTimerFired(Timer<Document>*); 671 void elementDataCacheClearTimerFired(Timer<Document>*);
685 Timer<Document> m_elementDataCacheClearTimer; 672 Timer<Document> m_elementDataCacheClearTimer;
686 673
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 // This is needed to avoid ambiguous overloads with the Node and TreeScope versi ons. 708 // This is needed to avoid ambiguous overloads with the Node and TreeScope versi ons.
722 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Document) 709 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Document)
723 710
724 // Put these methods here, because they require the Document definition, but we really want to inline them. 711 // Put these methods here, because they require the Document definition, but we really want to inline them.
725 712
726 inline bool Node::isDocumentNode() const 713 inline bool Node::isDocumentNode() const
727 { 714 {
728 return this == document(); 715 return this == document();
729 } 716 }
730 717
731 Node* eventTargetNodeForDocument(Document*);
732
733 } // namespace blink 718 } // namespace blink
734 719
735 #ifndef NDEBUG 720 #ifndef NDEBUG
736 // Outside the WebCore namespace for ease of invocation from gdb. 721 // Outside the WebCore namespace for ease of invocation from gdb.
737 void showLiveDocumentInstances(); 722 void showLiveDocumentInstances();
738 #endif 723 #endif
739 724
740 #endif // SKY_ENGINE_CORE_DOM_DOCUMENT_H_ 725 #endif // SKY_ENGINE_CORE_DOM_DOCUMENT_H_
OLDNEW
« no previous file with comments | « sky/engine/core/dom/ContainerNode.cpp ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698