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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 462133002: Remove custom style building functions for 'clip'. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index 105bd34f22734c110d9ad62f5f6fbe1d2275172f..664fb0b1e05a593b91044e466bc6980bc205a672 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -56,7 +56,6 @@
#include "core/css/CSSPropertyMetadata.h"
#include "core/css/Counter.h"
#include "core/css/Pair.h"
-#include "core/css/Rect.h"
#include "core/css/StylePropertySet.h"
#include "core/css/StyleRule.h"
#include "core/css/resolver/ElementStyleResources.h"
@@ -131,45 +130,6 @@ void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CS
StyleBuilder::applyProperty(id, state, value, isInitial, isInherit);
}
-static Length clipConvertToLength(StyleResolverState& state, CSSPrimitiveValue* value)
-{
- return value->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData());
-}
-
-void StyleBuilderFunctions::applyInitialCSSPropertyClip(StyleResolverState& state)
-{
- state.style()->setClip(Length(), Length(), Length(), Length());
- state.style()->setHasClip(false);
-}
-
-void StyleBuilderFunctions::applyInheritCSSPropertyClip(StyleResolverState& state)
-{
- RenderStyle* parentStyle = state.parentStyle();
- if (!parentStyle->hasClip())
- return applyInitialCSSPropertyClip(state);
- state.style()->setClip(parentStyle->clipTop(), parentStyle->clipRight(), parentStyle->clipBottom(), parentStyle->clipLeft());
- state.style()->setHasClip(true);
-}
-
-void StyleBuilderFunctions::applyValueCSSPropertyClip(StyleResolverState& state, CSSValue* value)
-{
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-
- if (primitiveValue->getValueID() == CSSValueAuto) {
- state.style()->setClip(Length(), Length(), Length(), Length());
- state.style()->setHasClip(false);
- return;
- }
-
- Rect* rect = primitiveValue->getRectValue();
- Length top = clipConvertToLength(state, rect->top());
- Length right = clipConvertToLength(state, rect->right());
- Length bottom = clipConvertToLength(state, rect->bottom());
- Length left = clipConvertToLength(state, rect->left());
- state.style()->setClip(top, right, bottom, left);
- state.style()->setHasClip(true);
-}
-
void StyleBuilderFunctions::applyInitialCSSPropertyColor(StyleResolverState& state)
{
Color color = RenderStyle::initialColor();

Powered by Google App Engine
This is Rietveld 408576698