~osomon/oxide/backport-42-patch-for-isError

« back to all changes in this revision

Viewing changes to patches/viewport-min-width.patch

  • Committer: Chris Coulson
  • Date: 2015-01-23 18:33:54 UTC
  • Revision ID: chris.coulson@canonical.com-20150123183354-xw98u7lhor69xzhj
Convert the fix for bug 1402975 to a small Blink patch instead. The problem with the previous approach is that Blink doesn't export a concept of UA stylesheets, meaning we have to check whether a site uses the viewport meta tag before deciding whether to inject the additional stylesheet. This approach is broken for dynamic sites that could add/remove the viewport meta tag or change the width from javascript

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Description: Set a minimum viewport width for sites that don't specify one
 
2
# Author: Chris Coulson <chris.coulson@canonical.com>
 
3
 
 
4
diff --git a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
 
5
--- a/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
 
6
+++ b/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
 
7
@@ -97,21 +97,17 @@ CSSDefaultStyleSheets::CSSDefaultStyleSh
 
8
     m_defaultViewportStyle = RuleSet::create();
 
9
     m_defaultPrintStyle = RuleSet::create();
 
10
     m_defaultQuirksStyle = RuleSet::create();
 
11
 
 
12
     // Strict-mode rules.
 
13
     String defaultRules = String(htmlCss, sizeof(htmlCss)) + RenderTheme::theme().extraDefaultStyleSheet();
 
14
     m_defaultStyleSheet = parseUASheet(defaultRules);
 
15
     m_defaultStyle->addRulesFromSheet(defaultStyleSheet(), screenEval());
 
16
-#if OS(ANDROID)
 
17
     String viewportRules(viewportAndroidCss, sizeof(viewportAndroidCss));
 
18
-#else
 
19
-    String viewportRules;
 
20
-#endif
 
21
     m_viewportStyleSheet = parseUASheet(viewportRules);
 
22
     m_defaultViewportStyle->addRulesFromSheet(viewportStyleSheet(), screenEval());
 
23
     m_defaultPrintStyle->addRulesFromSheet(defaultStyleSheet(), printEval());
 
24
 
 
25
     // Quirks-mode rules.
 
26
     String quirksRules = String(quirksCss, sizeof(quirksCss)) + RenderTheme::theme().extraQuirksStyleSheet();
 
27
     m_quirksStyleSheet = parseUASheet(quirksRules);
 
28
     m_defaultQuirksStyle->addRulesFromSheet(quirksStyleSheet(), screenEval());