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

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: Rebased. 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 2c61ec7d5c8227d5745783d790fdb89effefb4b8..ed7fd10f034f203ab463b37bdcc4784cb78b5c9f 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();
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.cpp ('k') | Source/core/rendering/RenderLayerModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698