[Webkit-unassigned] [Bug 48372] New: Fix direct event type querying by using a generic event wrapper function

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 26 13:52:02 PDT 2010


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

           Summary: Fix direct event type querying by using a generic
                    event wrapper function
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: inferno at chromium.org
                CC: dglazkov at chromium.org


As per Dimitri's comments on bug https://bugs.webkit.org/show_bug.cgi?id=48345, we should prevent direct event-type() querying in various places e.g.

void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event)
{
    if (event->type() == eventNames().resizeEvent)
        m_doc->windowSizeChanged();
    else if (event->type() == eventNames().clickEvent) {
        MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);

And replace with a generic wrapper like isMouseClickEvent(event) which does the
1) event type check - event->type() == eventNames().clickEvent
2) event cast check - event->isMouseEvent

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list