Title: [126470] trunk/Source/WebKit/blackberry
- Revision
- 126470
- Author
- [email protected]
- Date
- 2012-08-23 13:27:10 -0700 (Thu, 23 Aug 2012)
Log Message
[BlackBerry] Web pages are zoomed out to much on initial load
https://bugs.webkit.org/show_bug.cgi?id=94830
Reviewed by Adam Treat.
Patch by Jacky Jiang <[email protected]>
PR: 193943
Browser continuously adds paddings to the left and right sides of the
main contents which makes the main contents even smaller.
The issue can be reproduced on the desktop websites such as
huffingtonpost.ca, bloomberg.com, online.wsj.com, nytimes.com,
yahoo.com, thestar.com, sina.com.cn, sohu.com and so on.
The root cause is that we layout those contents at the width of 1280
although the fixed width of the main contents of those websites is
less than 1000, which results in adding the paddings.
To fix this, we need to get back to the default max layout size
1024 * 768, which will make the main contents of those popular websites
take full advantage of the screen real estate and look much better.
Internally reviewed by Adam Treat.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
(BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/RenderQueue.cpp:
(BlackBerry::WebKit::RenderQueue::splittingFactor):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (126469 => 126470)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-08-23 20:22:52 UTC (rev 126469)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-08-23 20:27:10 UTC (rev 126470)
@@ -2488,8 +2488,8 @@
const int defaultLayoutHeight = m_defaultLayoutSize.height();
int minWidth = defaultLayoutWidth;
- int maxWidth = defaultMaxLayoutSize().width();
- int maxHeight = defaultMaxLayoutSize().height();
+ int maxWidth = DEFAULT_MAX_LAYOUT_WIDTH;
+ int maxHeight = DEFAULT_MAX_LAYOUT_HEIGHT;
// If the load state is none then we haven't actually got anything yet, but we need to layout
// the entire page so that the user sees the entire page (unrendered) instead of just part of it.
@@ -3500,7 +3500,7 @@
if (m_viewportArguments == defaultViewportArguments)
return IntSize();
- int desktopWidth = defaultMaxLayoutSize().width();
+ int desktopWidth = DEFAULT_MAX_LAYOUT_WIDTH;
int deviceWidth = Platform::Graphics::Screen::primaryScreen()->width();
int deviceHeight = Platform::Graphics::Screen::primaryScreen()->height();
ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, m_webSettings->devicePixelRatio(), m_defaultLayoutSize);
@@ -6203,16 +6203,6 @@
}
}
-IntSize WebPagePrivate::defaultMaxLayoutSize()
-{
- static IntSize size;
- if (size.isEmpty())
- size = IntSize(std::max(1024, Platform::Graphics::Screen::primaryScreen()->landscapeWidth()),
- std::max(768, Platform::Graphics::Screen::primaryScreen()->landscapeHeight()));
-
- return size;
-}
-
WebString WebPage::textHasAttribute(const WebString& query) const
{
if (Document* doc = d->m_page->focusController()->focusedOrMainFrame()->document())
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (126469 => 126470)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-08-23 20:22:52 UTC (rev 126469)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-08-23 20:27:10 UTC (rev 126470)
@@ -41,6 +41,9 @@
#include <BlackBerryPlatformMessage.h>
+#define DEFAULT_MAX_LAYOUT_WIDTH 1024
+#define DEFAULT_MAX_LAYOUT_HEIGHT 768
+
namespace WebCore {
class AutofillManager;
class DOMWrapperWorld;
@@ -446,7 +449,6 @@
static WebCore::RenderLayer* enclosingPositionedAncestorOrSelfIfPositioned(WebCore::RenderLayer*);
static WebCore::RenderLayer* enclosingFixedPositionedAncestorOrSelfIfFixedPositioned(WebCore::RenderLayer*);
- static WebCore::IntSize defaultMaxLayoutSize();
static const String& defaultUserAgent();
void setVisible(bool);
Modified: trunk/Source/WebKit/blackberry/ChangeLog (126469 => 126470)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-08-23 20:22:52 UTC (rev 126469)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-08-23 20:27:10 UTC (rev 126470)
@@ -1,3 +1,33 @@
+2012-08-23 Jacky Jiang <[email protected]>
+
+ [BlackBerry] Web pages are zoomed out to much on initial load
+ https://bugs.webkit.org/show_bug.cgi?id=94830
+
+ Reviewed by Adam Treat.
+
+ PR: 193943
+ Browser continuously adds paddings to the left and right sides of the
+ main contents which makes the main contents even smaller.
+ The issue can be reproduced on the desktop websites such as
+ huffingtonpost.ca, bloomberg.com, online.wsj.com, nytimes.com,
+ yahoo.com, thestar.com, sina.com.cn, sohu.com and so on.
+ The root cause is that we layout those contents at the width of 1280
+ although the fixed width of the main contents of those websites is
+ less than 1000, which results in adding the paddings.
+ To fix this, we need to get back to the default max layout size
+ 1024 * 768, which will make the main contents of those popular websites
+ take full advantage of the screen real estate and look much better.
+
+ Internally reviewed by Adam Treat.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
+ (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+ * WebKitSupport/RenderQueue.cpp:
+ (BlackBerry::WebKit::RenderQueue::splittingFactor):
+
2012-08-22 Crystal Zhang <[email protected]>
[BlackBerry] Make all pickers non-zoomable
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp (126469 => 126470)
--- trunk/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp 2012-08-23 20:22:52 UTC (rev 126469)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp 2012-08-23 20:27:10 UTC (rev 126470)
@@ -244,8 +244,7 @@
// rendered in any one pass should stay fixed with regard to the zoom level.
Platform::IntRect untransformedRect = m_parent->m_webPage->d->mapFromTransformed(rect);
double rectArea = untransformedRect.width() * untransformedRect.height();
- Platform::IntSize defaultMaxLayoutSize = WebPagePrivate::defaultMaxLayoutSize();
- double maxArea = defaultMaxLayoutSize.width() * defaultMaxLayoutSize.height();
+ double maxArea = DEFAULT_MAX_LAYOUT_WIDTH * DEFAULT_MAX_LAYOUT_HEIGHT; // Defined in WebPage_p.h.
const unsigned splitFactor = 1 << 0;
double renderRectArea = maxArea / splitFactor;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes