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

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

Issue 23809007: Refactor the viewport code to be more understandable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove); 282 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchmove);
283 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); 283 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend);
284 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); 284 DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel);
285 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange); 285 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange);
286 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenerror); 286 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenerror);
287 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitpointerlockchange); 287 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitpointerlockchange);
288 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitpointerlockerror); 288 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitpointerlockerror);
289 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange); 289 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange);
290 DEFINE_ATTRIBUTE_EVENT_LISTENER(securitypolicyviolation); 290 DEFINE_ATTRIBUTE_EVENT_LISTENER(securitypolicyviolation);
291 291
292 bool shouldOverrideLegacyViewport(ViewportArguments::Type);
292 void setViewportArguments(const ViewportArguments&); 293 void setViewportArguments(const ViewportArguments&);
293 const ViewportArguments& viewportArguments() const { return m_viewportArgume nts; } 294 const ViewportArguments& viewportArguments() const { return m_viewportArgume nts; }
294 #ifndef NDEBUG 295 #ifndef NDEBUG
295 bool didDispatchViewportPropertiesChanged() const { return m_didDispatchView portPropertiesChanged; } 296 bool didDispatchViewportPropertiesChanged() const { return m_didDispatchView portPropertiesChanged; }
296 #endif 297 #endif
297 bool hasLegacyViewportTag() const { return m_legacyViewportArguments.isLegac yViewportType(); } 298 bool hasLegacyViewportTag() const { return m_legacyViewportArguments.isLegac yViewportType(); }
298 299
299 void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = r eferrerPolicy; } 300 void setReferrerPolicy(ReferrerPolicy referrerPolicy) { m_referrerPolicy = r eferrerPolicy; }
300 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } 301 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
301 302
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 1398
1398 inline const Document* Document::templateDocument() const 1399 inline const Document* Document::templateDocument() const
1399 { 1400 {
1400 // If DOCUMENT does not have a browsing context, Let TEMPLATE CONTENTS OWNER be DOCUMENT and abort these steps. 1401 // If DOCUMENT does not have a browsing context, Let TEMPLATE CONTENTS OWNER be DOCUMENT and abort these steps.
1401 if (!m_frame) 1402 if (!m_frame)
1402 return this; 1403 return this;
1403 1404
1404 return m_templateDocument.get(); 1405 return m_templateDocument.get();
1405 } 1406 }
1406 1407
1407 inline void Document::setViewportArguments(const ViewportArguments& viewportArgu ments) 1408 inline bool Document::shouldOverrideLegacyViewport(ViewportArguments::Type origi n)
1408 { 1409 {
1409 // If the legacy viewport tag has higher priority than the cascaded @viewpor t 1410 // The different (legacy) meta tags have different priorities based on the t ype
1410 // descriptors, use the values from the legacy tag. 1411 // regardless of which order they appear in the DOM. The priority is given b y the
1411 if (viewportArguments.type < m_legacyViewportArguments.type) 1412 // ViewportArguments::Type enum.
1412 m_viewportArguments = m_legacyViewportArguments; 1413 return origin >= m_legacyViewportArguments.type;
1413 else
1414 m_viewportArguments = viewportArguments;
1415 updateViewportArguments();
1416 } 1414 }
1417 1415
1418 inline Document* toDocument(ScriptExecutionContext* scriptExecutionContext) 1416 inline Document* toDocument(ScriptExecutionContext* scriptExecutionContext)
1419 { 1417 {
1420 ASSERT_WITH_SECURITY_IMPLICATION(!scriptExecutionContext || scriptExecutionC ontext->isDocument()); 1418 ASSERT_WITH_SECURITY_IMPLICATION(!scriptExecutionContext || scriptExecutionC ontext->isDocument());
1421 return static_cast<Document*>(scriptExecutionContext); 1419 return static_cast<Document*>(scriptExecutionContext);
1422 } 1420 }
1423 1421
1424 inline const Document* toDocument(const ScriptExecutionContext* scriptExecutionC ontext) 1422 inline const Document* toDocument(const ScriptExecutionContext* scriptExecutionC ontext)
1425 { 1423 {
(...skipping 21 matching lines...) Expand all
1447 inline bool Node::isDocumentNode() const 1445 inline bool Node::isDocumentNode() const
1448 { 1446 {
1449 return this == documentInternal(); 1447 return this == documentInternal();
1450 } 1448 }
1451 1449
1452 Node* eventTargetNodeForDocument(Document*); 1450 Node* eventTargetNodeForDocument(Document*);
1453 1451
1454 } // namespace WebCore 1452 } // namespace WebCore
1455 1453
1456 #endif // Document_h 1454 #endif // Document_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698