Title: [168803] branches/safari-538.34-branch/Source/WebKit2
Diff
Modified: branches/safari-538.34-branch/Source/WebKit2/ChangeLog (168802 => 168803)
--- branches/safari-538.34-branch/Source/WebKit2/ChangeLog 2014-05-14 07:43:47 UTC (rev 168802)
+++ branches/safari-538.34-branch/Source/WebKit2/ChangeLog 2014-05-14 07:45:39 UTC (rev 168803)
@@ -1,5 +1,32 @@
2014-05-14 Lucas Forschler <[email protected]>
+ Merge r168572
+
+ 2014-05-09 Benjamin Poulain <[email protected]>
+
+ [iOS][WK2] Fix bugs exposed by r168556
+ https://bugs.webkit.org/show_bug.cgi?id=132768
+
+ Reviewed by Ryosuke Niwa.
+
+ Fix two bugs exposed by r168556.
+ 1) We were only changing the page scale factor when the scale was not adjusted by live
+ resize. The idea was that the scale would either be the same (responsive content)
+ or that it would be defined by the next viewContentRectUpdate.
+
+ Now that we also send resize and scroll events, we must always update the scale since
+ it affects some APIs observable from _javascript_ (like scrolling bounds).
+
+ 2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error
+ were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change
+ of target.
+
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::withinEpsilon):
+ (WebKit::WebPage::dynamicViewportSizeUpdate):
+
+2014-05-14 Lucas Forschler <[email protected]>
+
Merge r168556
2014-05-09 Benjamin Poulain <[email protected]>
Modified: branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (168802 => 168803)
--- branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2014-05-14 07:43:47 UTC (rev 168802)
+++ branches/safari-538.34-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2014-05-14 07:45:39 UTC (rev 168803)
@@ -1891,6 +1891,11 @@
viewportConfigurationChanged();
}
+static inline bool withinEpsilon(float a, float b)
+{
+ return fabs(a - b) < std::numeric_limits<float>::epsilon();
+}
+
void WebPage::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double targetScale)
{
TemporaryChange<bool> dynamicSizeUpdateGuard(m_inDynamicSizeUpdate, true);
@@ -2031,15 +2036,14 @@
frameView.setUnobscuredContentRect(roundedUnobscuredContentRect);
m_drawingArea->setExposedContentRect(newExposedContentRect);
- if (scale == targetScale)
- scalePage(scale, roundedUnobscuredContentRect.location());
+ scalePage(scale, roundedUnobscuredContentRect.location());
FloatSize unobscuredContentRectSizeInContentCoordinates = newUnobscuredContentRect.size();
unobscuredContentRectSizeInContentCoordinates.scale(scale);
frameView.setCustomSizeForResizeEvent(expandedIntSize(unobscuredContentRectSizeInContentCoordinates));
frameView.setScrollOffset(roundedUnobscuredContentRect.location());
- if (pageScaleFactor() != targetScale || roundedIntPoint(targetUnobscuredRect.location()) != frameView.scrollPosition())
+ if (!withinEpsilon(pageScaleFactor(), targetScale) || roundedIntPoint(targetUnobscuredRect.location()) != frameView.scrollPosition())
send(Messages::WebPageProxy::DynamicViewportUpdateChangedTarget(pageScaleFactor(), frameView.scrollPosition()));
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes