<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195560] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195560">195560</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-01-25 15:33:05 -0800 (Mon, 25 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Resolving direction and writing mode properties should not mutate document
https://bugs.webkit.org/show_bug.cgi?id=153446

Reviewed by Andreas Kling.

Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.

* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueDirection):
(WebCore::StyleBuilderCustom::resetEffectiveZoom):
(WebCore::StyleBuilderCustom::applyValueWebkitWritingMode):
(WebCore::StyleBuilderCustom::applyValueWebkitTextOrientation):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::markers):
(WebCore::Document::directionSetOnDocumentElement): Deleted.
(WebCore::Document::writingModeSetOnDocumentElement): Deleted.
(WebCore::Document::setDirectionSetOnDocumentElement): Deleted.
(WebCore::Document::setWritingModeSetOnDocumentElement): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
* rendering/style/RenderStyle.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveForDocumentcpp">trunk/Source/WebCore/style/StyleResolveForDocument.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/ChangeLog        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-01-25  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Resolving direction and writing mode properties should not mutate document
+        https://bugs.webkit.org/show_bug.cgi?id=153446
+
+        Reviewed by Andreas Kling.
+
+        Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.
+
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueDirection):
+        (WebCore::StyleBuilderCustom::resetEffectiveZoom):
+        (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode):
+        (WebCore::StyleBuilderCustom::applyValueWebkitTextOrientation):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::styleForElement):
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        * dom/Document.h:
+        (WebCore::Document::markers):
+        (WebCore::Document::directionSetOnDocumentElement): Deleted.
+        (WebCore::Document::writingModeSetOnDocumentElement): Deleted.
+        (WebCore::Document::setDirectionSetOnDocumentElement): Deleted.
+        (WebCore::Document::setWritingModeSetOnDocumentElement): Deleted.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::styleDidChange):
+        * rendering/style/RenderStyle.h:
+        * style/StyleResolveForDocument.cpp:
+        (WebCore::Style::resolveForDocument):
+
</ins><span class="cx"> 2016-01-25  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the ASAN build.
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -164,10 +164,7 @@
</span><span class="cx"> inline void StyleBuilderCustom::applyValueDirection(StyleResolver&amp; styleResolver, CSSValue&amp; value)
</span><span class="cx"> {
</span><span class="cx">     styleResolver.style()-&gt;setDirection(downcast&lt;CSSPrimitiveValue&gt;(value));
</span><del>-
-    Element* element = styleResolver.element();
-    if (element &amp;&amp; styleResolver.element() == element-&gt;document().documentElement())
-        element-&gt;document().setDirectionSetOnDocumentElement(true);
</del><ins>+    styleResolver.style()-&gt;setHasExplicitlySetDirection(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void StyleBuilderCustom::resetEffectiveZoom(StyleResolver&amp; styleResolver)
</span><span class="lines">@@ -707,11 +704,7 @@
</span><span class="cx"> inline void StyleBuilderCustom::applyValueWebkitWritingMode(StyleResolver&amp; styleResolver, CSSValue&amp; value)
</span><span class="cx"> {
</span><span class="cx">     styleResolver.setWritingMode(downcast&lt;CSSPrimitiveValue&gt;(value));
</span><del>-
-    // FIXME: It is not ok to modify document state while applying style.
-    auto&amp; state = styleResolver.state();
-    if (state.element() &amp;&amp; state.element() == state.document().documentElement())
-        state.document().setWritingModeSetOnDocumentElement(true);
</del><ins>+    styleResolver.style()-&gt;setHasExplicitlySetWritingMode(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void StyleBuilderCustom::applyValueWebkitTextOrientation(StyleResolver&amp; styleResolver, CSSValue&amp; value)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -696,13 +696,6 @@
</span><span class="cx">     m_state = State(element, parentStyle, regionForStyling, selectorFilter);
</span><span class="cx">     State&amp; state = m_state;
</span><span class="cx"> 
</span><del>-    if (&amp;element == m_document.documentElement() &amp;&amp; matchingBehavior == MatchAllRules) {
-        // These bits may be set when resolving document element style.
-        // FIXME: Style resolver shouldn't mutate document.
-        m_document.setDirectionSetOnDocumentElement(false);
-        m_document.setWritingModeSetOnDocumentElement(false);
-    }
-
</del><span class="cx">     if (sharingBehavior == AllowStyleSharing) {
</span><span class="cx">         if (RenderStyle* sharedStyle = locateSharedStyle()) {
</span><span class="cx">             state.clear();
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -516,8 +516,6 @@
</span><span class="cx">     , m_loadEventDelayCount(0)
</span><span class="cx">     , m_loadEventDelayTimer(*this, &amp;Document::loadEventDelayTimerFired)
</span><span class="cx">     , m_referrerPolicy(ReferrerPolicyDefault)
</span><del>-    , m_directionSetOnDocumentElement(false)
-    , m_writingModeSetOnDocumentElement(false)
</del><span class="cx">     , m_writeRecursionIsTooDeep(false)
</span><span class="cx">     , m_writeRecursionDepth(0)
</span><span class="cx">     , m_lastHandledUserGestureTimestamp(0)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/dom/Document.h        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -932,11 +932,6 @@
</span><span class="cx"> 
</span><span class="cx">     DocumentMarkerController&amp; markers() const { return *m_markers; }
</span><span class="cx"> 
</span><del>-    bool directionSetOnDocumentElement() const { return m_directionSetOnDocumentElement; }
-    bool writingModeSetOnDocumentElement() const { return m_writingModeSetOnDocumentElement; }
-    void setDirectionSetOnDocumentElement(bool b) { m_directionSetOnDocumentElement = b; }
-    void setWritingModeSetOnDocumentElement(bool b) { m_writingModeSetOnDocumentElement = b; }
-
</del><span class="cx">     bool execCommand(const String&amp; command, bool userInterface = false, const String&amp; value = String());
</span><span class="cx">     bool queryCommandEnabled(const String&amp; command);
</span><span class="cx">     bool queryCommandIndeterm(const String&amp; command);
</span><span class="lines">@@ -1662,9 +1657,6 @@
</span><span class="cx"> 
</span><span class="cx">     ReferrerPolicy m_referrerPolicy;
</span><span class="cx"> 
</span><del>-    bool m_directionSetOnDocumentElement;
-    bool m_writingModeSetOnDocumentElement;
-
</del><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">     DocumentTiming m_documentTiming;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -384,12 +384,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (isDocElementRenderer || isBodyRenderer) {
</span><span class="cx">         // Propagate the new writing mode and direction up to the RenderView.
</span><ins>+        auto* documentElementRenderer = document().documentElement()-&gt;renderer();
</ins><span class="cx">         RenderStyle&amp; viewStyle = view().style();
</span><span class="cx">         bool viewChangedWritingMode = false;
</span><span class="cx">         bool rootStyleChanged = false;
</span><span class="cx">         bool viewStyleChanged = false;
</span><del>-        RenderObject* rootRenderer = isBodyRenderer ? document().documentElement()-&gt;renderer() : nullptr;
-        if (viewStyle.direction() != newStyle.direction() &amp;&amp; (isDocElementRenderer || !document().directionSetOnDocumentElement())) {
</del><ins>+        auto* rootRenderer = isBodyRenderer ? documentElementRenderer : nullptr;
+        if (viewStyle.direction() != newStyle.direction() &amp;&amp; (isDocElementRenderer || !documentElementRenderer-&gt;style().hasExplicitlySetDirection())) {
</ins><span class="cx">             viewStyle.setDirection(newStyle.direction());
</span><span class="cx">             viewStyleChanged = true;
</span><span class="cx">             if (isBodyRenderer) {
</span><span class="lines">@@ -399,7 +400,7 @@
</span><span class="cx">             setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (viewStyle.writingMode() != newStyle.writingMode() &amp;&amp; (isDocElementRenderer || !document().writingModeSetOnDocumentElement())) {
</del><ins>+        if (viewStyle.writingMode() != newStyle.writingMode() &amp;&amp; (isDocElementRenderer || !documentElementRenderer-&gt;style().hasExplicitlySetWritingMode())) {
</ins><span class="cx">             viewStyle.setWritingMode(newStyle.writingMode());
</span><span class="cx">             viewChangedWritingMode = true;
</span><span class="cx">             viewStyleChanged = true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -275,6 +275,12 @@
</span><span class="cx">         bool isLink() const { return getBoolean(isLinkOffset); }
</span><span class="cx">         void setIsLink(bool value) { updateBoolean(value, isLinkOffset); }
</span><span class="cx"> 
</span><ins>+        bool hasExplicitlySetDirection() const { return getBoolean(hasExplicitlySetDirectionOffset); }
+        void setHasExplicitlySetDirection(bool value) { updateBoolean(value, hasExplicitlySetDirectionOffset); }
+
+        bool hasExplicitlySetWritingMode() const { return getBoolean(hasExplicitlySetWritingModeOffset); }
+        void setHasExplicitlySetWritingMode(bool value) { updateBoolean(value, hasExplicitlySetWritingModeOffset); }
+
</ins><span class="cx">         static ptrdiff_t flagsMemoryOffset() { return OBJECT_OFFSETOF(NonInheritedFlags, m_flags); }
</span><span class="cx">         static uint64_t flagIsaffectedByActive() { return oneBitMask &lt;&lt; affectedByActiveOffset; }
</span><span class="cx">         static uint64_t flagIsaffectedByHover() { return oneBitMask &lt;&lt; affectedByHoverOffset; }
</span><span class="lines">@@ -354,15 +360,17 @@
</span><span class="cx">         static const uint64_t tableLayoutBitMask = oneBitMask;
</span><span class="cx">         static const unsigned tableLayoutOffset = explicitInheritanceOffset + explicitInheritanceBitCount;
</span><span class="cx">         static const unsigned verticalAlignBitCount = 4;
</span><del>-        static const unsigned verticalAlignPadding = 2;
-        static const unsigned verticalAlignAndPaddingBitCount = verticalAlignBitCount + verticalAlignPadding;
</del><span class="cx">         static const uint64_t verticalAlignMask = (oneBitMask &lt;&lt; verticalAlignBitCount) - 1;
</span><span class="cx">         static const unsigned verticalAlignOffset = tableLayoutOffset + tableLayoutBitCount;
</span><ins>+        static const unsigned hasExplicitlySetDirectionBitcount = 1;
+        static const unsigned hasExplicitlySetDirectionOffset = verticalAlignOffset + verticalAlignBitCount;
+        static const unsigned hasExplicitlySetWritingModeBitcount = 1;
+        static const unsigned hasExplicitlySetWritingModeOffset = hasExplicitlySetDirectionOffset + hasExplicitlySetDirectionBitcount;
</ins><span class="cx"> 
</span><span class="cx">         // Byte 6.
</span><span class="cx">         static const unsigned pseudoBitsBitCount = 7;
</span><span class="cx">         static const uint64_t pseudoBitsMask = (oneBitMask &lt;&lt; pseudoBitsBitCount) - 1;
</span><del>-        static const unsigned pseudoBitsOffset = verticalAlignOffset + verticalAlignBitCount;
</del><ins>+        static const unsigned pseudoBitsOffset = hasExplicitlySetWritingModeOffset + hasExplicitlySetWritingModeBitcount;
</ins><span class="cx"> 
</span><span class="cx">         static const unsigned hasViewportUnitsBitCount = 1;
</span><span class="cx">         static const uint64_t hasViewportUnitsBitMask = (oneBitMask &lt;&lt; hasViewportUnitsBitCount) - 1;
</span><span class="lines">@@ -386,7 +394,7 @@
</span><span class="cx">         static const unsigned isLinkOffset = affectedByDragOffset + 1;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-        // Only 60 bits are assigned. There are 4 bits available currently used as padding to improve code generation.
</del><ins>+        // Only 60 bits are assigned. There are 2 bits available currently used as padding to improve code generation.
</ins><span class="cx">         // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom().
</span><span class="cx">         uint64_t m_flags;
</span><span class="cx">     };
</span><span class="lines">@@ -744,6 +752,7 @@
</span><span class="cx"> 
</span><span class="cx">     TextDirection direction() const { return static_cast&lt;TextDirection&gt;(inherited_flags._direction); }
</span><span class="cx">     bool isLeftToRightDirection() const { return direction() == LTR; }
</span><ins>+    bool hasExplicitlySetDirection() const { return noninherited_flags.hasExplicitlySetDirection(); }
</ins><span class="cx"> 
</span><span class="cx">     const Length&amp; specifiedLineHeight() const;
</span><span class="cx">     Length lineHeight() const;
</span><span class="lines">@@ -1381,6 +1390,7 @@
</span><span class="cx">     void setTextDecorationSkip(TextDecorationSkip skip) { SET_VAR(rareInheritedData, m_textDecorationSkip, skip); }
</span><span class="cx">     void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
</span><span class="cx">     void setDirection(TextDirection v) { inherited_flags._direction = v; }
</span><ins>+    void setHasExplicitlySetDirection(bool v) { noninherited_flags.setHasExplicitlySetDirection(v); }
</ins><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">     void setSpecifiedLineHeight(Length v);
</span><span class="cx"> #endif
</span><span class="lines">@@ -1865,6 +1875,9 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    bool hasExplicitlySetWritingMode() const { return noninherited_flags.hasExplicitlySetWritingMode(); }
+    void setHasExplicitlySetWritingMode(bool v) { noninherited_flags.setHasExplicitlySetWritingMode(v); }
+
</ins><span class="cx">     // A unique style is one that has matches something that makes it impossible to share.
</span><span class="cx">     bool unique() const { return noninherited_flags.isUnique(); }
</span><span class="cx">     void setUnique() { noninherited_flags.setIsUnique(); }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveForDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (195559 => 195560)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2016-01-25 23:12:44 UTC (rev 195559)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2016-01-25 23:33:05 UTC (rev 195560)
</span><span class="lines">@@ -78,11 +78,11 @@
</span><span class="cx">         // If there is no body, then use the document element.
</span><span class="cx">         auto* body = document.bodyOrFrameset();
</span><span class="cx">         RenderObject* bodyRenderer = body ? body-&gt;renderer() : nullptr;
</span><del>-        if (bodyRenderer &amp;&amp; !document.writingModeSetOnDocumentElement())
</del><ins>+        if (bodyRenderer &amp;&amp; !docElementRenderer-&gt;style().hasExplicitlySetWritingMode())
</ins><span class="cx">             documentStyle.get().setWritingMode(bodyRenderer-&gt;style().writingMode());
</span><span class="cx">         else
</span><span class="cx">             documentStyle.get().setWritingMode(docElementRenderer-&gt;style().writingMode());
</span><del>-        if (bodyRenderer &amp;&amp; !document.directionSetOnDocumentElement())
</del><ins>+        if (bodyRenderer &amp;&amp; !docElementRenderer-&gt;style().hasExplicitlySetDirection())
</ins><span class="cx">             documentStyle.get().setDirection(bodyRenderer-&gt;style().direction());
</span><span class="cx">         else
</span><span class="cx">             documentStyle.get().setDirection(docElementRenderer-&gt;style().direction());
</span></span></pre>
</div>
</div>

</body>
</html>