Skip to content
Permalink
Browse files
Remove the remaining vestiges of minimal-ui
https://bugs.webkit.org/show_bug.cgi?id=138890

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-11-20
Reviewed by Sam Weinig.

Source/WebCore:

In ViewportArguments' setViewportFeature(), I skip the warning for now.

* WebCore.exp.in:
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
(WebCore::ViewportArguments::ViewportArguments):
(WebCore::ViewportArguments::operator==):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfiguration::viewportArgumentsLength):
(WebCore::ViewportConfiguration::layoutWidth):
(WebCore::ViewportConfiguration::layoutHeight):
(WebCore::ViewportConfigurationTextStream::operator<<):
(WebCore::ViewportConfiguration::description):
(WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI): Deleted.
(WebCore::ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates): Deleted.
(WebCore::ViewportConfiguration::resetMinimalUI): Deleted.
(WebCore::ViewportConfiguration::didFinishDocumentLoad): Deleted.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::minimumLayoutSizeForMinimalUI): Deleted.
(WebCore::ViewportConfiguration::usesMinimalUI): Deleted.

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.mm:
(dictionaryForViewportArguments):
* WebKit.iOS.exp:

Source/WebKit/mac:

* History/WebHistoryItem.mm:
* History/WebHistoryItemPrivate.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::didFinishDocumentLoad): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::savePageState):
(WebKit::WebPage::restorePageState):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateViewportSizeForCSSViewportUnits):


Canonical link: https://commits.webkit.org/156822@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Benjamin Poulain authored and BenjaminPoulain committed Nov 21, 2014
1 parent ecc1293 commit 2ea22030d76cf55fced4c7f8d5875b5e31db0bec
Showing 17 changed files with 87 additions and 101 deletions.
@@ -1,3 +1,36 @@
2014-11-20 Benjamin Poulain <bpoulain@apple.com>

Remove the remaining vestiges of minimal-ui
https://bugs.webkit.org/show_bug.cgi?id=138890

Reviewed by Sam Weinig.

In ViewportArguments' setViewportFeature(), I skip the warning for now.

* WebCore.exp.in:
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
(WebCore::ViewportArguments::ViewportArguments):
(WebCore::ViewportArguments::operator==):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfiguration::viewportArgumentsLength):
(WebCore::ViewportConfiguration::layoutWidth):
(WebCore::ViewportConfiguration::layoutHeight):
(WebCore::ViewportConfigurationTextStream::operator<<):
(WebCore::ViewportConfiguration::description):
(WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI): Deleted.
(WebCore::ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates): Deleted.
(WebCore::ViewportConfiguration::resetMinimalUI): Deleted.
(WebCore::ViewportConfiguration::didFinishDocumentLoad): Deleted.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::minimumLayoutSizeForMinimalUI): Deleted.
(WebCore::ViewportConfiguration::usesMinimalUI): Deleted.

2014-11-20 Benjamin Poulain <benjamin@webkit.org>

Web Inspector: do not show invalid specificity for dynamic cases of :matches()
@@ -961,18 +961,15 @@ __ZN7WebCore21UserContentController34removeUserMessageHandlerDescriptorERNS_28Us
__ZN7WebCore21UserContentController6createEv
__ZN7WebCore21UserContentControllerD1Ev
__ZN7WebCore21UserContentURLPattern5parseERKN3WTF6StringE
__ZN7WebCore21ViewportConfiguration14resetMinimalUIEv
__ZN7WebCore21ViewportConfiguration15setContentsSizeERKNS_7IntSizeE
__ZN7WebCore21ViewportConfiguration17testingParametersEv
__ZN7WebCore21ViewportConfiguration17webpageParametersEv
__ZN7WebCore21ViewportConfiguration20setMinimumLayoutSizeERKNS_9FloatSizeE
__ZN7WebCore21ViewportConfiguration20setViewportArgumentsERKNS_17ViewportArgumentsE
__ZN7WebCore21ViewportConfiguration21didFinishDocumentLoadEv
__ZN7WebCore21ViewportConfiguration21xhtmlMobileParametersEv
__ZN7WebCore21ViewportConfiguration22textDocumentParametersEv
__ZN7WebCore21ViewportConfiguration23imageDocumentParametersEv
__ZN7WebCore21ViewportConfiguration23setDefaultConfigurationERKNS0_10ParametersE
__ZN7WebCore21ViewportConfiguration32setMinimumLayoutSizeForMinimalUIERKNS_9FloatSizeE
__ZN7WebCore21ViewportConfigurationC1Ev
__ZN7WebCore21WindowsLatin1EncodingEv
__ZN7WebCore21createCFURLFromBufferEPKcmPK7__CFURL
@@ -1907,7 +1904,6 @@ __ZNK7WebCore21UserContentURLPattern7matchesERKNS_3URLE
__ZNK7WebCore21ViewportConfiguration10layoutSizeEv
__ZNK7WebCore21ViewportConfiguration12initialScaleEv
__ZNK7WebCore21ViewportConfiguration12minimumScaleEv
__ZNK7WebCore21ViewportConfiguration46activeMinimumLayoutSizeInScrollViewCoordinatesEv
__ZNK7WebCore22WheelEventDeltaTracker30dominantScrollGestureDirectionEv
__ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv
__ZNK7WebCore23AuthenticationChallenge20authenticationClientEv
@@ -395,7 +395,8 @@ void setViewportFeature(const String& keyString, const String& valueString, Docu
arguments->userZoom = findUserScalableValue(keyString, valueString, document);
#if PLATFORM(IOS)
else if (keyString == "minimal-ui")
arguments->minimalUI = true;
// FIXME: Ignore silently for now. This should eventually fallback to the warning.
{ }
#endif
else
reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, keyString, String());
@@ -87,9 +87,6 @@ struct ViewportArguments {
, maxZoom(ValueAuto)
, userZoom(ValueAuto)
, orientation(ValueAuto)
#if PLATFORM(IOS)
, minimalUI(false)
#endif
{
}

@@ -107,9 +104,6 @@ struct ViewportArguments {
float maxZoom;
float userZoom;
float orientation;
#if PLATFORM(IOS)
bool minimalUI;
#endif

bool operator==(const ViewportArguments& other) const
{
@@ -125,9 +119,6 @@ struct ViewportArguments {
&& minZoom == other.minZoom
&& maxZoom == other.maxZoom
&& userZoom == other.userZoom
#if PLATFORM(IOS)
&& minimalUI == other.minimalUI
#endif
&& orientation == other.orientation;
}

@@ -46,9 +46,6 @@ static bool constraintsAreAllRelative(const ViewportConfiguration::Parameters& c

ViewportConfiguration::ViewportConfiguration()
: m_minimumLayoutSize(1024, 768)
, m_minimumLayoutSizeForMinimalUI(m_minimumLayoutSize)
, m_usesMinimalUI(false)
, m_pageDidFinishDocumentLoad(false)
{
// Setup a reasonable default configuration to avoid computing infinite scale/sizes.
// Those are the original iPhone configuration.
@@ -85,22 +82,6 @@ void ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutS
updateConfiguration();
}

void ViewportConfiguration::setMinimumLayoutSizeForMinimalUI(const FloatSize& minimumLayoutSizeForMinimalUI)
{
if (m_minimumLayoutSizeForMinimalUI == minimumLayoutSizeForMinimalUI)
return;

m_minimumLayoutSizeForMinimalUI = minimumLayoutSizeForMinimalUI;
updateConfiguration();
}

const FloatSize& ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates() const
{
if (m_usesMinimalUI)
return m_minimumLayoutSizeForMinimalUI;
return m_minimumLayoutSize;
}

void ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments)
{
if (m_viewportArguments == viewportArguments)
@@ -110,17 +91,6 @@ void ViewportConfiguration::setViewportArguments(const ViewportArguments& viewpo
updateConfiguration();
}

void ViewportConfiguration::resetMinimalUI()
{
m_usesMinimalUI = false;
m_pageDidFinishDocumentLoad = false;
}

void ViewportConfiguration::didFinishDocumentLoad()
{
m_pageDidFinishDocumentLoad = true;
}

IntSize ViewportConfiguration::layoutSize() const
{
return IntSize(layoutWidth(), layoutHeight());
@@ -137,7 +107,7 @@ double ViewportConfiguration::initialScale() const

// If not, it is up to us to determine the initial scale.
// We want a scale small enough to fit the document width-wise.
const FloatSize& minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
const FloatSize& minimumLayoutSize = m_minimumLayoutSize;
double width = m_contentSize.width() > 0 ? m_contentSize.width() : layoutWidth();
double initialScale = 0;
if (width > 0)
@@ -159,7 +129,7 @@ double ViewportConfiguration::minimumScale() const
// If not, we still need to sanity check our value.
double minimumScale = m_configuration.minimumScale;

const FloatSize& minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
const FloatSize& minimumLayoutSize = m_minimumLayoutSize;
double contentWidth = m_contentSize.width();
if (contentWidth > 0 && contentWidth * minimumScale < minimumLayoutSize.width())
minimumScale = minimumLayoutSize.width() / contentWidth;
@@ -285,27 +255,22 @@ void ViewportConfiguration::updateConfiguration()

if (viewportArgumentUserZoomIsSet(m_viewportArguments.userZoom))
m_configuration.allowsUserScaling = m_viewportArguments.userZoom != 0.;

#if PLATFORM(IOS)
if (!m_pageDidFinishDocumentLoad)
m_usesMinimalUI = m_usesMinimalUI || m_viewportArguments.minimalUI;
#endif
}

double ViewportConfiguration::viewportArgumentsLength(double length) const
{
if (length == ViewportArguments::ValueDeviceWidth)
return activeMinimumLayoutSizeInScrollViewCoordinates().width();
return m_minimumLayoutSize.width();
if (length == ViewportArguments::ValueDeviceHeight)
return activeMinimumLayoutSizeInScrollViewCoordinates().height();
return m_minimumLayoutSize.height();
return length;
}

int ViewportConfiguration::layoutWidth() const
{
ASSERT(!constraintsAreAllRelative(m_configuration));

const FloatSize& minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
const FloatSize& minimumLayoutSize = m_minimumLayoutSize;
if (m_configuration.widthIsSet) {
// If we scale to fit, then accept the viewport width with sanity checking.
if (!m_configuration.initialScaleIsSet) {
@@ -341,7 +306,7 @@ int ViewportConfiguration::layoutHeight() const
{
ASSERT(!constraintsAreAllRelative(m_configuration));

const FloatSize& minimumLayoutSize = activeMinimumLayoutSizeInScrollViewCoordinates();
const FloatSize& minimumLayoutSize = m_minimumLayoutSize;
if (m_configuration.heightIsSet) {
// If we scale to fit, then accept the viewport height with sanity checking.
if (!m_configuration.initialScaleIsSet) {
@@ -456,9 +421,6 @@ ViewportConfigurationTextStream& ViewportConfigurationTextStream::operator<<(con
ts << "(zoom " << viewportArguments.zoom << ", minZoom " << viewportArguments.minZoom << ", maxZoom " << viewportArguments.maxZoom << ")";
ts.decreaseIndent();

#if PLATFORM(IOS)
dumpProperty(ts, "minimalUI", viewportArguments.minimalUI);
#endif
return ts;
}

@@ -493,8 +455,6 @@ CString ViewportConfiguration::description() const

dumpProperty(ts, "contentSize", m_contentSize);
dumpProperty(ts, "minimumLayoutSize", m_minimumLayoutSize);
dumpProperty(ts, "minimumLayoutSizeForMinimalUI", m_minimumLayoutSizeForMinimalUI);
ts << "(uses minimal UI " << m_usesMinimalUI << ")";

ts << "\n";
ts.increaseIndent();
@@ -74,23 +74,14 @@ class ViewportConfiguration {
const FloatSize& minimumLayoutSize() const { return m_minimumLayoutSize; }
WEBCORE_EXPORT void setMinimumLayoutSize(const FloatSize&);

const FloatSize& minimumLayoutSizeForMinimalUI() const { return m_minimumLayoutSizeForMinimalUI.isEmpty() ? m_minimumLayoutSize : m_minimumLayoutSizeForMinimalUI; }
WEBCORE_EXPORT void setMinimumLayoutSizeForMinimalUI(const FloatSize&);

WEBCORE_EXPORT const FloatSize& activeMinimumLayoutSizeInScrollViewCoordinates() const;

const ViewportArguments& viewportArguments() const { return m_viewportArguments; }
WEBCORE_EXPORT void setViewportArguments(const ViewportArguments&);

WEBCORE_EXPORT void resetMinimalUI();
WEBCORE_EXPORT void didFinishDocumentLoad();

WEBCORE_EXPORT IntSize layoutSize() const;
WEBCORE_EXPORT double initialScale() const;
WEBCORE_EXPORT double minimumScale() const;
double maximumScale() const { return m_configuration.maximumScale; }
bool allowsUserScaling() const { return m_configuration.allowsUserScaling; }
bool usesMinimalUI() const { return m_usesMinimalUI; }

WEBCORE_EXPORT static Parameters webpageParameters();
WEBCORE_EXPORT static Parameters textDocumentParameters();
@@ -113,11 +104,7 @@ class ViewportConfiguration {
Parameters m_defaultConfiguration;
IntSize m_contentSize;
FloatSize m_minimumLayoutSize;
FloatSize m_minimumLayoutSizeForMinimalUI;
ViewportArguments m_viewportArguments;

bool m_usesMinimalUI;
bool m_pageDidFinishDocumentLoad;
};

} // namespace WebCore
@@ -1,3 +1,14 @@
2014-11-20 Benjamin Poulain <bpoulain@apple.com>

Remove the remaining vestiges of minimal-ui
https://bugs.webkit.org/show_bug.cgi?id=138890

Reviewed by Sam Weinig.

* WebCoreSupport/WebChromeClientIOS.mm:
(dictionaryForViewportArguments):
* WebKit.iOS.exp:

2014-11-19 Daniel Bates <dabates@apple.com>

[iOS] Make WebKit build with public iOS SDK
@@ -168,8 +168,7 @@
@"maximum-scale":@(arguments.maxZoom),
@"user-scalable":@(arguments.userZoom),
@"width":@(arguments.width),
@"height":@(arguments.height),
@"minimal-ui":@(arguments.minimalUI) };
@"height":@(arguments.height) };
}

FloatSize WebChromeClientIOS::screenSize() const
@@ -19,7 +19,6 @@ _WebQuickLookUTIKey
_WebViewportHeightKey
_WebViewportInitialScaleKey
_WebViewportMaximumScaleKey
_WebViewportMinimalUIKey
_WebViewportMinimumScaleKey
_WebViewportUserScalableKey
_WebViewportWidthKey
@@ -1,3 +1,13 @@
2014-11-20 Benjamin Poulain <bpoulain@apple.com>

Remove the remaining vestiges of minimal-ui
https://bugs.webkit.org/show_bug.cgi?id=138890

Reviewed by Sam Weinig.

* History/WebHistoryItem.mm:
* History/WebHistoryItemPrivate.h:

2014-11-20 Tim Horton <timothy_horton@apple.com>

Cancel DataDetectors menu earlier if we know it can't be presented
@@ -65,7 +65,6 @@
NSString *WebViewportUserScalableKey = @"user-scalable";
NSString *WebViewportWidthKey = @"width";
NSString *WebViewportHeightKey = @"height";
NSString *WebViewportMinimalUIKey = @"minimal-ui";

static NSString *scaleKey = @"scale";
static NSString *scaleIsInitialKey = @"scaleIsInitial";
@@ -623,7 +622,6 @@ - (NSDictionary *)_viewportArguments
[argumentsDictionary setObject:[NSNumber numberWithFloat:viewportArguments.width] forKey:WebViewportWidthKey];
[argumentsDictionary setObject:[NSNumber numberWithFloat:viewportArguments.height] forKey:WebViewportHeightKey];
[argumentsDictionary setObject:[NSNumber numberWithFloat:viewportArguments.userZoom] forKey:WebViewportUserScalableKey];
[argumentsDictionary setObject:[NSNumber numberWithBool:viewportArguments.minimalUI] forKey:WebViewportMinimalUIKey];
return argumentsDictionary;
}

@@ -636,7 +634,6 @@ - (void)_setViewportArguments:(NSDictionary *)arguments
viewportArguments.width = [[arguments objectForKey:WebViewportWidthKey] floatValue];
viewportArguments.height = [[arguments objectForKey:WebViewportHeightKey] floatValue];
viewportArguments.userZoom = [[arguments objectForKey:WebViewportUserScalableKey] floatValue];
viewportArguments.minimalUI = [[arguments objectForKey:WebViewportMinimalUIKey] boolValue];
core(_private)->setViewportArguments(viewportArguments);
}

@@ -35,7 +35,6 @@ extern NSString *WebViewportMaximumScaleKey;
extern NSString *WebViewportUserScalableKey;
extern NSString *WebViewportWidthKey;
extern NSString *WebViewportHeightKey;
extern NSString *WebViewportMinimalUIKey;
#endif

@interface WebHistoryItem (WebPrivate)
@@ -1,3 +1,22 @@
2014-11-20 Benjamin Poulain <bpoulain@apple.com>

Remove the remaining vestiges of minimal-ui
https://bugs.webkit.org/show_bug.cgi?id=138890

Reviewed by Sam Weinig.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::didFinishDocumentLoad): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::savePageState):
(WebKit::WebPage::restorePageState):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateViewportSizeForCSSViewportUnits):

2014-11-20 Beth Dakin <bdakin@apple.com>

Preview popover needs minimum and maximum sizes
@@ -507,8 +507,6 @@ void WebFrameLoaderClient::dispatchDidFinishDocumentLoad()
if (!webPage)
return;

webPage->didFinishDocumentLoad(m_frame);

RefPtr<API::Object> userData;

// Notify the bundle client.

0 comments on commit 2ea2203

Please sign in to comment.