Commit 0251ee2d authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Wrap CSSBorderImageSliceValue on blink::cssvalue:: namespace

This is part of the gradual process of putting all types that derive
from CSSValue into blink::cssvalue:: namespace.

Bug: 667961
Change-Id: I5d90a018fa7e23cacf2bf9c9f7001f8ce1304ba1
Reviewed-on: https://chromium-review.googlesource.com/765621
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Reviewed-by: default avatarmeade_UTC10 <meade@chromium.org>
Reviewed-by: default avatarStuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517315}
parent ac4b148a
...@@ -24,7 +24,7 @@ struct SliceTypes { ...@@ -24,7 +24,7 @@ struct SliceTypes {
is_number[kSideLeft] = slice.slices.Left().IsFixed(); is_number[kSideLeft] = slice.slices.Left().IsFixed();
fill = slice.fill; fill = slice.fill;
} }
explicit SliceTypes(const CSSBorderImageSliceValue& slice) { explicit SliceTypes(const cssvalue::CSSBorderImageSliceValue& slice) {
is_number[kSideTop] = slice.Slices().Top()->IsPrimitiveValue() && is_number[kSideTop] = slice.Slices().Top()->IsPrimitiveValue() &&
ToCSSPrimitiveValue(slice.Slices().Top())->IsNumber(); ToCSSPrimitiveValue(slice.Slices().Top())->IsNumber();
is_number[kSideRight] = is_number[kSideRight] =
...@@ -193,7 +193,8 @@ InterpolationValue CSSImageSliceInterpolationType::MaybeConvertValue( ...@@ -193,7 +193,8 @@ InterpolationValue CSSImageSliceInterpolationType::MaybeConvertValue(
if (!value.IsBorderImageSliceValue()) if (!value.IsBorderImageSliceValue())
return nullptr; return nullptr;
const CSSBorderImageSliceValue& slice = ToCSSBorderImageSliceValue(value); const cssvalue::CSSBorderImageSliceValue& slice =
cssvalue::ToCSSBorderImageSliceValue(value);
std::unique_ptr<InterpolableList> list = std::unique_ptr<InterpolableList> list =
InterpolableList::Create(kSideIndexCount); InterpolableList::Create(kSideIndexCount);
const CSSValue* sides[kSideIndexCount]; const CSSValue* sides[kSideIndexCount];
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "platform/wtf/text/WTFString.h" #include "platform/wtf/text/WTFString.h"
namespace blink { namespace blink {
namespace cssvalue {
CSSBorderImageSliceValue::CSSBorderImageSliceValue(CSSQuadValue* slices, CSSBorderImageSliceValue::CSSBorderImageSliceValue(CSSQuadValue* slices,
bool fill) bool fill)
...@@ -55,4 +56,5 @@ void CSSBorderImageSliceValue::TraceAfterDispatch(blink::Visitor* visitor) { ...@@ -55,4 +56,5 @@ void CSSBorderImageSliceValue::TraceAfterDispatch(blink::Visitor* visitor) {
CSSValue::TraceAfterDispatch(visitor); CSSValue::TraceAfterDispatch(visitor);
} }
} // namespace cssvalue
} // namespace blink } // namespace blink
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "core/css/CSSQuadValue.h" #include "core/css/CSSQuadValue.h"
namespace blink { namespace blink {
namespace cssvalue {
class CSSBorderImageSliceValue : public CSSValue { class CSSBorderImageSliceValue : public CSSValue {
public: public:
...@@ -60,6 +61,7 @@ class CSSBorderImageSliceValue : public CSSValue { ...@@ -60,6 +61,7 @@ class CSSBorderImageSliceValue : public CSSValue {
DEFINE_CSS_VALUE_TYPE_CASTS(CSSBorderImageSliceValue, DEFINE_CSS_VALUE_TYPE_CASTS(CSSBorderImageSliceValue,
IsBorderImageSliceValue()); IsBorderImageSliceValue());
} // namespace cssvalue
} // namespace blink } // namespace blink
#endif // CSSBorderImageSliceValue_h #endif // CSSBorderImageSliceValue_h
...@@ -300,7 +300,7 @@ static CSSValue* ValueForPositionOffset(const ComputedStyle& style, ...@@ -300,7 +300,7 @@ static CSSValue* ValueForPositionOffset(const ComputedStyle& style,
return ZoomAdjustedPixelValueForLength(offset, style); return ZoomAdjustedPixelValueForLength(offset, style);
} }
static CSSBorderImageSliceValue* ValueForNinePieceImageSlice( static cssvalue::CSSBorderImageSliceValue* ValueForNinePieceImageSlice(
const NinePieceImage& image) { const NinePieceImage& image) {
// Create the slices. // Create the slices.
CSSPrimitiveValue* top = nullptr; CSSPrimitiveValue* top = nullptr;
...@@ -449,7 +449,8 @@ static CSSValue* ValueForNinePieceImage(const NinePieceImage& image, ...@@ -449,7 +449,8 @@ static CSSValue* ValueForNinePieceImage(const NinePieceImage& image,
image_value = image.GetImage()->ComputedCSSValue(); image_value = image.GetImage()->ComputedCSSValue();
// Create the image slice. // Create the image slice.
CSSBorderImageSliceValue* image_slices = ValueForNinePieceImageSlice(image); cssvalue::CSSBorderImageSliceValue* image_slices =
ValueForNinePieceImageSlice(image);
// Create the border area slices. // Create the border area slices.
CSSValue* border_slices = CSSValue* border_slices =
......
...@@ -123,7 +123,7 @@ CSSValue* CSSPropertyBorderImageUtils::ConsumeBorderImageSlice( ...@@ -123,7 +123,7 @@ CSSValue* CSSPropertyBorderImageUtils::ConsumeBorderImageSlice(
CSSPropertyParserHelpers::Complete4Sides(slices); CSSPropertyParserHelpers::Complete4Sides(slices);
if (default_fill == DefaultFill::kFill) if (default_fill == DefaultFill::kFill)
fill = true; fill = true;
return CSSBorderImageSliceValue::Create( return cssvalue::CSSBorderImageSliceValue::Create(
CSSQuadValue::Create(slices[0], slices[1], slices[2], slices[3], CSSQuadValue::Create(slices[0], slices[1], slices[2], slices[3],
CSSQuadValue::kSerializeAsQuad), CSSQuadValue::kSerializeAsQuad),
fill); fill);
......
...@@ -577,8 +577,8 @@ void CSSToStyleMap::MapNinePieceImageSlice(StyleResolverState&, ...@@ -577,8 +577,8 @@ void CSSToStyleMap::MapNinePieceImageSlice(StyleResolverState&,
return; return;
// Retrieve the border image value. // Retrieve the border image value.
const CSSBorderImageSliceValue& border_image_slice = const cssvalue::CSSBorderImageSliceValue& border_image_slice =
ToCSSBorderImageSliceValue(value); cssvalue::ToCSSBorderImageSliceValue(value);
// Set up a length box to represent our image slices. // Set up a length box to represent our image slices.
LengthBox box; LengthBox box;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment