Diff
Modified: trunk/Source/WebCore/ChangeLog (167860 => 167861)
--- trunk/Source/WebCore/ChangeLog 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/ChangeLog 2014-04-27 20:43:52 UTC (rev 167861)
@@ -1,3 +1,26 @@
+2014-04-27 Sam Weinig <[email protected]>
+
+ [iOS WebKit2] Add support for text autosizing
+ <rdar://problem/16545245>
+ https://bugs.webkit.org/show_bug.cgi?id=132237
+
+ Reviewed by Tim Horton.
+
+ Move text autosizing width from Frame to Page, as it is a Page level concept.
+
+ * WebCore.exp.in:
+ * page/Frame.cpp:
+ (WebCore::Frame::textAutosizingWidth): Deleted.
+ (WebCore::Frame::setTextAutosizingWidth): Deleted.
+ * page/Frame.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ * page/Page.h:
+ (WebCore::Page::textAutosizingWidth):
+ (WebCore::Page::setTextAutosizingWidth):
+
2014-04-27 Zan Dobersek <[email protected]>
Unreviewed. Updating one bindings test baseline after r167855.
Modified: trunk/Source/WebCore/WebCore.exp.in (167860 => 167861)
--- trunk/Source/WebCore/WebCore.exp.in 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-04-27 20:43:52 UTC (rev 167861)
@@ -3113,7 +3113,6 @@
#if ENABLE(IOS_TEXT_AUTOSIZING)
__ZN7WebCore12RenderObject19resetTextAutosizingEv
-__ZN7WebCore5Frame22setTextAutosizingWidthEf
#endif
#if ENABLE(MEDIA_SOURCE)
Modified: trunk/Source/WebCore/page/Frame.cpp (167860 => 167861)
--- trunk/Source/WebCore/page/Frame.cpp 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/page/Frame.cpp 2014-04-27 20:43:52 UTC (rev 167861)
@@ -485,18 +485,6 @@
return matchLabelsAgainstString(labels, element->getAttribute(idAttr));
}
-#if ENABLE(IOS_TEXT_AUTOSIZING)
-float Frame::textAutosizingWidth() const
-{
- return m_textAutosizingWidth;
-}
-
-void Frame::setTextAutosizingWidth(float width)
-{
- m_textAutosizingWidth = width;
-}
-#endif
-
#if PLATFORM(IOS)
void Frame::scrollOverflowLayer(RenderLayer* layer, const IntRect& visibleRect, const IntRect& exposeRect)
{
Modified: trunk/Source/WebCore/page/Frame.h (167860 => 167861)
--- trunk/Source/WebCore/page/Frame.h 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/page/Frame.h 2014-04-27 20:43:52 UTC (rev 167861)
@@ -240,11 +240,6 @@
String searchForLabelsBeforeElement(const Vector<String>& labels, Element*, size_t* resultDistance, bool* resultIsInCellAbove);
String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
-#if ENABLE(IOS_TEXT_AUTOSIZING)
- void setTextAutosizingWidth(float);
- float textAutosizingWidth() const;
-#endif
-
#if PLATFORM(IOS)
// Scroll the selection in an overflow layer on iOS.
void scrollOverflowLayer(RenderLayer* , const IntRect& visibleRect, const IntRect& exposeRect);
@@ -325,10 +320,6 @@
VisibleSelection m_rangedSelectionInitialExtent;
#endif
-#if ENABLE(IOS_TEXT_AUTOSIZING)
- float m_textAutosizingWidth;
-#endif
-
float m_pageZoomFactor;
float m_textZoomFactor;
Modified: trunk/Source/WebCore/page/FrameView.cpp (167860 => 167861)
--- trunk/Source/WebCore/page/FrameView.cpp 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/page/FrameView.cpp 2014-04-27 20:43:52 UTC (rev 167861)
@@ -1285,7 +1285,7 @@
root->layout();
#if ENABLE(IOS_TEXT_AUTOSIZING)
float minZoomFontSize = frame().settings().minimumZoomFontSize();
- float visWidth = frame().page()->mainFrame().textAutosizingWidth();
+ float visWidth = frame().page()->textAutosizingWidth();
if (minZoomFontSize && visWidth && !root->view().printing()) {
root->adjustComputedFontSizesOnBlocks(minZoomFontSize, visWidth);
bool needsLayout = root->needsLayout();
Modified: trunk/Source/WebCore/page/Page.cpp (167860 => 167861)
--- trunk/Source/WebCore/page/Page.cpp 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/page/Page.cpp 2014-04-27 20:43:52 UTC (rev 167861)
@@ -162,6 +162,9 @@
, m_zoomedOutPageScaleFactor(0)
, m_deviceScaleFactor(1)
, m_topContentInset(0)
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+ , m_textAutosizingWidth(0)
+#endif
, m_suppressScrollbarAnimations(false)
, m_verticalScrollElasticity(ScrollElasticityAllowed)
, m_horizontalScrollElasticity(ScrollElasticityAllowed)
@@ -783,7 +786,7 @@
if (FrameView* view = mainFrame().view())
view->topContentInsetDidChange();
}
-
+
void Page::setShouldSuppressScrollbarAnimations(bool suppressAnimations)
{
if (suppressAnimations == m_suppressScrollbarAnimations)
Modified: trunk/Source/WebCore/page/Page.h (167860 => 167861)
--- trunk/Source/WebCore/page/Page.h 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebCore/page/Page.h 2014-04-27 20:43:52 UTC (rev 167861)
@@ -282,7 +282,12 @@
float topContentInset() const { return m_topContentInset; }
void setTopContentInset(float);
-
+
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+ float textAutosizingWidth() const { return m_textAutosizingWidth; }
+ void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; }
+#endif
+
bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; }
void setShouldSuppressScrollbarAnimations(bool suppressAnimations);
void lockAllOverlayScrollbarsToHidden(bool lockOverlayScrollbars);
@@ -504,7 +509,11 @@
float m_deviceScaleFactor;
float m_topContentInset;
-
+
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+ float m_textAutosizingWidth;
+#endif
+
bool m_suppressScrollbarAnimations;
unsigned m_verticalScrollElasticity : 2; // ScrollElasticity
Modified: trunk/Source/WebKit/mac/ChangeLog (167860 => 167861)
--- trunk/Source/WebKit/mac/ChangeLog 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit/mac/ChangeLog 2014-04-27 20:43:52 UTC (rev 167861)
@@ -1,3 +1,15 @@
+2014-04-27 Sam Weinig <[email protected]>
+
+ [iOS WebKit2] Add support for text autosizing
+ <rdar://problem/16545245>
+ https://bugs.webkit.org/show_bug.cgi?id=132237
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _setTextAutosizingWidth:]):
+ Forward setting of the text autosizing width to the Page.
+
2014-04-25 Dean Jackson <[email protected]>
Allow a platform-specific size enumeration to be passed into popup-menu display
Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (167860 => 167861)
--- trunk/Source/WebKit/mac/WebView/WebFrame.mm 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm 2014-04-27 20:43:52 UTC (rev 167861)
@@ -1915,8 +1915,12 @@
- (void)_setTextAutosizingWidth:(CGFloat)width
{
- WebCore::Frame *frame = core(self);
- frame->setTextAutosizingWidth(width);
+ WebCore::Frame* frame = core(self);
+ Page* page = frame->page();
+ if (!page)
+ return;
+
+ page->setTextAutosizingWidth(width);
}
#else
- (void)resetTextAutosizingBeforeLayout
Modified: trunk/Source/WebKit2/ChangeLog (167860 => 167861)
--- trunk/Source/WebKit2/ChangeLog 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/ChangeLog 2014-04-27 20:43:52 UTC (rev 167861)
@@ -1,3 +1,24 @@
+2014-04-27 Sam Weinig <[email protected]>
+
+ [iOS WebKit2] Add support for text autosizing
+ <rdar://problem/16545245>
+ https://bugs.webkit.org/show_bug.cgi?id=132237
+
+ Reviewed by Tim Horton.
+
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::creationParameters):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::textAutosizingWidth):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ Pass the text autosizing width from the UIProcess to WebProcess.
+
2014-04-27 Tim Horton <[email protected]>
WebKit2 View Gestures (Zoom): Pages with 'background-attachment: fixed' don't behave correctly when zoomed
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (167860 => 167861)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2014-04-27 20:43:52 UTC (rev 167861)
@@ -73,6 +73,7 @@
#if PLATFORM(IOS)
encoder << screenSize;
encoder << availableScreenSize;
+ encoder << textAutosizingWidth;
#endif
}
@@ -154,6 +155,8 @@
return false;
if (!decoder.decode(parameters.availableScreenSize))
return false;
+ if (!decoder.decode(parameters.textAutosizingWidth))
+ return false;
#endif
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (167860 => 167861)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2014-04-27 20:43:52 UTC (rev 167861)
@@ -115,6 +115,7 @@
#if PLATFORM(IOS)
WebCore::FloatSize screenSize;
WebCore::FloatSize availableScreenSize;
+ float textAutosizingWidth;
#endif
};
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (167860 => 167861)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2014-04-27 20:43:52 UTC (rev 167861)
@@ -4247,6 +4247,7 @@
#if PLATFORM(IOS)
parameters.screenSize = screenSize();
parameters.availableScreenSize = availableScreenSize();
+ parameters.textAutosizingWidth = textAutosizingWidth();
#endif
return parameters;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (167860 => 167861)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-04-27 20:43:52 UTC (rev 167861)
@@ -1350,8 +1350,8 @@
#if PLATFORM(IOS)
WebCore::FloatSize screenSize();
WebCore::FloatSize availableScreenSize();
+ float textAutosizingWidth();
-
void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint& newScrollPosition);
void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius);
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (167860 => 167861)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2014-04-27 20:43:52 UTC (rev 167861)
@@ -477,7 +477,12 @@
{
return FloatSize(WKGetAvailableScreenSize());
}
-
+
+float WebPageProxy::textAutosizingWidth()
+{
+ return WKGetScreenSize().width;
+}
+
void WebPageProxy::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition)
{
m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (167860 => 167861)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2014-04-27 20:42:54 UTC (rev 167860)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2014-04-27 20:43:52 UTC (rev 167861)
@@ -380,6 +380,9 @@
m_pageGroup = WebProcess::shared().webPageGroup(parameters.pageGroupData);
m_page->setGroupName(m_pageGroup->identifier());
m_page->setDeviceScaleFactor(parameters.deviceScaleFactor);
+#if PLATFORM(IOS)
+ m_page->setTextAutosizingWidth(parameters.textAutosizingWidth);
+#endif
updatePreferences(parameters.store);
platformInitialize();