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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2405143003: Separate @viewport from other RuleSet construction. (Closed)
Patch Set: Missing resolve() Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index a056554db30a05b2b45a44569a2491b10d5ebbd6..a4b649e09df0dfea019e1c5bd31614a56947628f 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -227,18 +227,13 @@ class WebFrameTest : public ::testing::Test {
void applyViewportStyleOverride(
FrameTestHelpers::WebViewHelper* webViewHelper) {
- StyleSheetContents* styleSheet =
- StyleSheetContents::create(CSSParserContext(UASheetMode, nullptr));
- styleSheet->parseString(loadResourceAsASCIIString("viewportAndroid.css"));
- RuleSet* ruleSet = RuleSet::create();
- ruleSet->addRulesFromSheet(styleSheet, MediaQueryEvaluator("screen"));
-
Document* document =
toLocalFrame(webViewHelper->webView()->page()->mainFrame())->document();
- document->ensureStyleResolver()
- .viewportStyleResolver()
- ->collectViewportRules(ruleSet, ViewportStyleResolver::UserAgentOrigin);
- document->ensureStyleResolver().viewportStyleResolver()->resolve();
+ document->settings()->setViewportStyle(WebViewportStyle::Mobile);
+ ViewportStyleResolver& resolver =
+ document->styleEngine().ensureViewportStyleResolver();
+ resolver.collectViewportRulesFromUASheets();
+ resolver.resolve();
}
static void configueCompositingWebView(WebSettings* settings) {
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698