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

Unified Diff: third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp

Issue 2661323002: Implement CSSPaintValue and add a layout test. (Closed)
Patch Set: rebase Created 3 years, 10 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: third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
index 5a37f56c481afe7ba76b546e4f2899b80fb06166..2a4c8a414f2b554bd6d8f2f7ac1e512047895f59 100644
--- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
@@ -66,9 +66,13 @@ CSSPaintDefinition::CSSPaintDefinition(
CSSPaintDefinition::~CSSPaintDefinition() {}
-PassRefPtr<Image> CSSPaintDefinition::paint(const LayoutObject& layoutObject,
- const IntSize& size,
- float zoom) {
+PassRefPtr<Image> CSSPaintDefinition::paint(
+ const LayoutObject& layoutObject,
+ const IntSize& size,
+ float zoom,
+ const CSSStyleValueVector* paintArguments) {
+ DCHECK(paintArguments);
+
const IntSize specifiedSize = getSpecifiedSize(size, zoom);
ScriptState::Scope scope(m_scriptState.get());
@@ -99,7 +103,8 @@ PassRefPtr<Image> CSSPaintDefinition::paint(const LayoutObject& layoutObject,
v8::Local<v8::Value> argv[] = {
ikilpatrick 2017/02/21 17:40:36 you'll probably need to surround this with "if (R
renjieliu1 2017/02/22 04:47:54 Done.
ToV8(renderingContext, m_scriptState->context()->Global(), isolate),
ToV8(paintSize, m_scriptState->context()->Global(), isolate),
- ToV8(styleMap, m_scriptState->context()->Global(), isolate)};
+ ToV8(styleMap, m_scriptState->context()->Global(), isolate),
+ ToV8(*paintArguments, m_scriptState->context()->Global(), isolate)};
v8::Local<v8::Function> paint = m_paint.newLocal(isolate);
@@ -107,7 +112,7 @@ PassRefPtr<Image> CSSPaintDefinition::paint(const LayoutObject& layoutObject,
block.SetVerbose(true);
V8ScriptRunner::callFunction(paint, m_scriptState->getExecutionContext(),
- instance, 3, argv, isolate);
+ instance, 4, argv, isolate);
// The paint function may have produced an error, in which case produce an
// invalid image.

Powered by Google App Engine
This is Rietveld 408576698