<!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>[176593] 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/176593">176593</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-12-01 10:42:52 -0800 (Mon, 01 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Transform StyleBuilderCustom into a class and mark it as a friend of RenderStyle
https://bugs.webkit.org/show_bug.cgi?id=138999
Reviewed by Sam Weinig.
Transform StyleBuilderCustom into a class and mark it as a friend of
RenderStyle. This is needed because some of the StyleBuilderCustom
functions need to access RenderStyle's private API.
No new tests, no behavior change.
* css/StyleBuilderCustom.h:
Move functions from StyleBuilderFunctions namespace to
StyleBuilderCustom class.
* css/makeprop.pl:
Use StyleBuilderCustom scope instead of StyleBuilderFunctions for
custom implementation.
* rendering/style/RenderStyle.h:
Mark StyleBuilderCustom class as a friend, similarly to what was
already done for DeprecatedStyleBuilder and StyleResolver.</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="#trunkSourceWebCorecssmakeproppl">trunk/Source/WebCore/css/makeprop.pl</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176592 => 176593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-01 17:50:35 UTC (rev 176592)
+++ trunk/Source/WebCore/ChangeLog        2014-12-01 18:42:52 UTC (rev 176593)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-12-01 Chris Dumez <cdumez@apple.com>
+
+ Transform StyleBuilderCustom into a class and mark it as a friend of RenderStyle
+ https://bugs.webkit.org/show_bug.cgi?id=138999
+
+ Reviewed by Sam Weinig.
+
+ Transform StyleBuilderCustom into a class and mark it as a friend of
+ RenderStyle. This is needed because some of the StyleBuilderCustom
+ functions need to access RenderStyle's private API.
+
+ No new tests, no behavior change.
+
+ * css/StyleBuilderCustom.h:
+ Move functions from StyleBuilderFunctions namespace to
+ StyleBuilderCustom class.
+
+ * css/makeprop.pl:
+ Use StyleBuilderCustom scope instead of StyleBuilderFunctions for
+ custom implementation.
+
+ * rendering/style/RenderStyle.h:
+ Mark StyleBuilderCustom class as a friend, similarly to what was
+ already done for DeprecatedStyleBuilder and StyleResolver.
+
</ins><span class="cx"> 2014-11-17 Oliver Hunt <oliver@apple.com>
</span><span class="cx">
</span><span class="cx"> Make sure range based iteration of Vector<> still receives bounds checking
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (176592 => 176593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-12-01 17:50:35 UTC (rev 176592)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-12-01 18:42:52 UTC (rev 176593)
</span><span class="lines">@@ -39,9 +39,83 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> // Note that we assume the CSS parser only allows valid CSSValue types.
</span><del>-namespace StyleBuilderFunctions {
</del><ins>+class StyleBuilderCustom {
+public:
+ static void applyValueWebkitMarqueeIncrement(StyleResolver&, CSSValue&);
</ins><span class="cx">
</span><del>-inline void applyValueWebkitMarqueeIncrement(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+ static void applyValueDirection(StyleResolver&, CSSValue&);
+
+ static void applyInitialZoom(StyleResolver&);
+ static void applyInheritZoom(StyleResolver&);
+ static void applyValueZoom(StyleResolver&, CSSValue&);
+
+#if ENABLE(CSS_SHAPES)
+ static void applyValueWebkitShapeOutside(StyleResolver&, CSSValue&);
+#endif // ENABLE(CSS_SHAPES)
+
+ static void applyValueVerticalAlign(StyleResolver&, CSSValue&);
+
+#if ENABLE(CSS_IMAGE_RESOLUTION)
+ static void applyInheritImageResolution(StyleResolver&);
+ static void applyInitialImageResolution(StyleResolver&);
+ static void applyValueImageResolution(StyleResolver&, CSSValue&);
+#endif // ENABLE(CSS_IMAGE_RESOLUTION)
+
+ static void applyInheritSize(StyleResolver&);
+ static void applyInitialSize(StyleResolver&);
+ static void applyValueSize(StyleResolver&, CSSValue&);
+
+ static void applyInheritTextIndent(StyleResolver&);
+ static void applyInitialTextIndent(StyleResolver&);
+ static void applyValueTextIndent(StyleResolver&, CSSValue&);
+
+#define DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(type, modifier) \
+ static void applyInherit##type##modifier(StyleResolver&); \
+ static void applyInitial##type##modifier(StyleResolver&); \
+ static void applyValue##type##modifier(StyleResolver&, CSSValue&)
+
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(BorderImage, Outset);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(BorderImage, Repeat);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(BorderImage, Slice);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(BorderImage, Width);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(WebkitMaskBoxImage, Outset);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(WebkitMaskBoxImage, Repeat);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(WebkitMaskBoxImage, Slice);
+ DECLARE_BORDER_IMAGE_MODIFIER_HANDLER(WebkitMaskBoxImage, Width);
+
+ static void applyValueWordSpacing(StyleResolver&, CSSValue&);
+
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+ static void applyInheritLineHeight(StyleResolver&);
+ static void applyInitialLineHeight(StyleResolver&);
+#endif // ENABLE(IOS_TEXT_AUTOSIZING)
+ static void applyValueLineHeight(StyleResolver&, CSSValue&);
+
+ static void applyInheritOutlineStyle(StyleResolver&);
+ static void applyInitialOutlineStyle(StyleResolver&);
+ static void applyValueOutlineStyle(StyleResolver&, CSSValue&);
+
+ static void applyInitialClip(StyleResolver&);
+ static void applyInheritClip(StyleResolver&);
+ static void applyValueClip(StyleResolver&, CSSValue&);
+
+ static void applyValueWebkitLocale(StyleResolver&, CSSValue&);
+ static void applyValueWebkitWritingMode(StyleResolver&, CSSValue&);
+ static void applyValueWebkitTextOrientation(StyleResolver&, CSSValue&);
+ static void applyValueWebkitJustifySelf(StyleResolver&, CSSValue&);
+ static void applyValueWebkitPerspective(StyleResolver&, CSSValue&);
+
+private:
+ static void resetEffectiveZoom(StyleResolver&);
+ static CSSToLengthConversionData csstoLengthConversionDataWithTextZoomFactor(StyleResolver&);
+ static bool convertLineHeight(StyleResolver&, const CSSValue&, Length&, float multiplier = 1.f);
+
+ static Length mmLength(double mm);
+ static Length inchLength(double inch);
+ static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height);
+};
+
+inline void StyleBuilderCustom::applyValueWebkitMarqueeIncrement(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx"> Length marqueeLength(Undefined);
</span><span class="lines">@@ -65,7 +139,7 @@
</span><span class="cx"> styleResolver.style()->setMarqueeIncrement(marqueeLength);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueDirection(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueDirection(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setDirection(downcast<CSSPrimitiveValue>(value));
</span><span class="cx">
</span><span class="lines">@@ -74,25 +148,25 @@
</span><span class="cx"> element->document().setDirectionSetOnDocumentElement(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void resetEffectiveZoom(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::resetEffectiveZoom(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
</span><span class="cx"> styleResolver.setEffectiveZoom(styleResolver.parentStyle() ? styleResolver.parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInitialZoom(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInitialZoom(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> resetEffectiveZoom(styleResolver);
</span><span class="cx"> styleResolver.setZoom(RenderStyle::initialZoom());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInheritZoom(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInheritZoom(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> resetEffectiveZoom(styleResolver);
</span><span class="cx"> styleResolver.setZoom(styleResolver.parentStyle()->zoom());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueZoom(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueZoom(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -118,7 +192,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_SHAPES)
</span><del>-inline void applyValueWebkitShapeOutside(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWebkitShapeOutside(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (is<CSSPrimitiveValue>(value)) {
</span><span class="cx"> // FIXME: Shouldn't this be CSSValueNone?
</span><span class="lines">@@ -152,17 +226,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(CSS_SHAPES)
</span><span class="cx">
</span><del>-inline Length mmLength(double mm)
</del><ins>+inline Length StyleBuilderCustom::mmLength(double mm)
</ins><span class="cx"> {
</span><span class="cx"> Ref<CSSPrimitiveValue> value(CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM));
</span><span class="cx"> return value.get().computeLength<Length>(CSSToLengthConversionData());
</span><span class="cx"> }
</span><del>-inline Length inchLength(double inch)
</del><ins>+inline Length StyleBuilderCustom::inchLength(double inch)
</ins><span class="cx"> {
</span><span class="cx"> Ref<CSSPrimitiveValue> value(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN));
</span><span class="cx"> return value.get().computeLength<Length>(CSSToLengthConversionData());
</span><span class="cx"> }
</span><del>-static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
</del><ins>+bool StyleBuilderCustom::getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
</ins><span class="cx"> {
</span><span class="cx"> static NeverDestroyed<Length> a5Width(mmLength(148));
</span><span class="cx"> static NeverDestroyed<Length> a5Height(mmLength(210));
</span><span class="lines">@@ -236,7 +310,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueVerticalAlign(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueVerticalAlign(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx"> if (primitiveValue.getValueID())
</span><span class="lines">@@ -246,21 +320,21 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CSS_IMAGE_RESOLUTION)
</span><del>-inline void applyInheritImageResolution(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInheritImageResolution(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setImageResolutionSource(styleResolver.parentStyle()->imageResolutionSource());
</span><span class="cx"> styleResolver.style()->setImageResolutionSnap(styleResolver.parentStyle()->imageResolutionSnap());
</span><span class="cx"> styleResolver.style()->setImageResolution(styleResolver.parentStyle()->imageResolution());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInitialImageResolution(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInitialImageResolution(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setImageResolutionSource(RenderStyle::initialImageResolutionSource());
</span><span class="cx"> styleResolver.style()->setImageResolutionSnap(RenderStyle::initialImageResolutionSnap());
</span><span class="cx"> styleResolver.style()->setImageResolution(RenderStyle::initialImageResolution());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueImageResolution(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueImageResolution(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> ImageResolutionSource source = RenderStyle::initialImageResolutionSource();
</span><span class="cx"> ImageResolutionSnap snap = RenderStyle::initialImageResolutionSnap();
</span><span class="lines">@@ -280,9 +354,9 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(CSS_IMAGE_RESOLUTION)
</span><span class="cx">
</span><del>-inline void applyInheritSize(StyleResolver&) { }
-inline void applyInitialSize(StyleResolver&) { }
-inline void applyValueSize(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyInheritSize(StyleResolver&) { }
+inline void StyleBuilderCustom::applyInitialSize(StyleResolver&) { }
+inline void StyleBuilderCustom::applyValueSize(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->resetPageSizeType();
</span><span class="cx"> Length width;
</span><span class="lines">@@ -356,7 +430,7 @@
</span><span class="cx"> styleResolver.style()->setPageSize(LengthSize(width, height));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInheritTextIndent(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInheritTextIndent(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setTextIndent(styleResolver.parentStyle()->textIndent());
</span><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><span class="lines">@@ -365,7 +439,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInitialTextIndent(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInitialTextIndent(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setTextIndent(RenderStyle::initialTextIndent());
</span><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><span class="lines">@@ -374,7 +448,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueTextIndent(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueTextIndent(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> Length lengthOrPercentageValue;
</span><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><span class="lines">@@ -471,27 +545,27 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- static inline const NinePieceImage& getValue(RenderStyle* style)
</del><ins>+ static const NinePieceImage& getValue(RenderStyle* style)
</ins><span class="cx"> {
</span><span class="cx"> return type == BorderImage ? style->borderImage() : style->maskBoxImage();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static inline void setValue(RenderStyle* style, const NinePieceImage& value)
</del><ins>+ static void setValue(RenderStyle* style, const NinePieceImage& value)
</ins><span class="cx"> {
</span><span class="cx"> return type == BorderImage ? style->setBorderImage(value) : style->setMaskBoxImage(value);
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #define DEFINE_BORDER_IMAGE_MODIFIER_HANDLER(type, modifier) \
</span><del>-inline void applyInherit##type##modifier(StyleResolver& styleResolver) \
</del><ins>+inline void StyleBuilderCustom::applyInherit##type##modifier(StyleResolver& styleResolver) \
</ins><span class="cx"> { \
</span><span class="cx"> ApplyPropertyBorderImageModifier<type, modifier>::applyInheritValue(styleResolver); \
</span><span class="cx"> } \
</span><del>-inline void applyInitial##type##modifier(StyleResolver& styleResolver) \
</del><ins>+inline void StyleBuilderCustom::applyInitial##type##modifier(StyleResolver& styleResolver) \
</ins><span class="cx"> { \
</span><span class="cx"> ApplyPropertyBorderImageModifier<type, modifier>::applyInitialValue(styleResolver); \
</span><span class="cx"> } \
</span><del>-inline void applyValue##type##modifier(StyleResolver& styleResolver, CSSValue& value) \
</del><ins>+inline void StyleBuilderCustom::applyValue##type##modifier(StyleResolver& styleResolver, CSSValue& value) \
</ins><span class="cx"> { \
</span><span class="cx"> ApplyPropertyBorderImageModifier<type, modifier>::applyValue(styleResolver, value); \
</span><span class="cx"> }
</span><span class="lines">@@ -505,7 +579,7 @@
</span><span class="cx"> DEFINE_BORDER_IMAGE_MODIFIER_HANDLER(WebkitMaskBoxImage, Slice)
</span><span class="cx"> DEFINE_BORDER_IMAGE_MODIFIER_HANDLER(WebkitMaskBoxImage, Width)
</span><span class="cx">
</span><del>-inline CSSToLengthConversionData csstoLengthConversionDataWithTextZoomFactor(StyleResolver& styleResolver)
</del><ins>+inline CSSToLengthConversionData StyleBuilderCustom::csstoLengthConversionDataWithTextZoomFactor(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> if (Frame* frame = styleResolver.document().frame())
</span><span class="cx"> return styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(styleResolver.style()->effectiveZoom() * frame->textZoomFactor());
</span><span class="lines">@@ -513,7 +587,7 @@
</span><span class="cx"> return styleResolver.state().cssToLengthConversionData();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool convertLineHeight(StyleResolver& styleResolver, const CSSValue& value, Length& length, float multiplier = 1.f)
</del><ins>+inline bool StyleBuilderCustom::convertLineHeight(StyleResolver& styleResolver, const CSSValue& value, Length& length, float multiplier)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx"> if (primitiveValue.getValueID() == CSSValueNormal) {
</span><span class="lines">@@ -539,7 +613,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueWordSpacing(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWordSpacing(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -559,19 +633,19 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">
</span><del>-inline void applyInheritLineHeight(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInheritLineHeight(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setLineHeight(styleResolver.parentStyle()->lineHeight());
</span><span class="cx"> styleResolver.style()->setSpecifiedLineHeight(styleResolver.parentStyle()->specifiedLineHeight());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInitialLineHeight(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInitialLineHeight(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setLineHeight(RenderStyle::initialLineHeight());
</span><span class="cx"> styleResolver.style()->setSpecifiedLineHeight(RenderStyle::initialSpecifiedLineHeight());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueLineHeight(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueLineHeight(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> Length lineHeight;
</span><span class="cx"> float multiplier = styleResolver.style()->textSizeAdjust().isPercentage() ? styleResolver.style()->textSizeAdjust().multiplier() : 1.f;
</span><span class="lines">@@ -584,7 +658,7 @@
</span><span class="cx">
</span><span class="cx"> #else
</span><span class="cx">
</span><del>-inline void applyValueLineHeight(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueLineHeight(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> Length lineHeight;
</span><span class="cx"> if (!convertLineHeight(styleResolver, value, lineHeight))
</span><span class="lines">@@ -595,19 +669,19 @@
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-inline void applyInheritOutlineStyle(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInheritOutlineStyle(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setOutlineStyleIsAuto(styleResolver.parentStyle()->outlineStyleIsAuto());
</span><span class="cx"> styleResolver.style()->setOutlineStyle(styleResolver.parentStyle()->outlineStyle());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInitialOutlineStyle(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInitialOutlineStyle(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setOutlineStyleIsAuto(RenderStyle::initialOutlineStyleIsAuto());
</span><span class="cx"> styleResolver.style()->setOutlineStyle(RenderStyle::initialBorderStyle());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueOutlineStyle(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueOutlineStyle(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -615,13 +689,13 @@
</span><span class="cx"> styleResolver.style()->setOutlineStyle(primitiveValue);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInitialClip(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInitialClip(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.style()->setClip(Length(), Length(), Length(), Length());
</span><span class="cx"> styleResolver.style()->setHasClip(false);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyInheritClip(StyleResolver& styleResolver)
</del><ins>+inline void StyleBuilderCustom::applyInheritClip(StyleResolver& styleResolver)
</ins><span class="cx"> {
</span><span class="cx"> RenderStyle* parentStyle = styleResolver.parentStyle();
</span><span class="cx"> if (!parentStyle->hasClip())
</span><span class="lines">@@ -630,7 +704,7 @@
</span><span class="cx"> styleResolver.style()->setHasClip(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueClip(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueClip(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -648,7 +722,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueWebkitLocale(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWebkitLocale(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -662,7 +736,7 @@
</span><span class="cx"> styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueWebkitWritingMode(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWebkitWritingMode(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.setWritingMode(downcast<CSSPrimitiveValue>(value));
</span><span class="cx">
</span><span class="lines">@@ -672,12 +746,12 @@
</span><span class="cx"> state.document().setWritingModeSetOnDocumentElement(true);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueWebkitTextOrientation(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWebkitTextOrientation(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> styleResolver.setTextOrientation(downcast<CSSPrimitiveValue>(value));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueWebkitJustifySelf(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWebkitJustifySelf(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -688,7 +762,7 @@
</span><span class="cx"> styleResolver.style()->setJustifySelf(primitiveValue);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void applyValueWebkitPerspective(StyleResolver& styleResolver, CSSValue& value)
</del><ins>+inline void StyleBuilderCustom::applyValueWebkitPerspective(StyleResolver& styleResolver, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx">
</span><span class="lines">@@ -713,8 +787,6 @@
</span><span class="cx"> styleResolver.style()->setPerspective(perspectiveValue);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-} // namespace StyleBuilderFunctions
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // StyleBuilderCustom_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/makeprop.pl (176592 => 176593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeprop.pl        2014-12-01 17:50:35 UTC (rev 176592)
+++ trunk/Source/WebCore/css/makeprop.pl        2014-12-01 18:42:52 UTC (rev 176593)
</span><span class="lines">@@ -417,13 +417,16 @@
</span><span class="cx"> # Skip properties still using the legacy style builder.
</span><span class="cx"> next unless exists($propertiesWithStyleBuilderOptions{$name});
</span><span class="cx">
</span><ins>+ my $scope = $propertiesWithStyleBuilderOptions{$name}{"Custom"} eq "All" ? "StyleBuilderCustom" : "StyleBuilderFunctions";
+ my $valueScope = $propertiesWithStyleBuilderOptions{$name}{"Custom"} eq "Value" ? "StyleBuilderCustom" : $scope;
+
</ins><span class="cx"> print STYLEBUILDER " case CSSProperty" . $nameToId{$name} . ":\n";
</span><span class="cx"> print STYLEBUILDER " if (isInitial)\n";
</span><del>- print STYLEBUILDER " StyleBuilderFunctions::applyInitial" . $nameToId{$name} . "(styleResolver);\n";
</del><ins>+ print STYLEBUILDER " " . $scope . "::applyInitial" . $nameToId{$name} . "(styleResolver);\n";
</ins><span class="cx"> print STYLEBUILDER " else if (isInherit)\n";
</span><del>- print STYLEBUILDER " StyleBuilderFunctions::applyInherit" . $nameToId{$name} . "(styleResolver);\n";
</del><ins>+ print STYLEBUILDER " " . $scope . "::applyInherit" . $nameToId{$name} . "(styleResolver);\n";
</ins><span class="cx"> print STYLEBUILDER " else\n";
</span><del>- print STYLEBUILDER " StyleBuilderFunctions::applyValue" . $nameToId{$name} . "(styleResolver, value);\n";
</del><ins>+ print STYLEBUILDER " " . $valueScope . "::applyValue" . $nameToId{$name} . "(styleResolver, value);\n";
</ins><span class="cx"> print STYLEBUILDER " return true;\n";
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (176592 => 176593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-12-01 17:50:35 UTC (rev 176592)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-12-01 18:42:52 UTC (rev 176593)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx"> friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
</span><span class="cx"> friend class RenderSVGResource; // FIXME: Needs to alter the visited state by hand. Should clean the SVG code up and move it into RenderStyle perhaps.
</span><span class="cx"> friend class RenderTreeAsText; // FIXME: Only needed so the render tree can keep lying and dump the wrong colors. Rebaselining would allow this to be yanked.
</span><ins>+ friend class StyleBuilderCustom; // Sets members directly.
</ins><span class="cx"> friend class StyleResolver; // Sets members directly.
</span><span class="cx">
</span><span class="cx"> public:
</span></span></pre>
</div>
</div>
</body>
</html>