[Chromium] Allow pushState and related history APIs to be disabled per context
authormihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 23:26:58 +0000 (23:26 +0000)
committermihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 23:26:58 +0000 (23:26 +0000)
commit935cca01ff64ee8a7c39ed3f308f30abaf0b4b5d
treeceaba0a818dee19a3238ce3e035ef1c0dc3d19e6
parent69bbae92bab51c52aa2ee272ca99428efe7ec65b
[Chromium] Allow pushState and related history APIs to be disabled per context
https://bugs.webkit.org/show_bug.cgi?id=99780

Reviewed by Adam Barth.

Source/WebCore:

Chrome Apps do not support the history API (or navigation in general).
Since pushState is generally feature detected, it's cleanest to disable
it via a V8 per-context feature, so that applications can have the
appropriate fallback behavior (other history APIs are re-mapped to throw
exceptions, since history.back() and the link are not feature detected).

* dom/ContextFeatures.cpp:
(WebCore::ContextFeatures::pushStateEnabled):
(WebCore):
* dom/ContextFeatures.h:
* dom/Document.cpp:
(WebCore::Document::enqueuePopstateEvent):
* page/History.idl:

Source/WebKit/chromium:

Add pushState context feature.

* public/WebPermissionClient.h:
(WebPermissionClient):
(WebKit::WebPermissionClient::allowPushState):
* src/ContextFeaturesClientImpl.cpp:
(WebKit::ContextFeaturesClientImpl::askIfIsEnabled):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/ContextFeatures.cpp
Source/WebCore/dom/ContextFeatures.h
Source/WebCore/dom/Document.cpp
Source/WebCore/page/History.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebPermissionClient.h
Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp