summaryrefslogtreecommitdiff
path: root/Source/WebCore/page
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
commit5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch)
tree8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebCore/page
parent33b26980cb24288b5a9f2590ccf32a949281bb79 (diff)
downloadqtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebCore/page')
-rw-r--r--Source/WebCore/page/AbstractView.idl19
-rw-r--r--Source/WebCore/page/BarInfo.idl15
-rw-r--r--Source/WebCore/page/Chrome.cpp2
-rw-r--r--Source/WebCore/page/ChromeClient.h8
-rw-r--r--Source/WebCore/page/Console.idl61
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.cpp58
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.h8
-rw-r--r--Source/WebCore/page/Coordinates.idl25
-rw-r--r--Source/WebCore/page/Crypto.idl13
-rw-r--r--Source/WebCore/page/DOMSecurityPolicy.idl46
-rw-r--r--Source/WebCore/page/DOMSelection.cpp5
-rw-r--r--Source/WebCore/page/DOMSelection.idl113
-rw-r--r--Source/WebCore/page/DOMTimer.cpp25
-rw-r--r--Source/WebCore/page/DOMTimer.h13
-rw-r--r--Source/WebCore/page/DOMWindow.cpp14
-rw-r--r--Source/WebCore/page/DOMWindow.h5
-rw-r--r--Source/WebCore/page/DOMWindow.idl1357
-rw-r--r--Source/WebCore/page/DOMWindowPagePopup.idl14
-rw-r--r--Source/WebCore/page/EventHandler.cpp97
-rw-r--r--Source/WebCore/page/EventHandler.h5
-rw-r--r--Source/WebCore/page/EventSource.idl63
-rw-r--r--Source/WebCore/page/FeatureObserver.cpp2
-rw-r--r--Source/WebCore/page/FeatureObserver.h7
-rw-r--r--Source/WebCore/page/Frame.cpp15
-rw-r--r--Source/WebCore/page/Frame.h8
-rw-r--r--Source/WebCore/page/FrameTree.cpp9
-rw-r--r--Source/WebCore/page/FrameView.cpp80
-rw-r--r--Source/WebCore/page/FrameView.h19
-rw-r--r--Source/WebCore/page/GestureTapHighlighter.cpp63
-rw-r--r--Source/WebCore/page/History.idl41
-rw-r--r--Source/WebCore/page/Location.idl61
-rw-r--r--Source/WebCore/page/MemoryInfo.idl17
-rw-r--r--Source/WebCore/page/Navigator.idl49
-rw-r--r--Source/WebCore/page/Page.cpp93
-rw-r--r--Source/WebCore/page/Page.h21
-rw-r--r--Source/WebCore/page/PageGroup.cpp36
-rw-r--r--Source/WebCore/page/PageGroup.h4
-rw-r--r--Source/WebCore/page/PagePopupClient.cpp19
-rw-r--r--Source/WebCore/page/PagePopupClient.h8
-rw-r--r--Source/WebCore/page/PagePopupController.cpp4
-rw-r--r--Source/WebCore/page/PagePopupController.idl14
-rw-r--r--Source/WebCore/page/PageSerializer.cpp12
-rw-r--r--Source/WebCore/page/Performance.cpp4
-rw-r--r--Source/WebCore/page/Performance.h2
-rw-r--r--Source/WebCore/page/Performance.idl39
-rw-r--r--Source/WebCore/page/PerformanceEntry.idl27
-rw-r--r--Source/WebCore/page/PerformanceEntryList.idl23
-rw-r--r--Source/WebCore/page/PerformanceNavigation.idl27
-rw-r--r--Source/WebCore/page/PerformanceResourceTiming.idl39
-rw-r--r--Source/WebCore/page/PerformanceTiming.cpp22
-rw-r--r--Source/WebCore/page/PerformanceTiming.idl57
-rw-r--r--Source/WebCore/page/Screen.idl29
-rw-r--r--Source/WebCore/page/SecurityOrigin.cpp5
-rw-r--r--Source/WebCore/page/SecurityPolicy.cpp6
-rw-r--r--Source/WebCore/page/Settings.cpp28
-rw-r--r--Source/WebCore/page/Settings.h19
-rw-r--r--Source/WebCore/page/SpeechInput.cpp2
-rw-r--r--Source/WebCore/page/SpeechInputEvent.idl13
-rw-r--r--Source/WebCore/page/SpeechInputResult.idl15
-rw-r--r--Source/WebCore/page/SpeechInputResultList.idl17
-rw-r--r--Source/WebCore/page/SuspendableTimer.cpp2
-rw-r--r--Source/WebCore/page/TouchDisambiguation.cpp6
-rw-r--r--Source/WebCore/page/UserContentURLPattern.cpp17
-rw-r--r--Source/WebCore/page/UserContentURLPattern.h2
-rw-r--r--Source/WebCore/page/UserScript.h22
-rw-r--r--Source/WebCore/page/UserStyleSheet.h22
-rw-r--r--Source/WebCore/page/WebKitAnimation.idl41
-rw-r--r--Source/WebCore/page/WebKitAnimationList.idl15
-rw-r--r--Source/WebCore/page/WebKitPoint.idl17
-rw-r--r--Source/WebCore/page/WindowFeatures.cpp4
-rw-r--r--Source/WebCore/page/WorkerNavigator.idl27
-rw-r--r--Source/WebCore/page/animation/AnimationController.cpp16
-rw-r--r--Source/WebCore/page/animation/CompositeAnimation.cpp50
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinator.cpp285
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinator.h122
-rw-r--r--Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp92
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateNode.cpp97
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateNode.h104
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp228
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (renamed from Source/WebCore/page/scrolling/ScrollingTreeState.h)62
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateTree.cpp93
-rw-r--r--Source/WebCore/page/scrolling/ScrollingStateTree.h86
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTree.cpp24
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTree.h6
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeNode.cpp24
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeNode.h4
-rw-r--r--Source/WebCore/page/scrolling/ScrollingTreeState.cpp179
-rw-r--r--Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp75
-rw-r--r--Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.h85
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h121
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm335
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingStateNodeMac.mm (renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStateMac.mm)16
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h2
-rw-r--r--Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm14
94 files changed, 3044 insertions, 2173 deletions
diff --git a/Source/WebCore/page/AbstractView.idl b/Source/WebCore/page/AbstractView.idl
index 6d8232b50..c57aaeaba 100644
--- a/Source/WebCore/page/AbstractView.idl
+++ b/Source/WebCore/page/AbstractView.idl
@@ -24,15 +24,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module views {
+// Introduced in DOM Level 2:
+[
+ ObjCCustomImplementation,
+ OmitConstructor
+] interface AbstractView {
+ readonly attribute Document document;
+ readonly attribute StyleMedia styleMedia;
+};
- // Introduced in DOM Level 2:
- interface [
- ObjCCustomImplementation,
- OmitConstructor
- ] AbstractView {
- readonly attribute Document document;
- readonly attribute StyleMedia styleMedia;
- };
-
-}
diff --git a/Source/WebCore/page/BarInfo.idl b/Source/WebCore/page/BarInfo.idl
index 11a97c70e..a7dc091f6 100644
--- a/Source/WebCore/page/BarInfo.idl
+++ b/Source/WebCore/page/BarInfo.idl
@@ -26,13 +26,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+[
+ JSGenerateIsReachable=ImplFrame,
+ OmitConstructor
+] interface BarInfo {
+ readonly attribute boolean visible;
+};
- interface [
- JSGenerateIsReachable=ImplFrame,
- OmitConstructor
- ] BarInfo {
- readonly attribute boolean visible;
- };
-
-}
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index cca4a0925..e95b2a6cb 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -491,7 +491,7 @@ void Chrome::scheduleAnimation()
// --------
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void ChromeClient::dashboardRegionsChanged()
+void ChromeClient::annotatedRegionsChanged()
{
}
#endif
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index fa5b485e0..6a3631d22 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -78,6 +78,7 @@ namespace WebCore {
#if USE(ACCELERATED_COMPOSITING)
class GraphicsLayer;
+ class GraphicsLayerFactory;
#endif
#if ENABLE(INPUT_TYPE_COLOR)
@@ -207,7 +208,7 @@ namespace WebCore {
virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded) = 0;
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
- virtual void dashboardRegionsChanged();
+ virtual void annotatedRegionsChanged();
#endif
virtual void populateVisitedLinks();
@@ -246,6 +247,9 @@ namespace WebCore {
virtual void elementDidBlur(const Node*) { };
#if USE(ACCELERATED_COMPOSITING)
+ // Allows ports to customize the type of graphics layers created by this page.
+ virtual GraphicsLayerFactory* graphicsLayerFactory() const { return 0; }
+
// Pass 0 as the GraphicsLayer to detatch the root layer.
virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*) = 0;
// Sets a flag to specify that the next time content is drawn to the window,
@@ -253,7 +257,7 @@ namespace WebCore {
virtual void setNeedsOneShotDrawingSynchronization() = 0;
// Sets a flag to specify that the view needs to be updated, so we need
// to do an eager layout before the drawing.
- virtual void scheduleCompositingLayerSync() = 0;
+ virtual void scheduleCompositingLayerFlush() = 0;
// Returns whether or not the client can render the composited layer,
// regardless of the settings.
virtual bool allowsAcceleratedCompositing() const { return true; }
diff --git a/Source/WebCore/page/Console.idl b/Source/WebCore/page/Console.idl
index 56221d64c..1f2b96ac6 100644
--- a/Source/WebCore/page/Console.idl
+++ b/Source/WebCore/page/Console.idl
@@ -26,42 +26,39 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+[
+ JSGenerateIsReachable=ImplFrame,
+ OmitConstructor
+] interface Console {
- interface [
- JSGenerateIsReachable=ImplFrame,
- OmitConstructor
- ] Console {
-
- [CallWith=ScriptArguments|CallStack] void debug();
- [CallWith=ScriptArguments|CallStack] void error();
- [CallWith=ScriptArguments|CallStack] void info();
- [CallWith=ScriptArguments|CallStack] void log();
- [CallWith=ScriptArguments|CallStack] void warn();
- [CallWith=ScriptArguments|CallStack] void dir();
- [CallWith=ScriptArguments|CallStack] void dirxml();
- [V8Custom, CallWith=ScriptArguments|CallStack] void trace();
- [V8Custom, CallWith=ScriptArguments|CallStack, ImplementedAs=assertCondition] void assert(in boolean condition);
- [CallWith=ScriptArguments|CallStack] void count();
- [CallWith=ScriptArguments|CallStack] void markTimeline();
+ [CallWith=ScriptArguments|CallStack] void debug();
+ [CallWith=ScriptArguments|CallStack] void error();
+ [CallWith=ScriptArguments|CallStack] void info();
+ [CallWith=ScriptArguments|CallStack] void log();
+ [CallWith=ScriptArguments|CallStack] void warn();
+ [CallWith=ScriptArguments|CallStack] void dir();
+ [CallWith=ScriptArguments|CallStack] void dirxml();
+ [V8Custom, CallWith=ScriptArguments|CallStack] void trace();
+ [V8Custom, CallWith=ScriptArguments|CallStack, ImplementedAs=assertCondition] void assert(in boolean condition);
+ [CallWith=ScriptArguments|CallStack] void count();
+ [CallWith=ScriptArguments|CallStack] void markTimeline();
#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
- // As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence
- // "Sequences must not be used as the type of an attribute, constant or exception field."
- // FIXME: this will lead to BUG console.profiles !== console.profiles as profile will always returns new array.
- readonly attribute ScriptProfile[] profiles;
- [Custom] void profile(in DOMString title);
- [Custom] void profileEnd(in DOMString title);
+ // As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence
+ // "Sequences must not be used as the type of an attribute, constant or exception field."
+ // FIXME: this will lead to BUG console.profiles !== console.profiles as profile will always returns new array.
+ readonly attribute ScriptProfile[] profiles;
+ [Custom] void profile(in DOMString title);
+ [Custom] void profileEnd(in DOMString title);
#endif
- void time(in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString title);
- [CallWith=ScriptArguments|CallStack] void timeEnd(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString title);
- [CallWith=ScriptArguments|CallStack] void timeStamp();
- [CallWith=ScriptArguments|CallStack] void group();
- [CallWith=ScriptArguments|CallStack] void groupCollapsed();
- void groupEnd();
+ void time(in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString title);
+ [CallWith=ScriptArguments|CallStack] void timeEnd(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString title);
+ [CallWith=ScriptArguments|CallStack] void timeStamp();
+ [CallWith=ScriptArguments|CallStack] void group();
+ [CallWith=ScriptArguments|CallStack] void groupCollapsed();
+ void groupEnd();
- readonly attribute [V8CustomGetter] MemoryInfo memory;
- };
+ [V8CustomGetter] readonly attribute MemoryInfo memory;
+};
-}
diff --git a/Source/WebCore/page/ContentSecurityPolicy.cpp b/Source/WebCore/page/ContentSecurityPolicy.cpp
index 2667a8284..58d395fab 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.cpp
+++ b/Source/WebCore/page/ContentSecurityPolicy.cpp
@@ -39,6 +39,8 @@
#include "PingLoader.h"
#include "SchemeRegistry.h"
#include "ScriptCallStack.h"
+#include "ScriptCallStackFactory.h"
+#include "ScriptState.h"
#include "SecurityOrigin.h"
#include "TextEncoding.h"
#include <wtf/HashSet.h>
@@ -736,7 +738,7 @@ public:
bool allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus) const;
bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus) const;
bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus) const;
- bool allowEval(PassRefPtr<ScriptCallStack>, ContentSecurityPolicy::ReportingStatus) const;
+ bool allowEval(ScriptState*, ContentSecurityPolicy::ReportingStatus) const;
bool allowScriptNonce(const String& nonce, const String& contextURL, const WTF::OrdinalNumber& contextLine, const KURL&) const;
bool allowPluginType(const String& type, const String& typeAttribute, const KURL&, ContentSecurityPolicy::ReportingStatus) const;
@@ -769,7 +771,7 @@ private:
void setCSPDirective(const String& name, const String& value, OwnPtr<CSPDirectiveType>&);
SourceListDirective* operativeDirective(SourceListDirective*) const;
- void reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL = KURL(), const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
+ void reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL = KURL(), const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), ScriptState* = 0) const;
bool checkEval(SourceListDirective*) const;
bool checkInline(SourceListDirective*) const;
@@ -779,7 +781,7 @@ private:
void setEvalDisabledErrorMessage(const String& errorMessage) { m_evalDisabledErrorMessage = errorMessage; }
- bool checkEvalAndReportViolation(SourceListDirective*, const String& consoleMessage, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
+ bool checkEvalAndReportViolation(SourceListDirective*, const String& consoleMessage, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), ScriptState* = 0) const;
bool checkInlineAndReportViolation(SourceListDirective*, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine, bool isScript) const;
bool checkNonceAndReportViolation(NonceDirective*, const String& nonce, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine) const;
@@ -843,10 +845,10 @@ PassOwnPtr<CSPDirectiveList> CSPDirectiveList::create(ContentSecurityPolicy* pol
return directives.release();
}
-void CSPDirectiveList::reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const String& contextURL, const WTF::OrdinalNumber& contextLine, PassRefPtr<ScriptCallStack> callStack) const
+void CSPDirectiveList::reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const String& contextURL, const WTF::OrdinalNumber& contextLine, ScriptState* state) const
{
String message = m_reportOnly ? "[Report Only] " + consoleMessage : consoleMessage;
- m_policy->reportViolation(directiveText, message, blockedURL, m_reportURIs, m_header, contextURL, contextLine, callStack);
+ m_policy->reportViolation(directiveText, message, blockedURL, m_reportURIs, m_header, contextURL, contextLine, state);
}
bool CSPDirectiveList::checkEval(SourceListDirective* directive) const
@@ -883,7 +885,7 @@ SourceListDirective* CSPDirectiveList::operativeDirective(SourceListDirective* d
return directive ? directive : m_defaultSrc.get();
}
-bool CSPDirectiveList::checkEvalAndReportViolation(SourceListDirective* directive, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine, PassRefPtr<ScriptCallStack> callStack) const
+bool CSPDirectiveList::checkEvalAndReportViolation(SourceListDirective* directive, const String& consoleMessage, const String& contextURL, const WTF::OrdinalNumber& contextLine, ScriptState* state) const
{
if (checkEval(directive))
return true;
@@ -892,7 +894,7 @@ bool CSPDirectiveList::checkEvalAndReportViolation(SourceListDirective* directiv
if (directive == m_defaultSrc)
suffix = " Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.";
- reportViolation(directive->text(), consoleMessage + "\"" + directive->text() + "\"." + suffix + "\n", KURL(), contextURL, contextLine, callStack);
+ reportViolation(directive->text(), consoleMessage + "\"" + directive->text() + "\"." + suffix + "\n", KURL(), contextURL, contextLine, state);
if (!m_reportOnly) {
m_policy->reportBlockedScriptExecutionToInspector(directive->text());
return false;
@@ -999,11 +1001,11 @@ bool CSPDirectiveList::allowInlineStyle(const String& contextURL, const WTF::Ord
checkInline(operativeDirective(m_styleSrc.get()));
}
-bool CSPDirectiveList::allowEval(PassRefPtr<ScriptCallStack> callStack, ContentSecurityPolicy::ReportingStatus reportingStatus) const
+bool CSPDirectiveList::allowEval(ScriptState* state, ContentSecurityPolicy::ReportingStatus reportingStatus) const
{
DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to evaluate script because it violates the following Content Security Policy directive: ")));
return reportingStatus == ContentSecurityPolicy::SendReport ?
- checkEvalAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, String(), WTF::OrdinalNumber::beforeFirst(), callStack) :
+ checkEvalAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, String(), WTF::OrdinalNumber::beforeFirst(), state) :
checkEval(operativeDirective(m_scriptSrc.get()));
}
@@ -1304,7 +1306,8 @@ void ContentSecurityPolicy::didReceiveHeader(const String& header, HeaderType ty
{
if (m_scriptExecutionContext->isDocument()) {
Document* document = static_cast<Document*>(m_scriptExecutionContext);
- FeatureObserver::observe(document->domWindow(), FeatureObserver::PrefixedContentSecurityPolicy);
+ if (document->domWindow())
+ FeatureObserver::observe(document->domWindow(), FeatureObserver::PrefixedContentSecurityPolicy);
}
// RFC2616, section 4.2 specifies that headers appearing multiple times can
@@ -1345,11 +1348,21 @@ ContentSecurityPolicy::HeaderType ContentSecurityPolicy::deprecatedHeaderType()
return m_policies.isEmpty() ? EnforcePolicy : m_policies[0]->headerType();
}
-template<bool (CSPDirectiveList::*allowed)(PassRefPtr<ScriptCallStack>, ContentSecurityPolicy::ReportingStatus) const>
-bool isAllowedByAllWithCallStack(const CSPDirectiveListVector& policies, PassRefPtr<ScriptCallStack> callStack, ContentSecurityPolicy::ReportingStatus reportingStatus)
+template<bool (CSPDirectiveList::*allowed)(ContentSecurityPolicy::ReportingStatus) const>
+bool isAllowedByAll(const CSPDirectiveListVector& policies, ContentSecurityPolicy::ReportingStatus reportingStatus)
{
for (size_t i = 0; i < policies.size(); ++i) {
- if (!(policies[i].get()->*allowed)(callStack, reportingStatus))
+ if (!(policies[i].get()->*allowed)(reportingStatus))
+ return false;
+ }
+ return true;
+}
+
+template<bool (CSPDirectiveList::*allowed)(ScriptState* state, ContentSecurityPolicy::ReportingStatus) const>
+bool isAllowedByAllWithState(const CSPDirectiveListVector& policies, ScriptState* state, ContentSecurityPolicy::ReportingStatus reportingStatus)
+{
+ for (size_t i = 0; i < policies.size(); ++i) {
+ if (!(policies[i].get()->*allowed)(state, reportingStatus))
return false;
}
return true;
@@ -1410,9 +1423,9 @@ bool ContentSecurityPolicy::allowInlineStyle(const String& contextURL, const WTF
return isAllowedByAllWithContext<&CSPDirectiveList::allowInlineStyle>(m_policies, contextURL, contextLine, reportingStatus);
}
-bool ContentSecurityPolicy::allowEval(PassRefPtr<ScriptCallStack> callStack, ContentSecurityPolicy::ReportingStatus reportingStatus) const
+bool ContentSecurityPolicy::allowEval(ScriptState* state, ContentSecurityPolicy::ReportingStatus reportingStatus) const
{
- return isAllowedByAllWithCallStack<&CSPDirectiveList::allowEval>(m_policies, callStack, reportingStatus);
+ return isAllowedByAllWithState<&CSPDirectiveList::allowEval>(m_policies, state, reportingStatus);
}
String ContentSecurityPolicy::evalDisabledErrorMessage() const
@@ -1514,9 +1527,9 @@ void ContentSecurityPolicy::enforceSandboxFlags(SandboxFlags mask) const
m_scriptExecutionContext->enforceSandboxFlags(mask);
}
-void ContentSecurityPolicy::reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const Vector<KURL>& reportURIs, const String& header, const String& contextURL, const WTF::OrdinalNumber& contextLine, PassRefPtr<ScriptCallStack> callStack) const
+void ContentSecurityPolicy::reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const Vector<KURL>& reportURIs, const String& header, const String& contextURL, const WTF::OrdinalNumber& contextLine, ScriptState* state) const
{
- logToConsole(consoleMessage, contextURL, contextLine, callStack);
+ logToConsole(consoleMessage, contextURL, contextLine, state);
if (reportURIs.isEmpty())
return;
@@ -1612,8 +1625,17 @@ void ContentSecurityPolicy::reportInvalidSourceExpression(const String& directiv
logToConsole(message);
}
-void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, PassRefPtr<ScriptCallStack> callStack) const
+void ContentSecurityPolicy::logToConsole(const String& message, const String& contextURL, const WTF::OrdinalNumber& contextLine, ScriptState* state) const
{
+ RefPtr<ScriptCallStack> callStack;
+ if (InspectorInstrumentation::consoleAgentEnabled(m_scriptExecutionContext)) {
+ if (state)
+ callStack = createScriptCallStackForConsole(state);
+ else
+ callStack = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture, true);
+ if (callStack && !callStack->size())
+ callStack = 0;
+ }
m_scriptExecutionContext->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message, contextURL, contextLine.oneBasedInt(), callStack);
}
diff --git a/Source/WebCore/page/ContentSecurityPolicy.h b/Source/WebCore/page/ContentSecurityPolicy.h
index 39e049e10..0f87dfc3f 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.h
+++ b/Source/WebCore/page/ContentSecurityPolicy.h
@@ -27,6 +27,7 @@
#define ContentSecurityPolicy_h
#include "KURL.h"
+#include "ScriptState.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
@@ -40,7 +41,6 @@ class OrdinalNumber;
namespace WebCore {
class CSPDirectiveList;
-class ScriptCallStack;
class DOMStringList;
class ScriptExecutionContext;
class SecurityOrigin;
@@ -80,7 +80,7 @@ public:
bool allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, ReportingStatus = SendReport) const;
- bool allowEval(PassRefPtr<ScriptCallStack>, ReportingStatus = SendReport) const;
+ bool allowEval(ScriptState* = 0, ReportingStatus = SendReport) const;
bool allowScriptNonce(const String& nonce, const String& contextURL, const WTF::OrdinalNumber& contextLine, const KURL& = KURL()) const;
bool allowPluginType(const String& type, const String& typeAttribute, const KURL&, ReportingStatus = SendReport) const;
@@ -106,7 +106,7 @@ public:
void reportInvalidPluginTypes(const String&) const;
void reportInvalidSourceExpression(const String& directiveName, const String& source) const;
void reportUnrecognizedDirective(const String&) const;
- void reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const Vector<KURL>& reportURIs, const String& header, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
+ void reportViolation(const String& directiveText, const String& consoleMessage, const KURL& blockedURL, const Vector<KURL>& reportURIs, const String& header, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), ScriptState* = 0) const;
void reportBlockedScriptExecutionToInspector(const String& directiveText) const;
@@ -119,7 +119,7 @@ public:
private:
explicit ContentSecurityPolicy(ScriptExecutionContext*);
- void logToConsole(const String& message, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), PassRefPtr<ScriptCallStack> = 0) const;
+ void logToConsole(const String& message, const String& contextURL = String(), const WTF::OrdinalNumber& contextLine = WTF::OrdinalNumber::beforeFirst(), ScriptState* = 0) const;
ScriptExecutionContext* m_scriptExecutionContext;
bool m_overrideInlineStyleAllowed;
diff --git a/Source/WebCore/page/Coordinates.idl b/Source/WebCore/page/Coordinates.idl
index f83d87e55..cccba2272 100644
--- a/Source/WebCore/page/Coordinates.idl
+++ b/Source/WebCore/page/Coordinates.idl
@@ -23,17 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module core {
-
- interface [
- OmitConstructor
- ] Coordinates {
- readonly attribute double latitude;
- readonly attribute double longitude;
- readonly attribute [Custom] double altitude;
- readonly attribute double accuracy;
- readonly attribute [Custom] double altitudeAccuracy;
- readonly attribute [Custom] double heading;
- readonly attribute [Custom] double speed;
- };
-}
+[
+ OmitConstructor
+] interface Coordinates {
+ readonly attribute double latitude;
+ readonly attribute double longitude;
+ [Custom] readonly attribute double altitude;
+ readonly attribute double accuracy;
+ [Custom] readonly attribute double altitudeAccuracy;
+ [Custom] readonly attribute double heading;
+ [Custom] readonly attribute double speed;
+};
diff --git a/Source/WebCore/page/Crypto.idl b/Source/WebCore/page/Crypto.idl
index 807b63f81..589281af5 100644
--- a/Source/WebCore/page/Crypto.idl
+++ b/Source/WebCore/page/Crypto.idl
@@ -26,12 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+[
+ OmitConstructor
+] interface Crypto {
+ void getRandomValues(in ArrayBufferView array) raises(DOMException);
+};
- interface [
- OmitConstructor
- ] Crypto {
- void getRandomValues(in ArrayBufferView array) raises(DOMException);
- };
-
-}
diff --git a/Source/WebCore/page/DOMSecurityPolicy.idl b/Source/WebCore/page/DOMSecurityPolicy.idl
index 46077a00f..c9ff043d8 100644
--- a/Source/WebCore/page/DOMSecurityPolicy.idl
+++ b/Source/WebCore/page/DOMSecurityPolicy.idl
@@ -22,32 +22,28 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module core {
+[
+ Conditional=CSP_NEXT,
+ OmitConstructor,
+ InterfaceName=SecurityPolicy
+] interface DOMSecurityPolicy {
+ readonly attribute DOMStringList reportURIs;
- interface [
- Conditional=CSP_NEXT,
- OmitConstructor,
- InterfaceName=SecurityPolicy
- ] DOMSecurityPolicy {
- readonly attribute DOMStringList reportURIs;
+ boolean isActive();
- boolean isActive();
+ boolean allowsConnectionTo(in DOMString url);
+ boolean allowsFontFrom(in DOMString url);
+ boolean allowsFormAction(in DOMString url);
+ boolean allowsFrameFrom(in DOMString url);
+ boolean allowsImageFrom(in DOMString url);
+ boolean allowsMediaFrom(in DOMString url);
+ boolean allowsObjectFrom(in DOMString url);
+ boolean allowsPluginType(in DOMString type);
+ boolean allowsScriptFrom(in DOMString url);
+ boolean allowsStyleFrom(in DOMString url);
- boolean allowsConnectionTo(in DOMString url);
- boolean allowsFontFrom(in DOMString url);
- boolean allowsFormAction(in DOMString url);
- boolean allowsFrameFrom(in DOMString url);
- boolean allowsImageFrom(in DOMString url);
- boolean allowsMediaFrom(in DOMString url);
- boolean allowsObjectFrom(in DOMString url);
- boolean allowsPluginType(in DOMString type);
- boolean allowsScriptFrom(in DOMString url);
- boolean allowsStyleFrom(in DOMString url);
-
- boolean allowsEval();
- boolean allowsInlineScript();
- boolean allowsInlineStyle();
- };
-
-}
+ boolean allowsEval();
+ boolean allowsInlineScript();
+ boolean allowsInlineStyle();
+};
diff --git a/Source/WebCore/page/DOMSelection.cpp b/Source/WebCore/page/DOMSelection.cpp
index c3ad42807..062443ac4 100644
--- a/Source/WebCore/page/DOMSelection.cpp
+++ b/Source/WebCore/page/DOMSelection.cpp
@@ -53,10 +53,7 @@ static Node* selectionShadowAncestor(Frame* frame)
if (!node->isInShadowTree())
return 0;
- Node* shadowAncestor = node->shadowAncestorNode();
- while (shadowAncestor->isInShadowTree())
- shadowAncestor = shadowAncestor->shadowAncestorNode();
- return shadowAncestor;
+ return frame->document()->ancestorInThisScope(node);
}
DOMSelection::DOMSelection(const TreeScope* treeScope)
diff --git a/Source/WebCore/page/DOMSelection.idl b/Source/WebCore/page/DOMSelection.idl
index 1f7d3da3f..ee6979ae1 100644
--- a/Source/WebCore/page/DOMSelection.idl
+++ b/Source/WebCore/page/DOMSelection.idl
@@ -27,74 +27,71 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+// This is based off of Mozilla's Selection interface
+// https://developer.mozilla.org/En/DOM/Selection
+[
+ JSGenerateIsReachable=ImplFrame,
+ InterfaceName=Selection
+] interface DOMSelection {
+ readonly attribute Node anchorNode;
+ readonly attribute long anchorOffset;
+ readonly attribute Node focusNode;
+ readonly attribute long focusOffset;
- // This is based off of Mozilla's Selection interface
- // https://developer.mozilla.org/En/DOM/Selection
- interface [
- JSGenerateIsReachable=ImplFrame,
- InterfaceName=Selection
- ] DOMSelection {
- readonly attribute Node anchorNode;
- readonly attribute long anchorOffset;
- readonly attribute Node focusNode;
- readonly attribute long focusOffset;
+ readonly attribute boolean isCollapsed;
+ readonly attribute long rangeCount;
- readonly attribute boolean isCollapsed;
- readonly attribute long rangeCount;
+ void collapse(in [Optional=DefaultIsUndefined] Node node,
+ in [Optional=DefaultIsUndefined] long index)
+ raises(DOMException);
+ void collapseToEnd()
+ raises(DOMException);
+ void collapseToStart()
+ raises(DOMException);
- void collapse(in [Optional=DefaultIsUndefined] Node node,
- in [Optional=DefaultIsUndefined] long index)
- raises(DOMException);
- void collapseToEnd()
- raises(DOMException);
- void collapseToStart()
- raises(DOMException);
+ void deleteFromDocument();
+ boolean containsNode(in [Optional=DefaultIsUndefined] Node node,
+ in [Optional=DefaultIsUndefined] boolean allowPartial);
+ void selectAllChildren(in [Optional=DefaultIsUndefined] Node node)
+ raises(DOMException);
- void deleteFromDocument();
- boolean containsNode(in [Optional=DefaultIsUndefined] Node node,
- in [Optional=DefaultIsUndefined] boolean allowPartial);
- void selectAllChildren(in [Optional=DefaultIsUndefined] Node node)
- raises(DOMException);
+ void extend(in [Optional=DefaultIsUndefined] Node node,
+ in [Optional=DefaultIsUndefined] long offset)
+ raises(DOMException);
- void extend(in [Optional=DefaultIsUndefined] Node node,
- in [Optional=DefaultIsUndefined] long offset)
- raises(DOMException);
-
- Range getRangeAt(in [Optional=DefaultIsUndefined] long index)
- raises(DOMException);
- void removeAllRanges();
- void addRange(in [Optional=DefaultIsUndefined] Range range);
+ Range getRangeAt(in [Optional=DefaultIsUndefined] long index)
+ raises(DOMException);
+ void removeAllRanges();
+ void addRange(in [Optional=DefaultIsUndefined] Range range);
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [NotEnumerable] DOMString toString();
+ [NotEnumerable] DOMString toString();
#endif
- // WebKit extensions
- readonly attribute Node baseNode;
- readonly attribute long baseOffset;
- readonly attribute Node extentNode;
- readonly attribute long extentOffset;
+ // WebKit extensions
+ readonly attribute Node baseNode;
+ readonly attribute long baseOffset;
+ readonly attribute Node extentNode;
+ readonly attribute long extentOffset;
- // WebKit's "type" accessor returns "None", "Range" and "Caret"
- // IE's type accessor returns "none", "text" and "control"
- readonly attribute DOMString type;
+ // WebKit's "type" accessor returns "None", "Range" and "Caret"
+ // IE's type accessor returns "none", "text" and "control"
+ readonly attribute DOMString type;
- void modify(in [Optional=DefaultIsUndefined] DOMString alter,
- in [Optional=DefaultIsUndefined] DOMString direction,
- in [Optional=DefaultIsUndefined] DOMString granularity);
- void setBaseAndExtent(in [Optional=DefaultIsUndefined] Node baseNode,
- in [Optional=DefaultIsUndefined] long baseOffset,
- in [Optional=DefaultIsUndefined] Node extentNode,
- in [Optional=DefaultIsUndefined] long extentOffset)
- raises(DOMException);
- void setPosition(in [Optional=DefaultIsUndefined] Node node,
- in [Optional=DefaultIsUndefined] long offset)
- raises(DOMException);
+ void modify(in [Optional=DefaultIsUndefined] DOMString alter,
+ in [Optional=DefaultIsUndefined] DOMString direction,
+ in [Optional=DefaultIsUndefined] DOMString granularity);
+ void setBaseAndExtent(in [Optional=DefaultIsUndefined] Node baseNode,
+ in [Optional=DefaultIsUndefined] long baseOffset,
+ in [Optional=DefaultIsUndefined] Node extentNode,
+ in [Optional=DefaultIsUndefined] long extentOffset)
+ raises(DOMException);
+ void setPosition(in [Optional=DefaultIsUndefined] Node node,
+ in [Optional=DefaultIsUndefined] long offset)
+ raises(DOMException);
- // IE extentions
- // http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
- void empty();
- };
+ // IE extentions
+ // http://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx
+ void empty();
+};
-}
diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp
index dad76f58d..7d6831196 100644
--- a/Source/WebCore/page/DOMTimer.cpp
+++ b/Source/WebCore/page/DOMTimer.cpp
@@ -30,7 +30,7 @@
#include "InspectorInstrumentation.h"
#include "ScheduledAction.h"
#include "ScriptExecutionContext.h"
-#include "UserGestureIndicator.h"
+#include <wtf/CurrentTime.h>
#include <wtf/HashSet.h>
#include <wtf/StdLibExtras.h>
@@ -42,6 +42,7 @@ static const int maxIntervalForUserGestureForwarding = 1000; // One second match
static const int maxTimerNestingLevel = 5;
static const double oneMillisecond = 0.001;
double DOMTimer::s_minDefaultTimerInterval = 0.010; // 10 milliseconds
+double DOMTimer::s_defaultTimerAlignmentInterval = 0;
static int timerNestingLevel = 0;
@@ -68,8 +69,9 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction>
, m_nestingLevel(timerNestingLevel + 1)
, m_action(action)
, m_originalInterval(interval)
- , m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel))
{
+ if (shouldForwardUserGesture(interval, m_nestingLevel))
+ m_userGestureToken = UserGestureIndicator::currentToken();
scriptExecutionContext()->addTimeout(m_timeoutId, this);
double intervalMilliseconds = intervalClampedToMinimum(interval, context->minimumTimerInterval());
@@ -116,10 +118,8 @@ void DOMTimer::fired()
ScriptExecutionContext* context = scriptExecutionContext();
timerNestingLevel = m_nestingLevel;
ASSERT(!context->activeDOMObjectsAreSuspended());
- UserGestureIndicator gestureIndicator(m_shouldForwardUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
-
// Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
- m_shouldForwardUserGesture = false;
+ UserGestureIndicator gestureIndicator(m_userGestureToken.release());
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutId);
@@ -194,4 +194,19 @@ double DOMTimer::intervalClampedToMinimum(int timeout, double minimumTimerInterv
return intervalMilliseconds;
}
+double DOMTimer::alignedFireTime(double fireTime) const
+{
+ double alignmentInterval = scriptExecutionContext()->timerAlignmentInterval();
+ if (alignmentInterval) {
+ double currentTime = monotonicallyIncreasingTime();
+ if (fireTime <= currentTime)
+ return fireTime;
+
+ double alignedTime = ceil(fireTime / alignmentInterval) * alignmentInterval;
+ return alignedTime;
+ }
+
+ return fireTime;
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/page/DOMTimer.h b/Source/WebCore/page/DOMTimer.h
index 4fbc9aeb3..d23898de0 100644
--- a/Source/WebCore/page/DOMTimer.h
+++ b/Source/WebCore/page/DOMTimer.h
@@ -28,6 +28,7 @@
#define DOMTimer_h
#include "SuspendableTimer.h"
+#include "UserGestureIndicator.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -65,12 +66,22 @@ namespace WebCore {
static double defaultMinTimerInterval() { return s_minDefaultTimerInterval; }
static void setDefaultMinTimerInterval(double value) { s_minDefaultTimerInterval = value; }
+ // Retuns timer fire time rounded to the next multiple of timer alignment interval.
+ virtual double alignedFireTime(double) const;
+
+ // The default timer alignment interval (in seconds). If non zero, timer fire times
+ // will be rounded to a multiple of the alignment interval.
+ // These are only modified via static methods in Settings.
+ static double defaultTimerAlignmentInterval() { return s_defaultTimerAlignmentInterval; }
+ static void setDefaultTimerAlignmentInterval(double value) { s_defaultTimerAlignmentInterval = value; }
+
int m_timeoutId;
int m_nestingLevel;
OwnPtr<ScheduledAction> m_action;
int m_originalInterval;
- bool m_shouldForwardUserGesture;
+ RefPtr<UserGestureIndicator::Token> m_userGestureToken;
static double s_minDefaultTimerInterval;
+ static double s_defaultTimerAlignmentInterval;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index c4651d744..faa4ba048 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -248,7 +248,7 @@ bool DOMWindow::dispatchAllPendingBeforeUnloadEvents()
Vector<RefPtr<DOMWindow> > windows;
DOMWindowSet::iterator end = set.end();
for (DOMWindowSet::iterator it = set.begin(); it != end; ++it)
- windows.append(it->first);
+ windows.append(it->key);
size_t size = windows.size();
for (size_t i = 0; i < size; ++i) {
@@ -290,7 +290,7 @@ void DOMWindow::dispatchAllPendingUnloadEvents()
Vector<RefPtr<DOMWindow> > windows;
DOMWindowSet::iterator end = set.end();
for (DOMWindowSet::iterator it = set.begin(); it != end; ++it)
- windows.append(it->first);
+ windows.append(it->key);
size_t size = windows.size();
for (size_t i = 0; i < size; ++i) {
@@ -834,7 +834,7 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
// Capture stack trace only when inspector front-end is loaded as it may be time consuming.
RefPtr<ScriptCallStack> stackTrace;
- if (InspectorInstrumentation::hasFrontends())
+ if (InspectorInstrumentation::consoleAgentEnabled(sourceDocument))
stackTrace = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture, true);
// Schedule the message.
@@ -1533,17 +1533,17 @@ void DOMWindow::clearInterval(int timeoutId)
}
#if ENABLE(REQUEST_ANIMATION_FRAME)
-int DOMWindow::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
+int DOMWindow::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
{
if (Document* d = document())
- return d->webkitRequestAnimationFrame(callback);
+ return d->requestAnimationFrame(callback);
return 0;
}
-void DOMWindow::webkitCancelAnimationFrame(int id)
+void DOMWindow::cancelAnimationFrame(int id)
{
if (Document* d = document())
- d->webkitCancelAnimationFrame(id);
+ d->cancelAnimationFrame(id);
}
#endif
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index 87396185c..95f6ef1ee 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -263,9 +263,8 @@ namespace WebCore {
// WebKit animation extensions
#if ENABLE(REQUEST_ANIMATION_FRAME)
- int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
- void webkitCancelAnimationFrame(int id);
- void webkitCancelRequestAnimationFrame(int id) { webkitCancelAnimationFrame(id); }
+ int requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
+ void cancelAnimationFrame(int id);
#endif
// Events
diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl
index 9649aa931..0e104b692 100644
--- a/Source/WebCore/page/DOMWindow.idl
+++ b/Source/WebCore/page/DOMWindow.idl
@@ -24,782 +24,777 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
-
- interface [
- CheckSecurity,
- JSCustomDefineOwnProperty,
- CustomDeleteProperty,
- CustomGetOwnPropertySlot,
- CustomEnumerateProperty,
- JSCustomMarkFunction,
- JSCustomToNativeObject,
- CustomPutFunction,
- EventTarget,
- ExtendsDOMGlobalObject,
- JSGenerateToNativeObject,
- ReplaceableConstructor,
- JSLegacyParent=JSDOMWindowBase,
- V8CustomToJSObject,
- InterfaceName=Window
- ] DOMWindow {
- // DOM Level 0
- attribute [Replaceable] Screen screen;
- attribute [Replaceable, DoNotCheckSecurityOnGetter] History history;
- attribute [Replaceable] BarInfo locationbar;
- attribute [Replaceable] BarInfo menubar;
- attribute [Replaceable] BarInfo personalbar;
- attribute [Replaceable] BarInfo scrollbars;
- attribute [Replaceable] BarInfo statusbar;
- attribute [Replaceable] BarInfo toolbar;
- attribute [Replaceable] Navigator navigator;
- attribute [Replaceable] Navigator clientInformation;
- readonly attribute Crypto crypto;
+[
+ CheckSecurity,
+ JSCustomDefineOwnProperty,
+ CustomDeleteProperty,
+ CustomGetOwnPropertySlot,
+ CustomEnumerateProperty,
+ JSCustomMarkFunction,
+ JSCustomToNativeObject,
+ CustomPutFunction,
+ EventTarget,
+ ExtendsDOMGlobalObject,
+ JSGenerateToNativeObject,
+ ReplaceableConstructor,
+ JSLegacyParent=JSDOMWindowBase,
+ V8CustomToJSObject,
+ InterfaceName=Window
+] interface DOMWindow {
+ // DOM Level 0
+ attribute [Replaceable] Screen screen;
+ attribute [Replaceable, DoNotCheckSecurityOnGetter] History history;
+ attribute [Replaceable] BarInfo locationbar;
+ attribute [Replaceable] BarInfo menubar;
+ attribute [Replaceable] BarInfo personalbar;
+ attribute [Replaceable] BarInfo scrollbars;
+ attribute [Replaceable] BarInfo statusbar;
+ attribute [Replaceable] BarInfo toolbar;
+ attribute [Replaceable] Navigator navigator;
+ attribute [Replaceable] Navigator clientInformation;
+ readonly attribute Crypto crypto;
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
- attribute [DoNotCheckSecurity, CustomSetter, V8Unforgeable] Location location;
+ attribute [DoNotCheckSecurity, CustomSetter, V8Unforgeable] Location location;
#endif
- attribute [Replaceable, CustomGetter, V8CustomSetter] Event event;
-
- DOMSelection getSelection();
-
- readonly attribute [CheckSecurityForNode] Element frameElement;
-
- [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void focus();
- [DoNotCheckSecurity] void blur();
- [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void close();
-
- void print();
- void stop();
-
- [Custom] DOMWindow open(in DOMString url,
- in DOMString name,
- in [Optional] DOMString options);
-
- [Custom] DOMObject showModalDialog(in DOMString url,
- in [Optional] DOMObject dialogArgs,
- in [Optional] DOMString featureArgs);
-
- void alert(in [Optional=DefaultIsUndefined] DOMString message);
- boolean confirm(in [Optional=DefaultIsUndefined] DOMString message);
- [TreatReturnedNullStringAs=Null] DOMString prompt(in [Optional=DefaultIsUndefined] DOMString message,
- in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString defaultValue);
-
- boolean find(in [Optional=DefaultIsUndefined] DOMString string,
- in [Optional=DefaultIsUndefined] boolean caseSensitive,
- in [Optional=DefaultIsUndefined] boolean backwards,
- in [Optional=DefaultIsUndefined] boolean wrap,
- in [Optional=DefaultIsUndefined] boolean wholeWord,
- in [Optional=DefaultIsUndefined] boolean searchInFrames,
- in [Optional=DefaultIsUndefined] boolean showDialog);
-
- attribute [Replaceable] boolean offscreenBuffering;
-
- attribute [Replaceable] long outerHeight;
- attribute [Replaceable] long outerWidth;
- attribute [Replaceable] long innerHeight;
- attribute [Replaceable] long innerWidth;
- attribute [Replaceable] long screenX;
- attribute [Replaceable] long screenY;
- attribute [Replaceable] long screenLeft;
- attribute [Replaceable] long screenTop;
- attribute [Replaceable] long scrollX;
- attribute [Replaceable] long scrollY;
- readonly attribute long pageXOffset;
- readonly attribute long pageYOffset;
-
- void scrollBy(in [Optional=DefaultIsUndefined] long x, in [Optional=DefaultIsUndefined] long y);
- void scrollTo(in [Optional=DefaultIsUndefined] long x, in [Optional=DefaultIsUndefined] long y);
- void scroll(in [Optional=DefaultIsUndefined] long x, in [Optional=DefaultIsUndefined] long y);
- void moveBy(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
- void moveTo(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
- void resizeBy(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
- void resizeTo(in [Optional=DefaultIsUndefined] float width, in [Optional=DefaultIsUndefined] float height); // FIXME: this should take longs not floats.
-
- readonly attribute [DoNotCheckSecurity] boolean closed;
-
- attribute [Replaceable, DoNotCheckSecurityOnGetter] unsigned long length;
-
- attribute DOMString name;
-
- attribute DOMString status;
- attribute DOMString defaultStatus;
+ attribute [Replaceable, CustomGetter, V8CustomSetter] Event event;
+
+ DOMSelection getSelection();
+
+ readonly attribute [CheckSecurityForNode] Element frameElement;
+
+ [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void focus();
+ [DoNotCheckSecurity] void blur();
+ [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void close();
+
+ void print();
+ void stop();
+
+ [Custom] DOMWindow open(in DOMString url,
+ in DOMString name,
+ in [Optional] DOMString options);
+
+ [Custom] DOMObject showModalDialog(in DOMString url,
+ in [Optional] DOMObject dialogArgs,
+ in [Optional] DOMString featureArgs);
+
+ void alert(in [Optional=DefaultIsUndefined] DOMString message);
+ boolean confirm(in [Optional=DefaultIsUndefined] DOMString message);
+ [TreatReturnedNullStringAs=Null] DOMString prompt(in [Optional=DefaultIsUndefined] DOMString message,
+ in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString defaultValue);
+
+ boolean find(in [Optional=DefaultIsUndefined] DOMString string,
+ in [Optional=DefaultIsUndefined] boolean caseSensitive,
+ in [Optional=DefaultIsUndefined] boolean backwards,
+ in [Optional=DefaultIsUndefined] boolean wrap,
+ in [Optional=DefaultIsUndefined] boolean wholeWord,
+ in [Optional=DefaultIsUndefined] boolean searchInFrames,
+ in [Optional=DefaultIsUndefined] boolean showDialog);
+
+ attribute [Replaceable] boolean offscreenBuffering;
+
+ attribute [Replaceable] long outerHeight;
+ attribute [Replaceable] long outerWidth;
+ attribute [Replaceable] long innerHeight;
+ attribute [Replaceable] long innerWidth;
+ attribute [Replaceable] long screenX;
+ attribute [Replaceable] long screenY;
+ attribute [Replaceable] long screenLeft;
+ attribute [Replaceable] long screenTop;
+ attribute [Replaceable] long scrollX;
+ attribute [Replaceable] long scrollY;
+ readonly attribute long pageXOffset;
+ readonly attribute long pageYOffset;
+
+ void scrollBy(in [Optional=DefaultIsUndefined] long x, in [Optional=DefaultIsUndefined] long y);
+ void scrollTo(in [Optional=DefaultIsUndefined] long x, in [Optional=DefaultIsUndefined] long y);
+ void scroll(in [Optional=DefaultIsUndefined] long x, in [Optional=DefaultIsUndefined] long y);
+ void moveBy(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
+ void moveTo(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
+ void resizeBy(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
+ void resizeTo(in [Optional=DefaultIsUndefined] float width, in [Optional=DefaultIsUndefined] float height); // FIXME: this should take longs not floats.
+
+ readonly attribute [DoNotCheckSecurity] boolean closed;
+
+ attribute [Replaceable, DoNotCheckSecurityOnGetter] unsigned long length;
+
+ attribute DOMString name;
+
+ attribute DOMString status;
+ attribute DOMString defaultStatus;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- // This attribute is an alias of defaultStatus and is necessary for legacy uses.
- attribute DOMString defaultstatus;
+ // This attribute is an alias of defaultStatus and is necessary for legacy uses.
+ attribute DOMString defaultstatus;
#endif
- // Self referential attributes
- attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow self;
- readonly attribute [DoNotCheckSecurity, V8Unforgeable] DOMWindow window;
- attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow frames;
+ // Self referential attributes
+ attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow self;
+ readonly attribute [DoNotCheckSecurity, V8Unforgeable] DOMWindow window;
+ attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow frames;
- attribute [Replaceable, DoNotCheckSecurityOnGetter, V8CustomSetter] DOMWindow opener;
- attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow parent;
- readonly attribute [DoNotCheckSecurityOnGetter, V8Unforgeable] DOMWindow top;
+ attribute [Replaceable, DoNotCheckSecurityOnGetter, V8CustomSetter] DOMWindow opener;
+ attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow parent;
+ readonly attribute [DoNotCheckSecurityOnGetter, V8Unforgeable] DOMWindow top;
- // DOM Level 2 AbstractView Interface
- readonly attribute Document document;
+ // DOM Level 2 AbstractView Interface
+ readonly attribute Document document;
- // CSSOM View Module
- MediaQueryList matchMedia(in DOMString query);
+ // CSSOM View Module
+ MediaQueryList matchMedia(in DOMString query);
- // styleMedia has been removed from the CSSOM View specification.
- readonly attribute StyleMedia styleMedia;
+ // styleMedia has been removed from the CSSOM View specification.
+ readonly attribute StyleMedia styleMedia;
- // DOM Level 2 Style Interface
- CSSStyleDeclaration getComputedStyle(in [Optional=DefaultIsUndefined] Element element,
- in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString pseudoElement);
+ // DOM Level 2 Style Interface
+ CSSStyleDeclaration getComputedStyle(in [Optional=DefaultIsUndefined] Element element,
+ in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString pseudoElement);
- // WebKit extensions
+ // WebKit extensions
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- CSSRuleList getMatchedCSSRules(in [Optional=DefaultIsUndefined] Element element,
- in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString pseudoElement);
+ CSSRuleList getMatchedCSSRules(in [Optional=DefaultIsUndefined] Element element,
+ in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString pseudoElement);
#endif
- attribute [Replaceable] double devicePixelRatio;
-
- WebKitPoint webkitConvertPointFromPageToNode(in [Optional=DefaultIsUndefined] Node node,
- in [Optional=DefaultIsUndefined] WebKitPoint p);
- WebKitPoint webkitConvertPointFromNodeToPage(in [Optional=DefaultIsUndefined] Node node,
- in [Optional=DefaultIsUndefined] WebKitPoint p);
+ attribute [Replaceable] double devicePixelRatio;
+
+ WebKitPoint webkitConvertPointFromPageToNode(in [Optional=DefaultIsUndefined] Node node,
+ in [Optional=DefaultIsUndefined] WebKitPoint p);
+ WebKitPoint webkitConvertPointFromNodeToPage(in [Optional=DefaultIsUndefined] Node node,
+ in [Optional=DefaultIsUndefined] WebKitPoint p);
- readonly attribute [V8EnabledAtRuntime] DOMApplicationCache applicationCache;
+ readonly attribute [V8EnabledAtRuntime] DOMApplicationCache applicationCache;
- readonly attribute [V8EnabledAtRuntime] Storage sessionStorage
- getter raises(DOMException);
- readonly attribute [V8EnabledAtRuntime] Storage localStorage
- getter raises(DOMException);
+ readonly attribute [V8EnabledAtRuntime] Storage sessionStorage
+ getter raises(DOMException);
+ readonly attribute [V8EnabledAtRuntime] Storage localStorage
+ getter raises(DOMException);
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
- // This is the interface orientation in degrees. Some examples are:
- // 0 is straight up; -90 is when the device is rotated 90 clockwise;
- // 90 is when rotated counter clockwise.
- readonly attribute long orientation;
+ // This is the interface orientation in degrees. Some examples are:
+ // 0 is straight up; -90 is when the device is rotated 90 clockwise;
+ // 90 is when rotated counter clockwise.
+ readonly attribute long orientation;
#endif
- attribute [Replaceable] Console console;
+ attribute [Replaceable] Console console;
- // cross-document messaging
+ // cross-document messaging
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin)
- raises(DOMException);
- [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array messagePorts)
- raises(DOMException);
+ [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin)
+ raises(DOMException);
+ [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array messagePorts)
+ raises(DOMException);
#if defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
- [DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin)
- raises(DOMException);
- [DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array transferList)
- raises(DOMException);
+ [DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin)
+ raises(DOMException);
+ [DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array transferList)
+ raises(DOMException);
#endif // defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
#else
- // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
- [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] MessagePort messagePort, in DOMString targetOrigin)
- raises(DOMException);
+ // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
+ [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] MessagePort messagePort, in DOMString targetOrigin)
+ raises(DOMException);
#endif
#if defined(ENABLE_WEB_TIMING) && ENABLE_WEB_TIMING
- attribute [Replaceable] Performance performance;
+ attribute [Replaceable] Performance performance;
#endif
- // Timers
- [Custom] long setTimeout(in [Optional=DefaultIsUndefined] TimeoutHandler handler,
- in [Optional=DefaultIsUndefined] long timeout);
- // [Custom] long setTimeout(in TimeoutHandler handler, in long timeout, arguments...);
- // [Custom] long setTimeout(in DOMString code, in long timeout);
- void clearTimeout(in [Optional=DefaultIsUndefined] long handle);
- [Custom] long setInterval(in TimeoutHandler handler, in long timeout);
- // [Custom] long setInterval(in TimeoutHandler handler, in long timeout, arguments...);
- // [Custom] long setInterval(in DOMString code, in long timeout);
- void clearInterval(in [Optional=DefaultIsUndefined] long handle);
+ // Timers
+ [Custom] long setTimeout(in [Optional=DefaultIsUndefined] TimeoutHandler handler,
+ in [Optional=DefaultIsUndefined] long timeout);
+ // [Custom] long setTimeout(in TimeoutHandler handler, in long timeout, arguments...);
+ // [Custom] long setTimeout(in DOMString code, in long timeout);
+ void clearTimeout(in [Optional=DefaultIsUndefined] long handle);
+ [Custom] long setInterval(in TimeoutHandler handler, in long timeout);
+ // [Custom] long setInterval(in TimeoutHandler handler, in long timeout, arguments...);
+ // [Custom] long setInterval(in DOMString code, in long timeout);
+ void clearInterval(in [Optional=DefaultIsUndefined] long handle);
#if defined(ENABLE_REQUEST_ANIMATION_FRAME) && ENABLE_REQUEST_ANIMATION_FRAME
- // WebKit animation extensions, being standardized in the WebPerf WG
- long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
- void webkitCancelAnimationFrame(in long id);
- void webkitCancelRequestAnimationFrame(in long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.
+ [V8MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
+ void cancelAnimationFrame(in long id);
+ [ImplementedAs=requestAnimationFrame, V8MeasureAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
+ [ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(in long id);
+ [ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(in long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.
#endif
- // Base64
- DOMString atob(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString string)
- raises(DOMException);
- DOMString btoa(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString string)
- raises(DOMException);
-
- // Events
- attribute EventListener onabort;
- attribute EventListener onbeforeunload;
- attribute EventListener onblur;
- attribute EventListener oncanplay;
- attribute EventListener oncanplaythrough;
- attribute EventListener onchange;
- attribute EventListener onclick;
- attribute EventListener oncontextmenu;
- attribute EventListener ondblclick;
- attribute EventListener ondrag;
- attribute EventListener ondragend;
- attribute EventListener ondragenter;
- attribute EventListener ondragleave;
- attribute EventListener ondragover;
- attribute EventListener ondragstart;
- attribute EventListener ondrop;
- attribute EventListener ondurationchange;
- attribute EventListener onemptied;
- attribute EventListener onended;
- attribute EventListener onerror;
- attribute EventListener onfocus;
- attribute EventListener onhashchange;
- attribute EventListener oninput;
- attribute EventListener oninvalid;
- attribute EventListener onkeydown;
- attribute EventListener onkeypress;
- attribute EventListener onkeyup;
- attribute EventListener onload;
- attribute EventListener onloadeddata;
- attribute EventListener onloadedmetadata;
- attribute EventListener onloadstart;
- attribute EventListener onmessage;
- attribute EventListener onmousedown;
- attribute EventListener onmousemove;
- attribute EventListener onmouseout;
- attribute EventListener onmouseover;
- attribute EventListener onmouseup;
- attribute EventListener onmousewheel;
- attribute EventListener onoffline;
- attribute EventListener ononline;
- attribute EventListener onpagehide;
- attribute EventListener onpageshow;
- attribute EventListener onpause;
- attribute EventListener onplay;
- attribute EventListener onplaying;
- attribute EventListener onpopstate;
- attribute EventListener onprogress;
- attribute EventListener onratechange;
- attribute EventListener onresize;
- attribute EventListener onscroll;
- attribute EventListener onseeked;
- attribute EventListener onseeking;
- attribute EventListener onselect;
- attribute EventListener onstalled;
- attribute EventListener onstorage;
- attribute EventListener onsubmit;
- attribute EventListener onsuspend;
- attribute EventListener ontimeupdate;
- attribute EventListener onunload;
- attribute EventListener onvolumechange;
- attribute EventListener onwaiting;
-
- // Not implemented yet.
- // attribute EventListener onafterprint;
- // attribute EventListener onbeforeprint;
- // attribute EventListener onreadystatechange;
- // attribute EventListener onredo;
- // attribute EventListener onshow;
- // attribute EventListener onundo;
-
- // Webkit extensions
- attribute EventListener onreset;
- attribute EventListener onsearch;
- attribute EventListener onwebkitanimationend;
- attribute EventListener onwebkitanimationiteration;
- attribute EventListener onwebkitanimationstart;
- attribute EventListener onwebkittransitionend;
+ // Base64
+ DOMString atob(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString string)
+ raises(DOMException);
+ DOMString btoa(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString string)
+ raises(DOMException);
+
+ // Events
+ attribute EventListener onabort;
+ attribute EventListener onbeforeunload;
+ attribute EventListener onblur;
+ attribute EventListener oncanplay;
+ attribute EventListener oncanplaythrough;
+ attribute EventListener onchange;
+ attribute EventListener onclick;
+ attribute EventListener oncontextmenu;
+ attribute EventListener ondblclick;
+ attribute EventListener ondrag;
+ attribute EventListener ondragend;
+ attribute EventListener ondragenter;
+ attribute EventListener ondragleave;
+ attribute EventListener ondragover;
+ attribute EventListener ondragstart;
+ attribute EventListener ondrop;
+ attribute EventListener ondurationchange;
+ attribute EventListener onemptied;
+ attribute EventListener onended;
+ attribute EventListener onerror;
+ attribute EventListener onfocus;
+ attribute EventListener onhashchange;
+ attribute EventListener oninput;
+ attribute EventListener oninvalid;
+ attribute EventListener onkeydown;
+ attribute EventListener onkeypress;
+ attribute EventListener onkeyup;
+ attribute EventListener onload;
+ attribute EventListener onloadeddata;
+ attribute EventListener onloadedmetadata;
+ attribute EventListener onloadstart;
+ attribute EventListener onmessage;
+ attribute EventListener onmousedown;
+ attribute EventListener onmousemove;
+ attribute EventListener onmouseout;
+ attribute EventListener onmouseover;
+ attribute EventListener onmouseup;
+ attribute EventListener onmousewheel;
+ attribute EventListener onoffline;
+ attribute EventListener ononline;
+ attribute EventListener onpagehide;
+ attribute EventListener onpageshow;
+ attribute EventListener onpause;
+ attribute EventListener onplay;
+ attribute EventListener onplaying;
+ attribute EventListener onpopstate;
+ attribute EventListener onprogress;
+ attribute EventListener onratechange;
+ attribute EventListener onresize;
+ attribute EventListener onscroll;
+ attribute EventListener onseeked;
+ attribute EventListener onseeking;
+ attribute EventListener onselect;
+ attribute EventListener onstalled;
+ attribute EventListener onstorage;
+ attribute EventListener onsubmit;
+ attribute EventListener onsuspend;
+ attribute EventListener ontimeupdate;
+ attribute EventListener onunload;
+ attribute EventListener onvolumechange;
+ attribute EventListener onwaiting;
+
+ // Not implemented yet.
+ // attribute EventListener onafterprint;
+ // attribute EventListener onbeforeprint;
+ // attribute EventListener onreadystatechange;
+ // attribute EventListener onredo;
+ // attribute EventListener onshow;
+ // attribute EventListener onundo;
+
+ // Webkit extensions
+ attribute EventListener onreset;
+ attribute EventListener onsearch;
+ attribute EventListener onwebkitanimationend;
+ attribute EventListener onwebkitanimationiteration;
+ attribute EventListener onwebkitanimationstart;
+ attribute EventListener onwebkittransitionend;
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
- attribute EventListener onorientationchange;
+ attribute EventListener onorientationchange;
#endif
- attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchstart;
- attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchmove;
- attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchend;
- attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchcancel;
+ attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchstart;
+ attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchmove;
+ attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchend;
+ attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchcancel;
- attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondevicemotion;
- attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondeviceorientation;
+ attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondevicemotion;
+ attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondeviceorientation;
- attribute [Conditional=PROXIMITY_EVENTS] EventListener onwebkitdeviceproximity;
+ attribute [Conditional=PROXIMITY_EVENTS] EventListener onwebkitdeviceproximity;
- // EventTarget interface
- [Custom] void addEventListener(in DOMString type,
+ // EventTarget interface
+ [Custom] void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ [Custom] void removeEventListener(in DOMString type,
in EventListener listener,
in [Optional] boolean useCapture);
- [Custom] void removeEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- boolean dispatchEvent(in Event evt)
- raises(EventException);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
- [V8Custom] void captureEvents(/*in long eventFlags*/);
- [V8Custom] void releaseEvents(/*in long eventFlags*/);
+ [V8Custom] void captureEvents(/*in long eventFlags*/);
+ [V8Custom] void releaseEvents(/*in long eventFlags*/);
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- // Global constructors
- attribute StyleSheetConstructor StyleSheet;
- attribute CSSStyleSheetConstructor CSSStyleSheet;
+ // Global constructors
+ attribute StyleSheetConstructor StyleSheet;
+ attribute CSSStyleSheetConstructor CSSStyleSheet;
- attribute CSSValueConstructor CSSValue;
- attribute CSSPrimitiveValueConstructor CSSPrimitiveValue;
- attribute CSSValueListConstructor CSSValueList;
- attribute WebKitCSSTransformValueConstructor WebKitCSSTransformValue;
+ attribute CSSValueConstructor CSSValue;
+ attribute CSSPrimitiveValueConstructor CSSPrimitiveValue;
+ attribute CSSValueListConstructor CSSValueList;
+ attribute WebKitCSSTransformValueConstructor WebKitCSSTransformValue;
#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
- attribute WebKitCSSFilterValueConstructor WebKitCSSFilterValue;
+ attribute WebKitCSSFilterValueConstructor WebKitCSSFilterValue;
#endif
- attribute CSSRuleConstructor CSSRule;
- attribute CSSCharsetRuleConstructor CSSCharsetRule;
- attribute CSSFontFaceRuleConstructor CSSFontFaceRule;
- attribute CSSImportRuleConstructor CSSImportRule;
- attribute CSSMediaRuleConstructor CSSMediaRule;
- attribute CSSPageRuleConstructor CSSPageRule;
- attribute CSSStyleRuleConstructor CSSStyleRule;
-
- attribute CSSStyleDeclarationConstructor CSSStyleDeclaration;
- attribute MediaListConstructor MediaList;
- attribute CounterConstructor Counter;
- attribute CSSRuleListConstructor CSSRuleList;
- attribute RectConstructor Rect;
- attribute RGBColorConstructor RGBColor;
- attribute StyleSheetListConstructor StyleSheetList;
-
- // FIXME: Implement the commented-out global constructors for interfaces listed in DOM Level 3 Core specification.
- attribute DOMCoreExceptionConstructor DOMException;
- attribute DOMStringListConstructor DOMStringList;
+ attribute CSSRuleConstructor CSSRule;
+ attribute CSSCharsetRuleConstructor CSSCharsetRule;
+ attribute CSSFontFaceRuleConstructor CSSFontFaceRule;
+ attribute CSSImportRuleConstructor CSSImportRule;
+ attribute CSSMediaRuleConstructor CSSMediaRule;
+ attribute CSSPageRuleConstructor CSSPageRule;
+ attribute CSSStyleRuleConstructor CSSStyleRule;
+
+ attribute CSSStyleDeclarationConstructor CSSStyleDeclaration;
+ attribute MediaListConstructor MediaList;
+ attribute CounterConstructor Counter;
+ attribute CSSRuleListConstructor CSSRuleList;
+ attribute RectConstructor Rect;
+ attribute RGBColorConstructor RGBColor;
+ attribute StyleSheetListConstructor StyleSheetList;
+
+ // FIXME: Implement the commented-out global constructors for interfaces listed in DOM Level 3 Core specification.
+ attribute DOMCoreExceptionConstructor DOMException;
+ attribute DOMStringListConstructor DOMStringList;
// attribute NameListConstructor NameList;
// attribute DOMImplementationListConstructor DOMImplementationList;
// attribute DOMImplementationSourceConstructor DOMImplementationSource;
- attribute DOMImplementationConstructor DOMImplementation;
- attribute DOMSettableTokenListConstructor DOMSettableTokenList;
- attribute DOMTokenListConstructor DOMTokenList;
- attribute DocumentFragmentConstructor DocumentFragment;
- attribute DocumentConstructor Document;
- attribute NodeConstructor Node;
- attribute NodeListConstructor NodeList;
- attribute [Conditional=MICRODATA] PropertyNodeListConstructor PropertyNodeList;
- attribute NamedNodeMapConstructor NamedNodeMap;
- attribute CharacterDataConstructor CharacterData;
- attribute AttrConstructor Attr;
- attribute ElementConstructor Element;
- attribute TextConstructor Text;
- attribute CommentConstructor Comment;
+ attribute DOMImplementationConstructor DOMImplementation;
+ attribute DOMSettableTokenListConstructor DOMSettableTokenList;
+ attribute DOMTokenListConstructor DOMTokenList;
+ attribute DocumentFragmentConstructor DocumentFragment;
+ attribute DocumentConstructor Document;
+ attribute NodeConstructor Node;
+ attribute NodeListConstructor NodeList;
+ [Conditional=MICRODATA] attribute PropertyNodeListConstructor PropertyNodeList;
+ attribute NamedNodeMapConstructor NamedNodeMap;
+ attribute CharacterDataConstructor CharacterData;
+ attribute AttrConstructor Attr;
+ attribute ElementConstructor Element;
+ attribute TextConstructor Text;
+ attribute CommentConstructor Comment;
// attribute TypeInfoConstructor TypeInfo;
// attribute UserDataHandlerConstructor UserDataHandler;
// attribute DOMErrorConstructor DOMError;
// attribute DOMErrorHandlerConstructor DOMErrorHandler
// attribute DOMLocatorConstructor DOMLocator;
// attribute DOMConfigurationConstructor DOMConfiguration;
- attribute CDATASectionConstructor CDATASection;
- attribute DocumentTypeConstructor DocumentType;
- attribute NotationConstructor Notation;
- attribute EntityConstructor Entity;
- attribute EntityReferenceConstructor EntityReference;
- attribute ProcessingInstructionConstructor ProcessingInstruction;
- attribute [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] ShadowRootConstructor WebKitShadowRoot;
- attribute [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] HTMLContentElementConstructor HTMLContentElement;
- attribute [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] HTMLShadowElementConstructor HTMLShadowElement;
-
- attribute DOMSelectionConstructor Selection;
- attribute DOMWindowConstructor Window;
-
- attribute HTMLDocumentConstructor HTMLDocument;
- attribute HTMLElementConstructor HTMLElement;
- attribute HTMLAnchorElementConstructor HTMLAnchorElement;
- attribute HTMLAppletElementConstructor HTMLAppletElement;
- attribute HTMLAreaElementConstructor HTMLAreaElement;
- attribute HTMLBRElementConstructor HTMLBRElement;
- attribute HTMLBaseElementConstructor HTMLBaseElement;
- attribute HTMLBaseFontElementConstructor HTMLBaseFontElement;
- attribute HTMLBodyElementConstructor HTMLBodyElement;
- attribute HTMLButtonElementConstructor HTMLButtonElement;
- attribute HTMLCanvasElementConstructor HTMLCanvasElement;
- attribute HTMLDListElementConstructor HTMLDListElement;
- attribute [Conditional=DATALIST_ELEMENT] HTMLDataListElementConstructor HTMLDataListElement;
- attribute [Conditional=DIALOG_ELEMENT, V8EnabledPerContext=dialogElement] HTMLDialogElementConstructor HTMLDialogElement;
- attribute HTMLDirectoryElementConstructor HTMLDirectoryElement;
- attribute HTMLDivElementConstructor HTMLDivElement;
- attribute HTMLEmbedElementConstructor HTMLEmbedElement;
- attribute HTMLFieldSetElementConstructor HTMLFieldSetElement;
- attribute HTMLFontElementConstructor HTMLFontElement;
- attribute HTMLFormElementConstructor HTMLFormElement;
- attribute HTMLFrameElementConstructor HTMLFrameElement;
- attribute HTMLFrameSetElementConstructor HTMLFrameSetElement;
- attribute HTMLHRElementConstructor HTMLHRElement;
- attribute HTMLHeadElementConstructor HTMLHeadElement;
- attribute HTMLHeadingElementConstructor HTMLHeadingElement;
- attribute HTMLHtmlElementConstructor HTMLHtmlElement;
- attribute HTMLIFrameElementConstructor HTMLIFrameElement;
- attribute HTMLImageElementConstructor HTMLImageElement;
- attribute HTMLInputElementConstructor HTMLInputElement;
- attribute HTMLKeygenElementConstructor HTMLKeygenElement;
- attribute HTMLLIElementConstructor HTMLLIElement;
- attribute HTMLLabelElementConstructor HTMLLabelElement;
- attribute HTMLLegendElementConstructor HTMLLegendElement;
- attribute HTMLLinkElementConstructor HTMLLinkElement;
- attribute HTMLMapElementConstructor HTMLMapElement;
- attribute HTMLMarqueeElementConstructor HTMLMarqueeElement;
- attribute HTMLMenuElementConstructor HTMLMenuElement;
- attribute HTMLMetaElementConstructor HTMLMetaElement;
+ attribute CDATASectionConstructor CDATASection;
+ attribute DocumentTypeConstructor DocumentType;
+ attribute NotationConstructor Notation;
+ attribute EntityConstructor Entity;
+ attribute EntityReferenceConstructor EntityReference;
+ attribute ProcessingInstructionConstructor ProcessingInstruction;
+ [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] attribute ShadowRootConstructor WebKitShadowRoot;
+ [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] attribute HTMLContentElementConstructor HTMLContentElement;
+ [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] attribute HTMLShadowElementConstructor HTMLShadowElement;
+
+ attribute DOMSelectionConstructor Selection;
+ attribute DOMWindowConstructor Window;
+
+ attribute HTMLDocumentConstructor HTMLDocument;
+ attribute HTMLElementConstructor HTMLElement;
+ attribute HTMLAnchorElementConstructor HTMLAnchorElement;
+ attribute HTMLAppletElementConstructor HTMLAppletElement;
+ attribute HTMLAreaElementConstructor HTMLAreaElement;
+ attribute HTMLBRElementConstructor HTMLBRElement;
+ attribute HTMLBaseElementConstructor HTMLBaseElement;
+ attribute HTMLBaseFontElementConstructor HTMLBaseFontElement;
+ attribute HTMLBodyElementConstructor HTMLBodyElement;
+ attribute HTMLButtonElementConstructor HTMLButtonElement;
+ attribute HTMLCanvasElementConstructor HTMLCanvasElement;
+ attribute HTMLDListElementConstructor HTMLDListElement;
+ [Conditional=DATALIST_ELEMENT] attribute HTMLDataListElementConstructor HTMLDataListElement;
+ [Conditional=DIALOG_ELEMENT, V8EnabledPerContext=dialogElement] attribute HTMLDialogElementConstructor HTMLDialogElement;
+ attribute HTMLDirectoryElementConstructor HTMLDirectoryElement;
+ attribute HTMLDivElementConstructor HTMLDivElement;
+ attribute HTMLEmbedElementConstructor HTMLEmbedElement;
+ attribute HTMLFieldSetElementConstructor HTMLFieldSetElement;
+ attribute HTMLFontElementConstructor HTMLFontElement;
+ attribute HTMLFormElementConstructor HTMLFormElement;
+ attribute HTMLFrameElementConstructor HTMLFrameElement;
+ attribute HTMLFrameSetElementConstructor HTMLFrameSetElement;
+ attribute HTMLHRElementConstructor HTMLHRElement;
+ attribute HTMLHeadElementConstructor HTMLHeadElement;
+ attribute HTMLHeadingElementConstructor HTMLHeadingElement;
+ attribute HTMLHtmlElementConstructor HTMLHtmlElement;
+ attribute HTMLIFrameElementConstructor HTMLIFrameElement;
+ attribute HTMLImageElementConstructor HTMLImageElement;
+ attribute HTMLInputElementConstructor HTMLInputElement;
+ attribute HTMLKeygenElementConstructor HTMLKeygenElement;
+ attribute HTMLLIElementConstructor HTMLLIElement;
+ attribute HTMLLabelElementConstructor HTMLLabelElement;
+ attribute HTMLLegendElementConstructor HTMLLegendElement;
+ attribute HTMLLinkElementConstructor HTMLLinkElement;
+ attribute HTMLMapElementConstructor HTMLMapElement;
+ attribute HTMLMarqueeElementConstructor HTMLMarqueeElement;
+ attribute HTMLMenuElementConstructor HTMLMenuElement;
+ attribute HTMLMetaElementConstructor HTMLMetaElement;
#if defined(ENABLE_METER_ELEMENT) && ENABLE_METER_ELEMENT
- attribute HTMLMeterElementConstructor HTMLMeterElement;
+ attribute HTMLMeterElementConstructor HTMLMeterElement;
#endif
- attribute HTMLModElementConstructor HTMLModElement;
- attribute HTMLOListElementConstructor HTMLOListElement;
- attribute HTMLObjectElementConstructor HTMLObjectElement;
- attribute HTMLOptGroupElementConstructor HTMLOptGroupElement;
- attribute HTMLOptionElementConstructor HTMLOptionElement;
- attribute HTMLOutputElementConstructor HTMLOutputElement;
- attribute HTMLParagraphElementConstructor HTMLParagraphElement;
- attribute HTMLParamElementConstructor HTMLParamElement;
- attribute HTMLPreElementConstructor HTMLPreElement;
+ attribute HTMLModElementConstructor HTMLModElement;
+ attribute HTMLOListElementConstructor HTMLOListElement;
+ attribute HTMLObjectElementConstructor HTMLObjectElement;
+ attribute HTMLOptGroupElementConstructor HTMLOptGroupElement;
+ attribute HTMLOptionElementConstructor HTMLOptionElement;
+ attribute HTMLOutputElementConstructor HTMLOutputElement;
+ attribute HTMLParagraphElementConstructor HTMLParagraphElement;
+ attribute HTMLParamElementConstructor HTMLParamElement;
+ attribute HTMLPreElementConstructor HTMLPreElement;
#if defined(ENABLE_PROGRESS_ELEMENT) && ENABLE_PROGRESS_ELEMENT
- attribute HTMLProgressElementConstructor HTMLProgressElement;
+ attribute HTMLProgressElementConstructor HTMLProgressElement;
#endif
- attribute HTMLQuoteElementConstructor HTMLQuoteElement;
- attribute HTMLScriptElementConstructor HTMLScriptElement;
- attribute HTMLSelectElementConstructor HTMLSelectElement;
- attribute HTMLSpanElementConstructor HTMLSpanElement;
- attribute HTMLStyleElementConstructor HTMLStyleElement;
- attribute HTMLTableCaptionElementConstructor HTMLTableCaptionElement;
- attribute HTMLTableCellElementConstructor HTMLTableCellElement;
- attribute HTMLTableColElementConstructor HTMLTableColElement;
- attribute HTMLTableElementConstructor HTMLTableElement;
- attribute HTMLTableRowElementConstructor HTMLTableRowElement;
- attribute HTMLTableSectionElementConstructor HTMLTableSectionElement;
- attribute HTMLTextAreaElementConstructor HTMLTextAreaElement;
- attribute HTMLTitleElementConstructor HTMLTitleElement;
- attribute HTMLUListElementConstructor HTMLUListElement;
-
- attribute HTMLCollectionConstructor HTMLCollection;
- attribute HTMLAllCollectionConstructor HTMLAllCollection;
- attribute [Conditional=MICRODATA] HTMLPropertiesCollectionConstructor HTMLPropertiesCollection;
- attribute HTMLUnknownElementConstructor HTMLUnknownElement;
-
- attribute [JSCustomGetter, CustomConstructor] HTMLImageElementConstructorConstructor Image; // Usable with new operator
- attribute [JSCustomGetter] HTMLOptionElementConstructorConstructor Option; // Usable with new operator
-
- attribute [Conditional=ENCRYPTED_MEDIA, V8EnabledAtRuntime=encryptedMedia] MediaKeyErrorConstructor MediaKeyError;
- attribute [Conditional=ENCRYPTED_MEDIA, V8EnabledAtRuntime=encryptedMedia] MediaKeyEventConstructor MediaKeyEvent;
-
- attribute [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] HTMLTrackElementConstructor HTMLTrackElement;
- attribute [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] TextTrackConstructor TextTrack;
- attribute [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] TextTrackCueConstructor TextTrackCue; // Usable with the new operator
- attribute [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] TextTrackCueListConstructor TextTrackCueList;
- attribute [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] TextTrackListConstructor TextTrackList;
- attribute [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] TrackEventConstructor TrackEvent;
-
- attribute [JSCustomGetter, Conditional=VIDEO, V8EnabledAtRuntime] HTMLAudioElementConstructorConstructor Audio; // Usable with the new operator
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] HTMLAudioElementConstructor HTMLAudioElement;
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] HTMLMediaElementConstructor HTMLMediaElement;
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] HTMLVideoElementConstructor HTMLVideoElement;
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] MediaErrorConstructor MediaError;
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] TimeRangesConstructor TimeRanges;
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] HTMLSourceElementConstructor HTMLSourceElement;
- attribute [Conditional=VIDEO, V8EnabledAtRuntime] MediaControllerConstructor MediaController;
-
- attribute [Conditional=WEB_INTENTS_TAG] HTMLIntentElementConstructor HTMLIntentElement;
-
- attribute CanvasPatternConstructor CanvasPattern;
- attribute CanvasGradientConstructor CanvasGradient;
- attribute CanvasRenderingContext2DConstructor CanvasRenderingContext2D;
-
- attribute ImageDataConstructor ImageData;
- attribute TextMetricsConstructor TextMetrics;
-
- attribute [Conditional=WEBGL] WebGLActiveInfoConstructor WebGLActiveInfo;
- attribute [Conditional=WEBGL] WebGLBufferConstructor WebGLBuffer;
- attribute [Conditional=WEBGL] WebGLFramebufferConstructor WebGLFramebuffer;
- attribute [Conditional=WEBGL] WebGLProgramConstructor WebGLProgram;
- attribute [Conditional=WEBGL] WebGLRenderbufferConstructor WebGLRenderbuffer;
- attribute [Conditional=WEBGL] WebGLRenderingContextConstructor WebGLRenderingContext;
- attribute [Conditional=WEBGL] WebGLShaderConstructor WebGLShader;
- attribute [Conditional=WEBGL] WebGLShaderPrecisionFormatConstructor WebGLShaderPrecisionFormat;
- attribute [Conditional=WEBGL] WebGLTextureConstructor WebGLTexture;
- attribute [Conditional=WEBGL] WebGLUniformLocationConstructor WebGLUniformLocation;
-
- attribute DOMStringMapConstructor DOMStringMap;
-
- attribute ArrayBufferConstructor ArrayBuffer; // Usable with new operator
- attribute Int8ArrayConstructor Int8Array; // Usable with new operator
- attribute Uint8ArrayConstructor Uint8Array; // Usable with new operator
- attribute Uint8ClampedArrayConstructor Uint8ClampedArray; // Usable with new operator
- attribute Int16ArrayConstructor Int16Array; // Usable with new operator
- attribute Uint16ArrayConstructor Uint16Array; // Usable with new operator
- attribute Int32ArrayConstructor Int32Array; // Usable with new operator
- attribute Uint32ArrayConstructor Uint32Array; // Usable with new operator
- attribute Float32ArrayConstructor Float32Array; // Usable with new operator
- attribute Float64ArrayConstructor Float64Array; // Usable with new operator
- attribute DataViewConstructor DataView; // Usable with new operator
-
- // Event Constructors
- attribute EventConstructor Event;
- attribute BeforeLoadEventConstructor BeforeLoadEvent;
- attribute CompositionEventConstructor CompositionEvent;
- attribute CustomEventConstructor CustomEvent;
- attribute ErrorEventConstructor ErrorEvent;
- attribute HashChangeEventConstructor HashChangeEvent;
- attribute KeyboardEventConstructor KeyboardEvent;
- attribute MessageEventConstructor MessageEvent;
- attribute MouseEventConstructor MouseEvent;
- attribute MutationEventConstructor MutationEvent;
- attribute OverflowEventConstructor OverflowEvent;
- attribute PopStateEventConstructor PopStateEvent;
- attribute PageTransitionEventConstructor PageTransitionEvent;
- attribute ProgressEventConstructor ProgressEvent;
- attribute TextEventConstructor TextEvent;
- attribute UIEventConstructor UIEvent;
- attribute WebKitAnimationEventConstructor WebKitAnimationEvent;
- attribute WebKitTransitionEventConstructor WebKitTransitionEvent;
- attribute WheelEventConstructor WheelEvent;
- attribute XMLHttpRequestProgressEventConstructor XMLHttpRequestProgressEvent;
- attribute [Conditional=DEVICE_ORIENTATION, V8EnabledAtRuntime] DeviceMotionEventConstructor DeviceMotionEvent;
- attribute [Conditional=DEVICE_ORIENTATION, V8EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
- attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent;
- attribute StorageEventConstructor StorageEvent;
- attribute [Conditional=INPUT_SPEECH] SpeechInputEventConstructor SpeechInputEvent;
- attribute [Conditional=WEBGL] WebGLContextEventConstructor WebGLContextEvent;
- attribute [Conditional=PROXIMITY_EVENTS] DeviceProximityEventConstructor DeviceProximityEvent;
-
- attribute EventExceptionConstructor EventException;
-
- attribute WebKitCSSKeyframeRuleConstructor WebKitCSSKeyframeRule;
- attribute WebKitCSSKeyframesRuleConstructor WebKitCSSKeyframesRule;
- attribute [Conditional=CSS_REGIONS] WebKitCSSRegionRuleConstructor WebKitCSSRegionRule;
-
- attribute WebKitCSSMatrixConstructor WebKitCSSMatrix; // Usable with the new operator
-
- attribute WebKitPointConstructor WebKitPoint; // Usable with new the operator
-
- attribute ClipboardConstructor Clipboard;
-
- attribute [Conditional=WORKERS] WorkerConstructor Worker; // Usable with the new operator
- attribute [Conditional=SHARED_WORKERS, JSCustomGetter, V8EnabledAtRuntime] SharedWorkerConstructor SharedWorker; // Usable with the new operator
-
- attribute FileConstructor File;
- attribute FileListConstructor FileList;
- attribute BlobConstructor Blob;
-
- attribute NodeFilterConstructor NodeFilter;
- attribute RangeConstructor Range;
- attribute RangeExceptionConstructor RangeException;
-
- attribute EventSourceConstructor EventSource; // Usable with new the operator
-
- // Mozilla has a separate XMLDocument object for XML documents.
- // We just use Document for this.
- attribute DocumentConstructor XMLDocument;
- attribute DOMParserConstructor DOMParser;
- attribute XMLSerializerConstructor XMLSerializer;
- attribute XMLHttpRequestConstructor XMLHttpRequest; // Usable with the new operator
- attribute XMLHttpRequestUploadConstructor XMLHttpRequestUpload;
- attribute XMLHttpRequestExceptionConstructor XMLHttpRequestException;
- attribute [Conditional=XSLT] XSLTProcessorConstructor XSLTProcessor; // Usable with the new operator
+ attribute HTMLQuoteElementConstructor HTMLQuoteElement;
+ attribute HTMLScriptElementConstructor HTMLScriptElement;
+ attribute HTMLSelectElementConstructor HTMLSelectElement;
+ attribute HTMLSpanElementConstructor HTMLSpanElement;
+ attribute HTMLStyleElementConstructor HTMLStyleElement;
+ attribute HTMLTableCaptionElementConstructor HTMLTableCaptionElement;
+ attribute HTMLTableCellElementConstructor HTMLTableCellElement;
+ attribute HTMLTableColElementConstructor HTMLTableColElement;
+ attribute HTMLTableElementConstructor HTMLTableElement;
+ attribute HTMLTableRowElementConstructor HTMLTableRowElement;
+ attribute HTMLTableSectionElementConstructor HTMLTableSectionElement;
+ attribute HTMLTextAreaElementConstructor HTMLTextAreaElement;
+ attribute HTMLTitleElementConstructor HTMLTitleElement;
+ attribute HTMLUListElementConstructor HTMLUListElement;
+
+ attribute HTMLCollectionConstructor HTMLCollection;
+ attribute HTMLAllCollectionConstructor HTMLAllCollection;
+ [Conditional=MICRODATA] attribute HTMLPropertiesCollectionConstructor HTMLPropertiesCollection;
+ attribute HTMLUnknownElementConstructor HTMLUnknownElement;
+
+ [JSCustomGetter, CustomConstructor] attribute HTMLImageElementConstructorConstructor Image; // Usable with new operator
+ [JSCustomGetter] attribute HTMLOptionElementConstructorConstructor Option; // Usable with new operator
+
+ [Conditional=ENCRYPTED_MEDIA, V8EnabledAtRuntime=encryptedMedia] attribute MediaKeyErrorConstructor MediaKeyError;
+ [Conditional=ENCRYPTED_MEDIA, V8EnabledAtRuntime=encryptedMedia] attribute MediaKeyEventConstructor MediaKeyEvent;
+
+ [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] attribute HTMLTrackElementConstructor HTMLTrackElement;
+ [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] attribute TextTrackConstructor TextTrack;
+ [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] attribute TextTrackCueConstructor TextTrackCue; // Usable with the new operator
+ [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] attribute TextTrackCueListConstructor TextTrackCueList;
+ [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] attribute TextTrackListConstructor TextTrackList;
+ [Conditional=VIDEO_TRACK, V8EnabledAtRuntime=webkitVideoTrack] attribute TrackEventConstructor TrackEvent;
+
+ [JSCustomGetter, Conditional=VIDEO, V8EnabledAtRuntime] attribute HTMLAudioElementConstructorConstructor Audio; // Usable with the new operator
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute HTMLAudioElementConstructor HTMLAudioElement;
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute HTMLMediaElementConstructor HTMLMediaElement;
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute HTMLVideoElementConstructor HTMLVideoElement;
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute MediaErrorConstructor MediaError;
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute TimeRangesConstructor TimeRanges;
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute HTMLSourceElementConstructor HTMLSourceElement;
+ [Conditional=VIDEO, V8EnabledAtRuntime] attribute MediaControllerConstructor MediaController;
+
+ [Conditional=WEB_INTENTS_TAG] attribute HTMLIntentElementConstructor HTMLIntentElement;
+
+ attribute CanvasPatternConstructor CanvasPattern;
+ attribute CanvasGradientConstructor CanvasGradient;
+ attribute CanvasRenderingContext2DConstructor CanvasRenderingContext2D;
+
+ attribute ImageDataConstructor ImageData;
+ attribute TextMetricsConstructor TextMetrics;
+
+ [Conditional=WEBGL] attribute WebGLActiveInfoConstructor WebGLActiveInfo;
+ [Conditional=WEBGL] attribute WebGLBufferConstructor WebGLBuffer;
+ [Conditional=WEBGL] attribute WebGLFramebufferConstructor WebGLFramebuffer;
+ [Conditional=WEBGL] attribute WebGLProgramConstructor WebGLProgram;
+ [Conditional=WEBGL] attribute WebGLRenderbufferConstructor WebGLRenderbuffer;
+ [Conditional=WEBGL] attribute WebGLRenderingContextConstructor WebGLRenderingContext;
+ [Conditional=WEBGL] attribute WebGLShaderConstructor WebGLShader;
+ [Conditional=WEBGL] attribute WebGLShaderPrecisionFormatConstructor WebGLShaderPrecisionFormat;
+ [Conditional=WEBGL] attribute WebGLTextureConstructor WebGLTexture;
+ [Conditional=WEBGL] attribute WebGLUniformLocationConstructor WebGLUniformLocation;
+
+ attribute DOMStringMapConstructor DOMStringMap;
+
+ attribute ArrayBufferConstructor ArrayBuffer; // Usable with new operator
+ attribute Int8ArrayConstructor Int8Array; // Usable with new operator
+ attribute Uint8ArrayConstructor Uint8Array; // Usable with new operator
+ attribute Uint8ClampedArrayConstructor Uint8ClampedArray; // Usable with new operator
+ attribute Int16ArrayConstructor Int16Array; // Usable with new operator
+ attribute Uint16ArrayConstructor Uint16Array; // Usable with new operator
+ attribute Int32ArrayConstructor Int32Array; // Usable with new operator
+ attribute Uint32ArrayConstructor Uint32Array; // Usable with new operator
+ attribute Float32ArrayConstructor Float32Array; // Usable with new operator
+ attribute Float64ArrayConstructor Float64Array; // Usable with new operator
+ attribute DataViewConstructor DataView; // Usable with new operator
+
+ // Event Constructors
+ attribute EventConstructor Event;
+ attribute BeforeLoadEventConstructor BeforeLoadEvent;
+ attribute CompositionEventConstructor CompositionEvent;
+ attribute CustomEventConstructor CustomEvent;
+ attribute ErrorEventConstructor ErrorEvent;
+ attribute HashChangeEventConstructor HashChangeEvent;
+ attribute KeyboardEventConstructor KeyboardEvent;
+ attribute MessageEventConstructor MessageEvent;
+ attribute MouseEventConstructor MouseEvent;
+ attribute MutationEventConstructor MutationEvent;
+ attribute OverflowEventConstructor OverflowEvent;
+ attribute PopStateEventConstructor PopStateEvent;
+ attribute PageTransitionEventConstructor PageTransitionEvent;
+ attribute ProgressEventConstructor ProgressEvent;
+ attribute TextEventConstructor TextEvent;
+ attribute UIEventConstructor UIEvent;
+ attribute WebKitAnimationEventConstructor WebKitAnimationEvent;
+ attribute WebKitTransitionEventConstructor WebKitTransitionEvent;
+ attribute WheelEventConstructor WheelEvent;
+ attribute XMLHttpRequestProgressEventConstructor XMLHttpRequestProgressEvent;
+ [Conditional=DEVICE_ORIENTATION, V8EnabledAtRuntime] attribute DeviceMotionEventConstructor DeviceMotionEvent;
+ [Conditional=DEVICE_ORIENTATION, V8EnabledAtRuntime] attribute DeviceOrientationEventConstructor DeviceOrientationEvent;
+ [Conditional=TOUCH_EVENTS] attribute TouchEventConstructor TouchEvent;
+ attribute StorageEventConstructor StorageEvent;
+ [Conditional=INPUT_SPEECH] attribute SpeechInputEventConstructor SpeechInputEvent;
+ [Conditional=WEBGL] attribute WebGLContextEventConstructor WebGLContextEvent;
+ [Conditional=PROXIMITY_EVENTS] attribute DeviceProximityEventConstructor DeviceProximityEvent;
+
+ attribute EventExceptionConstructor EventException;
+
+ attribute WebKitCSSKeyframeRuleConstructor WebKitCSSKeyframeRule;
+ attribute WebKitCSSKeyframesRuleConstructor WebKitCSSKeyframesRule;
+ [Conditional=CSS_REGIONS] attribute WebKitCSSRegionRuleConstructor WebKitCSSRegionRule;
+
+ attribute WebKitCSSMatrixConstructor WebKitCSSMatrix; // Usable with the new operator
+
+ attribute WebKitPointConstructor WebKitPoint; // Usable with new the operator
+
+ attribute ClipboardConstructor Clipboard;
+
+ [Conditional=WORKERS] attribute WorkerConstructor Worker; // Usable with the new operator
+ [Conditional=SHARED_WORKERS, JSCustomGetter, V8EnabledAtRuntime] attribute SharedWorkerConstructor SharedWorker; // Usable with the new operator
+
+ attribute FileConstructor File;
+ attribute FileListConstructor FileList;
+ attribute BlobConstructor Blob;
+
+ attribute NodeFilterConstructor NodeFilter;
+ attribute RangeConstructor Range;
+ attribute RangeExceptionConstructor RangeException;
+
+ attribute EventSourceConstructor EventSource; // Usable with new the operator
+
+ // Mozilla has a separate XMLDocument object for XML documents.
+ // We just use Document for this.
+ attribute DocumentConstructor XMLDocument;
+ attribute DOMParserConstructor DOMParser;
+ attribute XMLSerializerConstructor XMLSerializer;
+ attribute XMLHttpRequestConstructor XMLHttpRequest; // Usable with the new operator
+ attribute XMLHttpRequestUploadConstructor XMLHttpRequestUpload;
+ attribute XMLHttpRequestExceptionConstructor XMLHttpRequestException;
+ [Conditional=XSLT] attribute XSLTProcessorConstructor XSLTProcessor; // Usable with the new operator
#if defined(ENABLE_CHANNEL_MESSAGING) && ENABLE_CHANNEL_MESSAGING
- attribute MessagePortConstructor MessagePort;
- attribute MessageChannelConstructor MessageChannel; // Usable with the new operator
+ attribute MessagePortConstructor MessagePort;
+ attribute MessageChannelConstructor MessageChannel; // Usable with the new operator
#endif
- attribute DOMPluginConstructor Plugin;
- attribute DOMPluginArrayConstructor PluginArray;
+ attribute DOMPluginConstructor Plugin;
+ attribute DOMPluginArrayConstructor PluginArray;
- attribute DOMMimeTypeConstructor MimeType;
- attribute DOMMimeTypeArrayConstructor MimeTypeArray;
+ attribute DOMMimeTypeConstructor MimeType;
+ attribute DOMMimeTypeArrayConstructor MimeTypeArray;
- attribute ClientRectConstructor ClientRect;
- attribute ClientRectListConstructor ClientRectList;
+ attribute ClientRectConstructor ClientRect;
+ attribute ClientRectListConstructor ClientRectList;
- attribute StorageConstructor Storage;
+ attribute StorageConstructor Storage;
#if defined(ENABLE_ANIMATION_API) && ENABLE_ANIMATION_API
- attribute WebKitAnimationConstructor WebKitAnimation;
- attribute WebKitAnimationListConstructor WebKitAnimationList;
+ attribute WebKitAnimationConstructor WebKitAnimation;
+ attribute WebKitAnimationListConstructor WebKitAnimationList;
#endif
- attribute XPathEvaluatorConstructor XPathEvaluator;
- attribute XPathResultConstructor XPathResult;
- attribute XPathExceptionConstructor XPathException;
+ attribute XPathEvaluatorConstructor XPathEvaluator;
+ attribute XPathResultConstructor XPathResult;
+ attribute XPathExceptionConstructor XPathException;
- attribute [Conditional=SVG] SVGZoomEventConstructor SVGZoomEvent;
+ [Conditional=SVG] attribute SVGZoomEventConstructor SVGZoomEvent;
#if defined(ENABLE_SVG) && ENABLE_SVG
- // Expose all implemented SVG 1.1 interfaces, excluding the SVG MI interfaces:
- // SVGAnimatedPathData, SVGAnimatedPoints, SVGExternalResourcesRequired,
- // SVGFilterPrimitiveStandardAttributes, SVGFitToViewBox, SVGLangSpace, SVGLocatable
- // SVGStylable, SVGTests, SVGTransformable, SVGURIReference, SVGZoomAndPan
- attribute SVGAElementConstructor SVGAElement;
- attribute SVGAngleConstructor SVGAngle;
- attribute SVGAnimatedAngleConstructor SVGAnimatedAngle;
- attribute SVGAnimatedBooleanConstructor SVGAnimatedBoolean;
- attribute SVGAnimatedEnumerationConstructor SVGAnimatedEnumeration;
- attribute SVGAnimatedIntegerConstructor SVGAnimatedInteger;
- attribute SVGAnimatedLengthConstructor SVGAnimatedLength;
- attribute SVGAnimatedLengthListConstructor SVGAnimatedLengthList;
- attribute SVGAnimatedNumberConstructor SVGAnimatedNumber;
- attribute SVGAnimatedNumberListConstructor SVGAnimatedNumberList;
- attribute SVGAnimatedPreserveAspectRatioConstructor SVGAnimatedPreserveAspectRatio;
- attribute SVGAnimatedRectConstructor SVGAnimatedRect;
- attribute SVGAnimatedStringConstructor SVGAnimatedString;
- attribute SVGAnimatedTransformListConstructor SVGAnimatedTransformList;
- attribute SVGCircleElementConstructor SVGCircleElement;
- attribute SVGClipPathElementConstructor SVGClipPathElement;
- attribute SVGColorConstructor SVGColor;
- attribute SVGCursorElementConstructor SVGCursorElement;
+ // Expose all implemented SVG 1.1 interfaces, excluding the SVG MI interfaces:
+ // SVGAnimatedPathData, SVGAnimatedPoints, SVGExternalResourcesRequired,
+ // SVGFilterPrimitiveStandardAttributes, SVGFitToViewBox, SVGLangSpace, SVGLocatable
+ // SVGStylable, SVGTests, SVGTransformable, SVGURIReference, SVGZoomAndPan
+ attribute SVGAElementConstructor SVGAElement;
+ attribute SVGAngleConstructor SVGAngle;
+ attribute SVGAnimatedAngleConstructor SVGAnimatedAngle;
+ attribute SVGAnimatedBooleanConstructor SVGAnimatedBoolean;
+ attribute SVGAnimatedEnumerationConstructor SVGAnimatedEnumeration;
+ attribute SVGAnimatedIntegerConstructor SVGAnimatedInteger;
+ attribute SVGAnimatedLengthConstructor SVGAnimatedLength;
+ attribute SVGAnimatedLengthListConstructor SVGAnimatedLengthList;
+ attribute SVGAnimatedNumberConstructor SVGAnimatedNumber;
+ attribute SVGAnimatedNumberListConstructor SVGAnimatedNumberList;
+ attribute SVGAnimatedPreserveAspectRatioConstructor SVGAnimatedPreserveAspectRatio;
+ attribute SVGAnimatedRectConstructor SVGAnimatedRect;
+ attribute SVGAnimatedStringConstructor SVGAnimatedString;
+ attribute SVGAnimatedTransformListConstructor SVGAnimatedTransformList;
+ attribute SVGCircleElementConstructor SVGCircleElement;
+ attribute SVGClipPathElementConstructor SVGClipPathElement;
+ attribute SVGColorConstructor SVGColor;
+ attribute SVGCursorElementConstructor SVGCursorElement;
// attribute SVGCSSRuleConstructor SVGCSSRule;
- attribute SVGDefsElementConstructor SVGDefsElement;
- attribute SVGDescElementConstructor SVGDescElement;
- attribute SVGDocumentConstructor SVGDocument;
- attribute SVGElementConstructor SVGElement;
- attribute SVGElementInstanceConstructor SVGElementInstance;
- attribute SVGElementInstanceListConstructor SVGElementInstanceList;
- attribute SVGEllipseElementConstructor SVGEllipseElement;
- attribute SVGForeignObjectElementConstructor SVGForeignObjectElement;
- attribute SVGExceptionConstructor SVGException;
- attribute SVGGElementConstructor SVGGElement;
- attribute SVGGradientElementConstructor SVGGradientElement;
- attribute SVGImageElementConstructor SVGImageElement;
- attribute SVGLengthConstructor SVGLength;
- attribute SVGLengthListConstructor SVGLengthList;
- attribute SVGLinearGradientElementConstructor SVGLinearGradientElement;
- attribute SVGLineElementConstructor SVGLineElement;
- attribute SVGMarkerElementConstructor SVGMarkerElement;
- attribute SVGMaskElementConstructor SVGMaskElement;
- attribute SVGMatrixConstructor SVGMatrix;
- attribute SVGMetadataElementConstructor SVGMetadataElement;
- attribute SVGNumberConstructor SVGNumber;
- attribute SVGNumberListConstructor SVGNumberList;
- attribute SVGPaintConstructor SVGPaint;
- attribute SVGPathElementConstructor SVGPathElement;
- attribute SVGPathSegConstructor SVGPathSeg;
- attribute SVGPathSegArcAbsConstructor SVGPathSegArcAbs;
- attribute SVGPathSegArcRelConstructor SVGPathSegArcRel;
- attribute SVGPathSegClosePathConstructor SVGPathSegClosePath;
- attribute SVGPathSegCurvetoCubicAbsConstructor SVGPathSegCurvetoCubicAbs;
- attribute SVGPathSegCurvetoCubicRelConstructor SVGPathSegCurvetoCubicRel;
- attribute SVGPathSegCurvetoCubicSmoothAbsConstructor SVGPathSegCurvetoCubicSmoothAbs;
- attribute SVGPathSegCurvetoCubicSmoothRelConstructor SVGPathSegCurvetoCubicSmoothRel;
- attribute SVGPathSegCurvetoQuadraticAbsConstructor SVGPathSegCurvetoQuadraticAbs;
- attribute SVGPathSegCurvetoQuadraticRelConstructor SVGPathSegCurvetoQuadraticRel;
- attribute SVGPathSegCurvetoQuadraticSmoothAbsConstructor SVGPathSegCurvetoQuadraticSmoothAbs;
- attribute SVGPathSegCurvetoQuadraticSmoothRelConstructor SVGPathSegCurvetoQuadraticSmoothRel;
- attribute SVGPathSegLinetoAbsConstructor SVGPathSegLinetoAbs;
- attribute SVGPathSegLinetoHorizontalAbsConstructor SVGPathSegLinetoHorizontalAbs;
- attribute SVGPathSegLinetoHorizontalRelConstructor SVGPathSegLinetoHorizontalRel;
- attribute SVGPathSegLinetoRelConstructor SVGPathSegLinetoRel;
- attribute SVGPathSegLinetoVerticalAbsConstructor SVGPathSegLinetoVerticalAbs;
- attribute SVGPathSegLinetoVerticalRelConstructor SVGPathSegLinetoVerticalRel;
- attribute SVGPathSegListConstructor SVGPathSegList;
- attribute SVGPathSegMovetoAbsConstructor SVGPathSegMovetoAbs;
- attribute SVGPathSegMovetoRelConstructor SVGPathSegMovetoRel;
- attribute SVGPatternElementConstructor SVGPatternElement;
- attribute SVGPointConstructor SVGPoint;
- attribute SVGPointListConstructor SVGPointList;
- attribute SVGPolygonElementConstructor SVGPolygonElement;
- attribute SVGPolylineElementConstructor SVGPolylineElement;
- attribute SVGPreserveAspectRatioConstructor SVGPreserveAspectRatio;
- attribute SVGRadialGradientElementConstructor SVGRadialGradientElement;
- attribute SVGRectConstructor SVGRect;
- attribute SVGRectElementConstructor SVGRectElement;
- attribute SVGRenderingIntentConstructor SVGRenderingIntent;
- attribute SVGScriptElementConstructor SVGScriptElement;
- attribute SVGStopElementConstructor SVGStopElement;
- attribute SVGStringListConstructor SVGStringList;
- attribute SVGStyleElementConstructor SVGStyleElement;
- attribute SVGSVGElementConstructor SVGSVGElement;
- attribute SVGSwitchElementConstructor SVGSwitchElement;
- attribute SVGSymbolElementConstructor SVGSymbolElement;
- attribute SVGTextContentElementConstructor SVGTextContentElement;
- attribute SVGTextElementConstructor SVGTextElement;
- attribute SVGTextPathElementConstructor SVGTextPathElement;
- attribute SVGTextPositioningElementConstructor SVGTextPositioningElement;
- attribute SVGTitleElementConstructor SVGTitleElement;
- attribute SVGTransformConstructor SVGTransform;
- attribute SVGTransformListConstructor SVGTransformList;
- attribute SVGTRefElementConstructor SVGTRefElement;
- attribute SVGTSpanElementConstructor SVGTSpanElement;
- attribute SVGUnitTypesConstructor SVGUnitTypes;
- attribute SVGUseElementConstructor SVGUseElement;
- attribute SVGViewElementConstructor SVGViewElement;
- attribute SVGViewSpecConstructor SVGViewSpec;
- attribute SVGZoomAndPanConstructor SVGZoomAndPan;
-
- attribute SVGAnimateColorElementConstructor SVGAnimateColorElement;
- attribute SVGAnimateElementConstructor SVGAnimateElement;
- attribute SVGAnimateMotionElementConstructor SVGAnimateMotionElement;
- attribute SVGAnimateTransformElementConstructor SVGAnimateTransformElement;
- attribute SVGMPathElementConstructor SVGMPathElement;
- attribute SVGSetElementConstructor SVGSetElement;
+ attribute SVGDefsElementConstructor SVGDefsElement;
+ attribute SVGDescElementConstructor SVGDescElement;
+ attribute SVGDocumentConstructor SVGDocument;
+ attribute SVGElementConstructor SVGElement;
+ attribute SVGElementInstanceConstructor SVGElementInstance;
+ attribute SVGElementInstanceListConstructor SVGElementInstanceList;
+ attribute SVGEllipseElementConstructor SVGEllipseElement;
+ attribute SVGForeignObjectElementConstructor SVGForeignObjectElement;
+ attribute SVGExceptionConstructor SVGException;
+ attribute SVGGElementConstructor SVGGElement;
+ attribute SVGGradientElementConstructor SVGGradientElement;
+ attribute SVGImageElementConstructor SVGImageElement;
+ attribute SVGLengthConstructor SVGLength;
+ attribute SVGLengthListConstructor SVGLengthList;
+ attribute SVGLinearGradientElementConstructor SVGLinearGradientElement;
+ attribute SVGLineElementConstructor SVGLineElement;
+ attribute SVGMarkerElementConstructor SVGMarkerElement;
+ attribute SVGMaskElementConstructor SVGMaskElement;
+ attribute SVGMatrixConstructor SVGMatrix;
+ attribute SVGMetadataElementConstructor SVGMetadataElement;
+ attribute SVGNumberConstructor SVGNumber;
+ attribute SVGNumberListConstructor SVGNumberList;
+ attribute SVGPaintConstructor SVGPaint;
+ attribute SVGPathElementConstructor SVGPathElement;
+ attribute SVGPathSegConstructor SVGPathSeg;
+ attribute SVGPathSegArcAbsConstructor SVGPathSegArcAbs;
+ attribute SVGPathSegArcRelConstructor SVGPathSegArcRel;
+ attribute SVGPathSegClosePathConstructor SVGPathSegClosePath;
+ attribute SVGPathSegCurvetoCubicAbsConstructor SVGPathSegCurvetoCubicAbs;
+ attribute SVGPathSegCurvetoCubicRelConstructor SVGPathSegCurvetoCubicRel;
+ attribute SVGPathSegCurvetoCubicSmoothAbsConstructor SVGPathSegCurvetoCubicSmoothAbs;
+ attribute SVGPathSegCurvetoCubicSmoothRelConstructor SVGPathSegCurvetoCubicSmoothRel;
+ attribute SVGPathSegCurvetoQuadraticAbsConstructor SVGPathSegCurvetoQuadraticAbs;
+ attribute SVGPathSegCurvetoQuadraticRelConstructor SVGPathSegCurvetoQuadraticRel;
+ attribute SVGPathSegCurvetoQuadraticSmoothAbsConstructor SVGPathSegCurvetoQuadraticSmoothAbs;
+ attribute SVGPathSegCurvetoQuadraticSmoothRelConstructor SVGPathSegCurvetoQuadraticSmoothRel;
+ attribute SVGPathSegLinetoAbsConstructor SVGPathSegLinetoAbs;
+ attribute SVGPathSegLinetoHorizontalAbsConstructor SVGPathSegLinetoHorizontalAbs;
+ attribute SVGPathSegLinetoHorizontalRelConstructor SVGPathSegLinetoHorizontalRel;
+ attribute SVGPathSegLinetoRelConstructor SVGPathSegLinetoRel;
+ attribute SVGPathSegLinetoVerticalAbsConstructor SVGPathSegLinetoVerticalAbs;
+ attribute SVGPathSegLinetoVerticalRelConstructor SVGPathSegLinetoVerticalRel;
+ attribute SVGPathSegListConstructor SVGPathSegList;
+ attribute SVGPathSegMovetoAbsConstructor SVGPathSegMovetoAbs;
+ attribute SVGPathSegMovetoRelConstructor SVGPathSegMovetoRel;
+ attribute SVGPatternElementConstructor SVGPatternElement;
+ attribute SVGPointConstructor SVGPoint;
+ attribute SVGPointListConstructor SVGPointList;
+ attribute SVGPolygonElementConstructor SVGPolygonElement;
+ attribute SVGPolylineElementConstructor SVGPolylineElement;
+ attribute SVGPreserveAspectRatioConstructor SVGPreserveAspectRatio;
+ attribute SVGRadialGradientElementConstructor SVGRadialGradientElement;
+ attribute SVGRectConstructor SVGRect;
+ attribute SVGRectElementConstructor SVGRectElement;
+ attribute SVGRenderingIntentConstructor SVGRenderingIntent;
+ attribute SVGScriptElementConstructor SVGScriptElement;
+ attribute SVGStopElementConstructor SVGStopElement;
+ attribute SVGStringListConstructor SVGStringList;
+ attribute SVGStyleElementConstructor SVGStyleElement;
+ attribute SVGSVGElementConstructor SVGSVGElement;
+ attribute SVGSwitchElementConstructor SVGSwitchElement;
+ attribute SVGSymbolElementConstructor SVGSymbolElement;
+ attribute SVGTextContentElementConstructor SVGTextContentElement;
+ attribute SVGTextElementConstructor SVGTextElement;
+ attribute SVGTextPathElementConstructor SVGTextPathElement;
+ attribute SVGTextPositioningElementConstructor SVGTextPositioningElement;
+ attribute SVGTitleElementConstructor SVGTitleElement;
+ attribute SVGTransformConstructor SVGTransform;
+ attribute SVGTransformListConstructor SVGTransformList;
+ attribute SVGTRefElementConstructor SVGTRefElement;
+ attribute SVGTSpanElementConstructor SVGTSpanElement;
+ attribute SVGUnitTypesConstructor SVGUnitTypes;
+ attribute SVGUseElementConstructor SVGUseElement;
+ attribute SVGViewElementConstructor SVGViewElement;
+ attribute SVGViewSpecConstructor SVGViewSpec;
+ attribute SVGZoomAndPanConstructor SVGZoomAndPan;
+
+ attribute SVGAnimateColorElementConstructor SVGAnimateColorElement;
+ attribute SVGAnimateElementConstructor SVGAnimateElement;
+ attribute SVGAnimateMotionElementConstructor SVGAnimateMotionElement;
+ attribute SVGAnimateTransformElementConstructor SVGAnimateTransformElement;
+ attribute SVGMPathElementConstructor SVGMPathElement;
+ attribute SVGSetElementConstructor SVGSetElement;
#if defined(ENABLE_SVG_FONTS) && ENABLE_SVG_FONTS
- attribute SVGAltGlyphDefElementConstructor SVGAltGlyphDefElement;
- attribute SVGAltGlyphElementConstructor SVGAltGlyphElement;
- attribute SVGAltGlyphItemElementConstructor SVGAltGlyphItemElement;
+ attribute SVGAltGlyphDefElementConstructor SVGAltGlyphDefElement;
+ attribute SVGAltGlyphElementConstructor SVGAltGlyphElement;
+ attribute SVGAltGlyphItemElementConstructor SVGAltGlyphItemElement;
// attribute SVGDefinitionSrcElementConstructor SVGDefinitionSrcElement;
- attribute SVGFontElementConstructor SVGFontElement;
- attribute SVGFontFaceElementConstructor SVGFontFaceElement;
- attribute SVGFontFaceFormatElementConstructor SVGFontFaceFormatElement;
- attribute SVGFontFaceNameElementConstructor SVGFontFaceNameElement;
- attribute SVGFontFaceSrcElementConstructor SVGFontFaceSrcElement;
- attribute SVGFontFaceUriElementConstructor SVGFontFaceUriElement;
- attribute SVGGlyphElementConstructor SVGGlyphElement;
- attribute SVGGlyphRefElementConstructor SVGGlyphRefElement;
- attribute SVGHKernElementConstructor SVGHKernElement;
- attribute SVGMissingGlyphElementConstructor SVGMissingGlyphElement;
- attribute SVGVKernElementConstructor SVGVKernElement;
+ attribute SVGFontElementConstructor SVGFontElement;
+ attribute SVGFontFaceElementConstructor SVGFontFaceElement;
+ attribute SVGFontFaceFormatElementConstructor SVGFontFaceFormatElement;
+ attribute SVGFontFaceNameElementConstructor SVGFontFaceNameElement;
+ attribute SVGFontFaceSrcElementConstructor SVGFontFaceSrcElement;
+ attribute SVGFontFaceUriElementConstructor SVGFontFaceUriElement;
+ attribute SVGGlyphElementConstructor SVGGlyphElement;
+ attribute SVGGlyphRefElementConstructor SVGGlyphRefElement;
+ attribute SVGHKernElementConstructor SVGHKernElement;
+ attribute SVGMissingGlyphElementConstructor SVGMissingGlyphElement;
+ attribute SVGVKernElementConstructor SVGVKernElement;
#endif
#if defined(ENABLE_FILTERS) && ENABLE_FILTERS
- attribute SVGComponentTransferFunctionElementConstructor SVGComponentTransferFunctionElement;
- attribute SVGFEBlendElementConstructor SVGFEBlendElement;
- attribute SVGFEColorMatrixElementConstructor SVGFEColorMatrixElement;
- attribute SVGFEComponentTransferElementConstructor SVGFEComponentTransferElement;
- attribute SVGFECompositeElementConstructor SVGFECompositeElement;
- attribute SVGFEConvolveMatrixElementConstructor SVGFEConvolveMatrixElement;
- attribute SVGFEDiffuseLightingElementConstructor SVGFEDiffuseLightingElement;
- attribute SVGFEDisplacementMapElementConstructor SVGFEDisplacementMapElement;
- attribute SVGFEDistantLightElementConstructor SVGFEDistantLightElement;
- attribute SVGFEDropShadowElementConstructor SVGFEDropShadowElement;
- attribute SVGFEFloodElementConstructor SVGFEFloodElement;
- attribute SVGFEFuncAElementConstructor SVGFEFuncAElement;
- attribute SVGFEFuncBElementConstructor SVGFEFuncBElement;
- attribute SVGFEFuncGElementConstructor SVGFEFuncGElement;
- attribute SVGFEFuncRElementConstructor SVGFEFuncRElement;
- attribute SVGFEGaussianBlurElementConstructor SVGFEGaussianBlurElement;
- attribute SVGFEImageElementConstructor SVGFEImageElement;
- attribute SVGFEMergeElementConstructor SVGFEMergeElement;
- attribute SVGFEMergeNodeElementConstructor SVGFEMergeNodeElement;
- attribute SVGFEMorphologyElementConstructor SVGFEMorphologyElement;
- attribute SVGFEOffsetElementConstructor SVGFEOffsetElement;
- attribute SVGFEPointLightElementConstructor SVGFEPointLightElement;
- attribute SVGFESpecularLightingElementConstructor SVGFESpecularLightingElement;
- attribute SVGFESpotLightElementConstructor SVGFESpotLightElement;
- attribute SVGFETileElementConstructor SVGFETileElement;
- attribute SVGFETurbulenceElementConstructor SVGFETurbulenceElement;
- attribute SVGFilterElementConstructor SVGFilterElement;
+ attribute SVGComponentTransferFunctionElementConstructor SVGComponentTransferFunctionElement;
+ attribute SVGFEBlendElementConstructor SVGFEBlendElement;
+ attribute SVGFEColorMatrixElementConstructor SVGFEColorMatrixElement;
+ attribute SVGFEComponentTransferElementConstructor SVGFEComponentTransferElement;
+ attribute SVGFECompositeElementConstructor SVGFECompositeElement;
+ attribute SVGFEConvolveMatrixElementConstructor SVGFEConvolveMatrixElement;
+ attribute SVGFEDiffuseLightingElementConstructor SVGFEDiffuseLightingElement;
+ attribute SVGFEDisplacementMapElementConstructor SVGFEDisplacementMapElement;
+ attribute SVGFEDistantLightElementConstructor SVGFEDistantLightElement;
+ attribute SVGFEDropShadowElementConstructor SVGFEDropShadowElement;
+ attribute SVGFEFloodElementConstructor SVGFEFloodElement;
+ attribute SVGFEFuncAElementConstructor SVGFEFuncAElement;
+ attribute SVGFEFuncBElementConstructor SVGFEFuncBElement;
+ attribute SVGFEFuncGElementConstructor SVGFEFuncGElement;
+ attribute SVGFEFuncRElementConstructor SVGFEFuncRElement;
+ attribute SVGFEGaussianBlurElementConstructor SVGFEGaussianBlurElement;
+ attribute SVGFEImageElementConstructor SVGFEImageElement;
+ attribute SVGFEMergeElementConstructor SVGFEMergeElement;
+ attribute SVGFEMergeNodeElementConstructor SVGFEMergeNodeElement;
+ attribute SVGFEMorphologyElementConstructor SVGFEMorphologyElement;
+ attribute SVGFEOffsetElementConstructor SVGFEOffsetElement;
+ attribute SVGFEPointLightElementConstructor SVGFEPointLightElement;
+ attribute SVGFESpecularLightingElementConstructor SVGFESpecularLightingElement;
+ attribute SVGFESpotLightElementConstructor SVGFESpotLightElement;
+ attribute SVGFETileElementConstructor SVGFETileElement;
+ attribute SVGFETurbulenceElementConstructor SVGFETurbulenceElement;
+ attribute SVGFilterElementConstructor SVGFilterElement;
#endif
#endif
- attribute DOMFormDataConstructor FormData;
+ attribute DOMFormDataConstructor FormData;
- attribute [Conditional=BLOB|FILE_SYSTEM] FileErrorConstructor FileError;
- attribute [Conditional=BLOB] FileReaderConstructor FileReader;
+ [Conditional=BLOB|FILE_SYSTEM] attribute FileErrorConstructor FileError;
+ [Conditional=BLOB] attribute FileReaderConstructor FileReader;
- attribute [Conditional=BLOB&LEGACY_WEBKIT_BLOB_BUILDER] WebKitBlobBuilderConstructor WebKitBlobBuilder;
+ [Conditional=BLOB] attribute DOMURLConstructor URL;
+ [Conditional=BLOB] attribute DOMURLConstructor webkitURL; // FIXME: deprecate this.
- attribute [Conditional=BLOB] DOMURLConstructor URL;
- attribute [Conditional=BLOB] DOMURLConstructor webkitURL; // FIXME: deprecate this.
+ [Conditional=MUTATION_OBSERVERS] attribute MutationObserverConstructor WebKitMutationObserver;
- attribute [Conditional=MUTATION_OBSERVERS] MutationObserverConstructor WebKitMutationObserver;
-
- attribute [Conditional=MEDIA_SOURCE, V8EnabledAtRuntime=mediaSource] MediaSourceConstructor WebKitMediaSource;
- attribute [Conditional=MEDIA_SOURCE, V8EnabledAtRuntime=mediaSource] SourceBufferConstructor WebKitSourceBuffer;
- attribute [Conditional=MEDIA_SOURCE, V8EnabledAtRuntime=mediaSource] SourceBufferListConstructor WebKitSourceBufferList;
+ [Conditional=MEDIA_SOURCE, V8EnabledAtRuntime=mediaSource] attribute MediaSourceConstructor WebKitMediaSource;
+ [Conditional=MEDIA_SOURCE, V8EnabledAtRuntime=mediaSource] attribute SourceBufferConstructor WebKitSourceBuffer;
+ [Conditional=MEDIA_SOURCE, V8EnabledAtRuntime=mediaSource] attribute SourceBufferListConstructor WebKitSourceBufferList;
#endif // defined(LANGUAGE_JAVASCRIPT)
#if defined(V8_BINDING) && V8_BINDING
- // window.toString() requires special handling in V8
- [V8DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
+ // window.toString() requires special handling in V8
+ [V8DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
#endif // defined(V8_BINDING)
- };
-
-}
+};
diff --git a/Source/WebCore/page/DOMWindowPagePopup.idl b/Source/WebCore/page/DOMWindowPagePopup.idl
index aa477a111..301d8b963 100644
--- a/Source/WebCore/page/DOMWindowPagePopup.idl
+++ b/Source/WebCore/page/DOMWindowPagePopup.idl
@@ -28,11 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
- interface [
- Conditional=PAGE_POPUP,
- Supplemental=DOMWindow
- ] DOMWindowPagePopup {
- readonly attribute [V8EnabledPerContext=pagePopup] PagePopupController pagePopupController;
- };
-}
+[
+ Conditional=PAGE_POPUP,
+ Supplemental=DOMWindow
+] interface DOMWindowPagePopup {
+ [V8EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+};
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 32d238ce3..5ef0c61da 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,6 +40,7 @@
#include "DragController.h"
#include "DragState.h"
#include "Editor.h"
+#include "EditorClient.h"
#include "EventNames.h"
#include "FloatPoint.h"
#include "FloatRect.h"
@@ -428,25 +430,33 @@ bool EventHandler::updateSelectionForMouseDownDispatchingSelectStart(Node* targe
return true;
}
-void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result)
+void EventHandler::selectClosestWordFromHitTestResult(const HitTestResult& result, AppendTrailingWhitespace appendTrailingWhitespace)
{
Node* innerNode = result.targetNode();
VisibleSelection newSelection;
- if (innerNode && innerNode->renderer() && m_mouseDownMayStartSelect) {
+ if (innerNode && innerNode->renderer()) {
VisiblePosition pos(innerNode->renderer()->positionForPoint(result.localPoint()));
if (pos.isNotNull()) {
newSelection = VisibleSelection(pos);
newSelection.expandUsingGranularity(WordGranularity);
}
- if (newSelection.isRange() && result.event().clickCount() == 2 && m_frame->editor()->isSelectTrailingWhitespaceEnabled())
+ if (appendTrailingWhitespace == ShouldAppendTrailingWhitespace && newSelection.isRange())
newSelection.appendTrailingWhitespace();
updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, WordGranularity);
}
}
+void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result)
+{
+ if (m_mouseDownMayStartSelect) {
+ selectClosestWordFromHitTestResult(result.hitTestResult(),
+ (result.event().clickCount() == 2 && m_frame->editor()->isSelectTrailingWhitespaceEnabled()) ? ShouldAppendTrailingWhitespace : DontAppendTrailingWhitespace);
+ }
+}
+
void EventHandler::selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults& result)
{
if (!result.hitTestResult().isLiveLink())
@@ -559,7 +569,13 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
} else
newSelection = VisibleSelection(visiblePos);
- return updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, granularity);
+ bool handled = updateSelectionForMouseDownDispatchingSelectStart(innerNode, newSelection, granularity);
+
+ if (event.event().button() == MiddleButton) {
+ // Ignore handled, since we want to paste to where the caret was placed anyway.
+ handled = handlePasteGlobalSelection(event.event()) || handled;
+ }
+ return handled;
}
static inline bool canMouseDownStartSelect(Node* node)
@@ -904,6 +920,11 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e
m_frame->selection()->selectFrameElementInParentIfFullySelected();
+ if (event.event().button() == MiddleButton) {
+ // Ignore handled, since we want to paste to where the caret was placed anyway.
+ handled = handlePasteGlobalSelection(event.event()) || handled;
+ }
+
return handled;
}
@@ -1671,8 +1692,8 @@ static RenderLayer* layerForNode(Node* node)
bool EventHandler::mouseMoved(const PlatformMouseEvent& event)
{
- MaximumDurationTracker maxDurationTracker(&m_maxMouseMovedDuration);
RefPtr<FrameView> protector(m_frame->view());
+ MaximumDurationTracker maxDurationTracker(&m_maxMouseMovedDuration);
#if ENABLE(TOUCH_EVENTS)
@@ -1896,6 +1917,41 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
return swallowMouseUpEvent || swallowClickEvent || swallowMouseReleaseEvent;
}
+bool EventHandler::handlePasteGlobalSelection(const PlatformMouseEvent& mouseEvent)
+{
+ // If the event was a middle click, attempt to copy global selection in after
+ // the newly set caret position.
+ //
+ // This code is called from either the mouse up or mouse down handling. There
+ // is some debate about when the global selection is pasted:
+ // xterm: pastes on up.
+ // GTK: pastes on down.
+ // Qt: pastes on up.
+ // Firefox: pastes on up.
+ // Chromium: pastes on up.
+ //
+ // There is something of a webcompat angle to this well, as highlighted by
+ // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on
+ // down then the text is pasted just before the onclick handler runs and
+ // clears the text box. So it's important this happens after the event
+ // handlers have been fired.
+#if PLATFORM(GTK)
+ if (mouseEvent.type() != PlatformEvent::MousePressed)
+ return false;
+#else
+ if (mouseEvent.type() != PlatformEvent::MouseReleased)
+ return false;
+#endif
+
+ Frame* focusFrame = m_frame->page()->focusController()->focusedOrMainFrame();
+ // Do not paste here if the focus was moved somewhere else.
+ if (m_frame == focusFrame && m_frame->editor()->client()->supportsGlobalSelection())
+ return m_frame->editor()->command(AtomicString("PasteGlobalSelection")).execute();
+
+ return false;
+}
+
+
#if ENABLE(DRAG_SUPPORT)
bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTarget, const PlatformMouseEvent& event, Clipboard* clipboard)
{
@@ -2118,8 +2174,8 @@ void EventHandler::updateMouseEventTargetNode(Node* targetNode, const PlatformMo
else {
// If the target node is a text node, dispatch on the parent node - rdar://4196646
if (result && result->isTextNode()) {
- ComposedShadowTreeParentWalker walker(result);
- walker.parentIncludingInsertionPointAndShadowRoot();
+ AncestorChainWalker walker(result);
+ walker.parent();
result = walker.get();
}
}
@@ -2465,8 +2521,9 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
return handleGestureTap(gestureEvent);
case PlatformEvent::GestureTapDown:
return handleGestureTapDown();
- case PlatformEvent::GestureDoubleTap:
case PlatformEvent::GestureLongPress:
+ return handleGestureLongPress(gestureEvent);
+ case PlatformEvent::GestureDoubleTap:
case PlatformEvent::GesturePinchBegin:
case PlatformEvent::GesturePinchEnd:
case PlatformEvent::GesturePinchUpdate:
@@ -2513,6 +2570,25 @@ bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent)
return defaultPrevented;
}
+bool EventHandler::handleGestureLongPress(const PlatformGestureEvent& gestureEvent)
+{
+#if OS(ANDROID)
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.position());
+ HitTestResult result = hitTestResultAtPoint(hitTestPoint, true);
+ Node* innerNode = result.targetNode();
+ if (!result.isLiveLink() && innerNode && (innerNode->isContentEditable() || innerNode->isTextNode())) {
+ selectClosestWordFromHitTestResult(result, DontAppendTrailingWhitespace);
+ if (m_frame->selection()->isRange())
+ return true;
+ }
+#endif
+#if ENABLE(CONTEXT_MENUS)
+ return sendContextMenuEventForGesture(gestureEvent);
+#else
+ return false;
+#endif
+}
+
bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gestureEvent)
{
return handleGestureScrollCore(gestureEvent, ScrollByPixelWheelEvent, true);
@@ -3623,6 +3699,9 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
if (node->isTextNode())
node = node->parentNode();
+ if (InspectorInstrumentation::handleTouchEvent(m_frame->page(), node))
+ return true;
+
Document* doc = node->document();
if (!doc)
continue;
@@ -3676,7 +3755,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// released or cancelled it will only appear in the changedTouches list.
if (pointState != PlatformTouchPoint::TouchReleased && pointState != PlatformTouchPoint::TouchCancelled) {
touches->append(touch);
- targetTouchesIterator->second->append(touch);
+ targetTouchesIterator->value->append(touch);
}
// Now build up the correct list for changedTouches.
diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h
index 6d8a0ab76..a604da2c8 100644
--- a/Source/WebCore/page/EventHandler.h
+++ b/Source/WebCore/page/EventHandler.h
@@ -89,6 +89,7 @@ extern const int GeneralDragHysteresis;
#endif // ENABLE(DRAG_SUPPORT)
enum HitTestScrollbars { ShouldHitTestScrollbars, DontHitTestScrollbars };
+enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace };
class EventHandler {
WTF_MAKE_NONCOPYABLE(EventHandler);
@@ -111,6 +112,7 @@ public:
void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
RenderObject* autoscrollRenderer() const;
void updateAutoscrollRenderer();
+ bool autoscrollInProgress() const { return m_autoscrollInProgress; }
void dispatchFakeMouseMoveEventSoon();
void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
@@ -160,10 +162,12 @@ public:
bool handleMouseReleaseEvent(const PlatformMouseEvent&);
bool handleWheelEvent(const PlatformWheelEvent&);
void defaultWheelEventHandler(Node*, WheelEvent*);
+ bool handlePasteGlobalSelection(const PlatformMouseEvent&);
#if ENABLE(GESTURE_EVENTS)
bool handleGestureEvent(const PlatformGestureEvent&);
bool handleGestureTap(const PlatformGestureEvent&);
+ bool handleGestureLongPress(const PlatformGestureEvent&);
bool handleGestureScrollUpdate(const PlatformGestureEvent&);
#endif
@@ -239,6 +243,7 @@ private:
bool eventActivatedView(const PlatformMouseEvent&) const;
bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleSelection&, TextGranularity);
+ void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace);
void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&);
void selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&);
diff --git a/Source/WebCore/page/EventSource.idl b/Source/WebCore/page/EventSource.idl
index 48df3ebe8..60d36faa0 100644
--- a/Source/WebCore/page/EventSource.idl
+++ b/Source/WebCore/page/EventSource.idl
@@ -29,41 +29,38 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+[
+ ActiveDOMObject,
+ Constructor(in DOMString scriptUrl),
+ CallWith=ScriptExecutionContext,
+ ConstructorRaisesException,
+ EventTarget,
+ JSNoStaticTables
+] interface EventSource {
- interface [
- ActiveDOMObject,
- Constructor(in DOMString scriptUrl),
- CallWith=ScriptExecutionContext,
- ConstructorRaisesException,
- EventTarget,
- JSNoStaticTables
- ] EventSource {
+ readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+ readonly attribute DOMString url;
- readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
- readonly attribute DOMString url;
+ // ready state
+ const unsigned short CONNECTING = 0;
+ const unsigned short OPEN = 1;
+ const unsigned short CLOSED = 2;
+ readonly attribute unsigned short readyState;
- // ready state
- const unsigned short CONNECTING = 0;
- const unsigned short OPEN = 1;
- const unsigned short CLOSED = 2;
- readonly attribute unsigned short readyState;
+ // networking
+ attribute EventListener onopen;
+ attribute EventListener onmessage;
+ attribute EventListener onerror;
+ void close();
- // networking
- attribute EventListener onopen;
- attribute EventListener onmessage;
- attribute EventListener onerror;
- void close();
+ // EventTarget interface
+ void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
- // EventTarget interface
- void addEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- void removeEventListener(in DOMString type,
- in EventListener listener,
- in [Optional] boolean useCapture);
- boolean dispatchEvent(in Event evt)
- raises(EventException);
-
- };
-}
+};
diff --git a/Source/WebCore/page/FeatureObserver.cpp b/Source/WebCore/page/FeatureObserver.cpp
index a1f889ec8..31d22c55f 100644
--- a/Source/WebCore/page/FeatureObserver.cpp
+++ b/Source/WebCore/page/FeatureObserver.cpp
@@ -54,6 +54,8 @@ FeatureObserver::~FeatureObserver()
void FeatureObserver::observe(DOMWindow* domWindow, Feature feature)
{
+ ASSERT(domWindow);
+
Document* document = domWindow->document();
if (!document)
return;
diff --git a/Source/WebCore/page/FeatureObserver.h b/Source/WebCore/page/FeatureObserver.h
index 6a50c53df..8e0e84588 100644
--- a/Source/WebCore/page/FeatureObserver.h
+++ b/Source/WebCore/page/FeatureObserver.h
@@ -41,7 +41,7 @@ public:
enum Feature {
PageDestruction,
LegacyNotifications,
- LegacyBlobBuilder,
+ UnusedSlot01, // Prior to 10/2012, we used this slot for LegacyBlobBuilder.
PrefixedIndexedDB,
WorkerStart,
SharedWorkerStart,
@@ -49,6 +49,11 @@ public:
WebAudioStart,
PrefixedContentSecurityPolicy,
UnprefixedIndexedDB,
+ OpenWebDatabase,
+ LegacyHTMLNotifications,
+ LegacyTextNotifications,
+ UnprefixedRequestAnimationFrame,
+ PrefixedRequestAnimationFrame,
// Add new features above this line.
NumberOfFeatures, // This enum value must be last.
};
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index a7aaf954b..6205fa6ce 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -184,7 +184,7 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader
setTiledBackingStoreEnabled(page->settings()->tiledBackingStoreEnabled());
#endif
} else {
- page->incrementFrameCount();
+ page->incrementSubframeCount();
// Make sure we will not end up with two frames referencing the same owner element.
Frame*& contentFrameSlot = ownerElement->m_contentFrame;
@@ -579,7 +579,7 @@ void Frame::injectUserScripts(UserScriptInjectionTime injectionTime)
return;
UserScriptMap::const_iterator end = userScripts->end();
for (UserScriptMap::const_iterator it = userScripts->begin(); it != end; ++it)
- injectUserScriptsForWorld(it->first.get(), *it->second, injectionTime);
+ injectUserScriptsForWorld(it->key.get(), *it->value, injectionTime);
}
void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVector& userScripts, UserScriptInjectionTime injectionTime)
@@ -704,7 +704,7 @@ void Frame::disconnectOwnerElement()
doc->clearAXObjectCache();
m_ownerElement->m_contentFrame = 0;
if (m_page)
- m_page->decrementFrameCount();
+ m_page->decrementSubframeCount();
}
m_ownerElement = 0;
}
@@ -876,7 +876,7 @@ Color Frame::tiledBackingStoreBackgroundColor() const
}
#endif
-String Frame::layerTreeAsText(bool showDebugInfo) const
+String Frame::layerTreeAsText(LayerTreeFlags flags) const
{
#if USE(ACCELERATED_COMPOSITING)
document()->updateLayout();
@@ -884,9 +884,9 @@ String Frame::layerTreeAsText(bool showDebugInfo) const
if (!contentRenderer())
return String();
- return contentRenderer()->compositor()->layerTreeAsText(showDebugInfo);
+ return contentRenderer()->compositor()->layerTreeAsText(flags);
#else
- UNUSED_PARAM(showDebugInfo);
+ UNUSED_PARAM(flags);
return String();
#endif
}
@@ -956,8 +956,9 @@ float Frame::frameScaleFactor() const
Page* page = this->page();
// Main frame is scaled with respect to he container but inner frames are not scaled with respect to the main frame.
- if (!page || page->mainFrame() != this)
+ if (!page || page->mainFrame() != this || page->settings()->applyPageScaleFactorInCompositor())
return 1;
+
return page->pageScaleFactor();
}
diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h
index 719692269..0a07c4220 100644
--- a/Source/WebCore/page/Frame.h
+++ b/Source/WebCore/page/Frame.h
@@ -76,6 +76,12 @@ namespace WebCore {
class TreeScope;
+ enum {
+ LayerTreeFlagsIncludeDebugInfo = 1 << 0,
+ LayerTreeFlagsIncludeVisibleRects = 1 << 2
+ };
+ typedef unsigned LayerTreeFlags;
+
class Frame : public RefCounted<Frame>, public TiledBackingStoreClient {
public:
static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
@@ -125,7 +131,7 @@ namespace WebCore {
void injectUserScripts(UserScriptInjectionTime);
- String layerTreeAsText(bool showDebugInfo = false) const;
+ String layerTreeAsText(LayerTreeFlags = 0) const;
static Frame* frameForWidget(const Widget*);
diff --git a/Source/WebCore/page/FrameTree.cpp b/Source/WebCore/page/FrameTree.cpp
index 6f8171450..1e0afe1dd 100644
--- a/Source/WebCore/page/FrameTree.cpp
+++ b/Source/WebCore/page/FrameTree.cpp
@@ -172,6 +172,9 @@ AtomicString FrameTree::uniqueChildName(const AtomicString& requestedName) const
inline Frame* FrameTree::scopedChild(unsigned index, TreeScope* scope) const
{
+ if (!scope)
+ return 0;
+
unsigned scopedIndex = 0;
for (Frame* result = firstChild(); result; result = result->tree()->nextSibling()) {
if (result->inScope(scope)) {
@@ -186,6 +189,9 @@ inline Frame* FrameTree::scopedChild(unsigned index, TreeScope* scope) const
inline Frame* FrameTree::scopedChild(const AtomicString& name, TreeScope* scope) const
{
+ if (!scope)
+ return 0;
+
for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
if (child->tree()->uniqueName() == name && child->inScope(scope))
return child;
@@ -194,6 +200,9 @@ inline Frame* FrameTree::scopedChild(const AtomicString& name, TreeScope* scope)
inline unsigned FrameTree::scopedChildCount(TreeScope* scope) const
{
+ if (!scope)
+ return 0;
+
unsigned scopedCount = 0;
for (Frame* result = firstChild(); result; result = result->tree()->nextSibling()) {
if (result->inScope(scope))
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 9f7274627..5006b95a1 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -97,6 +97,7 @@ using namespace HTMLNames;
double FrameView::sCurrentPaintTimeStamp = 0.0;
+
// REPAINT_THROTTLING now chooses default values for throttling parameters.
// Should be removed when applications start using runtime configuration.
#if ENABLE(REPAINT_THROTTLING)
@@ -334,7 +335,7 @@ void FrameView::init()
// Propagate the marginwidth/height and scrolling modes to the view.
Element* ownerElement = m_frame ? m_frame->ownerElement() : 0;
if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag))) {
- HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement);
+ HTMLFrameElementBase* frameElt = static_cast<HTMLFrameElementBase*>(ownerElement);
if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
setCanHaveScrollbars(false);
LayoutUnit marginWidth = frameElt->marginWidth();
@@ -781,6 +782,19 @@ TiledBacking* FrameView::tiledBacking()
return backing->graphicsLayer()->tiledBacking();
}
+uint64_t FrameView::scrollLayerID() const
+{
+ RenderView* root = rootRenderer(this);
+ if (!root)
+ return 0;
+
+ RenderLayerBacking* backing = root->layer()->backing();
+ if (!backing)
+ return 0;
+
+ return backing->scrollLayerID();
+}
+
#if ENABLE(RUBBER_BANDING)
GraphicsLayer* FrameView::layerForOverhangAreas() const
{
@@ -791,7 +805,7 @@ GraphicsLayer* FrameView::layerForOverhangAreas() const
}
#endif
-bool FrameView::syncCompositingStateForThisFrame(Frame* rootFrameForSync)
+bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)
{
RenderView* root = rootRenderer(this);
if (!root)
@@ -808,7 +822,7 @@ bool FrameView::syncCompositingStateForThisFrame(Frame* rootFrameForSync)
// visible flash to occur. Instead, stop the deferred repaint timer and repaint immediately.
flushDeferredRepaints();
- root->compositor()->flushPendingLayerChanges(rootFrameForSync == m_frame);
+ root->compositor()->flushPendingLayerChanges(rootFrameForFlush == m_frame);
return true;
}
@@ -887,16 +901,16 @@ bool FrameView::isEnclosedInCompositingLayer() const
return false;
}
-bool FrameView::syncCompositingStateIncludingSubframes()
+bool FrameView::flushCompositingStateIncludingSubframes()
{
#if USE(ACCELERATED_COMPOSITING)
- bool allFramesSynced = syncCompositingStateForThisFrame(m_frame.get());
+ bool allFramesFlushed = flushCompositingStateForThisFrame(m_frame.get());
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->traverseNext(m_frame.get())) {
- bool synced = child->view()->syncCompositingStateForThisFrame(m_frame.get());
- allFramesSynced &= synced;
+ bool flushed = child->view()->flushCompositingStateForThisFrame(m_frame.get());
+ allFramesFlushed &= flushed;
}
- return allFramesSynced;
+ return allFramesFlushed;
#else // USE(ACCELERATED_COMPOSITING)
return true;
#endif
@@ -1031,6 +1045,7 @@ void FrameView::layout(bool allowSubtree)
ASSERT(m_frame->view() == this);
Document* document = m_frame->document();
+ ASSERT(!document->inPageCache());
bool subtree;
RenderObject* root;
@@ -1213,7 +1228,7 @@ void FrameView::layout(bool allowSubtree)
root->document()->axObjectCache()->postNotification(root, AXObjectCache::AXLayoutComplete, true);
#endif
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
- updateDashboardRegions();
+ updateAnnotatedRegions();
#endif
ASSERT(!root->needsLayout());
@@ -2183,19 +2198,21 @@ void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot)
m_layoutRoot->markContainingBlocksForLayout(false, relayoutRoot);
m_layoutRoot = relayoutRoot;
ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout());
+ InspectorInstrumentation::didInvalidateLayout(m_frame.get());
} else {
// Just do a full relayout
if (m_layoutRoot)
m_layoutRoot->markContainingBlocksForLayout(false);
m_layoutRoot = 0;
relayoutRoot->markContainingBlocksForLayout(false);
+ InspectorInstrumentation::didInvalidateLayout(m_frame.get());
}
}
} else if (m_layoutSchedulingEnabled) {
- InspectorInstrumentation::didInvalidateLayout(m_frame.get());
int delay = m_frame->document()->minimumLayoutDelay();
m_layoutRoot = relayoutRoot;
ASSERT(!m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout());
+ InspectorInstrumentation::didInvalidateLayout(m_frame.get());
m_delayedLayout = delay != 0;
m_layoutTimer.startOneShot(delay * 0.001);
}
@@ -2247,7 +2264,7 @@ void FrameView::unscheduleRelayout()
}
#if ENABLE(REQUEST_ANIMATION_FRAME)
-void FrameView::serviceScriptedAnimations(DOMTimeStamp time)
+void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime)
{
for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) {
frame->view()->serviceScrollAnimations();
@@ -2259,7 +2276,7 @@ void FrameView::serviceScriptedAnimations(DOMTimeStamp time)
documents.append(frame->document());
for (size_t i = 0; i < documents.size(); ++i)
- documents[i]->serviceScriptedAnimations(time);
+ documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime);
}
#endif
@@ -2484,7 +2501,7 @@ void FrameView::performPostLayoutTasks()
#if USE(ACCELERATED_COMPOSITING)
if (TiledBacking* tiledBacking = this->tiledBacking())
- tiledBacking->setCanHaveScrollbars(canHaveScrollbars());
+ tiledBacking->setTileCoverage(canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea);
#endif
scrollToAnchor();
@@ -2896,20 +2913,20 @@ bool FrameView::scrollAnimatorEnabled() const
}
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void FrameView::updateDashboardRegions()
+void FrameView::updateAnnotatedRegions()
{
Document* document = m_frame->document();
- if (!document->hasDashboardRegions())
+ if (!document->hasAnnotatedRegions())
return;
- Vector<DashboardRegionValue> newRegions;
- document->renderBox()->collectDashboardRegions(newRegions);
- if (newRegions == document->dashboardRegions())
+ Vector<AnnotatedRegionValue> newRegions;
+ document->renderBox()->collectAnnotatedRegions(newRegions);
+ if (newRegions == document->annotatedRegions())
return;
- document->setDashboardRegions(newRegions);
+ document->setAnnotatedRegions(newRegions);
Page* page = m_frame->page();
if (!page)
return;
- page->chrome()->client()->dashboardRegionsChanged();
+ page->chrome()->client()->annotatedRegionsChanged();
}
#endif
@@ -3048,10 +3065,9 @@ bool FrameView::hasCustomScrollbars() const
FrameView* FrameView::parentFrameView() const
{
- if (Widget* parentView = parent()) {
- if (parentView->isFrameView())
- return static_cast<FrameView*>(parentView);
- }
+ if (Frame* parentFrame = m_frame->tree()->parent())
+ return parentFrame->view();
+
return 0;
}
@@ -3192,7 +3208,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
#if USE(ACCELERATED_COMPOSITING)
if (!p->paintingDisabled() && !document->printing())
- syncCompositingStateForThisFrame(m_frame.get());
+ flushCompositingStateForThisFrame(m_frame.get());
#endif
PaintBehavior oldPaintBehavior = m_paintBehavior;
@@ -3233,10 +3249,10 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
m_paintBehavior = oldPaintBehavior;
m_lastPaintTime = currentTime();
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
// Regions may have changed as a result of the visibility/z-index of element changing.
- if (document->dashboardRegionsDirty())
- updateDashboardRegions();
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+ if (document->annotatedRegionsDirty())
+ updateAnnotatedRegions();
#endif
if (isTopLevelPainter)
@@ -3459,7 +3475,7 @@ void FrameView::adjustPageHeightDeprecated(float *newBottom, float oldTop, float
IntRect FrameView::convertFromRenderer(const RenderObject* renderer, const IntRect& rendererRect) const
{
- IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect)).enclosingBoundingBox();
+ IntRect rect = renderer->localToAbsoluteQuad(FloatRect(rendererRect), SnapOffsetForTransforms).enclosingBoundingBox();
// Convert from page ("absolute") to FrameView coordinates.
if (!delegatesScrolling())
@@ -3478,13 +3494,13 @@ IntRect FrameView::convertToRenderer(const RenderObject* renderer, const IntRect
// FIXME: we don't have a way to map an absolute rect down to a local quad, so just
// move the rect for now.
- rect.setLocation(roundedIntPoint(renderer->absoluteToLocal(rect.location(), false, true /* use transforms */)));
+ rect.setLocation(roundedIntPoint(renderer->absoluteToLocal(rect.location(), UseTransforms | SnapOffsetForTransforms)));
return rect;
}
IntPoint FrameView::convertFromRenderer(const RenderObject* renderer, const IntPoint& rendererPoint) const
{
- IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, false, true /* use transforms */));
+ IntPoint point = roundedIntPoint(renderer->localToAbsolute(rendererPoint, UseTransforms | SnapOffsetForTransforms));
// Convert from page ("absolute") to FrameView coordinates.
if (!delegatesScrolling())
@@ -3500,7 +3516,7 @@ IntPoint FrameView::convertToRenderer(const RenderObject* renderer, const IntPoi
if (!delegatesScrolling())
point += IntSize(scrollX(), scrollY());
- return roundedIntPoint(renderer->absoluteToLocal(point, false, true /* use transforms */));
+ return roundedIntPoint(renderer->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms));
}
IntRect FrameView::convertToContainingView(const IntRect& localRect) const
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index ceea73ff5..944d9d16b 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -115,13 +115,13 @@ public:
bool needsFullRepaint() const { return m_doFullRepaint; }
#if ENABLE(REQUEST_ANIMATION_FRAME)
- void serviceScriptedAnimations(DOMTimeStamp);
+ void serviceScriptedAnimations(double monotonicAnimationStartTime);
#endif
#if USE(ACCELERATED_COMPOSITING)
void updateCompositingLayersAfterStyleChange();
void updateCompositingLayersAfterLayout();
- bool syncCompositingStateForThisFrame(Frame* rootFrameForSync);
+ bool flushCompositingStateForThisFrame(Frame* rootFrameForFlush);
void clearBackingStores();
void restoreBackingStores();
@@ -131,6 +131,10 @@ public:
void setNeedsOneShotDrawingSynchronization();
virtual TiledBacking* tiledBacking() OVERRIDE;
+
+ // In the future when any ScrollableArea can have a node in th ScrollingTree, this should
+ // become a virtual function on ScrollableArea.
+ uint64_t scrollLayerID() const;
#endif
bool hasCompositedContent() const;
@@ -140,8 +144,8 @@ public:
bool isEnclosedInCompositingLayer() const;
// Only used with accelerated compositing, but outside the #ifdef to make linkage easier.
- // Returns true if the sync was completed.
- bool syncCompositingStateIncludingSubframes();
+ // Returns true if the flush was completed.
+ bool flushCompositingStateIncludingSubframes();
// Returns true when a paint with the PaintBehaviorFlattenCompositingLayers flag set gives
// a faithful representation of the content.
@@ -176,7 +180,7 @@ public:
virtual IntRect windowResizerRect() const;
virtual void setFixedVisibleContentRect(const IntRect&) OVERRIDE;
- void setScrollPosition(const IntPoint&);
+ virtual void setScrollPosition(const IntPoint&) OVERRIDE;
void scrollPositionChangedViaPlatformWidget();
virtual void repaintFixedElementsAfterScrolling();
virtual void updateFixedElementsAfterScrolling();
@@ -222,7 +226,7 @@ public:
bool repaintsDisabled() { return m_disableRepaints > 0; }
#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
- void updateDashboardRegions();
+ void updateAnnotatedRegions();
#endif
void updateControlTints();
@@ -360,6 +364,9 @@ public:
// distinguish between the two.
const Pagination& pagination() const;
void setPagination(const Pagination&);
+
+ bool inProgrammaticScroll() const { return m_inProgrammaticScroll; }
+ void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
protected:
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
diff --git a/Source/WebCore/page/GestureTapHighlighter.cpp b/Source/WebCore/page/GestureTapHighlighter.cpp
index bb8f423bc..56df47c26 100644
--- a/Source/WebCore/page/GestureTapHighlighter.cpp
+++ b/Source/WebCore/page/GestureTapHighlighter.cpp
@@ -93,20 +93,24 @@ inline bool strikes(const LayoutRect& a, const LayoutRect& b)
&& a.y() <= b.maxY() && b.y() <= a.maxY();
}
-inline void shiftXEdgesToContainIfStrikes(LayoutRect& rect, const LayoutRect& other)
+inline void shiftXEdgesToContainIfStrikes(LayoutRect& rect, LayoutRect& other, bool isFirst)
{
if (rect.isEmpty())
return;
- LayoutUnit leftSide = rect.x();
- LayoutUnit rightSide = rect.maxX();
- if (!other.isEmpty() && strikes(rect, other)) {
- leftSide = std::min(leftSide, other.x());
- rightSide = std::max(rightSide, other.maxX());
- }
+ if (other.isEmpty() || !strikes(rect, other))
+ return;
+
+ LayoutUnit leftSide = std::min(rect.x(), other.x());
+ LayoutUnit rightSide = std::max(rect.maxX(), other.maxX());
+
+ rect.shiftXEdgeTo(leftSide);
+ rect.shiftMaxXEdgeTo(rightSide);
- rect.setX(leftSide);
- rect.setWidth(rightSide - leftSide);
+ if (isFirst)
+ other.shiftMaxXEdgeTo(rightSide);
+ else
+ other.shiftXEdgeTo(leftSide);
}
inline void addHighlightRect(Path& path, const LayoutRect& rect, const LayoutRect& prev, const LayoutRect& next)
@@ -158,33 +162,38 @@ Path absolutePathForRenderer(RenderObject* const o)
for (int i = 1; i < end; ++i)
mid.uniteIfNonZero(rects.at(i));
- Vector<LayoutRect> drawableRects;
-
- if (!mid.isEmpty())
- drawableRects.append(mid);
+ LayoutRect first;
+ LayoutRect last;
// Add the first box, but merge it with the center boxes if it intersects.
if (rects.size() && !rects.first().isEmpty()) {
- // Adjust center boxes to boundary of first
- if (drawableRects.size())
- shiftXEdgesToContainIfStrikes(drawableRects.last(), rects.first());
- if (drawableRects.size() && drawableRects.last().intersects(rects.first()))
- drawableRects.last().unite(rects.first());
- else
- drawableRects.prepend(rects.first());
+ if (!mid.isEmpty() && mid.intersects(rects.first()))
+ mid.unite(rects.first());
+ else {
+ first = rects.first();
+ shiftXEdgesToContainIfStrikes(mid, first, /* isFirst */ true);
+ }
}
// Add the last box, but merge it with the center boxes if it intersects.
if (rects.size() > 1 && !rects.last().isEmpty()) {
// Adjust center boxes to boundary of last
- if (drawableRects.size())
- shiftXEdgesToContainIfStrikes(drawableRects.last(), rects.last());
- if (drawableRects.size() && drawableRects.last().intersects(rects.last()))
- drawableRects.last().unite(rects.last());
- else
- drawableRects.append(rects.last());
+ if (!mid.isEmpty() && mid.intersects(rects.last()))
+ mid.unite(rects.last());
+ else {
+ last = rects.last();
+ shiftXEdgesToContainIfStrikes(mid, last, /* isFirst */ false);
+ }
}
+ Vector<LayoutRect> drawableRects;
+ if (!first.isEmpty())
+ drawableRects.append(first);
+ if (!mid.isEmpty())
+ drawableRects.append(mid);
+ if (!last.isEmpty())
+ drawableRects.append(last);
+
// Clip the overflow rects if needed, before the ring path is formed to
// ensure rounded highlight rects. This clipping has the problem with nested
// divs with transforms, which could be resolved by proper Path::intersecting.
@@ -199,7 +208,7 @@ Path absolutePathForRenderer(RenderObject* const o)
// Check ancestor layers for overflow clip and intersect them.
for (; layer; layer = layer->parent()) {
- RenderBoxModelObject* layerRenderer = layer->renderer();
+ RenderLayerModelObject* layerRenderer = layer->renderer();
if (layerRenderer->hasOverflowClip() && layerRenderer != currentRenderer) {
bool containerSkipped = false;
diff --git a/Source/WebCore/page/History.idl b/Source/WebCore/page/History.idl
index 2c7d7998c..abb245f1d 100644
--- a/Source/WebCore/page/History.idl
+++ b/Source/WebCore/page/History.idl
@@ -23,30 +23,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
-
- interface [
+[
#if defined(V8_BINDING) && V8_BINDING
- CheckSecurity,
+ CheckSecurity,
#endif
- JSCustomGetOwnPropertySlotAndDescriptor,
- CustomNamedSetter,
- JSGenerateIsReachable=ImplFrame,
- CustomDeleteProperty,
- CustomEnumerateProperty,
- OmitConstructor
- ] History {
- readonly attribute unsigned long length;
- readonly attribute [CachedAttribute, Custom] SerializedScriptValue state;
+ JSCustomGetOwnPropertySlotAndDescriptor,
+ CustomNamedSetter,
+ JSGenerateIsReachable=ImplFrame,
+ CustomDeleteProperty,
+ CustomEnumerateProperty,
+ OmitConstructor
+] interface History {
+ readonly attribute unsigned long length;
+ [CachedAttribute, Custom] readonly attribute SerializedScriptValue state;
- [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void back();
- [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void forward();
- [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void go(in [Optional=DefaultIsUndefined] long distance);
+ [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void back();
+ [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void forward();
+ [DoNotCheckSecurity, CallWith=ScriptExecutionContext] void go(in [Optional=DefaultIsUndefined] long distance);
- [Custom] void pushState(in any data, in DOMString title, in [Optional] DOMString url)
- raises(DOMException);
- [Custom] void replaceState(in any data, in DOMString title, in [Optional] DOMString url)
- raises(DOMException);
- };
+ [Custom] void pushState(in any data, in DOMString title, in [Optional] DOMString url)
+ raises(DOMException);
+ [Custom] void replaceState(in any data, in DOMString title, in [Optional] DOMString url)
+ raises(DOMException);
+};
-}
diff --git a/Source/WebCore/page/Location.idl b/Source/WebCore/page/Location.idl
index 1bc32a038..0707f0758 100644
--- a/Source/WebCore/page/Location.idl
+++ b/Source/WebCore/page/Location.idl
@@ -26,51 +26,48 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
-
- interface [
+[
#if defined(V8_BINDING) && V8_BINDING
- CheckSecurity,
+ CheckSecurity,
#endif
- JSCustomGetOwnPropertySlotAndDescriptor,
- CustomNamedSetter,
- JSGenerateIsReachable=ImplFrame,
- CustomDeleteProperty,
- CustomEnumerateProperty,
- JSCustomDefineOwnProperty,
- JSCustomNamedGetterOnPrototype,
- JSCustomDefineOwnPropertyOnPrototype,
- OmitConstructor
- ] Location {
+ JSCustomGetOwnPropertySlotAndDescriptor,
+ CustomNamedSetter,
+ JSGenerateIsReachable=ImplFrame,
+ CustomDeleteProperty,
+ CustomEnumerateProperty,
+ JSCustomDefineOwnProperty,
+ JSCustomNamedGetterOnPrototype,
+ JSCustomDefineOwnPropertyOnPrototype,
+ OmitConstructor
+] interface Location {
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
- attribute [DoNotCheckSecurityOnSetter, CustomSetter, V8Unforgeable] DOMString href;
+ [DoNotCheckSecurityOnSetter, CustomSetter, V8Unforgeable] attribute DOMString href;
#endif
- [Custom, V8Unforgeable] void assign(in [Optional=DefaultIsUndefined] DOMString url);
- [Custom, V8Unforgeable] void replace(in [Optional=DefaultIsUndefined] DOMString url);
- [Custom, V8Unforgeable] void reload();
+ [Custom, V8Unforgeable] void assign(in [Optional=DefaultIsUndefined] DOMString url);
+ [Custom, V8Unforgeable] void replace(in [Optional=DefaultIsUndefined] DOMString url);
+ [Custom, V8Unforgeable] void reload();
- // URI decomposition attributes
+ // URI decomposition attributes
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
- attribute [CustomSetter] DOMString protocol;
- attribute [CustomSetter] DOMString host;
- attribute [CustomSetter] DOMString hostname;
- attribute [CustomSetter] DOMString port;
- attribute [CustomSetter] DOMString pathname;
- attribute [CustomSetter] DOMString search;
- attribute [CustomSetter] DOMString hash;
+ [CustomSetter] attribute DOMString protocol;
+ [CustomSetter] attribute DOMString host;
+ [CustomSetter] attribute DOMString hostname;
+ [CustomSetter] attribute DOMString port;
+ [CustomSetter] attribute DOMString pathname;
+ [CustomSetter] attribute DOMString search;
+ [CustomSetter] attribute DOMString hash;
- readonly attribute DOMString origin;
+ readonly attribute DOMString origin;
#endif
- readonly attribute DOMStringList ancestorOrigins;
+ readonly attribute DOMStringList ancestorOrigins;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- [NotEnumerable, Custom, V8Unforgeable, V8ReadOnly, ImplementedAs=toStringFunction] DOMString toString();
+ [NotEnumerable, Custom, V8Unforgeable, V8ReadOnly, ImplementedAs=toStringFunction] DOMString toString();
#endif
#if defined(V8_BINDING) && V8_BINDING
- [NotEnumerable, Custom, V8Unforgeable, V8ReadOnly] DOMObject valueOf();
+ [NotEnumerable, Custom, V8Unforgeable, V8ReadOnly] DOMObject valueOf();
#endif
- };
+};
-}
diff --git a/Source/WebCore/page/MemoryInfo.idl b/Source/WebCore/page/MemoryInfo.idl
index b9149d54d..df50b4804 100644
--- a/Source/WebCore/page/MemoryInfo.idl
+++ b/Source/WebCore/page/MemoryInfo.idl
@@ -28,16 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+[
+ OmitConstructor
+] interface MemoryInfo {
- interface [
- OmitConstructor
- ] MemoryInfo {
+ readonly attribute unsigned long totalJSHeapSize;
+ readonly attribute unsigned long usedJSHeapSize;
+ [JSCustomGetter] readonly attribute unsigned long jsHeapSizeLimit;
- readonly attribute unsigned long totalJSHeapSize;
- readonly attribute unsigned long usedJSHeapSize;
- readonly attribute [JSCustomGetter] unsigned long jsHeapSizeLimit;
+};
- };
-
-}
diff --git a/Source/WebCore/page/Navigator.idl b/Source/WebCore/page/Navigator.idl
index 3c2af01c9..0c676ebe5 100644
--- a/Source/WebCore/page/Navigator.idl
+++ b/Source/WebCore/page/Navigator.idl
@@ -17,30 +17,27 @@
Boston, MA 02110-1301, USA.
*/
-module window {
+[
+ JSGenerateIsReachable=ImplFrame,
+ OmitConstructor
+] interface Navigator {
+ readonly attribute DOMString appCodeName;
+ readonly attribute DOMString appName;
+ readonly attribute DOMString appVersion;
+ readonly attribute DOMString language;
+ readonly attribute DOMString userAgent;
+ readonly attribute DOMString platform;
+ readonly attribute DOMPluginArray plugins;
+ readonly attribute DOMMimeTypeArray mimeTypes;
+ readonly attribute DOMString product;
+ readonly attribute DOMString productSub;
+ readonly attribute DOMString vendor;
+ readonly attribute DOMString vendorSub;
+ readonly attribute boolean cookieEnabled;
+ boolean javaEnabled();
+
+ readonly attribute boolean onLine;
+
+ void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
+};
- interface [
- JSGenerateIsReachable=ImplFrame,
- OmitConstructor
- ] Navigator {
- readonly attribute DOMString appCodeName;
- readonly attribute DOMString appName;
- readonly attribute DOMString appVersion;
- readonly attribute DOMString language;
- readonly attribute DOMString userAgent;
- readonly attribute DOMString platform;
- readonly attribute DOMPluginArray plugins;
- readonly attribute DOMMimeTypeArray mimeTypes;
- readonly attribute DOMString product;
- readonly attribute DOMString productSub;
- readonly attribute DOMString vendor;
- readonly attribute DOMString vendorSub;
- readonly attribute boolean cookieEnabled;
- boolean javaEnabled();
-
- readonly attribute boolean onLine;
-
- void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
- };
-
-}
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
index 1793df15e..3df7586e8 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
@@ -72,6 +72,7 @@
#include "StyleResolver.h"
#include "TextResourceDecoder.h"
#include "VoidCallback.h"
+#include "WebCoreMemoryInstrumentation.h"
#include "Widget.h"
#include <wtf/HashMap.h>
#include <wtf/RefCountedLeakCounter.h>
@@ -82,6 +83,7 @@
namespace WebCore {
static HashSet<Page*>* allPages;
+static const double hiddenPageTimerAlignmentInterval = 1.0; // once a second
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, pageCounter, ("Page"));
@@ -134,7 +136,7 @@ Page::Page(PageClients& pageClients)
, m_theme(RenderTheme::themeForPage(this))
, m_editorClient(pageClients.editorClient)
, m_validationMessageClient(pageClients.validationMessageClient)
- , m_frameCount(0)
+ , m_subframeCount(0)
, m_openedByDOM(false)
, m_tabKeyCyclesThroughElements(true)
, m_defersLoading(false)
@@ -156,6 +158,7 @@ Page::Page(PageClients& pageClients)
, m_canStartMedia(true)
, m_viewMode(ViewModeWindowed)
, m_minimumTimerInterval(Settings::defaultMinDOMTimerInterval())
+ , m_timerAlignmentInterval(Settings::defaultDOMTimerAlignmentInterval())
, m_isEditable(false)
, m_isOnscreen(true)
#if ENABLE(PAGE_VISIBILITY_API)
@@ -651,7 +654,7 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin)
FrameView* view = document->view();
if (scale == m_pageScaleFactor) {
- if (view && view->scrollPosition() != origin) {
+ if (view && (view->scrollPosition() != origin || view->delegatesScrolling())) {
document->updateLayoutIgnorePendingStylesheets();
view->setScrollPosition(origin);
}
@@ -1025,6 +1028,23 @@ double Page::minimumTimerInterval() const
return m_minimumTimerInterval;
}
+void Page::setTimerAlignmentInterval(double interval)
+{
+ if (interval == m_timerAlignmentInterval)
+ return;
+
+ m_timerAlignmentInterval = interval;
+ for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNextWithWrap(false)) {
+ if (frame->document())
+ frame->document()->didChangeTimerAlignmentInterval();
+ }
+}
+
+double Page::timerAlignmentInterval() const
+{
+ return m_timerAlignmentInterval;
+}
+
void Page::dnsPrefetchingStateChanged()
{
for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
@@ -1081,21 +1101,22 @@ void Page::privateBrowsingStateChanged()
}
#if !ASSERT_DISABLED
-void Page::checkFrameCountConsistency() const
+void Page::checkSubframeCountConsistency() const
{
- ASSERT(m_frameCount >= 0);
+ ASSERT(m_subframeCount >= 0);
- int frameCount = 0;
+ int subframeCount = 0;
for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
- ++frameCount;
+ ++subframeCount;
- ASSERT(m_frameCount + 1 == frameCount);
+ ASSERT(m_subframeCount + 1 == subframeCount);
}
#endif
-#if ENABLE(PAGE_VISIBILITY_API)
+#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitialState)
{
+#if ENABLE(PAGE_VISIBILITY_API)
if (m_visibilityState == visibilityState)
return;
m_visibilityState = visibilityState;
@@ -1108,8 +1129,21 @@ void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitia
}
m_mainFrame->dispatchVisibilityStateChangeEvent();
}
+#endif
+
+#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+ if (visibilityState == WebCore::PageVisibilityStateHidden)
+ setTimerAlignmentInterval(hiddenPageTimerAlignmentInterval);
+ else
+ setTimerAlignmentInterval(Settings::defaultDOMTimerAlignmentInterval());
+#if !ENABLE(PAGE_VISIBILITY_API)
+ UNUSED_PARAM(isInitialState);
+#endif
+#endif
}
+#endif // ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+#if ENABLE(PAGE_VISIBILITY_API)
PageVisibilityState Page::visibilityState() const
{
return m_visibilityState;
@@ -1233,6 +1267,49 @@ void Page::resetSeenPlugins()
m_seenPlugins.clear();
}
+void Page::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Page);
+ info.addMember(m_chrome);
+ info.addMember(m_dragCaretController);
+
+#if ENABLE(DRAG_SUPPORT)
+ info.addMember(m_dragController);
+#endif
+ info.addMember(m_focusController);
+#if ENABLE(CONTEXT_MENUS)
+ info.addMember(m_contextMenuController);
+#endif
+#if ENABLE(INSPECTOR)
+ info.addMember(m_inspectorController);
+#endif
+#if ENABLE(POINTER_LOCK)
+ info.addMember(m_pointerLockController);
+#endif
+ info.addMember(m_scrollingCoordinator);
+ info.addMember(m_settings);
+ info.addMember(m_progress);
+ info.addMember(m_backForwardController);
+ info.addMember(m_mainFrame);
+ info.addMember(m_pluginData);
+ info.addMember(m_theme);
+ info.addMember(m_editorClient);
+ info.addMember(m_featureObserver);
+ info.addMember(m_groupName);
+ info.addMember(m_pagination);
+ info.addMember(m_userStyleSheetPath);
+ info.addMember(m_userStyleSheet);
+ info.addMember(m_singlePageGroup);
+ info.addMember(m_group);
+ info.addWeakPointer(m_debugger);
+ info.addMember(m_sessionStorage);
+ info.addMember(m_relevantUnpaintedRenderObjects);
+ info.addMember(m_relevantPaintedRegion);
+ info.addMember(m_relevantUnpaintedRegion);
+ info.addMember(m_alternativeTextClient);
+ info.addMember(m_seenPlugins);
+}
+
Page::PageClients::PageClients()
: alternativeTextClient(0)
, chromeClient(0)
diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h
index cd6c665b4..76d9ac7ed 100644
--- a/Source/WebCore/page/Page.h
+++ b/Source/WebCore/page/Page.h
@@ -172,9 +172,9 @@ namespace WebCore {
PageGroup& group() { if (!m_group) initGroup(); return *m_group; }
PageGroup* groupPtr() { return m_group; } // can return 0
- void incrementFrameCount() { ++m_frameCount; }
- void decrementFrameCount() { ASSERT(m_frameCount); --m_frameCount; }
- int frameCount() const { checkFrameCountConsistency(); return m_frameCount; }
+ void incrementSubframeCount() { ++m_subframeCount; }
+ void decrementSubframeCount() { ASSERT(m_subframeCount); --m_subframeCount; }
+ int subframeCount() const { checkSubframeCountConsistency(); return m_subframeCount; }
Chrome* chrome() const { return m_chrome.get(); }
DragCaretController* dragCaretController() const { return m_dragCaretController.get(); }
@@ -322,6 +322,8 @@ namespace WebCore {
#if ENABLE(PAGE_VISIBILITY_API)
PageVisibilityState visibilityState() const;
+#endif
+#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
void setVisibilityState(PageVisibilityState, bool);
#endif
@@ -350,13 +352,15 @@ namespace WebCore {
void sawPlugin(const String& serviceType);
void resetSeenPlugins();
+ void reportMemoryUsage(MemoryObjectInfo*) const;
+
private:
void initGroup();
#if ASSERT_DISABLED
- void checkFrameCountConsistency() const { }
+ void checkSubframeCountConsistency() const { }
#else
- void checkFrameCountConsistency() const;
+ void checkSubframeCountConsistency() const;
#endif
MediaCanStartListener* takeAnyMediaCanStartListener();
@@ -364,6 +368,9 @@ namespace WebCore {
void setMinimumTimerInterval(double);
double minimumTimerInterval() const;
+ void setTimerAlignmentInterval(double);
+ double timerAlignmentInterval() const;
+
void collectPluginViews(Vector<RefPtr<PluginViewBase>, 32>& pluginViewBases);
OwnPtr<Chrome> m_chrome;
@@ -399,7 +406,7 @@ namespace WebCore {
FeatureObserver m_featureObserver;
- int m_frameCount;
+ int m_subframeCount;
String m_groupName;
bool m_openedByDOM;
@@ -442,6 +449,8 @@ namespace WebCore {
double m_minimumTimerInterval;
+ double m_timerAlignmentInterval;
+
bool m_isEditable;
bool m_isOnscreen;
diff --git a/Source/WebCore/page/PageGroup.cpp b/Source/WebCore/page/PageGroup.cpp
index 0fed49138..314ed1419 100644
--- a/Source/WebCore/page/PageGroup.cpp
+++ b/Source/WebCore/page/PageGroup.cpp
@@ -94,12 +94,12 @@ PageGroup* PageGroup::pageGroup(const String& groupName)
PageGroupMap::AddResult result = pageGroups->add(groupName, 0);
if (result.isNewEntry) {
- ASSERT(!result.iterator->second);
- result.iterator->second = new PageGroup(groupName);
+ ASSERT(!result.iterator->value);
+ result.iterator->value = new PageGroup(groupName);
}
- ASSERT(result.iterator->second);
- return result.iterator->second;
+ ASSERT(result.iterator->value);
+ return result.iterator->value;
}
void PageGroup::closeLocalStorage()
@@ -110,8 +110,8 @@ void PageGroup::closeLocalStorage()
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
- if (it->second->hasLocalStorage())
- it->second->localStorage()->close();
+ if (it->value->hasLocalStorage())
+ it->value->localStorage()->close();
}
}
@@ -122,8 +122,8 @@ void PageGroup::clearLocalStorageForAllOrigins()
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
- if (it->second->hasLocalStorage())
- it->second->localStorage()->clearAllOriginsForDeletion();
+ if (it->value->hasLocalStorage())
+ it->value->localStorage()->clearAllOriginsForDeletion();
}
}
@@ -134,8 +134,8 @@ void PageGroup::clearLocalStorageForOrigin(SecurityOrigin* origin)
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
- if (it->second->hasLocalStorage())
- it->second->localStorage()->clearOriginForDeletion(origin);
+ if (it->value->hasLocalStorage())
+ it->value->localStorage()->clearOriginForDeletion(origin);
}
}
@@ -146,8 +146,8 @@ void PageGroup::syncLocalStorage()
PageGroupMap::iterator end = pageGroups->end();
for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
- if (it->second->hasLocalStorage())
- it->second->localStorage()->sync();
+ if (it->value->hasLocalStorage())
+ it->value->localStorage()->sync();
}
}
@@ -262,7 +262,7 @@ StorageNamespace* PageGroup::localStorage()
}
void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
- PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
+ const Vector<String>& whitelist, const Vector<String>& blacklist,
UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)
{
ASSERT_ARG(world, world);
@@ -270,14 +270,14 @@ void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& sourc
OwnPtr<UserScript> userScript = adoptPtr(new UserScript(source, url, whitelist, blacklist, injectionTime, injectedFrames));
if (!m_userScripts)
m_userScripts = adoptPtr(new UserScriptMap);
- OwnPtr<UserScriptVector>& scriptsInWorld = m_userScripts->add(world, nullptr).iterator->second;
+ OwnPtr<UserScriptVector>& scriptsInWorld = m_userScripts->add(world, nullptr).iterator->value;
if (!scriptsInWorld)
scriptsInWorld = adoptPtr(new UserScriptVector);
scriptsInWorld->append(userScript.release());
}
void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
- PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
+ const Vector<String>& whitelist, const Vector<String>& blacklist,
UserContentInjectedFrames injectedFrames,
UserStyleLevel level,
UserStyleInjectionTime injectionTime)
@@ -287,7 +287,7 @@ void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& s
OwnPtr<UserStyleSheet> userStyleSheet = adoptPtr(new UserStyleSheet(source, url, whitelist, blacklist, injectedFrames, level));
if (!m_userStyleSheets)
m_userStyleSheets = adoptPtr(new UserStyleSheetMap);
- OwnPtr<UserStyleSheetVector>& styleSheetsInWorld = m_userStyleSheets->add(world, nullptr).iterator->second;
+ OwnPtr<UserStyleSheetVector>& styleSheetsInWorld = m_userStyleSheets->add(world, nullptr).iterator->value;
if (!styleSheetsInWorld)
styleSheetsInWorld = adoptPtr(new UserStyleSheetVector);
styleSheetsInWorld->append(userStyleSheet.release());
@@ -307,7 +307,7 @@ void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const KURL& ur
if (it == m_userScripts->end())
return;
- UserScriptVector* scripts = it->second.get();
+ UserScriptVector* scripts = it->value.get();
for (int i = scripts->size() - 1; i >= 0; --i) {
if (scripts->at(i)->url() == url)
scripts->remove(i);
@@ -329,7 +329,7 @@ void PageGroup::removeUserStyleSheetFromWorld(DOMWrapperWorld* world, const KURL
if (it == m_userStyleSheets->end())
return;
- UserStyleSheetVector* stylesheets = it->second.get();
+ UserStyleSheetVector* stylesheets = it->value.get();
for (int i = stylesheets->size() - 1; i >= 0; --i) {
if (stylesheets->at(i)->url() == url) {
stylesheets->remove(i);
diff --git a/Source/WebCore/page/PageGroup.h b/Source/WebCore/page/PageGroup.h
index 98c51dd59..7d2ddfaf1 100644
--- a/Source/WebCore/page/PageGroup.h
+++ b/Source/WebCore/page/PageGroup.h
@@ -83,10 +83,10 @@ namespace WebCore {
bool hasLocalStorage() { return m_localStorage; }
void addUserScriptToWorld(DOMWrapperWorld*, const String& source, const KURL&,
- PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
+ const Vector<String>& whitelist, const Vector<String>& blacklist,
UserScriptInjectionTime, UserContentInjectedFrames);
void addUserStyleSheetToWorld(DOMWrapperWorld*, const String& source, const KURL&,
- PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
+ const Vector<String>& whitelist, const Vector<String>& blacklist,
UserContentInjectedFrames,
UserStyleLevel level = UserStyleUserLevel,
UserStyleInjectionTime injectionTime = InjectInExistingDocuments);
diff --git a/Source/WebCore/page/PagePopupClient.cpp b/Source/WebCore/page/PagePopupClient.cpp
index 5b666ea45..7dab828b7 100644
--- a/Source/WebCore/page/PagePopupClient.cpp
+++ b/Source/WebCore/page/PagePopupClient.cpp
@@ -61,6 +61,14 @@ void PagePopupClient::addProperty(const char* name, const String& value, Documen
addLiteral(",\n", writer);
}
+void PagePopupClient::addProperty(const char* name, int value, DocumentWriter& writer)
+{
+ writer.addData(name, strlen(name));
+ addLiteral(": ", writer);
+ addString(String::number(value), writer);
+ addLiteral(",\n", writer);
+}
+
void PagePopupClient::addProperty(const char* name, unsigned value, DocumentWriter& writer)
{
writer.addData(name, strlen(name));
@@ -92,6 +100,17 @@ void PagePopupClient::addProperty(const char* name, const Vector<String>& values
addLiteral("],\n", writer);
}
+void PagePopupClient::addProperty(const char* name, const IntRect& rect, DocumentWriter& writer)
+{
+ writer.addData(name, strlen(name));
+ addLiteral(": {", writer);
+ addProperty("x", rect.x(), writer);
+ addProperty("y", rect.y(), writer);
+ addProperty("width", rect.width(), writer);
+ addProperty("height", rect.height(), writer);
+ addLiteral("},\n", writer);
+}
+
} // namespace WebCore
#endif // ENABLE(PAGE_POPUP)
diff --git a/Source/WebCore/page/PagePopupClient.h b/Source/WebCore/page/PagePopupClient.h
index 02aee3225..d0fb4bb56 100644
--- a/Source/WebCore/page/PagePopupClient.h
+++ b/Source/WebCore/page/PagePopupClient.h
@@ -34,12 +34,13 @@
#if ENABLE(PAGE_POPUP)
#include "DocumentWriter.h"
-#include "IntSize.h"
+#include "IntRect.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
class DocumentWriter;
+class Localizer;
class PagePopupClient {
public:
@@ -52,6 +53,9 @@ public:
// - window.setValueAndClosePopup(number, string).
virtual void writeDocument(DocumentWriter&) = 0;
+ // Returns a Localizer object associated to the client.
+ virtual Localizer& localizer() = 0;
+
// This is called by the content HTML of a PagePopup.
// An implementation of this function should call ChromeClient::closePagePopup().
virtual void setValueAndClosePopup(int numValue, const String& stringValue) = 0;
@@ -65,9 +69,11 @@ public:
static void addString(const String&, DocumentWriter&);
static void addJavaScriptString(const String&, DocumentWriter&);
static void addProperty(const char* name, const String& value, DocumentWriter&);
+ static void addProperty(const char* name, int value, DocumentWriter&);
static void addProperty(const char* name, unsigned value, DocumentWriter&);
static void addProperty(const char* name, bool value, DocumentWriter&);
static void addProperty(const char* name, const Vector<String>& values, DocumentWriter&);
+ static void addProperty(const char* name, const IntRect&, DocumentWriter&);
};
inline void PagePopupClient::addString(const String& str, DocumentWriter& writer)
diff --git a/Source/WebCore/page/PagePopupController.cpp b/Source/WebCore/page/PagePopupController.cpp
index 8ee36536b..24e4b349e 100644
--- a/Source/WebCore/page/PagePopupController.cpp
+++ b/Source/WebCore/page/PagePopupController.cpp
@@ -32,7 +32,7 @@
#include "PagePopupController.h"
#if ENABLE(PAGE_POPUP)
-#include "LocalizedNumber.h"
+#include "Localizer.h"
#include "PagePopupClient.h"
namespace WebCore {
@@ -55,7 +55,7 @@ void PagePopupController::setValueAndClosePopup(int numValue, const String& stri
String PagePopupController::localizeNumberString(const String& numberString)
{
- return convertToLocalizedNumber(numberString);
+ return m_popupClient->localizer().convertToLocalizedNumber(numberString);
}
}
diff --git a/Source/WebCore/page/PagePopupController.idl b/Source/WebCore/page/PagePopupController.idl
index d0669efe5..b2350bfec 100644
--- a/Source/WebCore/page/PagePopupController.idl
+++ b/Source/WebCore/page/PagePopupController.idl
@@ -28,11 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
- interface [
- Conditional=PAGE_POPUP
- ] PagePopupController {
- void setValueAndClosePopup(in long numberValue, in DOMString stringValue);
- DOMString localizeNumberString(in DOMString numberString);
- };
-}
+[
+ Conditional=PAGE_POPUP
+] interface PagePopupController {
+ void setValueAndClosePopup(in long numberValue, in DOMString stringValue);
+ DOMString localizeNumberString(in DOMString numberString);
+};
diff --git a/Source/WebCore/page/PageSerializer.cpp b/Source/WebCore/page/PageSerializer.cpp
index c911d54a9..23aadb32f 100644
--- a/Source/WebCore/page/PageSerializer.cpp
+++ b/Source/WebCore/page/PageSerializer.cpp
@@ -267,7 +267,7 @@ void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KUR
Document* document = styleSheet->ownerDocument();
// Some rules have resources associated with them that we need to retrieve.
if (rule->isImportRule()) {
- CSSImportRule* importRule = static_cast<CSSImportRule*>(rule);
+ CSSImportRule* importRule = static_cast<CSSImportRule*>(rule);
KURL importURL = document->completeURL(importRule->href());
if (m_resourceURLs.contains(importURL))
continue;
@@ -298,8 +298,14 @@ void PageSerializer::addImageToResources(CachedImage* image, RenderObject* image
if (!image || image->image() == Image::nullImage())
return;
+ RefPtr<SharedBuffer> data = imageRenderer ? image->imageForRenderer(imageRenderer)->data() : image->image()->data();
+ if (!data) {
+ // SVG images don't return data at this point. Bug 99102.
+ LOG_ERROR("No data for image %s", url.string().utf8().data());
+ return;
+ }
String mimeType = image->response().mimeType();
- m_resources->append(Resource(url, mimeType, imageRenderer ? image->imageForRenderer(imageRenderer)->data() : image->image()->data()));
+ m_resources->append(Resource(url, mimeType, data));
m_resourceURLs.add(url);
}
@@ -339,7 +345,7 @@ KURL PageSerializer::urlForBlankFrame(Frame* frame)
{
HashMap<Frame*, KURL>::iterator iter = m_blankFrameURLs.find(frame);
if (iter != m_blankFrameURLs.end())
- return iter->second;
+ return iter->value;
String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
KURL fakeURL(ParsedURLString, url);
m_blankFrameURLs.add(frame, fakeURL);
diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp
index 903393021..bff1b5361 100644
--- a/Source/WebCore/page/Performance.cpp
+++ b/Source/WebCore/page/Performance.cpp
@@ -165,9 +165,9 @@ EventTargetData* Performance::ensureEventTargetData()
return &m_eventTargetData;
}
-double Performance::webkitNow() const
+double Performance::now() const
{
- return 1000.0 * m_frame->document()->loader()->timing()->convertMonotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime());
+ return 1000.0 * m_frame->document()->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime());
}
} // namespace WebCore
diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h
index 8ba8c5eea..7c270ce0d 100644
--- a/Source/WebCore/page/Performance.h
+++ b/Source/WebCore/page/Performance.h
@@ -61,7 +61,7 @@ public:
PassRefPtr<MemoryInfo> memory() const;
PerformanceNavigation* navigation() const;
PerformanceTiming* timing() const;
- double webkitNow() const;
+ double now() const;
#if ENABLE(PERFORMANCE_TIMELINE)
PassRefPtr<PerformanceEntryList> webkitGetEntries() const;
diff --git a/Source/WebCore/page/Performance.idl b/Source/WebCore/page/Performance.idl
index fc9ffdf1f..c32cf328e 100644
--- a/Source/WebCore/page/Performance.idl
+++ b/Source/WebCore/page/Performance.idl
@@ -28,32 +28,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
-
- // See: http://dev.w3.org/2006/webapi/WebTiming/
- interface [
- Conditional=WEB_TIMING,
- EventTarget,
- OmitConstructor
- ] Performance {
- readonly attribute PerformanceNavigation navigation;
- readonly attribute PerformanceTiming timing;
- readonly attribute [V8CustomGetter] MemoryInfo memory;
+// See: http://dev.w3.org/2006/webapi/WebTiming/
+[
+ Conditional=WEB_TIMING,
+ EventTarget,
+ OmitConstructor
+] interface Performance {
+ readonly attribute PerformanceNavigation navigation;
+ readonly attribute PerformanceTiming timing;
+ [V8CustomGetter] readonly attribute MemoryInfo memory;
#if defined(ENABLE_PERFORMANCE_TIMELINE) && ENABLE_PERFORMANCE_TIMELINE
- PerformanceEntryList webkitGetEntries();
- PerformanceEntryList webkitGetEntriesByType(in DOMString entryType);
- PerformanceEntryList webkitGetEntriesByName(in DOMString name, in [Optional=DefaultIsNullString] DOMString entryType);
+ PerformanceEntryList webkitGetEntries();
+ PerformanceEntryList webkitGetEntriesByType(in DOMString entryType);
+ PerformanceEntryList webkitGetEntriesByName(in DOMString name, in [Optional=DefaultIsNullString] DOMString entryType);
#endif
#if defined(ENABLE_RESOURCE_TIMING) && ENABLE_RESOURCE_TIMING
- void webkitClearResourceTimings();
- void webkitSetResourceTimingBufferSize(in unsigned long maxSize);
+ void webkitClearResourceTimings();
+ void webkitSetResourceTimingBufferSize(in unsigned long maxSize);
- attribute EventListener onwebkitresourcetimingbufferfull;
+ attribute EventListener onwebkitresourcetimingbufferfull;
#endif
- // See http://www.w3.org/TR/hr-time/ for details.
- double webkitNow();
- };
+ // See http://www.w3.org/TR/hr-time/ for details.
+ double now();
+};
-}
diff --git a/Source/WebCore/page/PerformanceEntry.idl b/Source/WebCore/page/PerformanceEntry.idl
index 9e10fe0bf..ff38ded7c 100644
--- a/Source/WebCore/page/PerformanceEntry.idl
+++ b/Source/WebCore/page/PerformanceEntry.idl
@@ -28,18 +28,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
-
- // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
- interface [
- Conditional=WEB_TIMING,
- Conditional=PERFORMANCE_TIMELINE,
- CustomToJSObject,
- OmitConstructor
- ] PerformanceEntry {
- readonly attribute DOMString name;
- readonly attribute DOMString entryType;
- readonly attribute double startTime;
- readonly attribute double duration;
- };
-}
+// See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
+[
+ Conditional=WEB_TIMING,
+ Conditional=PERFORMANCE_TIMELINE,
+ CustomToJSObject,
+ OmitConstructor
+] interface PerformanceEntry {
+ readonly attribute DOMString name;
+ readonly attribute DOMString entryType;
+ readonly attribute double startTime;
+ readonly attribute double duration;
+};
diff --git a/Source/WebCore/page/PerformanceEntryList.idl b/Source/WebCore/page/PerformanceEntryList.idl
index 8be43d576..9226541c8 100644
--- a/Source/WebCore/page/PerformanceEntryList.idl
+++ b/Source/WebCore/page/PerformanceEntryList.idl
@@ -28,17 +28,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+// See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
+[
+ Conditional=WEB_TIMING,
+ Conditional=PERFORMANCE_TIMELINE,
+ OmitConstructor,
+ IndexedGetter
+] interface PerformanceEntryList {
+ readonly attribute unsigned long length;
+ PerformanceEntry item(in unsigned long index);
+};
- // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
- interface [
- Conditional=WEB_TIMING,
- Conditional=PERFORMANCE_TIMELINE,
- OmitConstructor,
- IndexedGetter
- ] PerformanceEntryList {
- readonly attribute unsigned long length;
- PerformanceEntry item(in unsigned long index);
- };
-
-}
diff --git a/Source/WebCore/page/PerformanceNavigation.idl b/Source/WebCore/page/PerformanceNavigation.idl
index 4c6b612ef..e9add4cb5 100644
--- a/Source/WebCore/page/PerformanceNavigation.idl
+++ b/Source/WebCore/page/PerformanceNavigation.idl
@@ -28,20 +28,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+// See: http://www.w3.org/TR/navigation-timing/
+[
+ Conditional=WEB_TIMING,
+ OmitConstructor
+] interface PerformanceNavigation {
+ const unsigned short TYPE_NAVIGATE = 0;
+ const unsigned short TYPE_RELOAD = 1;
+ const unsigned short TYPE_BACK_FORWARD = 2;
+ const unsigned short TYPE_RESERVED = 255;
+ readonly attribute unsigned short type;
- // See: http://www.w3.org/TR/navigation-timing/
- interface [
- Conditional=WEB_TIMING,
- OmitConstructor
- ] PerformanceNavigation {
- const unsigned short TYPE_NAVIGATE = 0;
- const unsigned short TYPE_RELOAD = 1;
- const unsigned short TYPE_BACK_FORWARD = 2;
- const unsigned short TYPE_RESERVED = 255;
- readonly attribute unsigned short type;
+ readonly attribute unsigned short redirectCount;
+};
- readonly attribute unsigned short redirectCount;
- };
-
-}
diff --git a/Source/WebCore/page/PerformanceResourceTiming.idl b/Source/WebCore/page/PerformanceResourceTiming.idl
index 3e0ad59ce..b5d6053b2 100644
--- a/Source/WebCore/page/PerformanceResourceTiming.idl
+++ b/Source/WebCore/page/PerformanceResourceTiming.idl
@@ -28,25 +28,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+// See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html
+[
+ Conditional=RESOURCE_TIMING,
+ OmitConstructor
+] interface PerformanceResourceTiming : PerformanceEntry {
+ readonly attribute DOMString initiatorType;
- // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html
- interface [
- Conditional=RESOURCE_TIMING,
- OmitConstructor
- ] PerformanceResourceTiming : PerformanceEntry {
- readonly attribute DOMString initiatorType;
-
- readonly attribute double redirectStart;
- readonly attribute double redirectEnd;
- readonly attribute double fetchStart;
- readonly attribute double domainLookupStart;
- readonly attribute double domainLookupEnd;
- readonly attribute double connectStart;
- readonly attribute double connectEnd;
- readonly attribute double secureConnectionStart;
- readonly attribute double requestStart;
- readonly attribute double responseStart;
- readonly attribute double responseEnd;
- };
-}
+ readonly attribute double redirectStart;
+ readonly attribute double redirectEnd;
+ readonly attribute double fetchStart;
+ readonly attribute double domainLookupStart;
+ readonly attribute double domainLookupEnd;
+ readonly attribute double connectStart;
+ readonly attribute double connectEnd;
+ readonly attribute double secureConnectionStart;
+ readonly attribute double requestStart;
+ readonly attribute double responseStart;
+ readonly attribute double responseEnd;
+};
diff --git a/Source/WebCore/page/PerformanceTiming.cpp b/Source/WebCore/page/PerformanceTiming.cpp
index 6a4524b09..4a0c0bd74 100644
--- a/Source/WebCore/page/PerformanceTiming.cpp
+++ b/Source/WebCore/page/PerformanceTiming.cpp
@@ -61,7 +61,7 @@ unsigned long long PerformanceTiming::navigationStart() const
if (!timing)
return 0;
- return toIntegerMilliseconds(timing->navigationStart());
+ return monotonicTimeToIntegerMilliseconds(timing->navigationStart());
}
unsigned long long PerformanceTiming::unloadEventStart() const
@@ -73,7 +73,7 @@ unsigned long long PerformanceTiming::unloadEventStart() const
if (timing->hasCrossOriginRedirect() || !timing->hasSameOriginAsPreviousDocument())
return 0;
- return toIntegerMilliseconds(timing->unloadEventStart());
+ return monotonicTimeToIntegerMilliseconds(timing->unloadEventStart());
}
unsigned long long PerformanceTiming::unloadEventEnd() const
@@ -85,7 +85,7 @@ unsigned long long PerformanceTiming::unloadEventEnd() const
if (timing->hasCrossOriginRedirect() || !timing->hasSameOriginAsPreviousDocument())
return 0;
- return toIntegerMilliseconds(timing->unloadEventEnd());
+ return monotonicTimeToIntegerMilliseconds(timing->unloadEventEnd());
}
unsigned long long PerformanceTiming::redirectStart() const
@@ -97,7 +97,7 @@ unsigned long long PerformanceTiming::redirectStart() const
if (timing->hasCrossOriginRedirect())
return 0;
- return toIntegerMilliseconds(timing->redirectStart());
+ return monotonicTimeToIntegerMilliseconds(timing->redirectStart());
}
unsigned long long PerformanceTiming::redirectEnd() const
@@ -109,7 +109,7 @@ unsigned long long PerformanceTiming::redirectEnd() const
if (timing->hasCrossOriginRedirect())
return 0;
- return toIntegerMilliseconds(timing->redirectEnd());
+ return monotonicTimeToIntegerMilliseconds(timing->redirectEnd());
}
unsigned long long PerformanceTiming::fetchStart() const
@@ -118,7 +118,7 @@ unsigned long long PerformanceTiming::fetchStart() const
if (!timing)
return 0;
- return toIntegerMilliseconds(timing->fetchStart());
+ return monotonicTimeToIntegerMilliseconds(timing->fetchStart());
}
unsigned long long PerformanceTiming::domainLookupStart() const
@@ -243,7 +243,7 @@ unsigned long long PerformanceTiming::responseEnd() const
if (!timing)
return 0;
- return toIntegerMilliseconds(timing->responseEnd());
+ return monotonicTimeToIntegerMilliseconds(timing->responseEnd());
}
unsigned long long PerformanceTiming::domLoading() const
@@ -297,7 +297,7 @@ unsigned long long PerformanceTiming::loadEventStart() const
if (!timing)
return 0;
- return toIntegerMilliseconds(timing->loadEventStart());
+ return monotonicTimeToIntegerMilliseconds(timing->loadEventStart());
}
unsigned long long PerformanceTiming::loadEventEnd() const
@@ -306,7 +306,7 @@ unsigned long long PerformanceTiming::loadEventEnd() const
if (!timing)
return 0;
- return toIntegerMilliseconds(timing->loadEventEnd());
+ return monotonicTimeToIntegerMilliseconds(timing->loadEventEnd());
}
DocumentLoader* PerformanceTiming::documentLoader() const
@@ -352,7 +352,7 @@ unsigned long long PerformanceTiming::resourceLoadTimeRelativeToAbsolute(int rel
ASSERT(relativeMilliseconds >= 0);
ResourceLoadTiming* resourceTiming = resourceLoadTiming();
ASSERT(resourceTiming);
- return toIntegerMilliseconds(resourceTiming->convertResourceLoadTimeToDocumentTime(documentLoadTiming(), relativeMilliseconds));
+ return monotonicTimeToIntegerMilliseconds(resourceTiming->convertResourceLoadTimeToMonotonicTime(relativeMilliseconds));
}
unsigned long long PerformanceTiming::monotonicTimeToIntegerMilliseconds(double monotonicSeconds) const
@@ -360,7 +360,7 @@ unsigned long long PerformanceTiming::monotonicTimeToIntegerMilliseconds(double
ASSERT(monotonicSeconds >= 0);
const DocumentLoadTiming* timing = documentLoadTiming();
ASSERT(timing);
- return toIntegerMilliseconds(timing->convertMonotonicTimeToDocumentTime(monotonicSeconds));
+ return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonicSeconds));
}
} // namespace WebCore
diff --git a/Source/WebCore/page/PerformanceTiming.idl b/Source/WebCore/page/PerformanceTiming.idl
index 3e14f7c44..ea823aa82 100644
--- a/Source/WebCore/page/PerformanceTiming.idl
+++ b/Source/WebCore/page/PerformanceTiming.idl
@@ -28,34 +28,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+// See: http://dev.w3.org/2006/webapi/WebTiming/
+[
+ Conditional=WEB_TIMING,
+ OmitConstructor
+] interface PerformanceTiming {
+ readonly attribute unsigned long long navigationStart;
+ readonly attribute unsigned long long unloadEventStart;
+ readonly attribute unsigned long long unloadEventEnd;
+ readonly attribute unsigned long long redirectStart;
+ readonly attribute unsigned long long redirectEnd;
+ readonly attribute unsigned long long fetchStart;
+ readonly attribute unsigned long long domainLookupStart;
+ readonly attribute unsigned long long domainLookupEnd;
+ readonly attribute unsigned long long connectStart;
+ readonly attribute unsigned long long connectEnd;
+ readonly attribute unsigned long long secureConnectionStart;
+ readonly attribute unsigned long long requestStart;
+ readonly attribute unsigned long long responseStart;
+ readonly attribute unsigned long long responseEnd;
+ readonly attribute unsigned long long domLoading;
+ readonly attribute unsigned long long domInteractive;
+ readonly attribute unsigned long long domContentLoadedEventStart;
+ readonly attribute unsigned long long domContentLoadedEventEnd;
+ readonly attribute unsigned long long domComplete;
+ readonly attribute unsigned long long loadEventStart;
+ readonly attribute unsigned long long loadEventEnd;
+};
- // See: http://dev.w3.org/2006/webapi/WebTiming/
- interface [
- Conditional=WEB_TIMING,
- OmitConstructor
- ] PerformanceTiming {
- readonly attribute unsigned long long navigationStart;
- readonly attribute unsigned long long unloadEventStart;
- readonly attribute unsigned long long unloadEventEnd;
- readonly attribute unsigned long long redirectStart;
- readonly attribute unsigned long long redirectEnd;
- readonly attribute unsigned long long fetchStart;
- readonly attribute unsigned long long domainLookupStart;
- readonly attribute unsigned long long domainLookupEnd;
- readonly attribute unsigned long long connectStart;
- readonly attribute unsigned long long connectEnd;
- readonly attribute unsigned long long secureConnectionStart;
- readonly attribute unsigned long long requestStart;
- readonly attribute unsigned long long responseStart;
- readonly attribute unsigned long long responseEnd;
- readonly attribute unsigned long long domLoading;
- readonly attribute unsigned long long domInteractive;
- readonly attribute unsigned long long domContentLoadedEventStart;
- readonly attribute unsigned long long domContentLoadedEventEnd;
- readonly attribute unsigned long long domComplete;
- readonly attribute unsigned long long loadEventStart;
- readonly attribute unsigned long long loadEventEnd;
- };
-
-}
diff --git a/Source/WebCore/page/Screen.idl b/Source/WebCore/page/Screen.idl
index 588060914..ee3cc30ae 100644
--- a/Source/WebCore/page/Screen.idl
+++ b/Source/WebCore/page/Screen.idl
@@ -27,20 +27,17 @@
*/
-module window {
+[
+ JSGenerateIsReachable=ImplFrame,
+ OmitConstructor
+] interface Screen {
+ readonly attribute unsigned long height;
+ readonly attribute unsigned long width;
+ readonly attribute unsigned long colorDepth;
+ readonly attribute unsigned long pixelDepth;
+ readonly attribute long availLeft;
+ readonly attribute long availTop;
+ readonly attribute unsigned long availHeight;
+ readonly attribute unsigned long availWidth;
+};
- interface [
- JSGenerateIsReachable=ImplFrame,
- OmitConstructor
- ] Screen {
- readonly attribute unsigned long height;
- readonly attribute unsigned long width;
- readonly attribute unsigned long colorDepth;
- readonly attribute unsigned long pixelDepth;
- readonly attribute long availLeft;
- readonly attribute long availTop;
- readonly attribute unsigned long availHeight;
- readonly attribute unsigned long availWidth;
- };
-
-}
diff --git a/Source/WebCore/page/SecurityOrigin.cpp b/Source/WebCore/page/SecurityOrigin.cpp
index da15021bd..d53750a17 100644
--- a/Source/WebCore/page/SecurityOrigin.cpp
+++ b/Source/WebCore/page/SecurityOrigin.cpp
@@ -427,11 +427,6 @@ void SecurityOrigin::grantLoadLocalResources()
// is a security hazard because the documents without the privilege can
// obtain the privilege by injecting script into the documents that have
// been granted the privilege.
- //
- // To be backwards compatible with older versions of WebKit, we also use
- // this function to grant the ability to load local resources to documents
- // loaded with SubstituteData.
- ASSERT(isUnique() || SecurityPolicy::allowSubstituteDataAccessToLocal());
m_canLoadLocalResources = true;
}
diff --git a/Source/WebCore/page/SecurityPolicy.cpp b/Source/WebCore/page/SecurityPolicy.cpp
index c2a5ab114..5b36f4f71 100644
--- a/Source/WebCore/page/SecurityPolicy.cpp
+++ b/Source/WebCore/page/SecurityPolicy.cpp
@@ -133,9 +133,9 @@ void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceO
String sourceString = sourceOrigin.toString();
OriginAccessMap::AddResult result = originAccessMap().add(sourceString, nullptr);
if (result.isNewEntry)
- result.iterator->second = adoptPtr(new OriginAccessWhiteList);
+ result.iterator->value = adoptPtr(new OriginAccessWhiteList);
- OriginAccessWhiteList* list = result.iterator->second.get();
+ OriginAccessWhiteList* list = result.iterator->value.get();
list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains));
}
@@ -152,7 +152,7 @@ void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sour
if (it == map.end())
return;
- OriginAccessWhiteList* list = it->second.get();
+ OriginAccessWhiteList* list = it->value.get();
size_t index = list->find(OriginAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains));
if (index == notFound)
return;
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index 30666c561..9876af5c7 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -62,7 +62,7 @@ static inline void setGenericFontFamilyMap(ScriptFontFamilyMap& fontMap, const A
if (it == fontMap.end())
return;
fontMap.remove(it);
- } else if (it != fontMap.end() && it->second == family)
+ } else if (it != fontMap.end() && it->value == family)
return;
else
fontMap.set(static_cast<int>(script), family);
@@ -75,7 +75,7 @@ static inline const AtomicString& getGenericFontFamilyForScript(const ScriptFont
{
ScriptFontFamilyMap::const_iterator it = fontMap.find(static_cast<int>(script));
if (it != fontMap.end())
- return it->second;
+ return it->value;
if (script != USCRIPT_COMMON)
return getGenericFontFamilyForScript(fontMap, USCRIPT_COMMON);
return emptyAtom;
@@ -293,6 +293,8 @@ Settings::Settings(Page* page)
, m_windowFocusRestricted(true)
, m_diagnosticLoggingEnabled(false)
, m_scrollingPerformanceLoggingEnabled(false)
+ , m_applyPageScaleFactorInCompositor(false)
+ , m_plugInSnapshottingEnabled(false)
, m_setImageLoadingSettingsTimer(this, &Settings::imageLoadingSettingsTimerFired)
, m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
{
@@ -681,6 +683,26 @@ double Settings::minDOMTimerInterval()
return m_page->minimumTimerInterval();
}
+void Settings::setDefaultDOMTimerAlignmentInterval(double interval)
+{
+ DOMTimer::setDefaultTimerAlignmentInterval(interval);
+}
+
+double Settings::defaultDOMTimerAlignmentInterval()
+{
+ return DOMTimer::defaultTimerAlignmentInterval();
+}
+
+void Settings::setDOMTimerAlignmentInterval(double interval)
+{
+ m_page->setTimerAlignmentInterval(interval);
+}
+
+double Settings::domTimerAlignmentInterval() const
+{
+ return m_page->timerAlignmentInterval();
+}
+
void Settings::setUsesPageCache(bool usesPageCache)
{
if (m_usesPageCache == usesPageCache)
diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
index c18dfd730..89785d12f 100644
--- a/Source/WebCore/page/Settings.h
+++ b/Source/WebCore/page/Settings.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
* (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
@@ -254,6 +254,12 @@ namespace WebCore {
void setMinDOMTimerInterval(double); // Per-page; initialized to default value.
double minDOMTimerInterval();
+ static void setDefaultDOMTimerAlignmentInterval(double);
+ static double defaultDOMTimerAlignmentInterval();
+
+ void setDOMTimerAlignmentInterval(double);
+ double domTimerAlignmentInterval() const;
+
void setUsesPageCache(bool);
bool usesPageCache() const { return m_usesPageCache; }
@@ -633,6 +639,12 @@ namespace WebCore {
void setDiagnosticLoggingEnabled(bool enabled) { m_diagnosticLoggingEnabled = enabled; }
bool diagnosticLoggingEnabled() const { return m_diagnosticLoggingEnabled; }
+ void setApplyPageScaleFactorInCompositor(bool enabled) { m_applyPageScaleFactorInCompositor = enabled; }
+ bool applyPageScaleFactorInCompositor() const { return m_applyPageScaleFactorInCompositor; }
+
+ void setPlugInSnapshottingEnabled(bool enabled) { m_plugInSnapshottingEnabled = enabled; }
+ bool plugInSnapshottingEnabled() const { return m_plugInSnapshottingEnabled; }
+
private:
explicit Settings(Page*);
@@ -818,9 +830,12 @@ namespace WebCore {
bool m_scrollingPerformanceLoggingEnabled : 1;
+ bool m_applyPageScaleFactorInCompositor : 1;
+ bool m_plugInSnapshottingEnabled : 1;
+
Timer<Settings> m_setImageLoadingSettingsTimer;
void imageLoadingSettingsTimerFired(Timer<Settings>*);
-
+
double m_incrementalRenderingSuppressionTimeoutInSeconds;
#if USE(AVFOUNDATION)
diff --git a/Source/WebCore/page/SpeechInput.cpp b/Source/WebCore/page/SpeechInput.cpp
index 0128ef8a4..8328c5d4d 100644
--- a/Source/WebCore/page/SpeechInput.cpp
+++ b/Source/WebCore/page/SpeechInput.cpp
@@ -62,7 +62,7 @@ int SpeechInput::registerListener(SpeechInputListener* listener)
#if defined(DEBUG)
// Check if already present.
for (HashMap<int, SpeechInputListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
- ASSERT(it->second != listener);
+ ASSERT(it->value != listener);
#endif
m_listeners.add(m_nextListenerId, listener);
diff --git a/Source/WebCore/page/SpeechInputEvent.idl b/Source/WebCore/page/SpeechInputEvent.idl
index 03846af14..be82107d1 100644
--- a/Source/WebCore/page/SpeechInputEvent.idl
+++ b/Source/WebCore/page/SpeechInputEvent.idl
@@ -23,12 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module core {
+[
+ Conditional=INPUT_SPEECH,
+] interface SpeechInputEvent : Event {
+ readonly attribute SpeechInputResultList results;
+};
- interface [
- Conditional=INPUT_SPEECH,
- ] SpeechInputEvent : Event {
- readonly attribute SpeechInputResultList results;
- };
-
-}
diff --git a/Source/WebCore/page/SpeechInputResult.idl b/Source/WebCore/page/SpeechInputResult.idl
index 3542c6056..ee1727089 100644
--- a/Source/WebCore/page/SpeechInputResult.idl
+++ b/Source/WebCore/page/SpeechInputResult.idl
@@ -23,13 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module core {
+[
+ Conditional=INPUT_SPEECH,
+] interface SpeechInputResult {
+ readonly attribute DOMString utterance;
+ readonly attribute float confidence;
+};
- interface [
- Conditional=INPUT_SPEECH,
- ] SpeechInputResult {
- readonly attribute DOMString utterance;
- readonly attribute float confidence;
- };
-
-}
diff --git a/Source/WebCore/page/SpeechInputResultList.idl b/Source/WebCore/page/SpeechInputResultList.idl
index b9213d002..79357cdad 100644
--- a/Source/WebCore/page/SpeechInputResultList.idl
+++ b/Source/WebCore/page/SpeechInputResultList.idl
@@ -23,14 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module core {
+[
+ IndexedGetter,
+ Conditional=INPUT_SPEECH
+] interface SpeechInputResultList {
+ readonly attribute unsigned long length;
+ SpeechInputResult item(in [IsIndex] unsigned long index);
+};
- interface [
- IndexedGetter,
- Conditional=INPUT_SPEECH
- ] SpeechInputResultList {
- readonly attribute unsigned long length;
- SpeechInputResult item(in [IsIndex] unsigned long index);
- };
-
-}
diff --git a/Source/WebCore/page/SuspendableTimer.cpp b/Source/WebCore/page/SuspendableTimer.cpp
index dd3e89f18..15e56280f 100644
--- a/Source/WebCore/page/SuspendableTimer.cpp
+++ b/Source/WebCore/page/SuspendableTimer.cpp
@@ -64,7 +64,7 @@ void SuspendableTimer::suspend(ReasonForSuspension)
#endif
m_active = isActive();
if (m_active) {
- m_nextFireInterval = nextFireInterval();
+ m_nextFireInterval = nextUnalignedFireInterval();
m_repeatInterval = repeatInterval();
TimerBase::stop();
}
diff --git a/Source/WebCore/page/TouchDisambiguation.cpp b/Source/WebCore/page/TouchDisambiguation.cpp
index 54319a6a4..b582338c2 100644
--- a/Source/WebCore/page/TouchDisambiguation.cpp
+++ b/Source/WebCore/page/TouchDisambiguation.cpp
@@ -106,7 +106,7 @@ void findGoodTouchTargets(const IntRect& touchBox, Frame* mainFrame, float pageS
if (node->isDocumentNode() || node->hasTagName(HTMLNames::htmlTag) || node->hasTagName(HTMLNames::bodyTag))
break;
if (node->willRespondToMouseClickEvents()) {
- TouchTargetData& targetData = touchTargets.add(node, TouchTargetData()).iterator->second;
+ TouchTargetData& targetData = touchTargets.add(node, TouchTargetData()).iterator->value;
targetData.windowBoundingBox = boundingBoxForEventNodes(node);
targetData.score = scoreTouchTarget(touchPoint, touchPointPadding, targetData.windowBoundingBox);
bestScore = max(bestScore, targetData.score);
@@ -118,9 +118,9 @@ void findGoodTouchTargets(const IntRect& touchBox, Frame* mainFrame, float pageS
for (HashMap<Node*, TouchTargetData>::iterator it = touchTargets.begin(); it != touchTargets.end(); ++it) {
// Currently the scoring function uses the overlap area with the fat point as the score.
// We ignore the candidates that has less than 1/2 overlap (we consider not really ambiguous enough) than the best candidate to avoid excessive popups.
- if (it->second.score < bestScore * 0.5)
+ if (it->value.score < bestScore * 0.5)
continue;
- goodTargets.append(it->second.windowBoundingBox);
+ goodTargets.append(it->value.windowBoundingBox);
}
}
diff --git a/Source/WebCore/page/UserContentURLPattern.cpp b/Source/WebCore/page/UserContentURLPattern.cpp
index 676b65573..c7d819b0b 100644
--- a/Source/WebCore/page/UserContentURLPattern.cpp
+++ b/Source/WebCore/page/UserContentURLPattern.cpp
@@ -25,19 +25,21 @@
#include "config.h"
#include "UserContentURLPattern.h"
+
#include "KURL.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
-bool UserContentURLPattern::matchesPatterns(const KURL& url, const Vector<String>* whitelist, const Vector<String>* blacklist)
+bool UserContentURLPattern::matchesPatterns(const KURL& url, const Vector<String>& whitelist, const Vector<String>& blacklist)
{
// In order for a URL to be a match it has to be present in the whitelist and not present in the blacklist.
// If there is no whitelist at all, then all URLs are assumed to be in the whitelist.
- bool matchesWhitelist = !whitelist || whitelist->isEmpty();
+ bool matchesWhitelist = whitelist.isEmpty();
if (!matchesWhitelist) {
- for (unsigned i = 0; i < whitelist->size(); ++i) {
- UserContentURLPattern contentPattern(whitelist->at(i));
+ size_t whitelistSize = whitelist.size();
+ for (size_t i = 0; i < whitelistSize; ++i) {
+ UserContentURLPattern contentPattern(whitelist[i]);
if (contentPattern.matches(url)) {
matchesWhitelist = true;
break;
@@ -46,9 +48,10 @@ bool UserContentURLPattern::matchesPatterns(const KURL& url, const Vector<String
}
bool matchesBlacklist = false;
- if (blacklist) {
- for (unsigned i = 0; i < blacklist->size(); ++i) {
- UserContentURLPattern contentPattern(blacklist->at(i));
+ if (!blacklist.isEmpty()) {
+ size_t blacklistSize = blacklist.size();
+ for (size_t i = 0; i < blacklistSize; ++i) {
+ UserContentURLPattern contentPattern(blacklist[i]);
if (contentPattern.matches(url)) {
matchesBlacklist = true;
break;
diff --git a/Source/WebCore/page/UserContentURLPattern.h b/Source/WebCore/page/UserContentURLPattern.h
index 51d9fee33..0de055ef5 100644
--- a/Source/WebCore/page/UserContentURLPattern.h
+++ b/Source/WebCore/page/UserContentURLPattern.h
@@ -53,7 +53,7 @@ public:
bool matchSubdomains() const { return m_matchSubdomains; }
- static bool matchesPatterns(const KURL&, const Vector<String>* whitelist, const Vector<String>* blacklist);
+ static bool matchesPatterns(const KURL&, const Vector<String>& whitelist, const Vector<String>& blacklist);
private:
bool parse(const String& pattern);
diff --git a/Source/WebCore/page/UserScript.h b/Source/WebCore/page/UserScript.h
index 051409038..8bbfa49bb 100644
--- a/Source/WebCore/page/UserScript.h
+++ b/Source/WebCore/page/UserScript.h
@@ -29,18 +29,20 @@
#include "KURL.h"
#include "UserContentTypes.h"
#include "UserScriptTypes.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class UserScript {
- WTF_MAKE_NONCOPYABLE(UserScript); WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_FAST_ALLOCATED;
public:
- UserScript(const String& source, const KURL& url,
- PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
- UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)
+ UserScript()
+ : m_injectionTime(InjectAtDocumentStart)
+ , m_injectedFrames(InjectInAllFrames)
+ {
+ }
+
+ UserScript(const String& source, const KURL& url, const Vector<String>& whitelist, const Vector<String>& blacklist, UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)
: m_source(source)
, m_url(url)
, m_whitelist(whitelist)
@@ -52,16 +54,16 @@ public:
const String& source() const { return m_source; }
const KURL& url() const { return m_url; }
- const Vector<String>* whitelist() const { return m_whitelist.get(); }
- const Vector<String>* blacklist() const { return m_blacklist.get(); }
+ const Vector<String>& whitelist() const { return m_whitelist; }
+ const Vector<String>& blacklist() const { return m_blacklist; }
UserScriptInjectionTime injectionTime() const { return m_injectionTime; }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
private:
String m_source;
KURL m_url;
- OwnPtr<Vector<String> > m_whitelist;
- OwnPtr<Vector<String> > m_blacklist;
+ Vector<String> m_whitelist;
+ Vector<String> m_blacklist;
UserScriptInjectionTime m_injectionTime;
UserContentInjectedFrames m_injectedFrames;
};
diff --git a/Source/WebCore/page/UserStyleSheet.h b/Source/WebCore/page/UserStyleSheet.h
index 068df1ef6..fc67d7aca 100644
--- a/Source/WebCore/page/UserStyleSheet.h
+++ b/Source/WebCore/page/UserStyleSheet.h
@@ -29,18 +29,20 @@
#include "KURL.h"
#include "UserContentTypes.h"
#include "UserStyleSheetTypes.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class UserStyleSheet {
- WTF_MAKE_NONCOPYABLE(UserStyleSheet); WTF_MAKE_FAST_ALLOCATED;
+ WTF_MAKE_FAST_ALLOCATED;
public:
- UserStyleSheet(const String& source, const KURL& url,
- PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
- UserContentInjectedFrames injectedFrames, UserStyleLevel level)
+ UserStyleSheet()
+ : m_injectedFrames(InjectInAllFrames)
+ , m_level(UserStyleUserLevel)
+ {
+ }
+
+ UserStyleSheet(const String& source, const KURL& url, const Vector<String>& whitelist, const Vector<String>& blacklist, UserContentInjectedFrames injectedFrames, UserStyleLevel level)
: m_source(source)
, m_url(url)
, m_whitelist(whitelist)
@@ -52,16 +54,16 @@ public:
const String& source() const { return m_source; }
const KURL& url() const { return m_url; }
- const Vector<String>* whitelist() const { return m_whitelist.get(); }
- const Vector<String>* blacklist() const { return m_blacklist.get(); }
+ const Vector<String>& whitelist() const { return m_whitelist; }
+ const Vector<String>& blacklist() const { return m_blacklist; }
UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
UserStyleLevel level() const { return m_level; }
private:
String m_source;
KURL m_url;
- OwnPtr<Vector<String> > m_whitelist;
- OwnPtr<Vector<String> > m_blacklist;
+ Vector<String> m_whitelist;
+ Vector<String> m_blacklist;
UserContentInjectedFrames m_injectedFrames;
UserStyleLevel m_level;
};
diff --git a/Source/WebCore/page/WebKitAnimation.idl b/Source/WebCore/page/WebKitAnimation.idl
index 4d3cad26d..2618be085 100644
--- a/Source/WebCore/page/WebKitAnimation.idl
+++ b/Source/WebCore/page/WebKitAnimation.idl
@@ -26,33 +26,30 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module html {
+interface WebKitAnimation {
- interface WebKitAnimation {
+ readonly attribute DOMString name;
- readonly attribute DOMString name;
+ readonly attribute double duration;
+ attribute double elapsedTime;
- readonly attribute double duration;
- attribute double elapsedTime;
+ readonly attribute double delay;
+ [Custom] readonly attribute long iterationCount;
- readonly attribute double delay;
- readonly attribute [Custom] long iterationCount;
+ readonly attribute boolean paused;
+ readonly attribute boolean ended;
- readonly attribute boolean paused;
- readonly attribute boolean ended;
+ const unsigned short DIRECTION_NORMAL = 0;
+ const unsigned short DIRECTION_ALTERNATE = 1;
+ readonly attribute unsigned short direction;
- const unsigned short DIRECTION_NORMAL = 0;
- const unsigned short DIRECTION_ALTERNATE = 1;
- readonly attribute unsigned short direction;
+ const unsigned short FILL_NONE = 0;
+ const unsigned short FILL_BACKWARDS = 1;
+ const unsigned short FILL_FORWARDS = 2;
+ const unsigned short FILL_BOTH = 3;
+ readonly attribute unsigned short fillMode;
- const unsigned short FILL_NONE = 0;
- const unsigned short FILL_BACKWARDS = 1;
- const unsigned short FILL_FORWARDS = 2;
- const unsigned short FILL_BOTH = 3;
- readonly attribute unsigned short fillMode;
+ void play();
+ void pause();
+};
- void play();
- void pause();
- };
-
-}
diff --git a/Source/WebCore/page/WebKitAnimationList.idl b/Source/WebCore/page/WebKitAnimationList.idl
index ed305f792..cf2da14f1 100644
--- a/Source/WebCore/page/WebKitAnimationList.idl
+++ b/Source/WebCore/page/WebKitAnimationList.idl
@@ -23,13 +23,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module html {
+[
+ IndexedGetter
+] interface WebKitAnimationList {
+ readonly attribute unsigned long length;
+ WebKitAnimation item(in unsigned long index);
+};
- interface [
- IndexedGetter
- ] WebKitAnimationList {
- readonly attribute unsigned long length;
- WebKitAnimation item(in unsigned long index);
- };
-
-}
diff --git a/Source/WebCore/page/WebKitPoint.idl b/Source/WebCore/page/WebKitPoint.idl
index e44fd2104..7034eb46e 100644
--- a/Source/WebCore/page/WebKitPoint.idl
+++ b/Source/WebCore/page/WebKitPoint.idl
@@ -23,14 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module window {
+[
+ CustomConstructor,
+ ConstructorParameters=2
+] interface WebKitPoint {
+ attribute float x;
+ attribute float y;
+};
- interface [
- CustomConstructor,
- ConstructorParameters=2
- ] WebKitPoint {
- attribute float x;
- attribute float y;
- };
-
-}
diff --git a/Source/WebCore/page/WindowFeatures.cpp b/Source/WebCore/page/WindowFeatures.cpp
index 6cde9b5ef..7768a09cd 100644
--- a/Source/WebCore/page/WindowFeatures.cpp
+++ b/Source/WebCore/page/WindowFeatures.cpp
@@ -211,7 +211,7 @@ bool WindowFeatures::boolFeature(const DialogFeaturesMap& features, const char*
DialogFeaturesMap::const_iterator it = features.find(key);
if (it == features.end())
return defaultValue;
- const String& value = it->second;
+ const String& value = it->value;
return value.isNull() || value == "1" || value == "yes" || value == "on";
}
@@ -223,7 +223,7 @@ float WindowFeatures::floatFeature(const DialogFeaturesMap& features, const char
// FIXME: The toDouble function does not offer a way to tell "0q" from string with no digits in it: Both
// return the number 0 and false for ok. But "0q" should yield the minimum rather than the default.
bool ok;
- double parsedNumber = it->second.toDouble(&ok);
+ double parsedNumber = it->value.toDouble(&ok);
if ((parsedNumber == 0 && !ok) || isnan(parsedNumber))
return defaultValue;
if (parsedNumber < min || max <= min)
diff --git a/Source/WebCore/page/WorkerNavigator.idl b/Source/WebCore/page/WorkerNavigator.idl
index 819de09d6..c37e200af 100644
--- a/Source/WebCore/page/WorkerNavigator.idl
+++ b/Source/WebCore/page/WorkerNavigator.idl
@@ -26,20 +26,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-module threads {
+[
+ Conditional=WORKERS,
+ JSGenerateIsReachable=Impl,
+ JSNoStaticTables,
+ OmitConstructor
+] interface WorkerNavigator {
+ readonly attribute DOMString appName;
+ readonly attribute DOMString appVersion;
+ readonly attribute DOMString platform;
+ readonly attribute DOMString userAgent;
- interface [
- Conditional=WORKERS,
- JSGenerateIsReachable=Impl,
- JSNoStaticTables,
- OmitConstructor
- ] WorkerNavigator {
- readonly attribute DOMString appName;
- readonly attribute DOMString appVersion;
- readonly attribute DOMString platform;
- readonly attribute DOMString userAgent;
+ readonly attribute boolean onLine;
+};
- readonly attribute boolean onLine;
- };
-
-}
diff --git a/Source/WebCore/page/animation/AnimationController.cpp b/Source/WebCore/page/animation/AnimationController.cpp
index c49119e6a..5e0717e0a 100644
--- a/Source/WebCore/page/animation/AnimationController.cpp
+++ b/Source/WebCore/page/animation/AnimationController.cpp
@@ -93,14 +93,14 @@ double AnimationControllerPrivate::updateAnimations(SetChanged callSetChanged/*
RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
- CompositeAnimation* compAnim = it->second.get();
+ CompositeAnimation* compAnim = it->value.get();
if (!compAnim->suspended() && compAnim->hasAnimations()) {
double t = compAnim->timeToNextService();
if (t != -1 && (t < timeToNextService || timeToNextService == -1))
timeToNextService = t;
if (!timeToNextService) {
if (callSetChanged == CallSetChanged) {
- Node* node = it->first->node();
+ Node* node = it->key->node();
ASSERT(!node || (node->document() && !node->document()->inPageCache()));
node->setNeedsStyleRecalc(SyntheticStyleChange);
calledSetChanged = true;
@@ -292,9 +292,9 @@ void AnimationControllerPrivate::suspendAnimationsForDocument(Document* document
RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
- RenderObject* renderer = it->first;
+ RenderObject* renderer = it->key;
if (renderer->document() == document) {
- CompositeAnimation* compAnim = it->second.get();
+ CompositeAnimation* compAnim = it->value.get();
compAnim->suspendAnimations();
}
}
@@ -308,9 +308,9 @@ void AnimationControllerPrivate::resumeAnimationsForDocument(Document* document)
RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
- RenderObject* renderer = it->first;
+ RenderObject* renderer = it->key;
if (renderer->document() == document) {
- CompositeAnimation* compAnim = it->second.get();
+ CompositeAnimation* compAnim = it->value.get();
compAnim->resumeAnimations();
}
}
@@ -396,8 +396,8 @@ unsigned AnimationControllerPrivate::numberOfActiveAnimations(Document* document
RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
- RenderObject* renderer = it->first;
- CompositeAnimation* compAnim = it->second.get();
+ RenderObject* renderer = it->key;
+ CompositeAnimation* compAnim = it->value.get();
if (renderer->document() == document)
count += compAnim->numberOfActiveAnimations();
}
diff --git a/Source/WebCore/page/animation/CompositeAnimation.cpp b/Source/WebCore/page/animation/CompositeAnimation.cpp
index f35778189..0b0f379d5 100644
--- a/Source/WebCore/page/animation/CompositeAnimation.cpp
+++ b/Source/WebCore/page/animation/CompositeAnimation.cpp
@@ -58,7 +58,7 @@ void CompositeAnimation::clearRenderer()
// an animation callback (see https://bugs.webkit.org/show_bug.cgi?id=22052)
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* transition = it->second.get();
+ ImplicitAnimation* transition = it->value.get();
animationController()->animationWillBeRemoved(transition);
transition->clear();
}
@@ -67,7 +67,7 @@ void CompositeAnimation::clearRenderer()
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- KeyframeAnimation* anim = it->second.get();
+ KeyframeAnimation* anim = it->value.get();
animationController()->animationWillBeRemoved(anim);
anim->clear();
}
@@ -84,7 +84,7 @@ void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle*
// in the next loop and then toss the ones that didn't get marked.
CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it)
- it->second->setActive(false);
+ it->value->setActive(false);
RefPtr<RenderStyle> modifiedCurrentStyle;
@@ -181,7 +181,7 @@ void CompositeAnimation::updateTransitions(RenderObject* renderer, RenderStyle*
Vector<int> toBeRemoved;
end = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (!anim->active()) {
animationController()->animationWillBeRemoved(anim);
toBeRemoved.append(anim->animatingProperty());
@@ -207,13 +207,13 @@ void CompositeAnimation::updateKeyframeAnimations(RenderObject* renderer, Render
// The current and target animations are the same so we just need to toss any
// animation which is finished (postActive).
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it) {
- if (it->second->postActive())
- it->second->setIndex(-1);
+ if (it->value->postActive())
+ it->value->setIndex(-1);
}
} else {
// Mark all existing animations as no longer active.
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it)
- it->second->setIndex(-1);
+ it->value->setIndex(-1);
// Toss the animation order map.
m_keyframeAnimationOrderMap.clear();
@@ -262,7 +262,7 @@ void CompositeAnimation::updateKeyframeAnimations(RenderObject* renderer, Render
Vector<AtomicStringImpl*> animsToBeRemoved;
kfend = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != kfend; ++it) {
- KeyframeAnimation* keyframeAnim = it->second.get();
+ KeyframeAnimation* keyframeAnim = it->value.get();
if (keyframeAnim->index() < 0) {
animsToBeRemoved.append(keyframeAnim->name().impl());
animationController()->animationWillBeRemoved(keyframeAnim);
@@ -290,7 +290,7 @@ PassRefPtr<RenderStyle> CompositeAnimation::animate(RenderObject* renderer, Rend
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
- if (ImplicitAnimation* anim = it->second.get())
+ if (ImplicitAnimation* anim = it->value.get())
anim->animate(this, renderer, currentStyle, targetStyle, resultStyle);
}
}
@@ -312,7 +312,7 @@ PassRefPtr<RenderStyle> CompositeAnimation::getAnimatedStyle() const
RefPtr<RenderStyle> resultStyle;
CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
- if (ImplicitAnimation* implicitAnimation = it->second.get())
+ if (ImplicitAnimation* implicitAnimation = it->value.get())
implicitAnimation->getAnimatedStyle(resultStyle);
}
@@ -333,7 +333,7 @@ void CompositeAnimation::setAnimating(bool animating)
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* transition = it->second.get();
+ ImplicitAnimation* transition = it->value.get();
transition->setAnimating(animating);
}
}
@@ -341,7 +341,7 @@ void CompositeAnimation::setAnimating(bool animating)
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- KeyframeAnimation* anim = it->second.get();
+ KeyframeAnimation* anim = it->value.get();
anim->setAnimating(animating);
}
}
@@ -356,7 +356,7 @@ double CompositeAnimation::timeToNextService() const
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* transition = it->second.get();
+ ImplicitAnimation* transition = it->value.get();
double t = transition ? transition->timeToNextService() : -1;
if (t < minT || minT == -1)
minT = t;
@@ -368,7 +368,7 @@ double CompositeAnimation::timeToNextService() const
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- KeyframeAnimation* animation = it->second.get();
+ KeyframeAnimation* animation = it->value.get();
double t = animation ? animation->timeToNextService() : -1;
if (t < minT || minT == -1)
minT = t;
@@ -390,7 +390,7 @@ PassRefPtr<KeyframeAnimation> CompositeAnimation::getAnimationForProperty(CSSPro
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- RefPtr<KeyframeAnimation> anim = it->second;
+ RefPtr<KeyframeAnimation> anim = it->value;
if (anim->hasAnimationForProperty(property))
retval = anim;
}
@@ -410,14 +410,14 @@ void CompositeAnimation::suspendAnimations()
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- if (KeyframeAnimation* anim = it->second.get())
+ if (KeyframeAnimation* anim = it->value.get())
anim->updatePlayState(AnimPlayStatePaused);
}
}
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (anim && anim->hasStyle())
anim->updatePlayState(AnimPlayStatePaused);
}
@@ -435,7 +435,7 @@ void CompositeAnimation::resumeAnimations()
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- KeyframeAnimation* anim = it->second.get();
+ KeyframeAnimation* anim = it->value.get();
if (anim && anim->playStatePlaying())
anim->updatePlayState(AnimPlayStatePlaying);
}
@@ -444,7 +444,7 @@ void CompositeAnimation::resumeAnimations()
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (anim && anim->hasStyle())
anim->updatePlayState(AnimPlayStatePlaying);
}
@@ -456,7 +456,7 @@ void CompositeAnimation::overrideImplicitAnimations(CSSPropertyID property)
CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
if (!m_transitions.isEmpty()) {
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (anim && anim->animatingProperty() == property)
anim->setOverridden(true);
}
@@ -468,7 +468,7 @@ void CompositeAnimation::resumeOverriddenImplicitAnimations(CSSPropertyID proper
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator end = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != end; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (anim && anim->animatingProperty() == property)
anim->setOverridden(false);
}
@@ -481,7 +481,7 @@ bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool accele
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- KeyframeAnimation* anim = it->second.get();
+ KeyframeAnimation* anim = it->value.get();
if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow))
return true;
}
@@ -490,7 +490,7 @@ bool CompositeAnimation::isAnimatingProperty(CSSPropertyID property, bool accele
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (anim && anim->isAnimatingProperty(property, acceleratedOnly, isRunningNow))
return true;
}
@@ -556,7 +556,7 @@ unsigned CompositeAnimation::numberOfActiveAnimations() const
m_keyframeAnimations.checkConsistency();
AnimationNameMap::const_iterator animationsEnd = m_keyframeAnimations.end();
for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it != animationsEnd; ++it) {
- KeyframeAnimation* anim = it->second.get();
+ KeyframeAnimation* anim = it->value.get();
if (anim->running())
++count;
}
@@ -565,7 +565,7 @@ unsigned CompositeAnimation::numberOfActiveAnimations() const
if (!m_transitions.isEmpty()) {
CSSPropertyTransitionsMap::const_iterator transitionsEnd = m_transitions.end();
for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); it != transitionsEnd; ++it) {
- ImplicitAnimation* anim = it->second.get();
+ ImplicitAnimation* anim = it->value.get();
if (anim->running())
++count;
}
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
index a6018ba5d..b19bb13d9 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
@@ -36,7 +36,6 @@
#include "Region.h"
#include "RenderView.h"
#include "ScrollAnimator.h"
-#include "ScrollingTreeState.h"
#include <wtf/MainThread.h>
#if USE(ACCELERATED_COMPOSITING)
@@ -44,46 +43,44 @@
#endif
#if ENABLE(THREADED_SCROLLING)
-#include "ScrollingThread.h"
-#include "ScrollingTree.h"
-#include <wtf/Functional.h>
-#include <wtf/PassRefPtr.h>
+#include "ScrollingCoordinatorMac.h"
+#endif
+
+#if PLATFORM(CHROMIUM)
+#include "ScrollingCoordinatorChromium.h"
#endif
namespace WebCore {
+PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
+{
+#if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
+ return adoptRef(new ScrollingCoordinatorMac(page));
+#endif
+
+#if PLATFORM(CHROMIUM)
+ return adoptRef(new ScrollingCoordinatorChromium(page));
+#endif
+
+ return adoptRef(new ScrollingCoordinator(page));
+}
+
ScrollingCoordinator::ScrollingCoordinator(Page* page)
: m_page(page)
, m_forceMainThreadScrollLayerPositionUpdates(false)
-#if ENABLE(THREADED_SCROLLING)
- , m_scrollingTreeState(ScrollingTreeState::create())
- , m_scrollingTree(ScrollingTree::create(this))
- , m_scrollingTreeStateCommitterTimer(this, &ScrollingCoordinator::scrollingTreeStateCommitterTimerFired)
-#endif
- , m_private(0)
{
}
-void ScrollingCoordinator::pageDestroyed()
+ScrollingCoordinator::~ScrollingCoordinator()
{
- ASSERT(m_page);
- m_page = 0;
-
-#if ENABLE(THREADED_SCROLLING)
- m_scrollingTreeStateCommitterTimer.stop();
-
- // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
- ScrollingThread::dispatch(bind(&ScrollingTree::invalidate, m_scrollingTree.release()));
-#endif
+ ASSERT(!m_page);
}
-#if ENABLE(THREADED_SCROLLING)
-ScrollingTree* ScrollingCoordinator::scrollingTree() const
+void ScrollingCoordinator::pageDestroyed()
{
- ASSERT(m_scrollingTree);
- return m_scrollingTree.get();
+ ASSERT(m_page);
+ m_page = 0;
}
-#endif
bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView) const
{
@@ -105,7 +102,7 @@ bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView
#endif
}
-static Region computeNonFastScrollableRegion(Frame* frame, const IntPoint& frameLocation)
+Region ScrollingCoordinator::computeNonFastScrollableRegion(Frame* frame, const IntPoint& frameLocation)
{
Region nonFastScrollableRegion;
FrameView* frameView = frame->view();
@@ -147,41 +144,24 @@ static Region computeNonFastScrollableRegion(Frame* frame, const IntPoint& frame
return nonFastScrollableRegion;
}
-void ScrollingCoordinator::frameViewLayoutUpdated(FrameView* frameView)
+unsigned ScrollingCoordinator::computeCurrentWheelEventHandlerCount()
{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- // Compute the region of the page that we can't do fast scrolling for. This currently includes
- // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
- // frame view whose layout was updated is not the main frame.
- Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint());
- setNonFastScrollableRegion(nonFastScrollableRegion);
-
- if (!coordinatesScrollingForFrameView(frameView))
- return;
-
- ScrollParameters scrollParameters;
- scrollParameters.horizontalScrollElasticity = frameView->horizontalScrollElasticity();
- scrollParameters.verticalScrollElasticity = frameView->verticalScrollElasticity();
- scrollParameters.hasEnabledHorizontalScrollbar = frameView->horizontalScrollbar() && frameView->horizontalScrollbar()->enabled();
- scrollParameters.hasEnabledVerticalScrollbar = frameView->verticalScrollbar() && frameView->verticalScrollbar()->enabled();
- scrollParameters.horizontalScrollbarMode = frameView->horizontalScrollbarMode();
- scrollParameters.verticalScrollbarMode = frameView->verticalScrollbarMode();
+ unsigned wheelEventHandlerCount = 0;
- scrollParameters.scrollOrigin = frameView->scrollOrigin();
- scrollParameters.viewportRect = IntRect(IntPoint(), frameView->visibleContentRect().size());
- scrollParameters.contentsSize = frameView->contentsSize();
+ for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ if (frame->document())
+ wheelEventHandlerCount += frame->document()->wheelEventHandlerCount();
+ }
- setScrollParameters(scrollParameters);
+ return wheelEventHandlerCount;
}
-void ScrollingCoordinator::frameViewWheelEventHandlerCountChanged(FrameView*)
+void ScrollingCoordinator::frameViewWheelEventHandlerCountChanged(FrameView* frameView)
{
ASSERT(isMainThread());
ASSERT(m_page);
- recomputeWheelEventHandlerCount();
+ recomputeWheelEventHandlerCountForFrameView(frameView);
}
void ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange(FrameView* frameView)
@@ -206,7 +186,7 @@ void ScrollingCoordinator::frameViewFixedObjectsDidChange(FrameView* frameView)
updateShouldUpdateScrollLayerPositionOnMainThread();
}
-static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView)
+GraphicsLayer* ScrollingCoordinator::scrollLayerForFrameView(FrameView* frameView)
{
#if USE(ACCELERATED_COMPOSITING)
Frame* frame = frameView->frame();
@@ -232,53 +212,11 @@ void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView)
return;
frameViewLayoutUpdated(frameView);
- recomputeWheelEventHandlerCount();
+ recomputeWheelEventHandlerCountForFrameView(frameView);
updateShouldUpdateScrollLayerPositionOnMainThread();
- setScrollLayer(scrollLayerForFrameView(frameView));
-}
-
-bool ScrollingCoordinator::requestScrollPositionUpdate(FrameView* frameView, const IntPoint& scrollPosition)
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
- if (!coordinatesScrollingForFrameView(frameView))
- return false;
-
-#if ENABLE(THREADED_SCROLLING)
- if (frameView->frame()->document()->inPageCache()) {
- // If this frame view's document is being put into the page cache, we don't want to update our
- // main frame scroll position. Just let the FrameView think that we did.
- updateMainFrameScrollPosition(scrollPosition);
- return true;
- }
-
- m_scrollingTreeState->setRequestedScrollPosition(scrollPosition);
- scheduleTreeStateCommit();
- return true;
-#else
- UNUSED_PARAM(scrollPosition);
- return false;
-#endif
}
-bool ScrollingCoordinator::handleWheelEvent(FrameView*, const PlatformWheelEvent& wheelEvent)
-{
- ASSERT(isMainThread());
- ASSERT(m_page);
-
-#if ENABLE(THREADED_SCROLLING)
- if (m_scrollingTree->willWheelEventStartSwipeGesture(wheelEvent))
- return false;
-
- ScrollingThread::dispatch(bind(&ScrollingTree::handleWheelEvent, m_scrollingTree.get(), wheelEvent));
-#else
- UNUSED_PARAM(wheelEvent);
-#endif
- return true;
-}
-
-void ScrollingCoordinator::updateMainFrameScrollPosition(const IntPoint& scrollPosition)
+void ScrollingCoordinator::updateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll)
{
ASSERT(isMainThread());
@@ -289,49 +227,14 @@ void ScrollingCoordinator::updateMainFrameScrollPosition(const IntPoint& scrollP
if (!frameView)
return;
- frameView->setConstrainsScrollingToContentEdge(false);
- frameView->notifyScrollPositionChanged(scrollPosition);
- frameView->setConstrainsScrollingToContentEdge(true);
-}
-
-void ScrollingCoordinator::updateMainFrameScrollLayerPosition()
-{
-#if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
- ASSERT(isMainThread());
-
- if (!m_page)
- return;
-
- FrameView* frameView = m_page->mainFrame()->view();
- if (!frameView)
- return;
-
- if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
- scrollLayer->setPosition(-frameView->scrollPosition());
-#endif
-}
-
-void ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition()
-{
-#if USE(ACCELERATED_COMPOSITING) && ENABLE(THREADED_SCROLLING)
- ASSERT(isMainThread());
-
- if (!m_page)
- return;
-
- FrameView* frameView = m_page->mainFrame()->view();
- if (!frameView)
- return;
-
- IntPoint scrollPosition = m_scrollingTree->mainFrameScrollPosition();
+ bool oldProgrammaticScroll = frameView->inProgrammaticScroll();
+ frameView->setInProgrammaticScroll(programmaticScroll);
frameView->setConstrainsScrollingToContentEdge(false);
frameView->notifyScrollPositionChanged(scrollPosition);
frameView->setConstrainsScrollingToContentEdge(true);
- if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
- scrollLayer->setPosition(-frameView->scrollPosition());
-#endif
+ frameView->setInProgrammaticScroll(oldProgrammaticScroll);
}
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
@@ -350,16 +253,6 @@ void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase)
}
#endif
-void ScrollingCoordinator::recomputeWheelEventHandlerCount()
-{
- unsigned wheelEventHandlerCount = 0;
- for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- if (frame->document())
- wheelEventHandlerCount += frame->document()->wheelEventHandlerCount();
- }
- setWheelEventHandlerCount(wheelEventHandlerCount);
-}
-
bool ScrollingCoordinator::hasNonLayerFixedObjects(FrameView* frameView)
{
const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects();
@@ -410,104 +303,10 @@ void ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates(bool for
updateShouldUpdateScrollLayerPositionOnMainThread();
}
-#if ENABLE(THREADED_SCROLLING)
-void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
-{
- m_scrollingTreeState->setScrollLayer(scrollLayer);
- scheduleTreeStateCommit();
-}
-
-void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
-{
- m_scrollingTreeState->setNonFastScrollableRegion(region);
- scheduleTreeStateCommit();
-}
-
-void ScrollingCoordinator::setScrollParameters(const ScrollParameters& scrollParameters)
-{
- m_scrollingTreeState->setHorizontalScrollElasticity(scrollParameters.horizontalScrollElasticity);
- m_scrollingTreeState->setVerticalScrollElasticity(scrollParameters.verticalScrollElasticity);
- m_scrollingTreeState->setHasEnabledHorizontalScrollbar(scrollParameters.hasEnabledHorizontalScrollbar);
- m_scrollingTreeState->setHasEnabledVerticalScrollbar(scrollParameters.hasEnabledVerticalScrollbar);
- m_scrollingTreeState->setHorizontalScrollbarMode(scrollParameters.horizontalScrollbarMode);
- m_scrollingTreeState->setVerticalScrollbarMode(scrollParameters.verticalScrollbarMode);
-
- m_scrollingTreeState->setScrollOrigin(scrollParameters.scrollOrigin);
- m_scrollingTreeState->setViewportRect(scrollParameters.viewportRect);
- m_scrollingTreeState->setContentsSize(scrollParameters.contentsSize);
- scheduleTreeStateCommit();
-}
-
-
-void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
-{
- m_scrollingTreeState->setWheelEventHandlerCount(wheelEventHandlerCount);
- scheduleTreeStateCommit();
-}
-
-void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
-{
- // The FrameView's GraphicsLayer is likely to be out-of-synch with the PlatformLayer
- // at this point. So we'll update it before we switch back to main thread scrolling
- // in order to avoid layer positioning bugs.
- if (reasons)
- updateMainFrameScrollLayerPosition();
- m_scrollingTreeState->setShouldUpdateScrollLayerPositionOnMainThread(reasons);
- scheduleTreeStateCommit();
-}
-
-void ScrollingCoordinator::scheduleTreeStateCommit()
-{
- if (m_scrollingTreeStateCommitterTimer.isActive())
- return;
-
- if (!m_scrollingTreeState->hasChangedProperties())
- return;
-
- m_scrollingTreeStateCommitterTimer.startOneShot(0);
-}
-
-void ScrollingCoordinator::scrollingTreeStateCommitterTimerFired(Timer<ScrollingCoordinator>*)
-{
- commitTreeState();
-}
-
-void ScrollingCoordinator::commitTreeStateIfNeeded()
-{
- if (!m_scrollingTreeState->hasChangedProperties())
- return;
-
- commitTreeState();
- m_scrollingTreeStateCommitterTimer.stop();
-}
-
-void ScrollingCoordinator::commitTreeState()
-{
- ASSERT(m_scrollingTreeState->hasChangedProperties());
-
- OwnPtr<ScrollingTreeState> treeState = m_scrollingTreeState->commit();
- ScrollingThread::dispatch(bind(&ScrollingTree::commitNewTreeState, m_scrollingTree.get(), treeState.release()));
-}
-
-bool ScrollingCoordinator::supportsFixedPositionLayers() const
-{
- return false;
-}
-
-void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool)
-{
- // FIXME: Implement!
-}
-
-void ScrollingCoordinator::setLayerIsFixedToContainerLayer(GraphicsLayer*, bool)
-{
- // FIXME: Implement!
-}
-
-void ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLayer*)
+ScrollingNodeID ScrollingCoordinator::uniqueScrollLayerID()
{
- // FIXME: Implement.
+ static ScrollingNodeID uniqueScrollLayerID = 1;
+ return uniqueScrollLayerID++;
}
-#endif // !ENABLE(THREADED_SCROLLING)
} // namespace WebCore
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
index 110ed9393..fdbbc7374 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
@@ -34,6 +34,7 @@
#include <wtf/Forward.h>
#if ENABLE(THREADED_SCROLLING)
+#include <wtf/HashMap.h>
#include <wtf/ThreadSafeRefCounted.h>
#include <wtf/Threading.h>
#endif
@@ -45,14 +46,17 @@
namespace WebCore {
typedef unsigned MainThreadScrollingReasons;
+typedef uint64_t ScrollingNodeID;
+class Frame;
class FrameView;
class GraphicsLayer;
class Page;
class Region;
class ScrollableArea;
-class ScrollingCoordinatorPrivate;
-class ScrollingTreeState;
+class ScrollingStateNode;
+class ScrollingStateScrollingNode;
+class ScrollingStateTree;
#if ENABLE(THREADED_SCROLLING)
class ScrollingTree;
@@ -61,20 +65,19 @@ class ScrollingTree;
class ScrollingCoordinator : public ThreadSafeRefCounted<ScrollingCoordinator> {
public:
static PassRefPtr<ScrollingCoordinator> create(Page*);
- ~ScrollingCoordinator();
+ virtual ~ScrollingCoordinator();
- void pageDestroyed();
+ virtual void pageDestroyed();
#if ENABLE(THREADED_SCROLLING)
- ScrollingTree* scrollingTree() const;
- void commitTreeStateIfNeeded();
+ virtual ScrollingTree* scrollingTree() const { return 0; }
#endif
// Return whether this scrolling coordinator handles scrolling for the given frame view.
bool coordinatesScrollingForFrameView(FrameView*) const;
// Should be called whenever the given frame view has been laid out.
- void frameViewLayoutUpdated(FrameView*);
+ virtual void frameViewLayoutUpdated(FrameView*) { }
// Should be called whenever a wheel event handler is added or removed in the
// frame view's underlying document.
@@ -87,29 +90,11 @@ public:
void frameViewFixedObjectsDidChange(FrameView*);
// Should be called whenever the root layer for the given frame view changes.
- void frameViewRootLayerDidChange(FrameView*);
+ virtual void frameViewRootLayerDidChange(FrameView*);
- // Should be called whenever the horizontal scrollbar layer for the given frame view changes.
- void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer* horizontalScrollbarLayer);
-
- // Should be called whenever the vertical scrollbar layer for the given frame view changes.
- void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer* verticalScrollbarLayer);
-
- // Should be called whenever the scrollable layer for the given scroll area changes.
- void scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLayer*);
-
- // Requests that the scrolling coordinator updates the scroll position of the given frame view. If this function returns true, it means that the
- // position will be updated asynchronously. If it returns false, the caller should update the scrolling position itself.
- bool requestScrollPositionUpdate(FrameView*, const IntPoint&);
-
- // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not.
- bool handleWheelEvent(FrameView*, const PlatformWheelEvent&);
-
- // Dispatched by the scrolling tree whenever the main frame scroll position changes.
- void updateMainFrameScrollPosition(const IntPoint&);
-
- // Dispatched by the scrolling tree whenever the main frame scroll position changes and the scroll layer position needs to be updated as well.
- void updateMainFrameScrollPositionAndScrollLayerPosition();
+ // Return whether this scrolling coordinator can keep fixed position layers fixed to their
+ // containers while scrolling.
+ virtual bool supportsFixedPositionLayers() const { return false; }
#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
// Dispatched by the scrolling tree during handleWheelEvent. This is required as long as scrollbars are painted on the main thread.
@@ -119,15 +104,21 @@ public:
// Force all scroll layer position updates to happen on the main thread.
void setForceMainThreadScrollLayerPositionUpdates(bool);
- // Return whether this scrolling coordinator can keep fixed position layers fixed to their
- // containers while scrolling.
- bool supportsFixedPositionLayers() const;
+ // These virtual functions are currently unique to the threaded scrolling architecture.
+ // Their meaningful implementations are in ScrollingCoordinatorMac.
+ virtual void commitTreeStateIfNeeded() { }
+ virtual bool requestScrollPositionUpdate(FrameView*, const IntPoint&) { return false; }
+ virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&) { return true; }
+ virtual void updateMainFrameScrollPositionAndScrollLayerPosition() { }
+ virtual ScrollingNodeID attachToStateTree(ScrollingNodeID nodeID) { return nodeID; }
+ virtual void detachFromStateTree(ScrollingNodeID) { }
+ virtual void clearStateTree() { }
- // Mark/unmark a layer as a container for fixed position layers.
- void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool);
+ // Generated a unique id for scroll layers.
+ ScrollingNodeID uniqueScrollLayerID();
- // Attach/detach layer position to ancestor fixed position container.
- void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool);
+ // Dispatched by the scrolling tree whenever the main frame scroll position changes.
+ void updateMainFrameScrollPosition(const IntPoint&, bool programmaticScroll);
enum MainThreadScrollingReasonFlags {
ForcedOnMainThread = 1 << 0,
@@ -137,54 +128,31 @@ public:
IsImageDocument = 1 << 4
};
-private:
- explicit ScrollingCoordinator(Page*);
-
- void recomputeWheelEventHandlerCount();
- bool hasNonLayerFixedObjects(FrameView*);
- void updateShouldUpdateScrollLayerPositionOnMainThread();
-
- void setScrollLayer(GraphicsLayer*);
- void setNonFastScrollableRegion(const Region&);
-
- struct ScrollParameters {
- ScrollElasticity horizontalScrollElasticity;
- ScrollElasticity verticalScrollElasticity;
-
- bool hasEnabledHorizontalScrollbar;
- bool hasEnabledVerticalScrollbar;
-
- ScrollbarMode horizontalScrollbarMode;
- ScrollbarMode verticalScrollbarMode;
-
- IntPoint scrollOrigin;
+ // These virtual functions are currently unique to Chromium's WebLayer approach. Their meaningful
+ // implementations are in ScrollingCoordinatorChromium.
+ virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer*) { }
+ virtual void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer*) { }
+ virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLayer*) { }
+ virtual void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool) { }
+ virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool) { }
- IntRect viewportRect;
- IntSize contentsSize;
- };
-
- void setScrollParameters(const ScrollParameters&);
- void setWheelEventHandlerCount(unsigned);
- void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
+protected:
+ explicit ScrollingCoordinator(Page*);
- void updateMainFrameScrollLayerPosition();
+ Region computeNonFastScrollableRegion(Frame*, const IntPoint& frameLocation);
+ unsigned computeCurrentWheelEventHandlerCount();
+ GraphicsLayer* scrollLayerForFrameView(FrameView*);
Page* m_page;
- bool m_forceMainThreadScrollLayerPositionUpdates;
-
-#if ENABLE(THREADED_SCROLLING)
- void scheduleTreeStateCommit();
-
- void scrollingTreeStateCommitterTimerFired(Timer<ScrollingCoordinator>*);
- void commitTreeState();
+private:
+ virtual void recomputeWheelEventHandlerCountForFrameView(FrameView*) { }
+ virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons) { }
- OwnPtr<ScrollingTreeState> m_scrollingTreeState;
- RefPtr<ScrollingTree> m_scrollingTree;
- Timer<ScrollingCoordinator> m_scrollingTreeStateCommitterTimer;
-#endif
+ bool hasNonLayerFixedObjects(FrameView*);
+ void updateShouldUpdateScrollLayerPositionOnMainThread();
- ScrollingCoordinatorPrivate* m_private;
+ bool m_forceMainThreadScrollLayerPositionUpdates;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp b/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp
deleted file mode 100644
index 19c37f8e2..000000000
--- a/Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "ScrollingCoordinator.h"
-
-namespace WebCore {
-
-class ScrollingCoordinatorPrivate {
-};
-
-#if !ENABLE(THREADED_SCROLLING)
-PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
-{
- return adoptRef(new ScrollingCoordinator(page));
-}
-
-ScrollingCoordinator::~ScrollingCoordinator()
-{
- ASSERT(!m_page);
-}
-
-void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer*)
-{
-}
-
-void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer*)
-{
-}
-
-void ScrollingCoordinator::setScrollLayer(GraphicsLayer*)
-{
-}
-
-void ScrollingCoordinator::setNonFastScrollableRegion(const Region&)
-{
-}
-
-void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
-{
-}
-
-void ScrollingCoordinator::setWheelEventHandlerCount(unsigned)
-{
-}
-
-void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons)
-{
-}
-
-bool ScrollingCoordinator::supportsFixedPositionLayers() const
-{
- return false;
-}
-
-void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool)
-{
-}
-
-void ScrollingCoordinator::setLayerIsFixedToContainerLayer(GraphicsLayer*, bool)
-{
-}
-
-void ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLayer*)
-{
-}
-#endif // !ENABLE(THREADED_SCROLLING)
-
-}
diff --git a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
new file mode 100644
index 000000000..8c1a3836b
--- /dev/null
+++ b/Source/WebCore/page/scrolling/ScrollingStateNode.cpp
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingStateNode.h"
+
+#include "ScrollingStateTree.h"
+
+#if ENABLE(THREADED_SCROLLING)
+
+namespace WebCore {
+
+ScrollingStateNode::ScrollingStateNode(ScrollingStateTree* scrollingStateTree, ScrollingNodeID nodeID)
+ : m_scrollingStateTree(scrollingStateTree)
+ , m_nodeID(nodeID)
+ , m_parent(0)
+ , m_scrollLayerDidChange(false)
+{
+}
+
+// This copy constructor is used for cloning nodes in the tree, and it doesn't make sense
+// to clone the relationship pointers, so don't copy that information from the original
+// node.
+ScrollingStateNode::ScrollingStateNode(ScrollingStateNode* stateNode)
+ : m_scrollingStateTree(0)
+ , m_nodeID(stateNode->scrollingNodeID())
+ , m_parent(0)
+ , m_scrollLayerDidChange(stateNode->scrollLayerDidChange())
+{
+ setScrollLayer(stateNode->platformScrollLayer());
+}
+
+ScrollingStateNode::~ScrollingStateNode()
+{
+}
+
+void ScrollingStateNode::cloneAndResetChildNodes(ScrollingStateNode* clone)
+{
+ if (!m_children)
+ return;
+
+ size_t size = m_children->size();
+ for (size_t i = 0; i < size; ++i)
+ clone->appendChild(m_children->at(i)->cloneAndResetNode());
+}
+
+void ScrollingStateNode::appendChild(PassOwnPtr<ScrollingStateNode> childNode)
+{
+ childNode->setParent(this);
+
+ if (!m_children)
+ m_children = adoptPtr(new Vector<OwnPtr<ScrollingStateNode> >);
+
+ m_children->append(childNode);
+}
+
+void ScrollingStateNode::removeChild(ScrollingStateNode* node)
+{
+ if (!m_children)
+ return;
+
+ if (size_t index = m_children->find(node)) {
+ m_scrollingStateTree->didRemoveNode(node->scrollingNodeID());
+ m_children->remove(index);
+ return;
+ }
+
+ size_t size = m_children->size();
+ for (size_t i = 0; i < size; ++i)
+ m_children->at(i)->removeChild(node);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(THREADED_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/ScrollingStateNode.h b/Source/WebCore/page/scrolling/ScrollingStateNode.h
new file mode 100644
index 000000000..dc813ac10
--- /dev/null
+++ b/Source/WebCore/page/scrolling/ScrollingStateNode.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingStateNode_h
+#define ScrollingStateNode_h
+
+#if ENABLE(THREADED_SCROLLING)
+
+#include "GraphicsLayer.h"
+#include "ScrollingCoordinator.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+#endif
+
+namespace WebCore {
+
+class ScrollingStateTree;
+
+class ScrollingStateNode {
+ WTF_MAKE_NONCOPYABLE(ScrollingStateNode);
+
+public:
+ ScrollingStateNode(ScrollingStateTree*, ScrollingNodeID);
+ virtual ~ScrollingStateNode();
+
+ virtual bool isScrollingStateScrollingNode() { return false; }
+
+ virtual PassOwnPtr<ScrollingStateNode> cloneAndResetNode() = 0;
+ void cloneAndResetChildNodes(ScrollingStateNode*);
+
+ virtual bool hasChangedProperties() const = 0;
+ virtual unsigned changedProperties() const = 0;
+ virtual void resetChangedProperties() = 0;
+ virtual void setHasChangedProperties() { setScrollLayerDidChange(true); }
+
+ PlatformLayer* platformScrollLayer() const;
+ void setScrollLayer(const GraphicsLayer*);
+ void setScrollLayer(PlatformLayer*);
+
+ bool scrollLayerDidChange() const { return m_scrollLayerDidChange; }
+ void setScrollLayerDidChange(bool scrollLayerDidChange) { m_scrollLayerDidChange = scrollLayerDidChange; }
+
+ ScrollingStateTree* scrollingStateTree() const { return m_scrollingStateTree; }
+ void setScrollingStateTree(ScrollingStateTree* tree) { m_scrollingStateTree = tree; }
+
+ ScrollingNodeID scrollingNodeID() const { return m_nodeID; }
+
+ ScrollingStateNode* parent() const { return m_parent; }
+ void setParent(ScrollingStateNode* parent) { m_parent = parent; }
+
+ void appendChild(PassOwnPtr<ScrollingStateNode>);
+
+ void removeChild(ScrollingStateNode*);
+
+protected:
+ ScrollingStateNode(ScrollingStateNode*);
+
+ ScrollingStateTree* m_scrollingStateTree;
+
+private:
+ ScrollingNodeID m_nodeID;
+
+ ScrollingStateNode* m_parent;
+ OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children;
+
+ bool m_scrollLayerDidChange;
+
+#if PLATFORM(MAC)
+ RetainPtr<PlatformLayer> m_platformScrollLayer;
+#endif
+
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(THREADED_SCROLLING)
+
+#endif // ScrollingStateNode_h
diff --git a/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
new file mode 100644
index 000000000..06ea4730f
--- /dev/null
+++ b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
@@ -0,0 +1,228 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingStateScrollingNode.h"
+
+#include "ScrollingStateTree.h"
+#include <wtf/OwnPtr.h>
+
+#if ENABLE(THREADED_SCROLLING)
+
+namespace WebCore {
+
+PassOwnPtr<ScrollingStateScrollingNode> ScrollingStateScrollingNode::create(ScrollingStateTree* stateTree, ScrollingNodeID nodeID)
+{
+ return adoptPtr(new ScrollingStateScrollingNode(stateTree, nodeID));
+}
+
+ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree* stateTree, ScrollingNodeID nodeID)
+ : ScrollingStateNode(stateTree, nodeID)
+ , m_changedProperties(0)
+ , m_wheelEventHandlerCount(0)
+ , m_shouldUpdateScrollLayerPositionOnMainThread(0)
+ , m_horizontalScrollElasticity(ScrollElasticityNone)
+ , m_verticalScrollElasticity(ScrollElasticityNone)
+ , m_hasEnabledHorizontalScrollbar(false)
+ , m_hasEnabledVerticalScrollbar(false)
+ , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
+ , m_horizontalScrollbarMode(ScrollbarAuto)
+ , m_verticalScrollbarMode(ScrollbarAuto)
+{
+}
+
+ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateScrollingNode* stateNode)
+ : ScrollingStateNode(stateNode)
+ , m_changedProperties(stateNode->changedProperties())
+ , m_viewportRect(stateNode->viewportRect())
+ , m_contentsSize(stateNode->contentsSize())
+ , m_nonFastScrollableRegion(stateNode->nonFastScrollableRegion())
+ , m_wheelEventHandlerCount(stateNode->wheelEventHandlerCount())
+ , m_shouldUpdateScrollLayerPositionOnMainThread(stateNode->shouldUpdateScrollLayerPositionOnMainThread())
+ , m_horizontalScrollElasticity(stateNode->horizontalScrollElasticity())
+ , m_verticalScrollElasticity(stateNode->verticalScrollElasticity())
+ , m_hasEnabledHorizontalScrollbar(stateNode->hasEnabledHorizontalScrollbar())
+ , m_hasEnabledVerticalScrollbar(stateNode->hasEnabledVerticalScrollbar())
+ , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode->requestedScrollPositionRepresentsProgrammaticScroll())
+ , m_horizontalScrollbarMode(stateNode->horizontalScrollbarMode())
+ , m_verticalScrollbarMode(stateNode->verticalScrollbarMode())
+ , m_requestedScrollPosition(stateNode->requestedScrollPosition())
+ , m_scrollOrigin(stateNode->scrollOrigin())
+{
+}
+
+ScrollingStateScrollingNode::~ScrollingStateScrollingNode()
+{
+}
+
+void ScrollingStateScrollingNode::setHasChangedProperties()
+{
+ m_changedProperties = All;
+ ScrollingStateNode::setHasChangedProperties();
+}
+
+PassOwnPtr<ScrollingStateNode> ScrollingStateScrollingNode::cloneAndResetNode()
+{
+ OwnPtr<ScrollingStateScrollingNode> clone = adoptPtr(new ScrollingStateScrollingNode(this));
+
+ // Now that this node is cloned, reset our change properties.
+ setScrollLayerDidChange(false);
+ resetChangedProperties();
+
+ cloneAndResetChildNodes(clone.get());
+ return clone.release();
+}
+
+void ScrollingStateScrollingNode::setViewportRect(const IntRect& viewportRect)
+{
+ if (m_viewportRect == viewportRect)
+ return;
+
+ m_viewportRect = viewportRect;
+ m_changedProperties |= ViewportRect;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setContentsSize(const IntSize& contentsSize)
+{
+ if (m_contentsSize == contentsSize)
+ return;
+
+ m_contentsSize = contentsSize;
+ m_changedProperties |= ContentsSize;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setNonFastScrollableRegion(const Region& nonFastScrollableRegion)
+{
+ if (m_nonFastScrollableRegion == nonFastScrollableRegion)
+ return;
+
+ m_nonFastScrollableRegion = nonFastScrollableRegion;
+ m_changedProperties |= NonFastScrollableRegion;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
+{
+ if (m_wheelEventHandlerCount == wheelEventHandlerCount)
+ return;
+
+ m_wheelEventHandlerCount = wheelEventHandlerCount;
+ m_changedProperties |= WheelEventHandlerCount;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
+{
+ if (m_shouldUpdateScrollLayerPositionOnMainThread == reasons)
+ return;
+
+ m_shouldUpdateScrollLayerPositionOnMainThread = reasons;
+ m_changedProperties |= ShouldUpdateScrollLayerPositionOnMainThread;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setHorizontalScrollElasticity(ScrollElasticity horizontalScrollElasticity)
+{
+ if (m_horizontalScrollElasticity == horizontalScrollElasticity)
+ return;
+
+ m_horizontalScrollElasticity = horizontalScrollElasticity;
+ m_changedProperties |= HorizontalScrollElasticity;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setVerticalScrollElasticity(ScrollElasticity verticalScrollElasticity)
+{
+ if (m_verticalScrollElasticity == verticalScrollElasticity)
+ return;
+
+ m_verticalScrollElasticity = verticalScrollElasticity;
+ m_changedProperties |= VerticalScrollElasticity;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setHasEnabledHorizontalScrollbar(bool hasEnabledHorizontalScrollbar)
+{
+ if (m_hasEnabledHorizontalScrollbar == hasEnabledHorizontalScrollbar)
+ return;
+
+ m_hasEnabledHorizontalScrollbar = hasEnabledHorizontalScrollbar;
+ m_changedProperties |= HasEnabledHorizontalScrollbar;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setHasEnabledVerticalScrollbar(bool hasEnabledVerticalScrollbar)
+{
+ if (m_hasEnabledVerticalScrollbar == hasEnabledVerticalScrollbar)
+ return;
+
+ m_hasEnabledVerticalScrollbar = hasEnabledVerticalScrollbar;
+ m_changedProperties |= HasEnabledVerticalScrollbar;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setHorizontalScrollbarMode(ScrollbarMode horizontalScrollbarMode)
+{
+ if (m_horizontalScrollbarMode == horizontalScrollbarMode)
+ return;
+
+ m_horizontalScrollbarMode = horizontalScrollbarMode;
+ m_changedProperties |= HorizontalScrollbarMode;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setVerticalScrollbarMode(ScrollbarMode verticalScrollbarMode)
+{
+ if (m_verticalScrollbarMode == verticalScrollbarMode)
+ return;
+
+ m_verticalScrollbarMode = verticalScrollbarMode;
+ m_changedProperties |= VerticalScrollbarMode;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setRequestedScrollPosition(const IntPoint& requestedScrollPosition, bool representsProgrammaticScroll)
+{
+ m_requestedScrollPosition = requestedScrollPosition;
+ m_requestedScrollPositionRepresentsProgrammaticScroll = representsProgrammaticScroll;
+ m_changedProperties |= RequestedScrollPosition;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setScrollOrigin(const IntPoint& scrollOrigin)
+{
+ if (m_scrollOrigin == scrollOrigin)
+ return;
+
+ m_scrollOrigin = scrollOrigin;
+ m_changedProperties |= ScrollOrigin;
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(THREADED_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeState.h b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
index 4000cce2e..ba9f6475e 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeState.h
+++ b/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
@@ -23,32 +23,24 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScrollingTreeState_h
-#define ScrollingTreeState_h
+#ifndef ScrollingStateScrollingNode_h
+#define ScrollingStateScrollingNode_h
#if ENABLE(THREADED_SCROLLING)
-#include "GraphicsLayer.h"
#include "IntRect.h"
#include "Region.h"
#include "ScrollTypes.h"
#include "ScrollingCoordinator.h"
+#include "ScrollingStateNode.h"
#include <wtf/PassOwnPtr.h>
-#if PLATFORM(MAC)
-#include <wtf/RetainPtr.h>
-#endif
-
namespace WebCore {
-// The ScrollingTreeState object keeps track of the current state of scrolling related properties.
-// Whenever any properties change, the scrolling coordinator will be informed and will update the state
-// and schedule a timer that will clone the new state and send it over to the scrolling thread, avoiding locking.
-// FIXME: Once we support fast scrolling in subframes, this will have to become a tree-like structure.
-class ScrollingTreeState {
+class ScrollingStateScrollingNode : public ScrollingStateNode {
public:
- static PassOwnPtr<ScrollingTreeState> create();
- ~ScrollingTreeState();
+ static PassOwnPtr<ScrollingStateScrollingNode> create(ScrollingStateTree*, ScrollingNodeID);
+ virtual ~ScrollingStateScrollingNode();
enum ChangedProperty {
ViewportRect = 1 << 0,
@@ -63,12 +55,18 @@ public:
HorizontalScrollbarMode = 1 << 9,
VerticalScrollbarMode = 1 << 10,
ScrollOrigin = 1 << 11,
- ScrollLayer = 1 << 12,
- RequestedScrollPosition = 1 << 13,
+ RequestedScrollPosition = 1 << 12,
+ All = (1 << 13) - 1 // This will need to be updated if we add or remove anything the ChangedProperties.
};
- bool hasChangedProperties() const { return m_changedProperties; }
- unsigned changedProperties() const { return m_changedProperties; }
+ virtual bool isScrollingStateScrollingNode() OVERRIDE { return true; }
+
+ virtual PassOwnPtr<ScrollingStateNode> cloneAndResetNode() OVERRIDE;
+
+ virtual bool hasChangedProperties() const OVERRIDE { return m_changedProperties; }
+ virtual unsigned changedProperties() const OVERRIDE { return m_changedProperties; }
+ virtual void resetChangedProperties() OVERRIDE { m_changedProperties = 0; }
+ virtual void setHasChangedProperties();
const IntRect& viewportRect() const { return m_viewportRect; }
void setViewportRect(const IntRect&);
@@ -103,20 +101,17 @@ public:
ScrollbarMode verticalScrollbarMode() const { return m_verticalScrollbarMode; }
void setVerticalScrollbarMode(ScrollbarMode);
- PlatformLayer* platformScrollLayer() const;
- void setScrollLayer(const GraphicsLayer*);
-
const IntPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
- void setRequestedScrollPosition(const IntPoint&);
+ void setRequestedScrollPosition(const IntPoint&, bool representsProgrammaticScroll);
const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
void setScrollOrigin(const IntPoint&);
- // Copies the current tree state and clears the changed properties mask in the original.
- PassOwnPtr<ScrollingTreeState> commit();
+ bool requestedScrollPositionRepresentsProgrammaticScroll() const { return m_requestedScrollPositionRepresentsProgrammaticScroll; }
private:
- ScrollingTreeState();
+ ScrollingStateScrollingNode(ScrollingStateTree*, ScrollingNodeID);
+ ScrollingStateScrollingNode(ScrollingStateScrollingNode*);
unsigned m_changedProperties;
@@ -134,21 +129,26 @@ private:
bool m_hasEnabledHorizontalScrollbar;
bool m_hasEnabledVerticalScrollbar;
+ bool m_requestedScrollPositionRepresentsProgrammaticScroll;
ScrollbarMode m_horizontalScrollbarMode;
ScrollbarMode m_verticalScrollbarMode;
IntPoint m_requestedScrollPosition;
IntPoint m_scrollOrigin;
-
-#if PLATFORM(MAC)
- RetainPtr<PlatformLayer> m_platformScrollLayer;
-#endif
-
};
+inline ScrollingStateScrollingNode* toScrollingStateScrollingNode(ScrollingStateNode* node)
+{
+ ASSERT(!node || node->isScrollingStateScrollingNode());
+ return static_cast<ScrollingStateScrollingNode*>(node);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toScrollingStateScrollingNode(const ScrollingStateScrollingNode*);
+
} // namespace WebCore
#endif // ENABLE(THREADED_SCROLLING)
-#endif // ScrollingTreeState_h
+#endif // ScrollingStateScrollingNode_h
diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
new file mode 100644
index 000000000..850841e9a
--- /dev/null
+++ b/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollingStateTree.h"
+
+#if ENABLE(THREADED_SCROLLING)
+
+namespace WebCore {
+
+PassOwnPtr<ScrollingStateTree> ScrollingStateTree::create()
+{
+ return adoptPtr(new ScrollingStateTree);
+}
+
+ScrollingStateTree::ScrollingStateTree()
+ : m_hasChangedProperties(false)
+{
+}
+
+ScrollingStateTree::~ScrollingStateTree()
+{
+}
+
+PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit()
+{
+ // This function clones and resets the current state tree, but leaves the tree structure intact.
+ OwnPtr<ScrollingStateTree> treeStateClone = ScrollingStateTree::create();
+ treeStateClone->setRootStateNode(static_pointer_cast<ScrollingStateScrollingNode>(m_rootStateNode->cloneAndResetNode()));
+
+ // Copy the IDs of the nodes that have been removed since the last commit into the clone.
+ treeStateClone->m_nodesRemovedSinceLastCommit.swap(m_nodesRemovedSinceLastCommit);
+
+ // Now the clone tree has changed properties, and the original tree does not.
+ treeStateClone->m_hasChangedProperties = true;
+ m_hasChangedProperties = false;
+
+ return treeStateClone.release();
+}
+
+void ScrollingStateTree::removeNode(ScrollingStateNode* node)
+{
+ ASSERT(m_rootStateNode);
+
+ if (node == m_rootStateNode) {
+ didRemoveNode(m_rootStateNode->scrollingNodeID());
+ m_rootStateNode = 0;
+ return;
+ }
+
+ m_rootStateNode->removeChild(node);
+}
+
+void ScrollingStateTree::didRemoveNode(ScrollingNodeID nodeID)
+{
+ m_nodesRemovedSinceLastCommit.append(nodeID);
+}
+
+void ScrollingStateTree::rootLayerDidChange()
+{
+ // If the root layer has changed, then destroyed and re-created the root state node. That means that the
+ // cached properties in ScrollingStateScrollingNode are no longer reflective of the properties we have
+ // cached over in the ScrollingTree. To resolve this, we will mark all of the properties as having changed
+ // so that the ScrollingTree will be in synch with the state tree.
+ setHasChangedProperties(true);
+ rootStateNode()->setHasChangedProperties();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(THREADED_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/ScrollingStateTree.h b/Source/WebCore/page/scrolling/ScrollingStateTree.h
new file mode 100644
index 000000000..fc5b73542
--- /dev/null
+++ b/Source/WebCore/page/scrolling/ScrollingStateTree.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingStateTree_h
+#define ScrollingStateTree_h
+
+#if ENABLE(THREADED_SCROLLING)
+
+#include "ScrollingStateScrollingNode.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+// The ScrollingStateTree is a tree that managed ScrollingStateNodes. The nodes keep track of the current
+// state of scrolling related properties. Whenever any properties change, the scrolling coordinator
+// will be informed and will schedule a timer that will clone the new state tree and send it over to
+// the scrolling thread, avoiding locking.
+
+// FIXME: Right now the scrolling thread only ever looks at the root node. In the future, it should
+// look at the whole tree and build a ScrollingTree that mimics the ScrollingStateTree.
+
+// FIXME: Right now there is only one type of ScrollingStateNode, which is the ScrollingStateScrollingNode.
+// It is currently used for the main frame, but in the future it should be able to be used for subframes
+// and overflow areas. In the future, more classes will inherit from ScrollingStateNode, such as
+// ScrollingStateFixedNode and ScrollingStateStickyNode for fixed position objects and sticky positoned
+// objects, respectively.
+
+class ScrollingStateTree {
+public:
+ static PassOwnPtr<ScrollingStateTree> create();
+ ~ScrollingStateTree();
+
+ ScrollingStateScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
+ void setRootStateNode(PassOwnPtr<ScrollingStateScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
+
+ // Copies the current tree state and clears the changed properties mask in the original.
+ PassOwnPtr<ScrollingStateTree> commit();
+
+ void removeNode(ScrollingStateNode*);
+ void didRemoveNode(ScrollingNodeID);
+ const Vector<ScrollingNodeID>& removedNodes() const { return m_nodesRemovedSinceLastCommit; }
+
+ void rootLayerDidChange();
+
+ void setHasChangedProperties(bool changedProperties) { m_hasChangedProperties = changedProperties; }
+ bool hasChangedProperties() const { return m_hasChangedProperties; }
+
+private:
+ ScrollingStateTree();
+
+ PassOwnPtr<ScrollingStateTree> clone();
+
+ OwnPtr<ScrollingStateScrollingNode> m_rootStateNode;
+ Vector<ScrollingNodeID> m_nodesRemovedSinceLastCommit;
+ bool m_hasChangedProperties;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(THREADED_SCROLLING)
+
+#endif // ScrollingStateTree_h
diff --git a/Source/WebCore/page/scrolling/ScrollingTree.cpp b/Source/WebCore/page/scrolling/ScrollingTree.cpp
index 690ec9225..f274f4704 100644
--- a/Source/WebCore/page/scrolling/ScrollingTree.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingTree.cpp
@@ -30,10 +30,11 @@
#include "PlatformWheelEvent.h"
#include "ScrollingCoordinator.h"
+#include "ScrollingStateTree.h"
#include "ScrollingThread.h"
#include "ScrollingTreeNode.h"
-#include "ScrollingTreeState.h"
#include <wtf/MainThread.h>
+#include <wtf/TemporaryChange.h>
namespace WebCore {
@@ -51,6 +52,7 @@ ScrollingTree::ScrollingTree(ScrollingCoordinator* scrollingCoordinator)
, m_mainFramePinnedToTheLeft(false)
, m_mainFramePinnedToTheRight(false)
, m_scrollingPerformanceLoggingEnabled(false)
+ , m_isHandlingProgrammaticScroll(false)
{
}
@@ -118,22 +120,24 @@ void ScrollingTree::invalidate()
callOnMainThread(bind(derefScrollingCoordinator, m_scrollingCoordinator.release().leakRef()));
}
-void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingTreeState> scrollingTreeState)
+void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
{
ASSERT(ScrollingThread::isCurrentThread());
- if (scrollingTreeState->changedProperties() & (ScrollingTreeState::WheelEventHandlerCount | ScrollingTreeState::NonFastScrollableRegion | ScrollingTreeState::ScrollLayer)) {
+ if (scrollingStateTree->rootStateNode()->changedProperties() & (ScrollingStateScrollingNode::WheelEventHandlerCount | ScrollingStateScrollingNode::NonFastScrollableRegion) || scrollingStateTree->rootStateNode()->scrollLayerDidChange()) {
MutexLocker lock(m_mutex);
- if (scrollingTreeState->changedProperties() & ScrollingTreeState::ScrollLayer)
+ if (scrollingStateTree->rootStateNode()->scrollLayerDidChange())
m_mainFrameScrollPosition = IntPoint();
- if (scrollingTreeState->changedProperties() & ScrollingTreeState::WheelEventHandlerCount)
- m_hasWheelEventHandlers = scrollingTreeState->wheelEventHandlerCount();
- if (scrollingTreeState->changedProperties() & ScrollingTreeState::NonFastScrollableRegion)
- m_nonFastScrollableRegion = scrollingTreeState->nonFastScrollableRegion();
+ if (scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::WheelEventHandlerCount)
+ m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
+ if (scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::NonFastScrollableRegion)
+ m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
}
+
+ TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollingStateTree->rootStateNode()->requestedScrollPositionRepresentsProgrammaticScroll());
- m_rootNode->update(scrollingTreeState.get());
+ m_rootNode->update(scrollingStateTree->rootStateNode());
updateDebugRootLayer();
}
@@ -156,7 +160,7 @@ void ScrollingTree::updateMainFrameScrollPosition(const IntPoint& scrollPosition
m_mainFrameScrollPosition = scrollPosition;
}
- callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition));
+ callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition, m_isHandlingProgrammaticScroll));
}
IntPoint ScrollingTree::mainFrameScrollPosition()
diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h
index 40705a0fc..35e7b02e6 100644
--- a/Source/WebCore/page/scrolling/ScrollingTree.h
+++ b/Source/WebCore/page/scrolling/ScrollingTree.h
@@ -47,7 +47,7 @@ namespace WebCore {
class IntPoint;
class ScrollingCoordinator;
class ScrollingTreeNode;
-class ScrollingTreeState;
+class ScrollingStateTree;
// The ScrollingTree class lives almost exclusively on the scrolling thread and manages the
// hierarchy of scrollable regions on the page. It's also responsible for dispatching events
@@ -76,7 +76,7 @@ public:
void handleWheelEvent(const PlatformWheelEvent&);
void invalidate();
- void commitNewTreeState(PassOwnPtr<ScrollingTreeState>);
+ void commitNewTreeState(PassOwnPtr<ScrollingStateTree>);
void setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight);
@@ -120,6 +120,8 @@ private:
bool m_mainFramePinnedToTheRight;
bool m_scrollingPerformanceLoggingEnabled;
+
+ bool m_isHandlingProgrammaticScroll;
#if PLATFORM(MAC)
RetainPtr<CALayer> m_debugInfoLayer;
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
index 252c57708..79321ae8c 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
@@ -28,7 +28,7 @@
#if ENABLE(THREADED_SCROLLING)
-#include "ScrollingTreeState.h"
+#include "ScrollingStateTree.h"
namespace WebCore {
@@ -48,36 +48,36 @@ ScrollingTreeNode::~ScrollingTreeNode()
{
}
-void ScrollingTreeNode::update(ScrollingTreeState* state)
+void ScrollingTreeNode::update(ScrollingStateScrollingNode* state)
{
- if (state->changedProperties() & ScrollingTreeState::ViewportRect)
+ if (state->changedProperties() & ScrollingStateScrollingNode::ViewportRect)
m_viewportRect = state->viewportRect();
- if (state->changedProperties() & ScrollingTreeState::ContentsSize)
+ if (state->changedProperties() & ScrollingStateScrollingNode::ContentsSize)
m_contentsSize = state->contentsSize();
- if (state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThread)
+ if (state->changedProperties() & ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)
m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread();
- if (state->changedProperties() & ScrollingTreeState::HorizontalScrollElasticity)
+ if (state->changedProperties() & ScrollingStateScrollingNode::HorizontalScrollElasticity)
m_horizontalScrollElasticity = state->horizontalScrollElasticity();
- if (state->changedProperties() & ScrollingTreeState::VerticalScrollElasticity)
+ if (state->changedProperties() & ScrollingStateScrollingNode::VerticalScrollElasticity)
m_verticalScrollElasticity = state->verticalScrollElasticity();
- if (state->changedProperties() & ScrollingTreeState::HasEnabledHorizontalScrollbar)
+ if (state->changedProperties() & ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar)
m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar();
- if (state->changedProperties() & ScrollingTreeState::HasEnabledVerticalScrollbar)
+ if (state->changedProperties() & ScrollingStateScrollingNode::HasEnabledVerticalScrollbar)
m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar();
- if (state->changedProperties() & ScrollingTreeState::HorizontalScrollbarMode)
+ if (state->changedProperties() & ScrollingStateScrollingNode::HorizontalScrollbarMode)
m_horizontalScrollbarMode = state->horizontalScrollbarMode();
- if (state->changedProperties() & ScrollingTreeState::VerticalScrollbarMode)
+ if (state->changedProperties() & ScrollingStateScrollingNode::VerticalScrollbarMode)
m_verticalScrollbarMode = state->verticalScrollbarMode();
- if (state->changedProperties() & ScrollingTreeState::ScrollOrigin)
+ if (state->changedProperties() & ScrollingStateScrollingNode::ScrollOrigin)
m_scrollOrigin = state->scrollOrigin();
}
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeNode.h b/Source/WebCore/page/scrolling/ScrollingTreeNode.h
index 0feb253e9..6df7321b2 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeNode.h
+++ b/Source/WebCore/page/scrolling/ScrollingTreeNode.h
@@ -37,14 +37,14 @@ namespace WebCore {
class PlatformWheelEvent;
class ScrollingTree;
-class ScrollingTreeState;
+class ScrollingStateScrollingNode;
class ScrollingTreeNode {
public:
static PassOwnPtr<ScrollingTreeNode> create(ScrollingTree*);
virtual ~ScrollingTreeNode();
- virtual void update(ScrollingTreeState*);
+ virtual void update(ScrollingStateScrollingNode*);
virtual void handleWheelEvent(const PlatformWheelEvent&) = 0;
virtual void setScrollPosition(const IntPoint&) = 0;
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeState.cpp b/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
deleted file mode 100644
index 3197961e8..000000000
--- a/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ScrollingTreeState.h"
-
-#if ENABLE(THREADED_SCROLLING)
-
-namespace WebCore {
-
-PassOwnPtr<ScrollingTreeState> ScrollingTreeState::create()
-{
- return adoptPtr(new ScrollingTreeState);
-}
-
-ScrollingTreeState::ScrollingTreeState()
- : m_changedProperties(0)
- , m_wheelEventHandlerCount(0)
- , m_shouldUpdateScrollLayerPositionOnMainThread(0)
- , m_horizontalScrollElasticity(ScrollElasticityNone)
- , m_verticalScrollElasticity(ScrollElasticityNone)
- , m_hasEnabledHorizontalScrollbar(false)
- , m_hasEnabledVerticalScrollbar(false)
- , m_horizontalScrollbarMode(ScrollbarAuto)
- , m_verticalScrollbarMode(ScrollbarAuto)
-{
-}
-
-ScrollingTreeState::~ScrollingTreeState()
-{
-}
-
-void ScrollingTreeState::setViewportRect(const IntRect& viewportRect)
-{
- if (m_viewportRect == viewportRect)
- return;
-
- m_viewportRect = viewportRect;
- m_changedProperties |= ViewportRect;
-}
-
-void ScrollingTreeState::setContentsSize(const IntSize& contentsSize)
-{
- if (m_contentsSize == contentsSize)
- return;
-
- m_contentsSize = contentsSize;
- m_changedProperties |= ContentsSize;
-}
-
-void ScrollingTreeState::setNonFastScrollableRegion(const Region& nonFastScrollableRegion)
-{
- if (m_nonFastScrollableRegion == nonFastScrollableRegion)
- return;
-
- m_nonFastScrollableRegion = nonFastScrollableRegion;
- m_changedProperties |= NonFastScrollableRegion;
-}
-
-void ScrollingTreeState::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
-{
- if (m_wheelEventHandlerCount == wheelEventHandlerCount)
- return;
-
- m_wheelEventHandlerCount = wheelEventHandlerCount;
- m_changedProperties |= WheelEventHandlerCount;
-}
-
-void ScrollingTreeState::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
-{
- if (m_shouldUpdateScrollLayerPositionOnMainThread == reasons)
- return;
-
- m_shouldUpdateScrollLayerPositionOnMainThread = reasons;
- m_changedProperties |= ShouldUpdateScrollLayerPositionOnMainThread;
-}
-
-void ScrollingTreeState::setHorizontalScrollElasticity(ScrollElasticity horizontalScrollElasticity)
-{
- if (m_horizontalScrollElasticity == horizontalScrollElasticity)
- return;
-
- m_horizontalScrollElasticity = horizontalScrollElasticity;
- m_changedProperties |= HorizontalScrollElasticity;
-}
-
-void ScrollingTreeState::setVerticalScrollElasticity(ScrollElasticity verticalScrollElasticity)
-{
- if (m_verticalScrollElasticity == verticalScrollElasticity)
- return;
-
- m_verticalScrollElasticity = verticalScrollElasticity;
- m_changedProperties |= VerticalScrollElasticity;
-}
-
-void ScrollingTreeState::setHasEnabledHorizontalScrollbar(bool hasEnabledHorizontalScrollbar)
-{
- if (m_hasEnabledHorizontalScrollbar == hasEnabledHorizontalScrollbar)
- return;
-
- m_hasEnabledHorizontalScrollbar = hasEnabledHorizontalScrollbar;
- m_changedProperties |= HasEnabledHorizontalScrollbar;
-}
-
-void ScrollingTreeState::setHasEnabledVerticalScrollbar(bool hasEnabledVerticalScrollbar)
-{
- if (m_hasEnabledVerticalScrollbar == hasEnabledVerticalScrollbar)
- return;
-
- m_hasEnabledVerticalScrollbar = hasEnabledVerticalScrollbar;
- m_changedProperties |= HasEnabledVerticalScrollbar;
-}
-
-void ScrollingTreeState::setHorizontalScrollbarMode(ScrollbarMode horizontalScrollbarMode)
-{
- if (m_horizontalScrollbarMode == horizontalScrollbarMode)
- return;
-
- m_horizontalScrollbarMode = horizontalScrollbarMode;
- m_changedProperties |= HorizontalScrollbarMode;
-}
-
-void ScrollingTreeState::setVerticalScrollbarMode(ScrollbarMode verticalScrollbarMode)
-{
- if (m_verticalScrollbarMode == verticalScrollbarMode)
- return;
-
- m_verticalScrollbarMode = verticalScrollbarMode;
- m_changedProperties |= VerticalScrollbarMode;
-}
-
-void ScrollingTreeState::setRequestedScrollPosition(const IntPoint& requestedScrollPosition)
-{
- m_requestedScrollPosition = requestedScrollPosition;
- m_changedProperties |= RequestedScrollPosition;
-}
-
-void ScrollingTreeState::setScrollOrigin(const IntPoint& scrollOrigin)
-{
- if (m_scrollOrigin == scrollOrigin)
- return;
-
- m_scrollOrigin = scrollOrigin;
- m_changedProperties |= ScrollOrigin;
-}
-
-PassOwnPtr<ScrollingTreeState> ScrollingTreeState::commit()
-{
- OwnPtr<ScrollingTreeState> treeState = adoptPtr(new ScrollingTreeState(*this));
- m_changedProperties = 0;
-
- return treeState.release();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(THREADED_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
index aa056ad32..9743289c1 100644
--- a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
+++ b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp
@@ -25,7 +25,7 @@
#include "config.h"
-#include "ScrollingCoordinator.h"
+#include "ScrollingCoordinatorChromium.h"
#include "Frame.h"
#include "FrameView.h"
@@ -95,33 +95,32 @@ private:
OwnPtr<WebScrollbarLayer> m_verticalScrollbarLayer;
};
-PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
+ScrollingCoordinatorChromium::ScrollingCoordinatorChromium(Page* page)
+ : ScrollingCoordinator(page)
+ , m_private(new ScrollingCoordinatorPrivate)
{
- RefPtr<ScrollingCoordinator> coordinator(adoptRef(new ScrollingCoordinator(page)));
- coordinator->m_private = new ScrollingCoordinatorPrivate;
- return coordinator.release();
}
-ScrollingCoordinator::~ScrollingCoordinator()
+ScrollingCoordinatorChromium::~ScrollingCoordinatorChromium()
{
- ASSERT(!m_page);
delete m_private;
}
-static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView)
+void ScrollingCoordinatorChromium::frameViewLayoutUpdated(FrameView*)
{
-#if USE(ACCELERATED_COMPOSITING)
- Frame* frame = frameView->frame();
- if (!frame)
- return 0;
-
- RenderView* renderView = frame->contentRenderer();
- if (!renderView)
- return 0;
- return renderView->compositor()->scrollLayer();
-#else
- return 0;
-#endif
+ ASSERT(m_page);
+
+ // Compute the region of the page that we can't do fast scrolling for. This currently includes
+ // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
+ // frame view whose layout was updated is not the main frame.
+ Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint());
+ setNonFastScrollableRegion(nonFastScrollableRegion);
+}
+
+void ScrollingCoordinatorChromium::frameViewRootLayerDidChange(FrameView* frameView)
+{
+ ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
+ setScrollLayer(scrollLayerForFrameView(frameView));
}
static WebLayer* scrollableLayerForGraphicsLayer(GraphicsLayer* layer)
@@ -129,7 +128,7 @@ static WebLayer* scrollableLayerForGraphicsLayer(GraphicsLayer* layer)
return layer->platformLayer();
}
-static PassOwnPtr<WebScrollbarLayer> createScrollbarLayer(Scrollbar* scrollbar, WebLayer* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView)
+PassOwnPtr<WebScrollbarLayer> ScrollingCoordinatorChromium::createScrollbarLayer(Scrollbar* scrollbar, WebLayer* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView)
{
ASSERT(scrollbar);
ASSERT(scrollbarGraphicsLayer);
@@ -174,7 +173,7 @@ static PassOwnPtr<WebScrollbarLayer> createScrollbarLayer(Scrollbar* scrollbar,
return scrollbarLayer.release();
}
-void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer)
+void ScrollingCoordinatorChromium::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer)
{
if (!horizontalScrollbarLayer || !coordinatesScrollingForFrameView(frameView))
return;
@@ -183,7 +182,7 @@ void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*
m_private->setHorizontalScrollbarLayer(createScrollbarLayer(frameView->horizontalScrollbar(), m_private->scrollLayer(), horizontalScrollbarLayer, frameView));
}
-void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* verticalScrollbarLayer)
+void ScrollingCoordinatorChromium::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* verticalScrollbarLayer)
{
if (!verticalScrollbarLayer || !coordinatesScrollingForFrameView(frameView))
return;
@@ -192,12 +191,12 @@ void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* f
m_private->setVerticalScrollbarLayer(createScrollbarLayer(frameView->verticalScrollbar(), m_private->scrollLayer(), verticalScrollbarLayer, frameView));
}
-void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
+void ScrollingCoordinatorChromium::setScrollLayer(GraphicsLayer* scrollLayer)
{
m_private->setScrollLayer(scrollLayer ? scrollableLayerForGraphicsLayer(scrollLayer) : 0);
}
-void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
+void ScrollingCoordinatorChromium::setNonFastScrollableRegion(const Region& region)
{
// We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
@@ -210,12 +209,7 @@ void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
}
}
-void ScrollingCoordinator::setScrollParameters(const ScrollParameters&)
-{
- // FIXME: Implement!
-}
-
-void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
+void ScrollingCoordinatorChromium::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
{
// We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
@@ -223,7 +217,7 @@ void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerC
m_private->scrollLayer()->setHaveWheelEventHandlers(wheelEventHandlerCount > 0);
}
-void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
+void ScrollingCoordinatorChromium::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
{
// We won't necessarily get a setScrollLayer() call before this one, so grab the root ourselves.
setScrollLayer(scrollLayerForFrameView(m_page->mainFrame()->view()));
@@ -231,24 +225,19 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
m_private->scrollLayer()->setShouldScrollOnMainThread(reasons);
}
-bool ScrollingCoordinator::supportsFixedPositionLayers() const
-{
- return true;
-}
-
-void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLayer* layer, bool enable)
+void ScrollingCoordinatorChromium::setLayerIsContainerForFixedPositionLayers(GraphicsLayer* layer, bool enable)
{
if (WebLayer* scrollableLayer = scrollableLayerForGraphicsLayer(layer))
scrollableLayer->setIsContainerForFixedPositionLayers(enable);
}
-void ScrollingCoordinator::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)
+void ScrollingCoordinatorChromium::setLayerIsFixedToContainerLayer(GraphicsLayer* layer, bool enable)
{
if (WebLayer* scrollableLayer = scrollableLayerForGraphicsLayer(layer))
scrollableLayer->setFixedToContainerLayer(enable);
}
-void ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea, GraphicsLayer* scrollLayer)
+void ScrollingCoordinatorChromium::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea, GraphicsLayer* scrollLayer)
{
if (!scrollLayer)
return;
@@ -262,4 +251,10 @@ void ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
}
}
+void ScrollingCoordinatorChromium::recomputeWheelEventHandlerCountForFrameView(FrameView* frameView)
+{
+ UNUSED_PARAM(frameView);
+ setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount());
+}
+
}
diff --git a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.h b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.h
new file mode 100644
index 000000000..f6948e240
--- /dev/null
+++ b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingCoordinatorChromium_h
+#define ScrollingCoordinatorChromium_h
+
+#include "ScrollingCoordinator.h"
+
+namespace WebKit {
+class WebScrollbarLayer;
+class WebLayer;
+}
+
+namespace WebCore {
+
+class Scrollbar;
+class ScrollingCoordinatorPrivate;
+
+class ScrollingCoordinatorChromium : public ScrollingCoordinator {
+public:
+ explicit ScrollingCoordinatorChromium(Page*);
+ virtual ~ScrollingCoordinatorChromium();
+
+ // Should be called whenever the given frame view has been laid out.
+ virtual void frameViewLayoutUpdated(FrameView*);
+
+ // Should be called whenever the root layer for the given frame view changes.
+ virtual void frameViewRootLayerDidChange(FrameView*);
+
+ // Should be called whenever the horizontal scrollbar layer for the given frame view changes.
+ virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer*);
+
+ // Should be called whenever the vertical scrollbar layer for the given frame view changes.
+ virtual void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer*);
+
+ // Return whether this scrolling coordinator can keep fixed position layers fixed to their
+ // containers while scrolling.
+ virtual bool supportsFixedPositionLayers() const { return true; }
+
+ // Mark/unmark a layer as a container for fixed position layers.
+ virtual void setLayerIsContainerForFixedPositionLayers(GraphicsLayer*, bool);
+
+ // Attach/detach layer position to ancestor fixed position container.
+ virtual void setLayerIsFixedToContainerLayer(GraphicsLayer*, bool);
+
+ // Should be called whenever the scrollable layer for the given scroll area changes.
+ virtual void scrollableAreaScrollLayerDidChange(ScrollableArea*, GraphicsLayer*);
+
+private:
+ virtual void recomputeWheelEventHandlerCountForFrameView(FrameView*);
+ virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
+
+ void setScrollLayer(GraphicsLayer*);
+ void setNonFastScrollableRegion(const Region&);
+ void setWheelEventHandlerCount(unsigned);
+ PassOwnPtr<WebKit::WebScrollbarLayer> createScrollbarLayer(Scrollbar*, WebKit::WebLayer* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView*);
+
+ ScrollingCoordinatorPrivate* m_private;
+};
+
+} // namespace WebCore
+
+#endif // ScrollingCoordinatorChromium_h
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
new file mode 100644
index 000000000..c0d617fa9
--- /dev/null
+++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollingCoordinatorMac_h
+#define ScrollingCoordinatorMac_h
+
+#if ENABLE(THREADED_SCROLLING)
+
+#include "ScrollingCoordinator.h"
+
+namespace WebCore {
+
+class ScrollingCoordinatorMac : public ScrollingCoordinator {
+public:
+ explicit ScrollingCoordinatorMac(Page*);
+ virtual ~ScrollingCoordinatorMac();
+
+ virtual void pageDestroyed();
+
+ virtual ScrollingTree* scrollingTree() const;
+ virtual void commitTreeStateIfNeeded();
+
+ // Should be called whenever the given frame view has been laid out.
+ virtual void frameViewLayoutUpdated(FrameView*);
+
+ // Should be called whenever the root layer for the given frame view changes.
+ virtual void frameViewRootLayerDidChange(FrameView*);
+
+ // Should be called whenever the horizontal scrollbar layer for the given frame view changes.
+ virtual void frameViewHorizontalScrollbarLayerDidChange(FrameView*, GraphicsLayer* horizontalScrollbarLayer);
+
+ // Should be called whenever the vertical scrollbar layer for the given frame view changes.
+ virtual void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer* verticalScrollbarLayer);
+
+ // Requests that the scrolling coordinator updates the scroll position of the given frame view. If this function returns true, it means that the
+ // position will be updated asynchronously. If it returns false, the caller should update the scrolling position itself.
+ virtual bool requestScrollPositionUpdate(FrameView*, const IntPoint&);
+
+ // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not.
+ virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&);
+
+ // Dispatched by the scrolling tree whenever the main frame scroll position changes and the scroll layer position needs to be updated as well.
+ virtual void updateMainFrameScrollPositionAndScrollLayerPosition();
+
+ // These functions are used to indicate that a layer should be (or should not longer be) represented by a node
+ // in the scrolling tree.
+ virtual ScrollingNodeID attachToStateTree(ScrollingNodeID);
+ virtual void detachFromStateTree(ScrollingNodeID);
+
+ // This function wipes out the current tree.
+ virtual void clearStateTree();
+
+private:
+ virtual void recomputeWheelEventHandlerCountForFrameView(FrameView*);
+ virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
+
+ void ensureRootStateNodeForFrameView(FrameView*);
+ ScrollingStateScrollingNode* stateNodeForID(ScrollingNodeID);
+
+ struct ScrollParameters {
+ ScrollElasticity horizontalScrollElasticity;
+ ScrollElasticity verticalScrollElasticity;
+
+ bool hasEnabledHorizontalScrollbar;
+ bool hasEnabledVerticalScrollbar;
+
+ ScrollbarMode horizontalScrollbarMode;
+ ScrollbarMode verticalScrollbarMode;
+
+ IntPoint scrollOrigin;
+
+ IntRect viewportRect;
+ IntSize contentsSize;
+ };
+
+ void setScrollParametersForNode(const ScrollParameters&, ScrollingStateScrollingNode*);
+ void setScrollLayerForNode(GraphicsLayer*, ScrollingStateNode*);
+ void setNonFastScrollableRegionForNode(const Region&, ScrollingStateScrollingNode*);
+ void setWheelEventHandlerCountForNode(unsigned, ScrollingStateScrollingNode*);
+
+ void updateMainFrameScrollLayerPosition();
+
+ void scheduleTreeStateCommit();
+
+ void scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorMac>*);
+ void commitTreeState();
+
+ OwnPtr<ScrollingStateTree> m_scrollingStateTree;
+ RefPtr<ScrollingTree> m_scrollingTree;
+ Timer<ScrollingCoordinatorMac> m_scrollingStateTreeCommitterTimer;
+
+ HashMap<ScrollingNodeID, ScrollingStateNode*> m_stateNodeMap;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(THREADED_SCROLLING)
+
+#endif // ScrollingCoordinatorMac_h
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
index dbe821338..cb5fcde51 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
@@ -27,37 +27,134 @@
#if ENABLE(THREADED_SCROLLING)
-#import "ScrollingCoordinator.h"
-
-#import "FrameView.h"
-#import "Page.h"
-#import "ScrollingThread.h"
-#import "ScrollingTree.h"
-#import "ScrollingTreeState.h"
-#import <QuartzCore/QuartzCore.h>
-#import <wtf/Functional.h>
-#import <wtf/MainThread.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/StdLibExtras.h>
-#import <wtf/Vector.h>
+#import "ScrollingCoordinatorMac.h"
+
+#include "Frame.h"
+#include "FrameView.h"
+#include "IntRect.h"
+#include "Page.h"
+#include "PlatformWheelEvent.h"
+#include "PluginViewBase.h"
+#include "Region.h"
+#include "RenderLayerCompositor.h"
+#include "RenderView.h"
+#include "ScrollAnimator.h"
+#include "ScrollingStateScrollingNode.h"
+#include "ScrollingStateTree.h"
+#include "ScrollingThread.h"
+#include "ScrollingTree.h"
+
+#include <wtf/Functional.h>
+#include <wtf/MainThread.h>
+#include <wtf/PassRefPtr.h>
+
namespace WebCore {
class ScrollingCoordinatorPrivate {
};
-PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
+ScrollingCoordinatorMac::ScrollingCoordinatorMac(Page* page)
+ : ScrollingCoordinator(page)
+ , m_scrollingStateTree(ScrollingStateTree::create())
+ , m_scrollingTree(ScrollingTree::create(this))
+ , m_scrollingStateTreeCommitterTimer(this, &ScrollingCoordinatorMac::scrollingStateTreeCommitterTimerFired)
{
- return adoptRef(new ScrollingCoordinator(page));
}
-ScrollingCoordinator::~ScrollingCoordinator()
+ScrollingCoordinatorMac::~ScrollingCoordinatorMac()
{
- ASSERT(!m_page);
ASSERT(!m_scrollingTree);
}
-void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer*)
+void ScrollingCoordinatorMac::pageDestroyed()
+{
+ ScrollingCoordinator::pageDestroyed();
+
+ m_scrollingStateTreeCommitterTimer.stop();
+
+ // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
+ ScrollingThread::dispatch(bind(&ScrollingTree::invalidate, m_scrollingTree.release()));
+}
+
+ScrollingTree* ScrollingCoordinatorMac::scrollingTree() const
+{
+ ASSERT(m_scrollingTree);
+ return m_scrollingTree.get();
+}
+
+void ScrollingCoordinatorMac::commitTreeStateIfNeeded()
+{
+ if (!m_scrollingStateTree->hasChangedProperties())
+ return;
+
+ commitTreeState();
+ m_scrollingStateTreeCommitterTimer.stop();
+}
+
+void ScrollingCoordinatorMac::frameViewLayoutUpdated(FrameView* frameView)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_page);
+
+ // Compute the region of the page that we can't do fast scrolling for. This currently includes
+ // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
+ // frame view whose layout was updated is not the main frame.
+ Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame(), IntPoint());
+
+ // In the future, we may want to have the ability to set non-fast scrolling regions for more than
+ // just the root node. But right now, this concept only applies to the root.
+ setNonFastScrollableRegionForNode(nonFastScrollableRegion, m_scrollingStateTree->rootStateNode());
+
+ if (!coordinatesScrollingForFrameView(frameView))
+ return;
+
+ ScrollingStateScrollingNode* node = stateNodeForID(frameView->scrollLayerID());
+ if (!node)
+ return;
+
+ ScrollParameters scrollParameters;
+ scrollParameters.horizontalScrollElasticity = frameView->horizontalScrollElasticity();
+ scrollParameters.verticalScrollElasticity = frameView->verticalScrollElasticity();
+ scrollParameters.hasEnabledHorizontalScrollbar = frameView->horizontalScrollbar() && frameView->horizontalScrollbar()->enabled();
+ scrollParameters.hasEnabledVerticalScrollbar = frameView->verticalScrollbar() && frameView->verticalScrollbar()->enabled();
+ scrollParameters.horizontalScrollbarMode = frameView->horizontalScrollbarMode();
+ scrollParameters.verticalScrollbarMode = frameView->verticalScrollbarMode();
+
+ scrollParameters.scrollOrigin = frameView->scrollOrigin();
+ scrollParameters.viewportRect = IntRect(IntPoint(), frameView->visibleContentRect().size());
+ scrollParameters.contentsSize = frameView->contentsSize();
+
+ setScrollParametersForNode(scrollParameters, node);
+}
+
+void ScrollingCoordinatorMac::recomputeWheelEventHandlerCountForFrameView(FrameView* frameView)
+{
+ ScrollingStateScrollingNode* node = stateNodeForID(frameView->scrollLayerID());
+ if (!node)
+ return;
+ setWheelEventHandlerCountForNode(computeCurrentWheelEventHandlerCount(), node);
+}
+
+void ScrollingCoordinatorMac::frameViewRootLayerDidChange(FrameView* frameView)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_page);
+
+ if (!coordinatesScrollingForFrameView(frameView))
+ return;
+
+ // If the root layer does not have a ScrollingStateNode, then we should create one.
+ ensureRootStateNodeForFrameView(frameView);
+ ASSERT(m_scrollingStateTree->rootStateNode());
+ m_scrollingStateTree->rootLayerDidChange();
+
+ ScrollingCoordinator::frameViewRootLayerDidChange(frameView);
+
+ setScrollLayerForNode(scrollLayerForFrameView(frameView), stateNodeForID(frameView->scrollLayerID()));
+}
+
+void ScrollingCoordinatorMac::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer*)
{
ASSERT(isMainThread());
ASSERT(m_page);
@@ -68,7 +165,7 @@ void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView*
// FIXME: Implement.
}
-void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer*)
+void ScrollingCoordinatorMac::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer*)
{
ASSERT(isMainThread());
ASSERT(m_page);
@@ -79,6 +176,206 @@ void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* f
// FIXME: Implement.
}
+bool ScrollingCoordinatorMac::requestScrollPositionUpdate(FrameView* frameView, const IntPoint& scrollPosition)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_page);
+
+ if (!coordinatesScrollingForFrameView(frameView))
+ return false;
+
+ if (frameView->frame()->document()->inPageCache()) {
+ // If this frame view's document is being put into the page cache, we don't want to update our
+ // main frame scroll position. Just let the FrameView think that we did.
+ updateMainFrameScrollPosition(scrollPosition, frameView->inProgrammaticScroll());
+ return true;
+ }
+
+ ScrollingStateScrollingNode* stateNode = stateNodeForID(frameView->scrollLayerID());
+ if (!stateNode)
+ return false;
+
+ stateNode->setRequestedScrollPosition(scrollPosition, frameView->inProgrammaticScroll());
+ scheduleTreeStateCommit();
+ return true;
+}
+
+bool ScrollingCoordinatorMac::handleWheelEvent(FrameView*, const PlatformWheelEvent& wheelEvent)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_page);
+
+ if (m_scrollingTree->willWheelEventStartSwipeGesture(wheelEvent))
+ return false;
+
+ ScrollingThread::dispatch(bind(&ScrollingTree::handleWheelEvent, m_scrollingTree.get(), wheelEvent));
+
+ return true;
+}
+
+void ScrollingCoordinatorMac::updateMainFrameScrollPositionAndScrollLayerPosition()
+{
+ ASSERT(isMainThread());
+
+ if (!m_page)
+ return;
+
+ FrameView* frameView = m_page->mainFrame()->view();
+ if (!frameView)
+ return;
+
+ IntPoint scrollPosition = m_scrollingTree->mainFrameScrollPosition();
+
+ frameView->setConstrainsScrollingToContentEdge(false);
+ frameView->notifyScrollPositionChanged(scrollPosition);
+ frameView->setConstrainsScrollingToContentEdge(true);
+
+ if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
+ scrollLayer->setPosition(-frameView->scrollPosition());
+}
+
+ScrollingNodeID ScrollingCoordinatorMac::attachToStateTree(ScrollingNodeID scrollLayerID)
+{
+ ASSERT(scrollLayerID);
+
+ ScrollingStateScrollingNode* existingNode = stateNodeForID(scrollLayerID);
+ if (existingNode && existingNode == m_scrollingStateTree->rootStateNode())
+ return scrollLayerID;
+
+ clearStateTree();
+
+ // FIXME: In the future, this function will have to take a parent ID so that it can
+ // append the node in the appropriate spot in the state tree. For now we always assume
+ // this is the root node.
+ m_scrollingStateTree->setRootStateNode(ScrollingStateScrollingNode::create(m_scrollingStateTree.get(), scrollLayerID));
+ m_stateNodeMap.set(scrollLayerID, m_scrollingStateTree->rootStateNode());
+ return scrollLayerID;
+}
+
+void ScrollingCoordinatorMac::detachFromStateTree(ScrollingNodeID scrollLayerID)
+{
+ if (!scrollLayerID)
+ return;
+
+ ScrollingStateNode* node = m_stateNodeMap.take(scrollLayerID);
+ m_scrollingStateTree->removeNode(node);
+
+ // ScrollingStateTree::removeNode() will destroy children, so we have to make sure we remove those children
+ // from the HashMap.
+ const Vector<ScrollingNodeID>& removedNodes = m_scrollingStateTree->removedNodes();
+ size_t size = removedNodes.size();
+ for (size_t i = 0; i < size; ++i)
+ m_stateNodeMap.remove(removedNodes[i]);
+}
+
+void ScrollingCoordinatorMac::clearStateTree()
+{
+ m_stateNodeMap.clear();
+ if (ScrollingStateScrollingNode* node = m_scrollingStateTree->rootStateNode())
+ m_scrollingStateTree->removeNode(node);
+}
+
+ScrollingStateScrollingNode* ScrollingCoordinatorMac::stateNodeForID(ScrollingNodeID scrollLayerID)
+{
+ if (!scrollLayerID)
+ return 0;
+
+ HashMap<ScrollingNodeID, ScrollingStateNode*>::const_iterator it = m_stateNodeMap.find(scrollLayerID);
+ if (it == m_stateNodeMap.end())
+ return 0;
+
+ ScrollingStateNode* node = it->value;
+ return toScrollingStateScrollingNode(node);
+}
+
+void ScrollingCoordinatorMac::ensureRootStateNodeForFrameView(FrameView* frameView)
+{
+ attachToStateTree(frameView->scrollLayerID());
+}
+
+void ScrollingCoordinatorMac::setScrollLayerForNode(GraphicsLayer* scrollLayer, ScrollingStateNode* node)
+{
+ node->setScrollLayer(scrollLayer);
+ scheduleTreeStateCommit();
+}
+
+void ScrollingCoordinatorMac::setNonFastScrollableRegionForNode(const Region& region, ScrollingStateScrollingNode* node)
+{
+ node->setNonFastScrollableRegion(region);
+ scheduleTreeStateCommit();
+}
+
+void ScrollingCoordinatorMac::setScrollParametersForNode(const ScrollParameters& scrollParameters, ScrollingStateScrollingNode* node)
+{
+ node->setHorizontalScrollElasticity(scrollParameters.horizontalScrollElasticity);
+ node->setVerticalScrollElasticity(scrollParameters.verticalScrollElasticity);
+ node->setHasEnabledHorizontalScrollbar(scrollParameters.hasEnabledHorizontalScrollbar);
+ node->setHasEnabledVerticalScrollbar(scrollParameters.hasEnabledVerticalScrollbar);
+ node->setHorizontalScrollbarMode(scrollParameters.horizontalScrollbarMode);
+ node->setVerticalScrollbarMode(scrollParameters.verticalScrollbarMode);
+
+ node->setScrollOrigin(scrollParameters.scrollOrigin);
+ node->setViewportRect(scrollParameters.viewportRect);
+ node->setContentsSize(scrollParameters.contentsSize);
+ scheduleTreeStateCommit();
+}
+
+void ScrollingCoordinatorMac::setWheelEventHandlerCountForNode(unsigned wheelEventHandlerCount, ScrollingStateScrollingNode* node)
+{
+ node->setWheelEventHandlerCount(wheelEventHandlerCount);
+ scheduleTreeStateCommit();
+}
+
+void ScrollingCoordinatorMac::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
+{
+ // The FrameView's GraphicsLayer is likely to be out-of-synch with the PlatformLayer
+ // at this point. So we'll update it before we switch back to main thread scrolling
+ // in order to avoid layer positioning bugs.
+ if (reasons)
+ updateMainFrameScrollLayerPosition();
+ m_scrollingStateTree->rootStateNode()->setShouldUpdateScrollLayerPositionOnMainThread(reasons);
+ scheduleTreeStateCommit();
+}
+
+void ScrollingCoordinatorMac::updateMainFrameScrollLayerPosition()
+{
+ ASSERT(isMainThread());
+
+ if (!m_page)
+ return;
+
+ FrameView* frameView = m_page->mainFrame()->view();
+ if (!frameView)
+ return;
+
+ if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
+ scrollLayer->setPosition(-frameView->scrollPosition());
+}
+
+void ScrollingCoordinatorMac::scheduleTreeStateCommit()
+{
+ if (m_scrollingStateTreeCommitterTimer.isActive())
+ return;
+
+ if (!m_scrollingStateTree->hasChangedProperties())
+ return;
+
+ m_scrollingStateTreeCommitterTimer.startOneShot(0);
+}
+
+void ScrollingCoordinatorMac::scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorMac>*)
+{
+ commitTreeState();
+}
+
+void ScrollingCoordinatorMac::commitTreeState()
+{
+ ASSERT(m_scrollingStateTree->hasChangedProperties());
+
+ OwnPtr<ScrollingStateTree> treeState = m_scrollingStateTree->commit();
+ ScrollingThread::dispatch(bind(&ScrollingTree::commitNewTreeState, m_scrollingTree.get(), treeState.release()));
+}
+
} // namespace WebCore
#endif // ENABLE(THREADED_SCROLLING)
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeStateMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingStateNodeMac.mm
index 21f0c7253..5ea7532f6 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeStateMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingStateNodeMac.mm
@@ -24,18 +24,25 @@
*/
#include "config.h"
-#include "ScrollingTreeState.h"
+#include "ScrollingStateNode.h"
+
+#include "ScrollingStateTree.h"
#if ENABLE(THREADED_SCROLLING)
namespace WebCore {
-PlatformLayer* ScrollingTreeState::platformScrollLayer() const
+PlatformLayer* ScrollingStateNode::platformScrollLayer() const
{
return m_platformScrollLayer.get();
}
-void ScrollingTreeState::setScrollLayer(const GraphicsLayer* graphicsLayer)
+void ScrollingStateNode::setScrollLayer(PlatformLayer* platformLayer)
+{
+ m_platformScrollLayer = platformLayer;
+}
+
+void ScrollingStateNode::setScrollLayer(const GraphicsLayer* graphicsLayer)
{
PlatformLayer* platformScrollLayer = graphicsLayer ? graphicsLayer->platformLayer() : nil;
@@ -43,7 +50,8 @@ void ScrollingTreeState::setScrollLayer(const GraphicsLayer* graphicsLayer)
return;
m_platformScrollLayer = platformScrollLayer;
- m_changedProperties |= ScrollLayer;
+ m_scrollLayerDidChange = true;
+ m_scrollingStateTree->setHasChangedProperties(true);
}
} // namespace WebCore
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h b/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h
index 4304b61bb..45f70ed73 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h
+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.h
@@ -43,7 +43,7 @@ public:
private:
// ScrollingTreeNode member functions.
- virtual void update(ScrollingTreeState*) OVERRIDE;
+ virtual void update(ScrollingStateScrollingNode*) OVERRIDE;
virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
// ScrollElasticityController member functions.
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm
index 68b079cbd..e27be0959 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm
@@ -31,7 +31,7 @@
#include "PlatformWheelEvent.h"
#include "ScrollingCoordinator.h"
#include "ScrollingTree.h"
-#include "ScrollingTreeState.h"
+#include "ScrollingStateTree.h"
#include "Settings.h"
#include "TileCache.h"
#include "WebTileLayer.h"
@@ -62,26 +62,26 @@ ScrollingTreeNodeMac::~ScrollingTreeNodeMac()
CFRunLoopTimerInvalidate(m_snapRubberbandTimer.get());
}
-void ScrollingTreeNodeMac::update(ScrollingTreeState* state)
+void ScrollingTreeNodeMac::update(ScrollingStateScrollingNode* state)
{
ScrollingTreeNode::update(state);
- if (state->changedProperties() & ScrollingTreeState::ScrollLayer)
+ if (state->scrollLayerDidChange())
m_scrollLayer = state->platformScrollLayer();
- if (state->changedProperties() & ScrollingTreeState::RequestedScrollPosition)
+ if (state->changedProperties() & ScrollingStateScrollingNode::RequestedScrollPosition)
setScrollPosition(state->requestedScrollPosition());
- if (state->changedProperties() & (ScrollingTreeState::ScrollLayer | ScrollingTreeState::ContentsSize | ScrollingTreeState::ViewportRect))
+ if (state->scrollLayerDidChange() || state->changedProperties() & (ScrollingStateScrollingNode::ContentsSize | ScrollingStateScrollingNode::ViewportRect))
updateMainFramePinState(scrollPosition());
- if ((state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThread)) {
+ if ((state->changedProperties() & ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread)) {
unsigned mainThreadScrollingReasons = this->shouldUpdateScrollLayerPositionOnMainThread();
if (mainThreadScrollingReasons) {
// We're transitioning to the slow "update scroll layer position on the main thread" mode.
// Initialize the probable main thread scroll position with the current scroll layer position.
- if (state->changedProperties() & ScrollingTreeState::RequestedScrollPosition)
+ if (state->changedProperties() & ScrollingStateScrollingNode::RequestedScrollPosition)
m_probableMainThreadScrollPosition = state->requestedScrollPosition();
else {
CGPoint scrollLayerPosition = m_scrollLayer.get().position;