Changeset 71354 in webkit


Ignore:
Timestamp:
Nov 4, 2010 1:41:43 PM (13 years ago)
Author:
robert@webkit.org
Message:

2010-11-04 Robert Hogan <robert@webkit.org>

Reviewed by Darin Adler.

Stale reference to JSDOMWindow in ScriptController::m_cacheableBindingObject

Unskip fast/dom/nodesFromRect-basic.html on Qt.

https://bugs.webkit.org/show_bug.cgi?id=48758

  • platform/qt/Skipped:

2010-11-04 Robert Hogan <robert@webkit.org>

Reviewed by Darin Adler.

Stale reference to JSDOMWindow in ScriptController::m_cacheableBindingObject

After bug 37725 we need to update the globalObject() (i.e. JSDOMWindow)
associated with the m_cacheablebindingRootObject every time we clear the
frame and load a new page. This allows the runtime objects
(e.g. LayoutTestController etc.) to persist between navigations as
before but also ensures that when qt_runtime, or any other bridge,
looks at the root->globalObject() of a cacheable binding object
it gets the DOMWindow of the current page rather than the DOMWindow
that was in place when m_cacheableBindingRootObject was created.

Fixes fast/dom/nodesFromRect-basic.html on Qt.

https://bugs.webkit.org/show_bug.cgi?id=48758

  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::clearWindowShell):
  • bridge/runtime_root.cpp: (JSC::Bindings::RootObject::updateGlobalObject):
  • bridge/runtime_root.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r71350 r71354  
     12010-11-04  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Stale reference to JSDOMWindow in ScriptController::m_cacheableBindingObject
     6
     7        Unskip fast/dom/nodesFromRect-basic.html on Qt.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=48758
     10
     11        * platform/qt/Skipped:
     12
    1132010-11-04  Adam Roben  <aroben@apple.com>
    214
  • trunk/LayoutTests/platform/qt/Skipped

    r71320 r71354  
    54625462fast/images/webp-image-decoding.html
    54635463
    5464 # [Qt] DRT sideeffect revealed by r71004
    5465 # https://bugs.webkit.org/show_bug.cgi?id=48758
    5466 fast/dom/nodesFromRect-basic.html
    5467 
    54685464# [Qt] DRT sideeffect revealed by r71268
    54695465# https://bugs.webkit.org/show_bug.cgi?id=48958
  • trunk/WebCore/ChangeLog

    r71352 r71354  
     12010-11-04  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Stale reference to JSDOMWindow in ScriptController::m_cacheableBindingObject
     6
     7        After bug 37725 we need to update the globalObject() (i.e. JSDOMWindow)
     8        associated with the m_cacheablebindingRootObject every time we clear the
     9        frame and load a new page. This allows the runtime objects
     10        (e.g. LayoutTestController etc.) to persist between navigations as
     11        before but also ensures that when qt_runtime, or any other bridge,
     12        looks at the root->globalObject() of a cacheable binding object
     13        it gets the DOMWindow of the current page rather than the DOMWindow
     14        that was in place when m_cacheableBindingRootObject was created.
     15
     16        Fixes fast/dom/nodesFromRect-basic.html on Qt.
     17
     18        https://bugs.webkit.org/show_bug.cgi?id=48758
     19
     20        * bindings/js/ScriptController.cpp:
     21        (WebCore::ScriptController::clearWindowShell):
     22        * bridge/runtime_root.cpp:
     23        (JSC::Bindings::RootObject::updateGlobalObject):
     24        * bridge/runtime_root.h:
     25
    1262010-11-04  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    227
  • trunk/WebCore/bindings/js/ScriptController.cpp

    r69990 r71354  
    198198        windowShell->setWindow(m_frame->domWindow());
    199199
     200        // An m_cacheableBindingRootObject persists between page navigations
     201        // so needs to know about the new JSDOMWindow.
     202        if (m_cacheableBindingRootObject)
     203            m_cacheableBindingRootObject->updateGlobalObject(windowShell->window());
     204
    200205        if (Page* page = m_frame->page()) {
    201206            attachDebugger(windowShell, page->debugger());
  • trunk/WebCore/bridge/runtime_root.cpp

    r55109 r71354  
    169169}
    170170
     171void RootObject::updateGlobalObject(JSGlobalObject* globalObject)
     172{
     173    m_globalObject = globalObject;
     174}
     175
    171176void RootObject::addRuntimeObject(RuntimeObject* object)
    172177{
  • trunk/WebCore/bridge/runtime_root.h

    r55250 r71354  
    7070    const void* nativeHandle() const;
    7171    JSGlobalObject* globalObject() const;
     72    void updateGlobalObject(JSGlobalObject*);
    7273
    7374    void addRuntimeObject(RuntimeObject*);
Note: See TracChangeset for help on using the changeset viewer.