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

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

Issue 235933008: Move 'dir' attribute from HTMLDocument to Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move methods to a better location in Document.cpp Created 6 years, 8 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 | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 // Update title based on first title element in the head, if one exists. 1384 // Update title based on first title element in the head, if one exists.
1385 if (HTMLElement* headElement = head()) { 1385 if (HTMLElement* headElement = head()) {
1386 if (HTMLTitleElement* title = Traversal<HTMLTitleElement>::firstChild(*h eadElement)) 1386 if (HTMLTitleElement* title = Traversal<HTMLTitleElement>::firstChild(*h eadElement))
1387 setTitleElement(title->text(), title); 1387 setTitleElement(title->text(), title);
1388 } 1388 }
1389 1389
1390 if (!m_titleElement) 1390 if (!m_titleElement)
1391 updateTitle(String()); 1391 updateTitle(String());
1392 } 1392 }
1393 1393
1394 const AtomicString& Document::dir()
1395 {
1396 // FIXME(crbug.com/363107): This should be the root html element, not the bo dy.
1397 if (HTMLElement* b = body())
1398 return b->getAttribute(dirAttr);
1399 return nullAtom;
1400 }
1401
1402 void Document::setDir(const AtomicString& value)
1403 {
1404 // FIXME(crbug.com/363107): This should be the root html element, not the bo dy.
1405 if (HTMLElement* b = body())
1406 b->setAttribute(dirAttr, value);
1407 }
1408
1394 PageVisibilityState Document::pageVisibilityState() const 1409 PageVisibilityState Document::pageVisibilityState() const
1395 { 1410 {
1396 // The visibility of the document is inherited from the visibility of the 1411 // The visibility of the document is inherited from the visibility of the
1397 // page. If there is no page associated with the document, we will assume 1412 // page. If there is no page associated with the document, we will assume
1398 // that the page is hidden, as specified by the spec: 1413 // that the page is hidden, as specified by the spec:
1399 // http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview. html#dom-document-hidden 1414 // http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview. html#dom-document-hidden
1400 if (!m_frame || !m_frame->page()) 1415 if (!m_frame || !m_frame->page())
1401 return PageVisibilityStateHidden; 1416 return PageVisibilityStateHidden;
1402 return m_frame->page()->visibilityState(); 1417 return m_frame->page()->visibilityState();
1403 } 1418 }
(...skipping 4119 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 (*it)->invalidateCache(attrName); 5538 (*it)->invalidateCache(attrName);
5524 } 5539 }
5525 5540
5526 void Document::trace(Visitor* visitor) 5541 void Document::trace(Visitor* visitor)
5527 { 5542 {
5528 Supplementable<Document>::trace(visitor); 5543 Supplementable<Document>::trace(visitor);
5529 ContainerNode::trace(visitor); 5544 ContainerNode::trace(visitor);
5530 } 5545 }
5531 5546
5532 } // namespace WebCore 5547 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698