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

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

Issue 758073003: Always propagate direction and writing-mode from <body>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added XML and overconstraining tests. Created 6 years 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') | no next file » | 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 , m_renderView(0) 491 , m_renderView(0)
492 #if !ENABLE(OILPAN) 492 #if !ENABLE(OILPAN)
493 , m_weakFactory(this) 493 , m_weakFactory(this)
494 #endif 494 #endif
495 , m_contextDocument(initializer.contextDocument()) 495 , m_contextDocument(initializer.contextDocument())
496 , m_hasFullscreenSupplement(false) 496 , m_hasFullscreenSupplement(false)
497 , m_loadEventDelayCount(0) 497 , m_loadEventDelayCount(0)
498 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired) 498 , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
499 , m_pluginLoadingTimer(this, &Document::pluginLoadingTimerFired) 499 , m_pluginLoadingTimer(this, &Document::pluginLoadingTimerFired)
500 , m_referrerPolicy(ReferrerPolicyDefault) 500 , m_referrerPolicy(ReferrerPolicyDefault)
501 , m_directionSetOnDocumentElement(false)
502 , m_writingModeSetOnDocumentElement(false)
503 , m_writeRecursionIsTooDeep(false) 501 , m_writeRecursionIsTooDeep(false)
504 , m_writeRecursionDepth(0) 502 , m_writeRecursionDepth(0)
505 , m_taskRunner(MainThreadTaskRunner::create(this)) 503 , m_taskRunner(MainThreadTaskRunner::create(this))
506 , m_registrationContext(initializer.registrationContext(this)) 504 , m_registrationContext(initializer.registrationContext(this))
507 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi red) 505 , m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFi red)
508 , m_timeline(AnimationTimeline::create(this)) 506 , m_timeline(AnimationTimeline::create(this))
509 , m_templateDocumentHost(nullptr) 507 , m_templateDocumentHost(nullptr)
510 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired) 508 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsT imerFired)
511 , m_hasViewportUnits(false) 509 , m_hasViewportUnits(false)
512 , m_styleRecalcElementCounter(0) 510 , m_styleRecalcElementCounter(0)
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 1677
1680 WritingMode rootWritingMode = documentElementStyle->writingMode(); 1678 WritingMode rootWritingMode = documentElementStyle->writingMode();
1681 TextDirection rootDirection = documentElementStyle->direction(); 1679 TextDirection rootDirection = documentElementStyle->direction();
1682 1680
1683 HTMLElement* body = this->body(); 1681 HTMLElement* body = this->body();
1684 RefPtr<RenderStyle> bodyStyle; 1682 RefPtr<RenderStyle> bodyStyle;
1685 if (body) { 1683 if (body) {
1686 bodyStyle = body->renderStyle(); 1684 bodyStyle = body->renderStyle();
1687 if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsSt yleRecalc() || change == Force) 1685 if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsSt yleRecalc() || change == Force)
1688 bodyStyle = ensureStyleResolver().styleForElement(body, documentElem entStyle.get()); 1686 bodyStyle = ensureStyleResolver().styleForElement(body, documentElem entStyle.get());
1689 if (!writingModeSetOnDocumentElement()) 1687 rootWritingMode = bodyStyle->writingMode();
1690 rootWritingMode = bodyStyle->writingMode(); 1688 rootDirection = bodyStyle->direction();
1691 if (!directionSetOnDocumentElement())
1692 rootDirection = bodyStyle->direction();
1693 } 1689 }
1694 1690
1695 RefPtr<RenderStyle> overflowStyle; 1691 RefPtr<RenderStyle> overflowStyle;
1696 if (Element* element = viewportDefiningElement(documentElementStyle.get())) { 1692 if (Element* element = viewportDefiningElement(documentElementStyle.get())) {
1697 if (element == body) { 1693 if (element == body) {
1698 overflowStyle = bodyStyle; 1694 overflowStyle = bodyStyle;
1699 } else { 1695 } else {
1700 ASSERT(element == documentElement()); 1696 ASSERT(element == documentElement());
1701 overflowStyle = documentElementStyle; 1697 overflowStyle = documentElementStyle;
1702 } 1698 }
(...skipping 4123 matching lines...) Expand 10 before | Expand all | Expand 10 after
5826 #ifndef NDEBUG 5822 #ifndef NDEBUG
5827 using namespace blink; 5823 using namespace blink;
5828 void showLiveDocumentInstances() 5824 void showLiveDocumentInstances()
5829 { 5825 {
5830 WeakDocumentSet& set = liveDocumentSet(); 5826 WeakDocumentSet& set = liveDocumentSet();
5831 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5827 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5832 for (Document* document : set) 5828 for (Document* document : set)
5833 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5829 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5834 } 5830 }
5835 #endif 5831 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698