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

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

Issue 270283007: Implement the logic to find the correct <link> for Manifest in Document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@link_manifest
Patch Set: Created 6 years, 7 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/dom/Document.h ('k') | Source/core/dom/DocumentTest.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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 clearStyleResolver(); 711 clearStyleResolver();
712 } 712 }
713 713
714 DOMImplementation& Document::implementation() 714 DOMImplementation& Document::implementation()
715 { 715 {
716 if (!m_implementation) 716 if (!m_implementation)
717 m_implementation = DOMImplementation::create(*this); 717 m_implementation = DOMImplementation::create(*this);
718 return *m_implementation; 718 return *m_implementation;
719 } 719 }
720 720
721 bool Document::hasManifest() const 721 bool Document::hasAppCacheManifest() const
722 { 722 {
723 return isHTMLHtmlElement(documentElement()) && documentElement()->hasAttribu te(manifestAttr); 723 return isHTMLHtmlElement(documentElement()) && documentElement()->hasAttribu te(manifestAttr);
724 } 724 }
725 725
726 Location* Document::location() const 726 Location* Document::location() const
727 { 727 {
728 if (!frame()) 728 if (!frame())
729 return 0; 729 return 0;
730 730
731 return &domWindow()->location(); 731 return &domWindow()->location();
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2455 HTMLElement* oldBody = body(); 2455 HTMLElement* oldBody = body();
2456 if (oldBody == newBody) 2456 if (oldBody == newBody)
2457 return; 2457 return;
2458 2458
2459 if (oldBody) 2459 if (oldBody)
2460 documentElement()->replaceChild(newBody.release(), oldBody, exceptionSta te); 2460 documentElement()->replaceChild(newBody.release(), oldBody, exceptionSta te);
2461 else 2461 else
2462 documentElement()->appendChild(newBody.release(), exceptionState); 2462 documentElement()->appendChild(newBody.release(), exceptionState);
2463 } 2463 }
2464 2464
2465 HTMLHeadElement* Document::head() 2465 HTMLHeadElement* Document::head() const
2466 { 2466 {
2467 Node* de = documentElement(); 2467 Node* de = documentElement();
2468 if (!de) 2468 if (!de)
2469 return 0; 2469 return 0;
2470 2470
2471 return Traversal<HTMLHeadElement>::firstChild(*de); 2471 return Traversal<HTMLHeadElement>::firstChild(*de);
2472 } 2472 }
2473 2473
2474 Element* Document::viewportDefiningElement(RenderStyle* rootStyle) const 2474 Element* Document::viewportDefiningElement(RenderStyle* rootStyle) const
2475 { 2475 {
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
4679 4679
4680 if (firstTouchIcon.m_iconType != InvalidIcon) 4680 if (firstTouchIcon.m_iconType != InvalidIcon)
4681 iconURLs.append(firstTouchIcon); 4681 iconURLs.append(firstTouchIcon);
4682 if (firstTouchPrecomposedIcon.m_iconType != InvalidIcon) 4682 if (firstTouchPrecomposedIcon.m_iconType != InvalidIcon)
4683 iconURLs.append(firstTouchPrecomposedIcon); 4683 iconURLs.append(firstTouchPrecomposedIcon);
4684 for (int i = secondaryIcons.size() - 1; i >= 0; --i) 4684 for (int i = secondaryIcons.size() - 1; i >= 0; --i)
4685 iconURLs.append(secondaryIcons[i]); 4685 iconURLs.append(secondaryIcons[i]);
4686 return iconURLs; 4686 return iconURLs;
4687 } 4687 }
4688 4688
4689 HTMLLinkElement* Document::linkManifest() const
4690 {
4691 HTMLHeadElement* head = this->head();
4692 if (!head)
4693 return 0;
4694
4695 // The first link element with a manifest rel must be used. Others are ignor ed.
4696 for (HTMLLinkElement* linkElement = Traversal<HTMLLinkElement>::firstChild(* head); linkElement; linkElement = Traversal<HTMLLinkElement>::nextSibling(*linkE lement)) {
4697 if (!linkElement->relAttribute().isManifest())
4698 continue;
4699 return linkElement;
4700 }
4701
4702 return 0;
4703 }
4704
4689 void Document::setUseSecureKeyboardEntryWhenActive(bool usesSecureKeyboard) 4705 void Document::setUseSecureKeyboardEntryWhenActive(bool usesSecureKeyboard)
4690 { 4706 {
4691 if (m_useSecureKeyboardEntryWhenActive == usesSecureKeyboard) 4707 if (m_useSecureKeyboardEntryWhenActive == usesSecureKeyboard)
4692 return; 4708 return;
4693 4709
4694 m_useSecureKeyboardEntryWhenActive = usesSecureKeyboard; 4710 m_useSecureKeyboardEntryWhenActive = usesSecureKeyboard;
4695 m_frame->selection().updateSecureKeyboardEntryIfActive(); 4711 m_frame->selection().updateSecureKeyboardEntryIfActive();
4696 } 4712 }
4697 4713
4698 bool Document::useSecureKeyboardEntryWhenActive() const 4714 bool Document::useSecureKeyboardEntryWhenActive() const
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
5708 visitor->trace(m_visibilityObservers); 5724 visitor->trace(m_visibilityObservers);
5709 visitor->trace(m_userActionElements); 5725 visitor->trace(m_userActionElements);
5710 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5726 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5711 DocumentSupplementable::trace(visitor); 5727 DocumentSupplementable::trace(visitor);
5712 TreeScope::trace(visitor); 5728 TreeScope::trace(visitor);
5713 ContainerNode::trace(visitor); 5729 ContainerNode::trace(visitor);
5714 ExecutionContext::trace(visitor); 5730 ExecutionContext::trace(visitor);
5715 } 5731 }
5716 5732
5717 } // namespace WebCore 5733 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698