Title: [99173] trunk/Source/WebCore
- Revision
- 99173
- Author
- [email protected]
- Date
- 2011-11-03 05:21:27 -0700 (Thu, 03 Nov 2011)
Log Message
Differentiate implicit viewport from that of the meta tag
https://bugs.webkit.org/show_bug.cgi?id=71453
Reviewed by Simon Hausmann.
This is needed because of DPI adjustment taking place with the meta
tag. This is to be avoided when no viewport meta tag is present.
* dom/Document.cpp:
(WebCore::Document::processViewport):
* dom/ViewportArguments.cpp:
(WebCore::computeViewportAttributes):
* dom/ViewportArguments.h:
(WebCore::ViewportArguments::ViewportArguments):
(WebCore::ViewportArguments::operator==):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (99172 => 99173)
--- trunk/Source/WebCore/ChangeLog 2011-11-03 12:16:02 UTC (rev 99172)
+++ trunk/Source/WebCore/ChangeLog 2011-11-03 12:21:27 UTC (rev 99173)
@@ -1,3 +1,21 @@
+2011-11-03 Kenneth Rohde Christiansen <[email protected]>
+
+ Differentiate implicit viewport from that of the meta tag
+ https://bugs.webkit.org/show_bug.cgi?id=71453
+
+ Reviewed by Simon Hausmann.
+
+ This is needed because of DPI adjustment taking place with the meta
+ tag. This is to be avoided when no viewport meta tag is present.
+
+ * dom/Document.cpp:
+ (WebCore::Document::processViewport):
+ * dom/ViewportArguments.cpp:
+ (WebCore::computeViewportAttributes):
+ * dom/ViewportArguments.h:
+ (WebCore::ViewportArguments::ViewportArguments):
+ (WebCore::ViewportArguments::operator==):
+
2011-11-03 Andreas Kling <[email protected]>
Devirtualize CSSRule.
Modified: trunk/Source/WebCore/dom/Document.cpp (99172 => 99173)
--- trunk/Source/WebCore/dom/Document.cpp 2011-11-03 12:16:02 UTC (rev 99172)
+++ trunk/Source/WebCore/dom/Document.cpp 2011-11-03 12:21:27 UTC (rev 99173)
@@ -2670,7 +2670,7 @@
{
ASSERT(!features.isNull());
- m_viewportArguments = ViewportArguments();
+ m_viewportArguments = ViewportArguments(ViewportArguments::ViewportMeta);
processArguments(features, (void*)&m_viewportArguments, &setViewportFeature);
Frame* frame = this->frame();
Modified: trunk/Source/WebCore/dom/ViewportArguments.cpp (99172 => 99173)
--- trunk/Source/WebCore/dom/ViewportArguments.cpp 2011-11-03 12:16:02 UTC (rev 99172)
+++ trunk/Source/WebCore/dom/ViewportArguments.cpp 2011-11-03 12:21:27 UTC (rev 99173)
@@ -50,6 +50,17 @@
ASSERT(availableWidth > 0 && availableHeight > 0);
+ float autoDPI;
+
+ switch (args.type) {
+ case ViewportArguments::Implicit:
+ autoDPI = deviceDPI;
+ break;
+ case ViewportArguments::ViewportMeta:
+ autoDPI = 160;
+ break;
+ }
+
switch (int(args.targetDensityDpi)) {
case ViewportArguments::ValueDeviceDPI:
args.targetDensityDpi = deviceDPI;
@@ -58,6 +69,8 @@
args.targetDensityDpi = 120;
break;
case ViewportArguments::ValueAuto:
+ args.targetDensityDpi = autoDPI;
+ break;
case ViewportArguments::ValueMediumDPI:
args.targetDensityDpi = 160;
break;
Modified: trunk/Source/WebCore/dom/ViewportArguments.h (99172 => 99173)
--- trunk/Source/WebCore/dom/ViewportArguments.h 2011-11-03 12:16:02 UTC (rev 99172)
+++ trunk/Source/WebCore/dom/ViewportArguments.h 2011-11-03 12:21:27 UTC (rev 99173)
@@ -56,6 +56,11 @@
struct ViewportArguments {
+ enum Type {
+ Implicit,
+ ViewportMeta
+ } type;
+
enum {
ValueAuto = -1,
ValueDesktopWidth = -2,
@@ -67,8 +72,9 @@
ValueHighDPI = -8
};
- ViewportArguments()
- : initialScale(ValueAuto)
+ ViewportArguments(Type type = Implicit)
+ : type(type)
+ , initialScale(ValueAuto)
, minimumScale(ValueAuto)
, maximumScale(ValueAuto)
, width(ValueAuto)
@@ -88,6 +94,8 @@
bool operator==(const ViewportArguments& other) const
{
+ // Used for figuring out whether to reset the viewport or not,
+ // thus we are not taking type into account.
return initialScale == other.initialScale
&& minimumScale == other.minimumScale
&& maximumScale == other.maximumScale
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes