mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- cefclient: Add background-color
command-line argument (issue #1161).
- Rename cef_url.h to cef_parser.h. - Add new CefParseCSSColor function.
This commit is contained in:
@ -25,6 +25,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "third_party/WebKit/public/web/WebNode.h"
|
||||
#include "third_party/WebKit/public/web/WebViewClient.h"
|
||||
|
||||
#include "third_party/WebKit/Source/core/css/parser/CSSParser.h"
|
||||
#include "third_party/WebKit/Source/core/dom/Node.h"
|
||||
#include "third_party/WebKit/Source/web/WebLocalFrameImpl.h"
|
||||
#include "third_party/WebKit/Source/web/WebViewImpl.h"
|
||||
@ -121,4 +122,18 @@ blink::WebFrame* FindFrameByUniqueName(const blink::WebString& unique_name,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool ParseCSSColor(const blink::WebString& string, bool strict, SkColor& color) {
|
||||
blink::RGBA32 rgba_color =
|
||||
blink::makeRGBA(SkColorGetR(color), SkColorGetG(color),
|
||||
SkColorGetB(color), SkColorGetA(color));
|
||||
if (!blink::CSSParser::parseColor(rgba_color, string, strict))
|
||||
return false;
|
||||
|
||||
color = SkColorSetARGB(blink::alphaChannel(rgba_color),
|
||||
blink::redChannel(rgba_color),
|
||||
blink::greenChannel(rgba_color),
|
||||
blink::blueChannel(rgba_color));
|
||||
return true;
|
||||
}
|
||||
|
||||
} // webkit_glue
|
||||
|
Reference in New Issue
Block a user