Changeset 61964 in webkit


Ignore:
Timestamp:
Jun 26, 2010 3:59:31 PM (14 years ago)
Author:
beidson@apple.com
Message:

beforeProcess event needs to fire before inline scripts/stylesheets take effect
<rdar://problem/8084335> and https://bugs.webkit.org/show_bug.cgi?id=40484

Reviewed by Darin Adler.

This patch adds the Event, the onBeforeProcess attribute, and hooks the attribute up in a few places.
Besides that, no change in behavior.

Layout tests will come with the actual implementations as a followup to this patch.

Project file nonsense:

  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pri:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:

Scaffolding for the event itself:

  • dom/BeforeProcessEvent.cpp: Added.

(WebCore::BeforeProcessEvent::text):
(WebCore::BeforeProcessEvent::setText):

  • dom/BeforeProcessEvent.h: Added.

(WebCore::BeforeProcessEvent::create):
(WebCore::BeforeProcessEvent::initBeforeProcessEvent):
(WebCore::BeforeProcessEvent::BeforeProcessEvent):

  • dom/BeforeProcessEvent.idl: Added.
  • dom/EventNames.h:

Respect the onBeforeProcess attribute:

  • dom/Document.cpp:

(WebCore::Document::addListenerTypeIfNeeded):

  • dom/Document.h:

(WebCore::Document::):

  • html/HTMLAttributeNames.in:
  • html/HTMLScriptElement.cpp:

(WebCore::HTMLScriptElement::parseMappedAttribute):

  • html/HTMLStyleElement.cpp:

(WebCore::HTMLStyleElement::parseMappedAttribute):

Location:
trunk/WebCore
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61963 r61964  
     12010-06-26  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        beforeProcess event needs to fire before inline scripts/stylesheets take effect
     6        <rdar://problem/8084335> and https://bugs.webkit.org/show_bug.cgi?id=40484
     7
     8        This patch adds the Event, the onBeforeProcess attribute, and hooks the attribute up in a few places.
     9        Besides that, no change in behavior.
     10
     11        Layout tests will come with the actual implementations as a followup to this patch.
     12
     13        Project file nonsense:
     14        * DerivedSources.make:
     15        * GNUmakefile.am:
     16        * WebCore.gypi:
     17        * WebCore.pri:
     18        * WebCore.pro:
     19        * WebCore.vcproj/WebCore.vcproj:
     20        * WebCore.xcodeproj/project.pbxproj:
     21
     22        Scaffolding for the event itself:
     23        * dom/BeforeProcessEvent.cpp: Added.
     24        (WebCore::BeforeProcessEvent::text):
     25        (WebCore::BeforeProcessEvent::setText):
     26        * dom/BeforeProcessEvent.h: Added.
     27        (WebCore::BeforeProcessEvent::create):
     28        (WebCore::BeforeProcessEvent::initBeforeProcessEvent):
     29        (WebCore::BeforeProcessEvent::BeforeProcessEvent):
     30        * dom/BeforeProcessEvent.idl: Added.
     31
     32        * dom/EventNames.h:
     33
     34        Respect the onBeforeProcess attribute:
     35        * dom/Document.cpp:
     36        (WebCore::Document::addListenerTypeIfNeeded):
     37        * dom/Document.h:
     38        (WebCore::Document::):
     39
     40        * html/HTMLAttributeNames.in:
     41        * html/HTMLScriptElement.cpp:
     42        (WebCore::HTMLScriptElement::parseMappedAttribute):
     43        * html/HTMLStyleElement.cpp:
     44        (WebCore::HTMLStyleElement::parseMappedAttribute):
     45
    1462010-06-26  Darin Adler  <darin@apple.com>
    247
  • trunk/WebCore/DerivedSources.make

    r61950 r61964  
    5454    BarInfo \
    5555    BeforeLoadEvent \
     56    BeforeProcessEvent \
    5657    Blob \
    5758    BlobBuilder \
  • trunk/WebCore/GNUmakefile.am

    r61950 r61964  
    130130        WebCore/dom/Attr.idl \
    131131        WebCore/dom/BeforeLoadEvent.idl \
     132        WebCore/dom/BeforeProcessEvent.idl \
    132133        WebCore/dom/CDATASection.idl \
    133134        WebCore/dom/CharacterData.idl \
     
    734735        WebCore/dom/Attribute.h \
    735736        WebCore/dom/BeforeLoadEvent.h \
     737        WebCore/dom/BeforeProcessEvent.cpp \
     738        WebCore/dom/BeforeProcessEvent.h \
    736739        WebCore/dom/BeforeTextInsertedEvent.cpp \
    737740        WebCore/dom/BeforeTextInsertedEvent.h \
  • trunk/WebCore/WebCore.gypi

    r61955 r61964  
    3131            'dom/Attr.idl',
    3232            'dom/BeforeLoadEvent.idl',
     33            'dom/BeforeProcessEvent.idl',
    3334            'dom/CDATASection.idl',
    3435            'dom/CharacterData.idl',
     
    10631064            'dom/BeforeTextInsertedEvent.h',
    10641065            'dom/BeforeLoadEvent.h',
     1066            'dom/BeforeProcessEvent.cpp',
     1067            'dom/BeforeProcessEvent.h',
    10651068            'dom/BeforeUnloadEvent.cpp',
    10661069            'dom/BeforeUnloadEvent.h',
  • trunk/WebCore/WebCore.pri

    r61950 r61964  
    272272    dom/Attr.idl \
    273273    dom/BeforeLoadEvent.idl \
     274    dom/BeforeProcessEvent.idl \
    274275    dom/CharacterData.idl \
    275276    dom/ClientRect.idl \
  • trunk/WebCore/WebCore.pro

    r61950 r61964  
    455455    dom/Attr.cpp \
    456456    dom/Attribute.cpp \
     457    dom/BeforeProcessEvent.cpp \
    457458    dom/BeforeTextInsertedEvent.cpp \
    458459    dom/BeforeUnloadEvent.cpp \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r61950 r61964  
    722722                        </File>
    723723                        <File
     724                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBeforeProcessEvent.cpp"
     725                                >
     726                                <FileConfiguration
     727                                        Name="Debug|Win32"
     728                                        ExcludedFromBuild="true"
     729                                        >
     730                                        <Tool
     731                                                Name="VCCLCompilerTool"
     732                                        />
     733                                </FileConfiguration>
     734                                <FileConfiguration
     735                                        Name="Release|Win32"
     736                                        ExcludedFromBuild="true"
     737                                        >
     738                                        <Tool
     739                                                Name="VCCLCompilerTool"
     740                                        />
     741                                </FileConfiguration>
     742                                <FileConfiguration
     743                                        Name="Debug_Internal|Win32"
     744                                        ExcludedFromBuild="true"
     745                                        >
     746                                        <Tool
     747                                                Name="VCCLCompilerTool"
     748                                        />
     749                                </FileConfiguration>
     750                                <FileConfiguration
     751                                        Name="Debug_Cairo|Win32"
     752                                        ExcludedFromBuild="true"
     753                                        >
     754                                        <Tool
     755                                                Name="VCCLCompilerTool"
     756                                        />
     757                                </FileConfiguration>
     758                                <FileConfiguration
     759                                        Name="Release_Cairo|Win32"
     760                                        ExcludedFromBuild="true"
     761                                        >
     762                                        <Tool
     763                                                Name="VCCLCompilerTool"
     764                                        />
     765                                </FileConfiguration>
     766                                <FileConfiguration
     767                                        Name="Debug_All|Win32"
     768                                        ExcludedFromBuild="true"
     769                                        >
     770                                        <Tool
     771                                                Name="VCCLCompilerTool"
     772                                        />
     773                                </FileConfiguration>
     774                        </File>
     775                        <File
     776                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBeforeProcessEvent.h"
     777                                >
     778                        </File>
     779                        <File
    724780                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBlob.cpp"
    725781                                >
     
    2971829774                        </File>
    2971929775                        <File
     29776                                RelativePath="..\dom\BeforeProcessEvent.cpp"
     29777                                >
     29778                        </File>
     29779                        <File
     29780                                RelativePath="..\dom\BeforeProcessEvent.h"
     29781                                >
     29782                        </File>
     29783                        <File
    2972029784                                RelativePath="..\dom\BeforeTextInsertedEvent.cpp"
    2972129785                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r61950 r61964  
    10861086                5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
    10871087                516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; };
     1088                51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51721FB911D2790700638B42 /* BeforeProcessEvent.h */; };
     1089                51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */; };
     1090                51721FD311D27EF200638B42 /* JSBeforeProcessEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51721FD111D27EF200638B42 /* JSBeforeProcessEvent.h */; };
     1091                5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */; };
    10881092                51741D0F0B07259A00ED442C /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0B0B07259A00ED442C /* BackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10891093                51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0C0B07259A00ED442C /* BackForwardList.cpp */; };
     
    67456749                5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HistoryItemMac.mm; path = mac/HistoryItemMac.mm; sourceTree = "<group>"; };
    67466750                516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; };
     6751                51721FB911D2790700638B42 /* BeforeProcessEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeforeProcessEvent.h; sourceTree = "<group>"; };
     6752                51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BeforeProcessEvent.idl; sourceTree = "<group>"; };
     6753                51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBeforeProcessEvent.cpp; sourceTree = "<group>"; };
     6754                51721FD111D27EF200638B42 /* JSBeforeProcessEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeProcessEvent.h; sourceTree = "<group>"; };
     6755                5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeProcessEvent.cpp; sourceTree = "<group>"; };
    67476756                51741D0B0B07259A00ED442C /* BackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardList.h; sourceTree = "<group>"; };
    67486757                51741D0C0B07259A00ED442C /* BackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardList.cpp; sourceTree = "<group>"; };
     
    1449114500                                BC946345107A934B00857193 /* JSBeforeLoadEvent.cpp */,
    1449214501                                BC946347107A936600857193 /* JSBeforeLoadEvent.h */,
     14502                                51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */,
     14503                                51721FD111D27EF200638B42 /* JSBeforeProcessEvent.h */,
    1449314504                                79AC9216109945C80021266E /* JSCompositionEvent.cpp */,
    1449414505                                79AC9217109945C80021266E /* JSCompositionEvent.h */,
     
    1665116662                                BC9462D7107A7B4C00857193 /* BeforeLoadEvent.h */,
    1665216663                                BC9462CB107A7A3900857193 /* BeforeLoadEvent.idl */,
     16664                                5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */,
     16665                                51721FB911D2790700638B42 /* BeforeProcessEvent.h */,
     16666                                51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */,
    1665316667                                AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */,
    1665416668                                AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */,
     
    1955519569                                A853123D11D0471B00D4D077 /* FragmentScriptingPermission.h in Headers */,
    1955619570                                A8E6A78111D1661B00311F4A /* HTMLParserScheduler.h in Headers */,
     19571                                51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */,
     19572                                51721FD311D27EF200638B42 /* JSBeforeProcessEvent.h in Headers */,
    1955719573                                A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */,
    1955819574                                CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */,
     
    2187821894                                B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
    2187921895                                A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */,
     21896                                51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */,
     21897                                5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */,
    2188021898                                CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */,
    2188121899                                A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */,
  • trunk/WebCore/dom/Document.cpp

    r61904 r61964  
    32763276    else if (eventType == eventNames().beforeloadEvent)
    32773277        addListenerType(BEFORELOAD_LISTENER);
     3278    else if (eventType == eventNames().beforeprocessEvent)
     3279        addListenerType(BEFOREPROCESS_LISTENER);
    32783280#if ENABLE(TOUCH_EVENTS)
    32793281    else if (eventType == eventNames().touchstartEvent
  • trunk/WebCore/dom/Document.h

    r61868 r61964  
    664664        TRANSITIONEND_LISTENER               = 0x800,
    665665        BEFORELOAD_LISTENER                  = 0x1000,
    666         TOUCH_LISTENER                       = 0x2000
     666        TOUCH_LISTENER                       = 0x2000,
     667        BEFOREPROCESS_LISTENER               = 0x4000
    667668    };
    668669
  • trunk/WebCore/dom/EventNames.h

    r60624 r61964  
    3535    macro(beforeload) \
    3636    macro(beforepaste) \
     37    macro(beforeprocess) \
    3738    macro(beforeunload) \
    3839    macro(blur) \
  • trunk/WebCore/html/HTMLAttributeNames.in

    r61752 r61964  
    146146onbeforeload
    147147onbeforepaste
     148onbeforeprocess
    148149onbeforeunload
    149150onblur
  • trunk/WebCore/html/HTMLScriptElement.cpp

    r61959 r61964  
    7575    else if (attrName == onbeforeloadAttr)
    7676        setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
     77    else if (attrName == onbeforeprocessAttr)
     78        setAttributeEventListener(eventNames().beforeprocessEvent, createAttributeEventListener(this, attr));
    7779    else
    7880        HTMLElement::parseMappedAttribute(attr);
  • trunk/WebCore/html/HTMLStyleElement.cpp

    r61959 r61964  
    2828#include "Document.h"
    2929#include "HTMLNames.h"
     30#include "ScriptEventListener.h"
    3031
    3132namespace WebCore {
     
    5051    if (attr->name() == titleAttr && m_sheet)
    5152        m_sheet->setTitle(attr->value());
     53    else if (attr->name() == onbeforeprocessAttr)
     54        setAttributeEventListener(eventNames().beforeprocessEvent, createAttributeEventListener(this, attr));
    5255    else
    5356        HTMLElement::parseMappedAttribute(attr);
Note: See TracChangeset for help on using the changeset viewer.