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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 19098002: Introduce isHTMLHtmlElement and toHTMLHtmlElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 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 | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/Position.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, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #include "core/editing/Editor.h" 97 #include "core/editing/Editor.h"
98 #include "core/editing/FrameSelection.h" 98 #include "core/editing/FrameSelection.h"
99 #include "core/html/FormController.h" 99 #include "core/html/FormController.h"
100 #include "core/html/HTMLAllCollection.h" 100 #include "core/html/HTMLAllCollection.h"
101 #include "core/html/HTMLAnchorElement.h" 101 #include "core/html/HTMLAnchorElement.h"
102 #include "core/html/HTMLCanvasElement.h" 102 #include "core/html/HTMLCanvasElement.h"
103 #include "core/html/HTMLCollection.h" 103 #include "core/html/HTMLCollection.h"
104 #include "core/html/HTMLDocument.h" 104 #include "core/html/HTMLDocument.h"
105 #include "core/html/HTMLFrameOwnerElement.h" 105 #include "core/html/HTMLFrameOwnerElement.h"
106 #include "core/html/HTMLHeadElement.h" 106 #include "core/html/HTMLHeadElement.h"
107 #include "core/html/HTMLHtmlElement.h"
107 #include "core/html/HTMLIFrameElement.h" 108 #include "core/html/HTMLIFrameElement.h"
108 #include "core/html/HTMLImport.h" 109 #include "core/html/HTMLImport.h"
109 #include "core/html/HTMLLinkElement.h" 110 #include "core/html/HTMLLinkElement.h"
110 #include "core/html/HTMLNameCollection.h" 111 #include "core/html/HTMLNameCollection.h"
111 #include "core/html/HTMLScriptElement.h" 112 #include "core/html/HTMLScriptElement.h"
112 #include "core/html/HTMLStyleElement.h" 113 #include "core/html/HTMLStyleElement.h"
113 #include "core/html/HTMLTitleElement.h" 114 #include "core/html/HTMLTitleElement.h"
114 #include "core/html/PluginDocument.h" 115 #include "core/html/PluginDocument.h"
115 #include "core/html/parser/HTMLDocumentParser.h" 116 #include "core/html/parser/HTMLDocumentParser.h"
116 #include "core/html/parser/HTMLParserIdioms.h" 117 #include "core/html/parser/HTMLParserIdioms.h"
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 678
678 DOMImplementation* Document::implementation() 679 DOMImplementation* Document::implementation()
679 { 680 {
680 if (!m_implementation) 681 if (!m_implementation)
681 m_implementation = DOMImplementation::create(this); 682 m_implementation = DOMImplementation::create(this);
682 return m_implementation.get(); 683 return m_implementation.get();
683 } 684 }
684 685
685 bool Document::hasManifest() const 686 bool Document::hasManifest() const
686 { 687 {
687 return documentElement() && documentElement()->hasTagName(htmlTag) && docume ntElement()->hasAttribute(manifestAttr); 688 return documentElement() && isHTMLHtmlElement(documentElement()) && document Element()->hasAttribute(manifestAttr);
688 } 689 }
689 690
690 void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* a fterChange, int childCountDelta) 691 void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* a fterChange, int childCountDelta)
691 { 692 {
692 ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, c hildCountDelta); 693 ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, c hildCountDelta);
693 694
694 Element* newDocumentElement = ElementTraversal::firstWithin(this); 695 Element* newDocumentElement = ElementTraversal::firstWithin(this);
695 if (newDocumentElement == m_documentElement) 696 if (newDocumentElement == m_documentElement)
696 return; 697 return;
697 m_documentElement = newDocumentElement; 698 m_documentElement = newDocumentElement;
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2305 2306
2306 bool Document::shouldScheduleLayout() 2307 bool Document::shouldScheduleLayout()
2307 { 2308 {
2308 // This function will only be called when FrameView thinks a layout is neede d. 2309 // This function will only be called when FrameView thinks a layout is neede d.
2309 // This enforces a couple extra rules. 2310 // This enforces a couple extra rules.
2310 // 2311 //
2311 // (a) Only schedule a layout once the stylesheets are loaded. 2312 // (a) Only schedule a layout once the stylesheets are loaded.
2312 // (b) Only schedule layout once we have a body element. 2313 // (b) Only schedule layout once we have a body element.
2313 2314
2314 return (haveStylesheetsLoaded() && body()) 2315 return (haveStylesheetsLoaded() && body())
2315 || (documentElement() && !documentElement()->hasTagName(htmlTag)); 2316 || (documentElement() && !isHTMLHtmlElement(documentElement()));
2316 } 2317 }
2317 2318
2318 bool Document::isLayoutTimerActive() 2319 bool Document::isLayoutTimerActive()
2319 { 2320 {
2320 return view() && view()->layoutPending() && !minimumLayoutDelay(); 2321 return view() && view()->layoutPending() && !minimumLayoutDelay();
2321 } 2322 }
2322 2323
2323 int Document::minimumLayoutDelay() 2324 int Document::minimumLayoutDelay()
2324 { 2325 {
2325 if (m_overMinimumLayoutThreshold) 2326 if (m_overMinimumLayoutThreshold)
(...skipping 2834 matching lines...) Expand 10 before | Expand all | Expand 10 after
5160 { 5161 {
5161 return DocumentLifecycleNotifier::create(this); 5162 return DocumentLifecycleNotifier::create(this);
5162 } 5163 }
5163 5164
5164 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5165 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5165 { 5166 {
5166 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5167 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5167 } 5168 }
5168 5169
5169 } // namespace WebCore 5170 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698