Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: Source/core/dom/Document.cpp

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix incorrect assumption Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index d9973c2d86cf2b4bc9b8693edb4855524db8a4b0..019db4d95d02d9d69d401a01f83ea34fcefd6e82 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -362,7 +362,7 @@ static void printNavigationErrorMessage(const LocalFrame& frame, const KURL& act
String message = "Unsafe JavaScript attempt to initiate navigation for frame with URL '" + frame.document()->url().string() + "' from frame with URL '" + activeURL.string() + "'. " + reason + "\n";
// FIXME: should we print to the console of the document performing the navigation instead?
- frame.domWindow()->printErrorMessage(message);
+ frame.localDOMWindow()->printErrorMessage(message);
}
uint64_t Document::s_globalTreeVersion = 0;
@@ -444,7 +444,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
, m_evaluateMediaQueriesOnStyleRecalc(false)
, m_pendingSheetLayout(NoLayoutWithPendingSheets)
, m_frame(initializer.frame())
- , m_domWindow(m_frame ? m_frame->domWindow() : 0)
+ , m_domWindow(m_frame ? m_frame->localDOMWindow() : 0)
, m_importsController(initializer.importsController())
, m_activeParserCount(0)
, m_contextFeatures(ContextFeatures::defaultSwitch())
@@ -2635,10 +2635,10 @@ void Document::dispatchUnloadEvents()
DocumentLoadTiming* timing = documentLoader->timing();
ASSERT(timing->navigationStart());
timing->markUnloadEventStart();
- m_frame->domWindow()->dispatchEvent(unloadEvent, this);
+ m_frame->localDOMWindow()->dispatchEvent(unloadEvent, this);
timing->markUnloadEventEnd();
} else {
- m_frame->domWindow()->dispatchEvent(unloadEvent, m_frame->document());
+ m_frame->localDOMWindow()->dispatchEvent(unloadEvent, m_frame->document());
}
}
m_loadEventProgress = UnloadEventHandled;
@@ -5206,7 +5206,7 @@ void Document::serviceScriptedAnimations(double monotonicAnimationStartTime)
m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationStartTime);
}
-PassRefPtrWillBeRawPtr<Touch> Document::createTouch(LocalDOMWindow* window, EventTarget* target, int identifier, double pageX, double pageY, double screenX, double screenY, double radiusX, double radiusY, float rotationAngle, float force) const
+PassRefPtrWillBeRawPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, double pageX, double pageY, double screenX, double screenY, double radiusX, double radiusY, float rotationAngle, float force) const
{
// Match behavior from when these types were integers, and avoid surprises from someone explicitly
// passing Infinity/NaN.
@@ -5231,7 +5231,7 @@ PassRefPtrWillBeRawPtr<Touch> Document::createTouch(LocalDOMWindow* window, Even
// http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
// when this method should throw and nor is it by inspection of iOS behavior. It would be nice to verify any cases where it throws under iOS
// and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=47819
- LocalFrame* frame = window ? window->frame() : this->frame();
+ LocalFrame* frame = window && window->isLocalDOMWindow() ? toLocalDOMWindow(window)->frame() : this->frame();
return Touch::create(frame, target, identifier, FloatPoint(screenX, screenY), FloatPoint(pageX, pageY), FloatSize(radiusX, radiusY), rotationAngle, force);
}

Powered by Google App Engine
This is Rietveld 408576698