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

Unified Diff: Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1304993002: Change Rect and Quad to be CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_counter_out_attempt_3
Patch Set: Review feedback Created 5 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/ComputedStyleCSSValueMapping.cpp
diff --git a/Source/core/css/ComputedStyleCSSValueMapping.cpp b/Source/core/css/ComputedStyleCSSValueMapping.cpp
index ad9baf3a8a5c10161d961f71ddb065d20987cd9e..0b7f00bde1fa618ae38f51f4591ff2b056fdad79 100644
--- a/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -36,13 +36,13 @@
#include "core/css/CSSGridTemplateAreasValue.h"
#include "core/css/CSSPathValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSQuadValue.h"
#include "core/css/CSSReflectValue.h"
#include "core/css/CSSShadowValue.h"
#include "core/css/CSSTimingFunctionValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSValuePool.h"
#include "core/css/Pair.h"
-#include "core/css/Rect.h"
#include "core/layout/LayoutBlock.h"
#include "core/layout/LayoutBox.h"
#include "core/layout/LayoutGrid.h"
@@ -238,16 +238,10 @@ static PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> valueForNinePieceImageSl
}
}
- RefPtrWillBeRawPtr<Quad> quad = Quad::create();
- quad->setTop(top);
- quad->setRight(right);
- quad->setBottom(bottom);
- quad->setLeft(left);
-
- return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.release()), image.fill());
+ return CSSBorderImageSliceValue::create(CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsQuad), image.fill());
}
-static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const BorderImageLengthBox& box, const ComputedStyle& style)
+static PassRefPtrWillBeRawPtr<CSSQuadValue> valueForNinePieceImageQuad(const BorderImageLengthBox& box, const ComputedStyle& style)
{
// Create the slices.
RefPtrWillBeRawPtr<CSSPrimitiveValue> top = nullptr;
@@ -290,13 +284,7 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(cons
}
}
- RefPtrWillBeRawPtr<Quad> quad = Quad::create();
- quad->setTop(top);
- quad->setRight(right);
- quad->setBottom(bottom);
- quad->setLeft(left);
-
- return cssValuePool().createValue(quad.release());
+ return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsQuad);
}
static CSSValueID valueForRepeatRule(int rule)
@@ -2256,12 +2244,11 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
case CSSPropertyClip: {
if (style.hasAutoClip())
return cssValuePool().createIdentifierValue(CSSValueAuto);
- RefPtrWillBeRawPtr<Rect> rect = Rect::create();
- rect->setTop(zoomAdjustedPixelValue(style.clip().top().value(), style));
- rect->setRight(zoomAdjustedPixelValue(style.clip().right().value(), style));
- rect->setBottom(zoomAdjustedPixelValue(style.clip().bottom().value(), style));
- rect->setLeft(zoomAdjustedPixelValue(style.clip().left().value(), style));
- return cssValuePool().createValue(rect.release());
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> top = zoomAdjustedPixelValue(style.clip().top().value(), style);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> right = zoomAdjustedPixelValue(style.clip().right().value(), style);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = zoomAdjustedPixelValue(style.clip().bottom().value(), style);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> left = zoomAdjustedPixelValue(style.clip().left().value(), style);
+ return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsRect);
}
case CSSPropertySpeak:
return cssValuePool().createValue(style.speak());
« no previous file with comments | « Source/core/css/CSSValue.cpp ('k') | Source/core/css/Rect.h » ('j') | Source/core/css/Rect.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698