Changeset 89002 in webkit


Ignore:
Timestamp:
Jun 15, 2011 9:25:11 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-06-15 Adam Barth <abarth@webkit.org>

Reviewed by Anders Carlsson.

Remove ScriptController::isJavaScriptAnchorNavigation
https://bugs.webkit.org/show_bug.cgi?id=62775

This function no longer plays a role in the user gesture code now that
we're not encoding the user gesture state into the ScriptSourceCode
URL.

  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::processingUserGesture):
  • bindings/js/ScriptController.h:
  • bindings/v8/ScriptController.cpp: (WebCore::ScriptController::processingUserGesture):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89001 r89002  
     12011-06-15  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Remove ScriptController::isJavaScriptAnchorNavigation
     6        https://bugs.webkit.org/show_bug.cgi?id=62775
     7
     8        This function no longer plays a role in the user gesture code now that
     9        we're not encoding the user gesture state into the ScriptSourceCode
     10        URL.
     11
     12        * bindings/js/ScriptController.cpp:
     13        (WebCore::ScriptController::processingUserGesture):
     14        * bindings/js/ScriptController.h:
     15        * bindings/v8/ScriptController.cpp:
     16        (WebCore::ScriptController::processingUserGesture):
     17
    1182011-06-15  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebCore/bindings/js/ScriptController.cpp

    r89001 r89002  
    252252        return UserGestureIndicator::getUserGestureState() != DefinitelyNotProcessingUserGesture;
    253253
    254     // FIXME: Remove the isJavaScriptAnchorNavigation check once https://bugs.webkit.org/show_bug.cgi?id=62702 is fixed.
    255     if (frame->script()->isJavaScriptAnchorNavigation())
    256         return true;
    257 
    258254    // If a DOM event is being processed, check that it was initiated by the user
    259255    // and that it is in the whitelist of event types allowed to generate pop-ups.
     
    263259
    264260    return UserGestureIndicator::processingUserGesture();
    265 }
    266 
    267 // FIXME: This seems like an insufficient check to verify a click on a javascript: anchor.
    268 bool ScriptController::isJavaScriptAnchorNavigation() const
    269 {
    270     // This is the <a href="javascript:window.open('...')> case -> we let it through
    271     if (m_sourceURL && m_sourceURL->isNull() && !m_processingTimerCallback)
    272         return true;
    273 
    274     // This is the <script>window.open(...)</script> case or a timer callback -> block it
    275     return false;
    276261}
    277262
  • trunk/Source/WebCore/bindings/js/ScriptController.h

    r89001 r89002  
    170170    void disconnectPlatformScriptObjects();
    171171
    172     bool isJavaScriptAnchorNavigation() const;
    173 
    174172    ShellMap m_windowShells;
    175173    Frame* m_frame;
     
    178176    bool m_inExecuteScript;
    179177
    180     bool m_processingTimerCallback;
    181178    bool m_paused;
    182179
  • trunk/Source/WebCore/bindings/v8/ScriptController.cpp

    r89001 r89002  
    171171        return event->fromUserGesture();
    172172
    173     // FIXME: Remove this check once https://bugs.webkit.org/show_bug.cgi?id=62702 is fixed.
    174     const String* sourceURL = firstFrame->script()->sourceURL();
    175     if (sourceURL && sourceURL->isNull() && !firstFrame->script()->proxy()->timerCallback())
    176         return true;
    177 
    178173    return UserGestureIndicator::processingUserGesture();
    179174}
Note: See TracChangeset for help on using the changeset viewer.