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

Unified Diff: Source/core/dom/Document.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Doug's review. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 2a08daf8953682dfdec731b73448020ef1826e16..d0d022b561f580fe2e058b9863f316e5a4dbf368 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1628,7 +1628,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
ASSERT(inStyleRecalc());
ASSERT(documentElement());
- RefPtr<LayoutStyle> documentElementStyle = documentElement()->layoutStyle();
+ RefPtr<LayoutStyle> documentElementStyle = documentElement()->mutableLayoutStyle();
if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force)
documentElementStyle = ensureStyleResolver().styleForElement(documentElement());
@@ -1638,7 +1638,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
HTMLElement* body = this->body();
RefPtr<LayoutStyle> bodyStyle;
if (body) {
- bodyStyle = body->layoutStyle();
+ bodyStyle = body->mutableLayoutStyle();
if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsStyleRecalc() || change == Force)
bodyStyle = ensureStyleResolver().styleForElement(body, documentElementStyle.get());
rootWritingMode = bodyStyle->writingMode();
@@ -1685,7 +1685,7 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
WebScrollBlocksOn scrollBlocksOn = documentElementStyle->scrollBlocksOn();
- RefPtr<LayoutStyle> documentStyle = renderView()->style();
+ RefPtr<LayoutStyle> documentStyle = renderView()->mutableStyle();
if (documentStyle->writingMode() != rootWritingMode
|| documentStyle->direction() != rootDirection
|| documentStyle->overflowX() != overflowX
@@ -1704,13 +1704,13 @@ void Document::inheritHtmlAndBodyElementStyles(StyleRecalcChange change)
}
if (body) {
- if (LayoutStyle* style = body->layoutStyle()) {
+ if (const LayoutStyle* style = body->layoutStyle()) {
if (style->direction() != rootDirection || style->writingMode() != rootWritingMode)
body->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::WritingModeChange));
}
}
- if (LayoutStyle* style = documentElement()->layoutStyle()) {
+ if (const LayoutStyle* style = documentElement()->layoutStyle()) {
if (style->direction() != rootDirection || style->writingMode() != rootWritingMode)
documentElement()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::WritingModeChange));
}
@@ -2408,7 +2408,7 @@ HTMLHeadElement* Document::head() const
return Traversal<HTMLHeadElement>::firstChild(*de);
}
-Element* Document::viewportDefiningElement(LayoutStyle* rootStyle) const
+Element* Document::viewportDefiningElement(const LayoutStyle* rootStyle) const
{
// If a BODY element sets non-visible overflow, it is to be propagated to the viewport, as long
// as the following conditions are all met:
@@ -4204,7 +4204,7 @@ void Document::setEncodingData(const DocumentEncodingData& newData)
m_visuallyOrdered = shouldUseVisualOrdering;
// FIXME: How is possible to not have a renderer here?
if (renderView())
- renderView()->style()->setRTLOrdering(m_visuallyOrdered ? VisualOrder : LogicalOrder);
+ renderView()->mutableStyleRef().setRTLOrdering(m_visuallyOrdered ? VisualOrder : LogicalOrder);
setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::VisuallyOrdered));
}
}
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698