Do not add platform-specific methods to cross-platform header
[WebKit-https.git] / WebCore / ChangeLog
1 2009-09-28  Jian Li  <jianli@chromium.org>
2
3         Reviewed by David Levin.
4
5         Do not add platform-specific methods to cross-platform header
6         FileSystem.h per Darin's feedback for 29109.
7         https://bugs.webkit.org/show_bug.cgi?id=29830
8
9         * platform/FileSystem.h:
10         * platform/chromium/DragDataChromium.cpp:
11         (WebCore::DragData::asURL):
12         * platform/chromium/FileSystemChromium.cpp:
13
14 2009-09-28  Dumitru Daniliuc  <dumi@chromium.org>
15
16         Reviewed by Dimitri Glazkov.
17
18         Register Chromium's VFSs with a proper sqlite3_io_methods
19         finder. This should only affect the POSIX implementation. The
20         Windows change is included for consistency and in case sqlite
21         starts using something similar in its Windows VFS in the future.
22
23         https://bugs.webkit.org/show_bug.cgi?id=29743
24
25         * platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp:
26         (WebCore::SQLiteFileSystem::registerSQLiteVFS):
27         * platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp:
28         (WebCore::SQLiteFileSystem::registerSQLiteVFS):
29
30 2009-09-28  Nate Chapin  <japhet@chromium.org>
31
32         Reviewed by Adam Barth.
33
34         Change the V8 bindings' handling of window.toString(),
35         so we return [object DOMWindow] (like JSC), not [object global].
36
37         https://bugs.webkit.org/show_bug.cgi?id=29742
38
39         This will fix a couple of Chromium port test failures and enable us to
40         use the default expectations for a bunch more.
41
42         * bindings/v8/custom/V8DOMWindowCustom.cpp: Use the DOMWindow wrapper instead
43         of the global object wrapper when it's available in the DOMWindow toString callback.
44
45 2009-09-28  Nate Chapin  <japhet@chromium.org>
46
47         Rubber stamped by David Levin.
48
49         Chromium build fix, add back in #include of V8Proxy.h in V8WebKitPointConstructor.cpp.
50
51         * bindings/v8/custom/V8WebKitPointConstructor.cpp: Re-include V8Proxy.h.
52
53 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
54
55         Reviewed by Darin Adler.
56
57         NotNullPassRefPtr: smart pointer optimized for passing references that are not null
58         https://bugs.webkit.org/show_bug.cgi?id=29822
59         
60         Added NotNullPassRefPtr, and deployed it in all places that initialize
61         JavaScript objects.
62
63         * bindings/js/DOMObjectWithSVGContext.h:
64         (WebCore::DOMObjectWithSVGContext::DOMObjectWithSVGContext):
65         * bindings/js/JSDOMBinding.cpp:
66         (WebCore::cacheDOMStructure):
67         * bindings/js/JSDOMBinding.h:
68         (WebCore::DOMObject::DOMObject):
69         (WebCore::DOMObjectWithGlobalPointer::DOMObjectWithGlobalPointer):
70         (WebCore::DOMConstructorObject::DOMConstructorObject):
71         (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
72         * bindings/js/JSDOMGlobalObject.cpp:
73         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
74         * bindings/js/JSDOMGlobalObject.h:
75         * bindings/js/JSDOMWindowBase.cpp:
76         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
77         * bindings/js/JSDOMWindowBase.h:
78         * bindings/js/JSHTMLAllCollection.h:
79         (WebCore::JSHTMLAllCollection::JSHTMLAllCollection):
80         * bindings/js/JSInspectedObjectWrapper.cpp:
81         (WebCore::JSInspectedObjectWrapper::JSInspectedObjectWrapper):
82         * bindings/js/JSInspectedObjectWrapper.h:
83         * bindings/js/JSInspectorCallbackWrapper.cpp:
84         (WebCore::JSInspectorCallbackWrapper::JSInspectorCallbackWrapper):
85         * bindings/js/JSInspectorCallbackWrapper.h:
86         * bindings/js/JSQuarantinedObjectWrapper.cpp:
87         (WebCore::JSQuarantinedObjectWrapper::JSQuarantinedObjectWrapper):
88         * bindings/js/JSQuarantinedObjectWrapper.h:
89         * bindings/js/JSWorkerContextBase.cpp:
90         (WebCore::JSWorkerContextBase::JSWorkerContextBase):
91         * bindings/js/JSWorkerContextBase.h:
92         * bindings/scripts/CodeGeneratorJS.pm:
93         * bridge/runtime_object.cpp:
94         (JSC::RuntimeObjectImp::RuntimeObjectImp):
95         * bridge/runtime_object.h:
96
97 2009-09-28  Nate Chapin  <japhet@chromium.org>
98
99         Reviewed by Dimitri Glazkov.
100
101         Allow V8 to handle x/y parameters in a WebKitPoint constructor.
102         https://bugs.webkit.org/show_bug.cgi?id=29823
103
104         Fixes V8's handling of LayoutTests/fast/dom/Window/webkitConvertPoint.html
105
106         * bindings/v8/custom/V8WebKitPointConstructor.cpp: Allow for x/y parameters in constructor.
107
108 2009-09-28  Mark Rowe  <mrowe@apple.com>
109
110         Fix the build by doing something approximating reasonableness in the Xcode project.
111
112         * WebCore.xcodeproj/project.pbxproj:
113
114 2009-09-28  Simon Hausmann  <hausmann@webkit.org>
115
116         Prospective Tiger build fix.
117
118         * WebCore.xcodeproj/project.pbxproj: Try to use unique IDs for the new files.
119
120 2009-09-28  Pavel Feldman  <pfeldman@chromium.org>
121
122         Reviewed by Timothy Hatcher.
123
124         Web Inspector: Add explicit frontend event for commit load.
125
126         https://bugs.webkit.org/show_bug.cgi?id=29814
127
128         * inspector/InspectorController.cpp:
129         (WebCore::InspectorController::didCommitLoad):
130         * inspector/InspectorFrontend.cpp:
131         (WebCore::InspectorFrontend::didCommitLoad):
132         * inspector/InspectorFrontend.h:
133         * inspector/front-end/DOMAgent.js:
134         (WebInspector.DOMAgent.prototype._setDocument):
135         * inspector/front-end/inspector.js:
136         (WebInspector.addResource):
137         (WebInspector.didCommitLoad):
138
139 2009-09-28  Yaar Schnitman  <yaar@chromium.org>
140
141         Reviewed by Dimitri Glazkov.
142
143         Chromium port - recognize we are being built independently
144         of chromium and look for dependencies under webkit/chromium rather
145         than chromium/src.
146
147         https://bugs.webkit.org/show_bug.cgi?id=29722
148
149         * WebCore.gyp/WebCore.gyp: See above. Also removed a few files from
150           the sources list, since they are not supposed to be built here.
151
152 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
153
154         Reviewed by Simon Hausmann.
155
156         [Qt] Implement XSLT support with QtXmlPatterns.
157         https://bugs.webkit.org/show_bug.cgi?id=28303
158
159         * GNUmakefile.am:
160         * WebCore.gypi:
161         * WebCore.pro:
162         * WebCore.vcproj/WebCore.vcproj:
163         * WebCoreSources.bkl:
164         * dom/Document.cpp:
165         (WebCore::Document::Document):
166         (WebCore::Document::~Document):
167         (WebCore::Document::setTransformSource):
168         * dom/Document.h:
169         (WebCore::Document::transformSource):
170         * dom/TransformSource.h: Added.
171         (WebCore::TransformSource::platformSource):
172         * dom/TransformSourceLibxslt.cpp: Added.
173         (WebCore::TransformSource::TransformSource): Wraps a libxml2 document.
174         (WebCore::TransformSource::~TransformSource):
175         * dom/TransformSourceQt.cpp: Added.
176         (WebCore::TransformSource::TransformSource): Wraps a plain string.
177         (WebCore::TransformSource::~TransformSource):
178         * dom/XMLTokenizerLibxml2.cpp:
179         (WebCore::XMLTokenizer::doEnd):
180         * dom/XMLTokenizerQt.cpp:
181         (WebCore::XMLTokenizer::doEnd):
182         (WebCore::XMLTokenizer::parseProcessingInstruction):
183         * xml/XSLStyleSheet.h:
184         (WebCore::XSLStyleSheet::sheetString):
185         * xml/XSLStyleSheetLibxslt.cpp:
186         (WebCore::XSLStyleSheet::document):
187         * xml/XSLStyleSheetQt.cpp: Added.
188         * xml/XSLTProcessor.h:
189         * xml/XSLTProcessorLibxslt.cpp:
190         (WebCore::xmlDocPtrFromNode):
191         * xml/XSLTProcessorQt.cpp: Added.
192         (WebCore::XSLTMessageHandler::XSLTMessageHandler): A subclass of QAbstractMessageHandler.
193         (WebCore::XSLTMessageHandler::handleMessage): Forwards all processor messages to the Console.
194         (WebCore::XSLTProcessor::transformToString): Uses QXmlQuery.
195
196 2009-09-28  Andrew Scherkus  <scherkus@chromium.org>
197
198         Reviewed by Eric Carlson.
199
200         Delegate implementation of rendererIsNeeded() for media control elements to RenderTheme.
201
202         https://bugs.webkit.org/show_bug.cgi?id=28689
203
204         Covered by LayoutTests/media/video-no-audio.html
205
206         * rendering/MediaControlElements.cpp: Removed subclass implementations of rendererIsNeeded().
207         (WebCore::MediaControlElement::rendererIsNeeded): Include calling shouldRenderMediaControlPart().
208         (WebCore::MediaControlInputElement::rendererIsNeeded): Include calling shouldRenderMediaControlPart().
209         * rendering/MediaControlElements.h:
210         * rendering/RenderTheme.cpp:
211         (WebCore::RenderTheme::shouldRenderMediaControlPart): New method.  Contains logic moved from subclass implementations of rendererIsNeeded().
212         * rendering/RenderTheme.h:
213         * rendering/RenderThemeChromiumSkia.cpp:
214         (WebCore::RenderThemeChromiumSkia::shouldRenderMediaControlPart): Override to always render mute button.
215         * rendering/RenderThemeChromiumSkia.h:
216
217 2009-09-28  Jian Li  <jianli@chromium.org>
218
219         Reviewed by David Levin.
220
221         [chromium] DragData::asURL should return file URL.
222         https://bugs.webkit.org/show_bug.cgi?id=29109
223
224         Tested by LayoutTests/fast/events/drag-to-navigate.html.
225
226         * platform/FileSystem.h:
227         * platform/chromium/ChromiumBridge.h:
228         * platform/chromium/DragDataChromium.cpp:
229         (WebCore::DragData::asURL):
230         * platform/chromium/FileSystemChromium.cpp:
231         (WebCore::getAbsolutePath):
232         (WebCore::isDirectory):
233         (WebCore::filePathToURL):
234
235 2009-09-28  Dimitri Glazkov  <dglazkov@chromium.org>
236
237         Reviewed by David Levin.
238
239         [V8] Add a special case to handle index arguments, because we need to be
240         able to see if they're < 0.
241         https://bugs.webkit.org/show_bug.cgi?id=29810
242
243         Test: LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.html
244
245         * bindings/scripts/CodeGeneratorV8.pm: Added special case (matching CodeGeneratorJS.pm)
246           for index arguments.
247
248 2009-09-28  Dan Bernstein  <mitz@apple.com>
249
250         Reviewed by Darin Adler.
251
252         Extend the MediaWiki/KHTMLFixes.css workaround to cover older MediaWiki versions
253         https://bugs.webkit.org/show_bug.cgi?id=29792
254
255         * html/HTMLLinkElement.cpp:
256         (WebCore::HTMLLinkElement::setCSSStyleSheet): If site specific hacks are
257         enabled, check if the linked style sheet is one of two versions of the
258         MediaWiki KHTMLFixes.css. If so, remove the offending rule.
259
260 2009-09-28  Dimitri Glazkov  <dglazkov@chromium.org>
261
262         Reviewed by Adam Barth.
263
264         [V8] Fix an error in type logic in CodeGeneratorV8.pm, where
265         unsigned ints are accidentally used as signed.
266         https://bugs.webkit.org/show_bug.cgi?id=29810
267
268         Test: LayoutTests/fast/forms/textarea-maxlength.html
269
270         * bindings/scripts/CodeGeneratorV8.pm: Made sure "unsigned long" in IDL is
271           properly generates on "unsigned" return value.
272
273 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
274
275         Reviewed by Simon Hausmann.
276
277         Rename XSLStyleSheet.cpp to XSLStyleSheetLibxslt.cpp.
278         https://bugs.webkit.org/show_bug.cgi?id=28303
279
280         In preparation for adding XSLT support with QtXmlPatterns to the Qt
281         port, rename XSLStyleSheet.cpp to XSLStyleSheetLibxslt.cpp as we will
282         have our own implementation which most likely will not share any code
283         with the current one.
284
285         Additionally, fix some coding style issues.
286
287         * GNUmakefile.am:
288         * WebCore.gypi:
289         * WebCore.vcproj/WebCore.vcproj:
290         * WebCore.xcodeproj/project.pbxproj:
291         * WebCoreSources.bkl:
292         * xml/XSLStyleSheet.cpp: Renamed to XSLStyleSheetLibxslt.cpp.
293         * xml/XSLStyleSheetLibxslt.cpp: Added.
294
295 2009-09-28  Simon Hausmann  <simon.hausmann@nokia.com>
296
297         Prospective build fix for r48812.
298
299         Forgot to remove the inline reset() implementation when reverting the indentation
300         changes in the file.
301
302         * xml/XSLTProcessor.h:
303
304 2009-09-28  Pavel Feldman  <pfeldman@chromium.org>
305
306         Reviewed by nobody (trivial follow up fix), Joseph Pecoraro LGTM-ed.
307
308         Web Inspector: Follow up to r48809.
309         InspectorController.wrapObject should only be called on the inspectable page side.
310
311         https://bugs.webkit.org/show_bug.cgi?id=17429
312
313         * inspector/front-end/EventListenersSidebarPane.js:
314         (WebInspector.EventListenersSidebarPane.prototype.update.callback):
315         (WebInspector.EventListenersSidebarPane.prototype.update):
316         (WebInspector.EventListenersSection):
317         (WebInspector.EventListenersSection.prototype.update):
318         (WebInspector.EventListenerBar):
319         (WebInspector.EventListenerBar.prototype.update):
320
321 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
322
323         Reviewed by Simon Hausmann.
324
325         Move the libxslt specific part of XSLTProcessor to a separate file.
326         https://bugs.webkit.org/show_bug.cgi?id=28303
327
328         In preparation for adding XSLT support with QtXmlPatterns to the Qt
329         port, move the libxslt part of the XSLTProcessor implementation into
330         another file and leave the part that can be reused and shared.
331
332         Additionally, fix some coding style issues.
333
334         * GNUmakefile.am:
335         * WebCore.gypi:
336         * WebCore.vcproj/WebCore.vcproj:
337         * WebCore.xcodeproj/project.pbxproj:
338         * WebCoreSources.bkl:
339         * xml/XSLTProcessor.cpp:
340         (WebCore::XSLTProcessor::createDocumentFromSource): Remove trailing whitespaces.
341         (WebCore::createFragmentFromSource): Remove trailing whitespaces.
342         (WebCore::XSLTProcessor::transformToFragment): Remove trailing whitespaces.
343         (WebCore::XSLTProcessor::reset): Moved out of the class definition.
344         * xml/XSLTProcessorLibxslt.cpp: Added.
345         (WebCore::XSLTProcessor::genericErrorFunc): Moved.
346         (WebCore::XSLTProcessor::parseErrorFunc): Moved.
347         (WebCore::docLoaderFunc): Moved.
348         (WebCore::setXSLTLoadCallBack): Moved.
349         (WebCore::writeToVector): Moved.
350         (WebCore::saveResultToString): Moved.
351         (WebCore::xsltParamArrayFromParameterMap): Moved.
352         (WebCore::freeXsltParamArray): Moved.
353         (WebCore::xsltStylesheetPointer): Moved.
354         (WebCore::xmlDocPtrFromNode): Moved.
355         (WebCore::resultMIMEType): Moved.
356         (WebCore::XSLTProcessor::transformToString): Moved.
357
358 2009-09-28  Charles Wei  <charles.wei@torchmobile.com.cn>
359
360         Reviewed by Nikolas Zimmermann.
361
362         Fix the crash of SVG that crashes when use a non-exist symbol
363         https://bugs.webkit.org/show_bug.cgi?id=27693
364
365         Test: svg/custom/use-non-existing-symbol-crash.svg
366
367         * svg/SVGUseElement.cpp:
368         (WebCore::shadowTreeContainsChangedNodes):
369
370 2009-09-28  Joseph Pecoraro  <joepeck@webkit.org>
371
372         Reviewed by Timothy Hatcher.
373
374         Inspector Should Show Event Listeners/Handlers Registered on each Node
375         https://bugs.webkit.org/show_bug.cgi?id=17429
376         
377           Extracted a method from dispatchEvent to get the event ancestor chain
378         
379         * dom/Node.cpp:
380         (WebCore::Node::eventAncestors): the extracted method
381         (WebCore::Node::dispatchGenericEvent): use eventAncestors
382         * dom/Node.h:
383
384           Asynchronous Flow For the Inspector, Backend -> DOM Agent -> Frontend
385           The DOMAgent's getEventListenersForNode handles the logic of finding
386           all the relevant listeners in the event flow.
387
388         * inspector/InspectorBackend.cpp:
389         (WebCore::InspectorBackend::getEventListenersForNode):
390         * inspector/InspectorBackend.h:
391         * inspector/InspectorBackend.idl:
392         * inspector/InspectorDOMAgent.cpp:
393         (WebCore::InspectorDOMAgent::getEventListenersForNode):
394         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
395         (WebCore::InspectorDOMAgent::buildObjectForNode): added localName
396         * inspector/InspectorDOMAgent.h:
397         (WebCore::EventListenerInfo::EventListenerInfo):
398         * inspector/InspectorFrontend.cpp:
399         (WebCore::InspectorFrontend::didGetEventListenersForNode):
400         * inspector/InspectorFrontend.h:
401         (WebCore::InspectorFrontend::scriptState):
402         * inspector/front-end/DOMAgent.js: added localName to WebInspector.DOMNode from payload
403         (WebInspector.EventListeners.getEventListenersForNodeAsync.mycallback):
404         (WebInspector.EventListeners.getEventListenersForNodeAsync):
405
406           New Sidebar Pane in the Element's Panel
407           Includes Gear Menu for filtering the Event Listeners on the
408           "Selected Node Only" or "All Nodes"
409
410         * inspector/front-end/ElementsPanel.js: Handles refreshing the Pane when necessary
411         (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
412         (WebInspector.ElementsPanel):
413         (WebInspector.ElementsPanel.prototype.updateEventListeners):
414         * inspector/front-end/EventListenersSidebarPane.js: Added. 
415         (WebInspector.EventListenersSidebarPane): The 1st level in the Pane
416         (WebInspector.EventListenersSidebarPane.prototype.update.callback):
417         (WebInspector.EventListenersSidebarPane.prototype.update):
418         (WebInspector.EventListenersSection): The 2nd level in the Pane
419         (WebInspector.EventListenersSection.prototype.update): filters on Preference
420         (WebInspector.EventListenersSection.prototype.addListener):
421         (WebInspector.EventListenerBar): The 3rd level in the Pane
422         (WebInspector.EventListenerBar.prototype._getNodeDisplayName):
423         (WebInspector.EventListenerBar.prototype._getFunctionDisplayName):
424         (WebInspector.EventListenersSidebarPane.prototype._changeSetting): For the Gear Menu
425         
426           Consolidated "appropriateSelectorForNode"
427
428         * inspector/front-end/StylesSidebarPane.js:
429         * inspector/front-end/utilities.js:
430
431           Miscellaneous Updates
432
433         * English.lproj/localizedStrings.js: "Event Listeners", "No Event Listeners", "Selected Node Only", "All Nodes"
434         * WebCore.gypi: included the new inspector files
435         * WebCore.vcproj/WebCore.vcproj: included source files that were missing
436         * inspector/front-end/Images/grayConnectorPoint.png: Added. Thanks to Timothy Hatcher.
437         * inspector/front-end/Images/whiteConnectorPoint.png: Added. Thanks to Timothy Hatcher.
438         * inspector/front-end/inspector.js: Preferences for the Gear Menu Event Listeners filter
439         * inspector/front-end/inspector.css: reused as much as possible
440         * inspector/front-end/inspector.html: include the new script
441         * inspector/front-end/WebKit.qrc: included the new inspector files
442
443 2009-09-27  Sam Weinig  <sam@webkit.org>
444
445         Reviewed by Dan Bernstein.
446
447         Fix for https://bugs.webkit.org/show_bug.cgi?id=29760
448         Implement CSSOM Range.getClientRects/getBoundingClientRect 
449
450         Tests: fast/dom/Range/getBoundingClientRect-getClientRects-relative-to-viewport.html
451                fast/dom/Range/getBoundingClientRect.html
452                fast/dom/Range/getClientRects.html
453
454         * dom/Range.cpp:
455         (WebCore::Range::getClientRects):
456         (WebCore::Range::getBoundingClientRect):
457         (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoom):
458         (WebCore::Range::getBorderAndTextQuads):
459         * dom/Range.h:
460         * dom/Range.idl:
461         Implement Range.getClientRects/getBoundingClientRect.
462
463         * dom/Element.cpp:
464         * rendering/RenderObject.h: 
465         (WebCore::adjustForAbsoluteZoom):
466         (WebCore::adjustIntRectForAbsoluteZoom):
467         (WebCore::adjustFloatPointForAbsoluteZoom):
468         (WebCore::adjustFloatQuadForAbsoluteZoom):
469         Move point/quad adjustment methods from Element.cpp to RenderObject.h
470         so that Range.cpp can use them as well.
471
472 2009-09-27  Simon Hausmann  <hausmann@webkit.org>
473
474         Unreviewed fix for WebInspector with Qt build.
475
476         Simply re-generate the Qt resource file by running
477         WebKitTools/Scripts/generate-qt-inspector-resource
478
479         * inspector/front-end/WebKit.qrc:
480
481 2009-09-27  Pavel Feldman  <pfeldman@chromium.org>
482
483         Reviewed by nobody (trivial ChangeLog fix).
484
485         Restore WebCore/ChangeLog truncated in r48778.
486
487 2009-09-27  Pavel Feldman  <pfeldman@chromium.org>
488
489         Reviewed by Timothy Hatcher.
490
491         Web Inspector: DOM store is being unbound twice, leading to assertion failure.
492
493         https://bugs.webkit.org/show_bug.cgi?id=29770
494
495         * inspector/InspectorController.cpp:
496         (WebCore::InspectorController::didOpenDatabase):
497         (WebCore::InspectorController::didUseDOMStorage):
498         * inspector/InspectorDOMStorageResource.cpp:
499         (WebCore::InspectorDOMStorageResource::unbind):
500
501 2009-09-26  Pavel Feldman  <pfeldman@chromium.org>
502
503         Reviewed by Timothy Hatcher.
504
505         Web Inspector: Do not track DOM changes while inspector window is closed.
506
507         https://bugs.webkit.org/show_bug.cgi?id=29769
508
509         * inspector/InspectorController.cpp:
510         (WebCore::InspectorController::inspectedWindowScriptObjectCleared):
511         (WebCore::InspectorController::populateScriptObjects):
512         (WebCore::InspectorController::resetScriptObjects):
513         (WebCore::InspectorController::didCommitLoad):
514         * inspector/InspectorController.h:
515         * inspector/InspectorDOMAgent.cpp:
516         (WebCore::InspectorDOMAgent::setDocument):
517         * inspector/InspectorDOMAgent.h:
518         * loader/FrameLoader.cpp:
519         (WebCore::FrameLoader::dispatchWindowObjectAvailable):
520         * page/android/InspectorControllerAndroid.cpp:
521         (WebCore::InspectorController::inspectedWindowScriptObjectCleared):
522
523 2009-09-26  Pavel Feldman  <pfeldman@chromium.org>
524
525         Reviewed by Timothy Hatcher.
526
527         Web Inspector: [REGRESSION] Double Clicking Resources Fails to Open in New Window
528
529         https://bugs.webkit.org/show_bug.cgi?id=29762
530
531         * inspector/front-end/InjectedScript.js:
532         (InjectedScript.setStyleText):
533         (InjectedScript.openInInspectedWindow):
534         * inspector/front-end/InjectedScriptAccess.js:
535         * inspector/front-end/ResourcesPanel.js:
536         (WebInspector.ResourceSidebarTreeElement.prototype.ondblclick):
537
538 2009-09-26  David Kilzer  <ddkilzer@apple.com>
539
540         Part 2 of 2: <http://webkit.org/b/29753> DerivedSources.make broken for non-Mac targets
541
542         Reviewed by Darin Adler.
543
544         Fix ENABLE_ORIENTATION_EVENTS for non-Mac platforms.
545
546         * DerivedSources.make: Moved Platform.h check for
547         ENABLE_ORIENTATION_EVENTS into Mac-only section and added
548         default of ENABLE_ORIENTATION_EVENTS = 0 to non-Mac section.
549         Added ifndef test to make it possible to override both
550         ENABLE_DASHBOARD_SUPPORT and ENABLE_ORIENTATION_EVENTS external
551         to the makefile.  Moved addition of ENABLE_ORIENTATION_EVENTS to
552         ADDITIONAL_IDL_DEFINES to common section.
553         * GNUmakefile.am: Added support for ENABLE_ORIENTATION_EVENTS if
554         it is ever used.
555         * WebCore.pro: Ditto.
556
557 2009-09-26  Kent Tamura  <tkent@chromium.org>
558
559         Reviewed by David Kilzer.
560
561         Move placeholder-related code to HTMLTextFormControlElement from
562         HTMLInputElement, WMLInputElement, InputElement, and
563         HTMLTextAreaElement.
564         https://bugs.webkit.org/show_bug.cgi?id=28703
565
566         * dom/InputElement.cpp:
567         (WebCore::InputElement::dispatchFocusEvent):
568         (WebCore::InputElement::dispatchBlurEvent):
569         (WebCore::InputElement::setValueFromRenderer):
570         * dom/InputElement.h:
571         * html/HTMLFormControlElement.cpp:
572         (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
573         (WebCore::HTMLTextFormControlElement::~HTMLTextFormControlElement):
574         (WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
575         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
576         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
577         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
578         * html/HTMLFormControlElement.h:
579         (WebCore::HTMLTextFormControlElement::handleFocusEvent):
580         (WebCore::HTMLTextFormControlElement::handleBlurEvent):
581         * html/HTMLInputElement.cpp:
582         (WebCore::HTMLInputElement::HTMLInputElement):
583         (WebCore::HTMLInputElement::handleFocusEvent):
584         (WebCore::HTMLInputElement::handleBlurEvent):
585         (WebCore::HTMLInputElement::parseMappedAttribute):
586         (WebCore::HTMLInputElement::createRenderer):
587         (WebCore::HTMLInputElement::setValue):
588         (WebCore::HTMLInputElement::setValueFromRenderer):
589         * html/HTMLInputElement.h:
590         (WebCore::HTMLInputElement::supportsPlaceholder):
591         (WebCore::HTMLInputElement::isEmptyValue):
592         * html/HTMLIsIndexElement.cpp:
593         (WebCore::HTMLIsIndexElement::parseMappedAttribute):
594         * html/HTMLTextAreaElement.cpp:
595         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
596         (WebCore::HTMLTextAreaElement::createRenderer):
597         * html/HTMLTextAreaElement.h:
598         (WebCore::HTMLTextAreaElement::supportsPlaceholder):
599         (WebCore::HTMLTextAreaElement::isEmptyValue):
600         * rendering/RenderTextControl.cpp:
601         (WebCore::RenderTextControl::RenderTextControl):
602         * rendering/RenderTextControl.h:
603         * rendering/RenderTextControlMultiLine.cpp:
604         (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
605         * rendering/RenderTextControlMultiLine.h:
606         * rendering/RenderTextControlSingleLine.cpp:
607         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
608         (WebCore::RenderTextControlSingleLine::updateFromElement):
609         * rendering/RenderTextControlSingleLine.h:
610         * wml/WMLInputElement.cpp:
611         (WebCore::WMLInputElement::setValue):
612         (WebCore::WMLInputElement::createRenderer):
613         * wml/WMLInputElement.h:
614
615 2009-09-26  Shu Chang  <Chang.Shu@nokia.com>
616
617         Reviewed by Alexey Proskuryakov.
618
619         Optimize the code so only the text from start to end is scanned.
620         https://bugs.webkit.org/show_bug.cgi?id=29092
621
622         On a platform with webkit+Qt+Symbian, the parsing time for a 600K text
623         file improved from 400ms to 40ms (10x faster).
624
625         * dom/Text.cpp:
626         (WebCore::Text::createWithLengthLimit):
627
628 2009-09-26  Xiaomei Ji  <xji@chromium.org>
629
630         Reviewed by Eric Seidel.
631
632         This Patch fixes [chromium] the drop-down is always left-aligned even
633         for RTL element.
634         https://bugs.webkit.org/show_bug.cgi?id=29612
635
636         For auto-complete, the items in drop-down should be right-aligned if
637         the directionality of <input> field is RTL.
638         For <select><option>, the items in drop-down should be right-aligned
639         if the directionality of <select> is RTL.
640
641         No automatic test is possible. Manual tests are added.
642
643         * manual-tests/autofill_alignment.html: Added.
644         * manual-tests/select_alignment.html: Added.
645         * platform/chromium/PopupMenuChromium.cpp:
646         (WebCore::PopupListBox::paintRow): Adjust the starting x-axis of text to
647         be paint if it should be right-aligned.
648
649 2009-09-25  Dan Bernstein  <mitz@apple.com>
650
651         Reviewed by Sam Weinig.
652
653         REGRESSION (r48775) FontList.plist written by TOT WebKit causes Safari 4
654         to crash on launch
655         https://bugs.webkit.org/show_bug.cgi?id=29759
656
657         * platform/graphics/win/FontDatabase.cpp:
658         (WebCore::writeFontDatabaseToPlist): Reverted to saving the CG font DB
659         property list at the root of FontList.plist, but with an additional
660         key for the last value of the Fonts registry key.
661         (WebCore::populateFontDatabase): Pass the FontList.plist in its entirety
662         to populatFontDatabaseFromPlist.
663
664 2009-09-25  Kevin Ollivier  <kevino@theolliviers.com>
665
666         Build fix. Adding missing header files.
667
668         * bindings/js/JSNamedNodeMapCustom.cpp:
669
670 2009-09-25  David Kilzer  <ddkilzer@apple.com>
671
672         Part 1 of 2: <http://webkit.org/b/29753> DerivedSources.make broken for non-Mac targets
673
674         Reviewed by Darin Adler.
675
676         * DerivedSources.make: Move tests for ENABLE_CONTEXT_MENUS,
677         ENABLE_DRAG_SUPPORT and ENABLE_INSPECTOR into Mac-only section.
678
679 2009-09-25  Adam Barth  <abarth@webkit.org>
680
681         Reviewed by Darin Adler.
682
683         Load blocks during unload should not affect targeted loads
684         https://bugs.webkit.org/show_bug.cgi?id=29747
685
686         Move the check of the unload state after checking for targeted links.
687
688         Test: fast/loader/unload-hyperlink-targeted.html
689
690         * loader/FrameLoader.cpp:
691         (WebCore::FrameLoader::loadURL):
692
693 2009-09-25  Kenneth Russell  <kbr@google.com>
694
695         Reviewed by Dimitri Glazkov.
696
697         [Chromium] Add initial V8 bindings for WebGL
698         https://bugs.webkit.org/show_bug.cgi?id=29664
699
700         * WebCore.gypi:
701         * bindings/scripts/CodeGeneratorV8.pm:
702         * bindings/v8/DOMObjectsInclude.h:
703         * bindings/v8/DerivedSourcesAllInOne.cpp:
704         * bindings/v8/V8DOMWrapper.cpp:
705         (WebCore::V8DOMWrapper::getTemplate):
706         * bindings/v8/V8Index.cpp:
707         * bindings/v8/V8Index.h:
708         * bindings/v8/custom/V8CanvasArrayBufferCustom.cpp: Added.
709         (WebCore::CALLBACK_FUNC_DECL):
710         * bindings/v8/custom/V8CanvasArrayCustom.h: Added.
711         (WebCore::constructCanvasArray):
712         * bindings/v8/custom/V8CanvasByteArrayCustom.cpp: Added.
713         (WebCore::CALLBACK_FUNC_DECL):
714         (WebCore::INDEXED_PROPERTY_GETTER):
715         (WebCore::INDEXED_PROPERTY_SETTER):
716         * bindings/v8/custom/V8CanvasFloatArrayCustom.cpp: Added.
717         (WebCore::CALLBACK_FUNC_DECL):
718         (WebCore::INDEXED_PROPERTY_GETTER):
719         (WebCore::INDEXED_PROPERTY_SETTER):
720         * bindings/v8/custom/V8CanvasIntArrayCustom.cpp: Added.
721         (WebCore::CALLBACK_FUNC_DECL):
722         (WebCore::INDEXED_PROPERTY_GETTER):
723         (WebCore::INDEXED_PROPERTY_SETTER):
724         * bindings/v8/custom/V8CanvasRenderingContext3DCustom.cpp: Added.
725         (WebCore::jsArrayToFloatArray):
726         (WebCore::jsArrayToIntArray):
727         (WebCore::CALLBACK_FUNC_DECL):
728         (WebCore::):
729         (WebCore::vertexAttribAndUniformHelperf):
730         (WebCore::uniformHelperi):
731         (WebCore::uniformMatrixHelper):
732         * bindings/v8/custom/V8CanvasShortArrayCustom.cpp: Added.
733         (WebCore::CALLBACK_FUNC_DECL):
734         (WebCore::INDEXED_PROPERTY_GETTER):
735         (WebCore::INDEXED_PROPERTY_SETTER):
736         * bindings/v8/custom/V8CanvasUnsignedByteArrayCustom.cpp: Added.
737         (WebCore::CALLBACK_FUNC_DECL):
738         (WebCore::INDEXED_PROPERTY_GETTER):
739         (WebCore::INDEXED_PROPERTY_SETTER):
740         * bindings/v8/custom/V8CanvasUnsignedIntArrayCustom.cpp: Added.
741         (WebCore::CALLBACK_FUNC_DECL):
742         (WebCore::INDEXED_PROPERTY_GETTER):
743         (WebCore::INDEXED_PROPERTY_SETTER):
744         * bindings/v8/custom/V8CanvasUnsignedShortArrayCustom.cpp: Added.
745         (WebCore::CALLBACK_FUNC_DECL):
746         (WebCore::INDEXED_PROPERTY_GETTER):
747         (WebCore::INDEXED_PROPERTY_SETTER):
748         * bindings/v8/custom/V8CustomBinding.h:
749         * bindings/v8/custom/V8DocumentCustom.cpp:
750         (WebCore::CALLBACK_FUNC_DECL):
751         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
752         (WebCore::CALLBACK_FUNC_DECL):
753         * platform/graphics/GraphicsContext3D.h:
754
755 2009-09-25  Jeremy Orlow  <jorlow@chromium.org>
756
757         This is breaking Chromium try bots, so I'm counting this as a build fix.
758
759         Add more svn:ignore exceptions.  On different platforms, these files are
760         generated with different case for WebCore.
761
762         * WebCore.gyp: Changed property svn:ignore.
763
764 2009-09-25  Alexey Proskuryakov  <ap@apple.com>
765
766         Reverting r48767, as it broke Windows build in a non-trivial way.
767
768         * bindings/js/JSAbstractWorkerCustom.cpp:
769         (WebCore::JSAbstractWorker::addEventListener):
770         (WebCore::JSAbstractWorker::removeEventListener):
771         * bindings/js/JSDOMApplicationCacheCustom.cpp:
772         (WebCore::JSDOMApplicationCache::addEventListener):
773         (WebCore::JSDOMApplicationCache::removeEventListener):
774         * bindings/js/JSDOMGlobalObject.cpp:
775         (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
776         * bindings/js/JSDOMWindowCustom.cpp:
777         (WebCore::JSDOMWindow::addEventListener):
778         (WebCore::JSDOMWindow::removeEventListener):
779         * bindings/js/JSEventListener.cpp:
780         (WebCore::JSEventListener::JSEventListener):
781         (WebCore::JSEventListener::jsFunction):
782         (WebCore::JSEventListener::markJSFunction):
783         (WebCore::JSEventListener::handleEvent):
784         (WebCore::JSEventListener::reportError):
785         * bindings/js/JSEventListener.h:
786         (WebCore::JSEventListener::create):
787         * bindings/js/JSEventSourceCustom.cpp:
788         (WebCore::JSEventSource::addEventListener):
789         (WebCore::JSEventSource::removeEventListener):
790         * bindings/js/JSLazyEventListener.cpp:
791         (WebCore::JSLazyEventListener::JSLazyEventListener):
792         (WebCore::JSLazyEventListener::jsFunction):
793         (WebCore::JSLazyEventListener::parseCode):
794         * bindings/js/JSLazyEventListener.h:
795         (WebCore::JSLazyEventListener::create):
796         * bindings/js/JSMessagePortCustom.cpp:
797         (WebCore::JSMessagePort::addEventListener):
798         (WebCore::JSMessagePort::removeEventListener):
799         * bindings/js/JSNodeCustom.cpp:
800         (WebCore::JSNode::addEventListener):
801         (WebCore::JSNode::removeEventListener):
802         * bindings/js/JSSVGElementInstanceCustom.cpp:
803         (WebCore::JSSVGElementInstance::addEventListener):
804         (WebCore::JSSVGElementInstance::removeEventListener):
805         * bindings/js/JSWorkerContextCustom.cpp:
806         (WebCore::JSWorkerContext::addEventListener):
807         (WebCore::JSWorkerContext::removeEventListener):
808         * bindings/js/JSXMLHttpRequestCustom.cpp:
809         (WebCore::JSXMLHttpRequest::addEventListener):
810         (WebCore::JSXMLHttpRequest::removeEventListener):
811         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
812         (WebCore::JSXMLHttpRequestUpload::addEventListener):
813         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
814         * bindings/js/ScriptEventListener.cpp:
815         (WebCore::createAttributeEventListener):
816         * bindings/objc/ObjCEventListener.h:
817         * bindings/objc/ObjCEventListener.mm:
818         (WebCore::ObjCEventListener::handleEvent):
819         * bindings/scripts/CodeGeneratorJS.pm:
820         * dom/EventListener.h:
821         (WebCore::EventListener::reportError):
822         (WebCore::EventListener::jsFunction):
823         * dom/EventTarget.cpp:
824         (WebCore::EventTarget::fireEventListeners):
825         * inspector/InspectorDOMAgent.cpp:
826         (WebCore::InspectorDOMAgent::handleEvent):
827         * inspector/InspectorDOMAgent.h:
828         * inspector/InspectorDOMStorageResource.cpp:
829         (WebCore::InspectorDOMStorageResource::handleEvent):
830         * inspector/InspectorDOMStorageResource.h:
831         * loader/ImageDocument.cpp:
832         (WebCore::ImageEventListener::handleEvent):
833         * svg/animation/SVGSMILElement.cpp:
834         (WebCore::ConditionEventListener::handleEvent):
835         * workers/WorkerContext.cpp:
836         (WebCore::WorkerContext::reportException):
837
838 2009-09-24  Tony Chang  <tony@chromium.org>
839
840         Reviewed by David Levin.
841
842         Add a gyp variable to allow building a debug webcore without debug
843         symbols.  This allows for faster compile, link, and gdb times.
844
845         https://bugs.webkit.org/show_bug.cgi?id=29721
846
847         No new tests, build config change.
848
849         * WebCore.gyp/WebCore.gyp:
850
851 2009-09-25  Darin Fisher  <darin@chromium.org>
852
853         Reviewed by Dimitri Glazkov.
854
855         Declare RegisteredEventListener as a class instead of a struct.
856         This fixes a warning in the Chromium build.
857
858         * dom/RegisteredEventListener.h:
859
860 2009-09-25  Dan Bernstein  <mitz@apple.com>
861
862         Reviewed by Jon Honeycutt.
863
864         WebCore part of
865         <rdar://problem/7211635> 2 byte characters are displayed as garbaged
866         <rdar://problem/7212626> garbled/gibberish text (off-by-one)
867
868         When the Windows Fonts directory contains more than one font file for a
869         given font name, which of the fonts gets assigned to the name in the
870         Core Graphics font database was determined arbitrarily and did not
871         always match the font GDI used for the same font name. The mismatch
872         caused character-to-glyph mapping to use one font and glyph rendering to
873         use another.
874
875         The fix is to update the Core Graphics font database from the registry
876         entries (that reflect the name-to-font mapping that GDI uses) after
877         populating it with the result of scanning the Fonts directory. As a
878         consequence, the directory needs to be scanned at startup every time the
879         registry key changes, so the last value of the registry key is kept
880         in the property list on disk so that it could be compared to the current
881         value on startup.
882
883         * platform/graphics/win/FontDatabase.cpp:
884         (WebCore::populateFontDatabaseFromPlist): Now takes a property list as
885         a parameter and avoids round-tripping through XML by calling
886         wkAddFontsFromPlist() instead of wkAddFontsFromPlistRepresentation().
887         (WebCore::fontFilenamesFromRegistryKey):
888         (WebCore::cgFontDBKey):
889         (WebCore::writeFontDatabaseToPlist): Now takes the CG font DB property
890         list and a property list with the font filenames from the registry and
891         writes a dictionary with those property lists as values.
892         (WebCore::fontFilenamesFromRegistry): Added. Returns an array with the
893         values in the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
894         registry key.
895         (WebCore::populateFontDatabase): Changed to read the contents of the
896         Fonts registry key and compare it with the last-saved value from the
897         property list, and to call wkAddFontsFromRegistry() after populating the
898         CG font DB from the file system. Uses wkCreateFontsPlist() instead of
899         wkCreateFontsPlistRepresentation() to avoid round-tripping through XML.
900
901 2009-09-25  Geoffrey Garen  <ggaren@apple.com>
902
903         Reviewed by Darin Adler.
904
905         Inlined some object creation code, including lexicalGlobalObject access
906         https://bugs.webkit.org/show_bug.cgi?id=29750
907
908         * bindings/js/JSInspectorBackendCustom.cpp:
909         (WebCore::JSInspectorBackend::currentCallFrame):
910         * inspector/JavaScriptDebugServer.cpp:
911         (WebCore::JavaScriptDebugServer::hasBreakpoint): Updated for JavaScriptCore
912         API changes.
913
914 2009-09-25  Dave Hyatt  <hyatt@apple.com>
915
916         Reviewed by Anders Carlsson.
917
918         https://bugs.webkit.org/show_bug.cgi?id=24399
919         Make @import work in user stylesheets.  The first bug was that the URL wasn't being set on the
920         user sheets themselves, so relative @import URLs couldn't resolve properly.  The second bug
921         was that the loads would be denied.  This is fixed by using the requestUserCSSStyleSheet method
922         instead of the normal request method.  In order to know when to do this, CSSStyleSheets now have
923         a propagated boolean, m_isUserStyleSheet, that lets them know if they are user stylesheets or not.
924
925         * css/CSSImportRule.cpp:
926         (WebCore::CSSImportRule::insertedIntoParent):
927         * css/CSSStyleSheet.cpp:
928         (WebCore::CSSStyleSheet::CSSStyleSheet):
929         * css/CSSStyleSheet.h:
930         (WebCore::CSSStyleSheet::setIsUserStyleSheet):
931         (WebCore::CSSStyleSheet::isUserStyleSheet):
932         * dom/Document.cpp:
933         (WebCore::Document::pageUserSheet):
934         (WebCore::Document::pageGroupUserSheets):
935
936 2009-09-25  Simon Fraser  <simon.fraser@apple.com>
937
938         Reviewed by Darin Adler.
939
940         ASSERTION FAILED: !repaintContainer || repaintContainer == this
941         https://bugs.webkit.org/show_bug.cgi?id=29755
942         
943         It's possible for RenderObject::container() to return an object that is higher
944         in the hierarchy than the repaintContainer that is being used to repaint an
945         object. For example, this can happen when running an accelerated opacity
946         transition on an element with a position:absolute parent, and a position:absolute child.
947         
948         In this case we need to detect when RenderObject::container() will skip over
949         repaintContainer, and in that case adjust the coords to shift into repaintContainer's space.
950
951         Test: compositing/repaint/opacity-between-absolute.html
952
953         * rendering/RenderBox.cpp:
954         (WebCore::RenderBox::mapLocalToContainer):
955         (WebCore::RenderBox::computeRectForRepaint):
956         * rendering/RenderInline.cpp:
957         (WebCore::RenderInline::computeRectForRepaint):
958         * rendering/RenderObject.cpp:
959         (WebCore::RenderObject::container):
960         * rendering/RenderObject.h:
961
962 2009-09-25  Simon Fraser  <simon.fraser@apple.com>
963
964         Reviewed by Darin Adler.
965
966         Crash with hardware accelerated rotation of a PDF image in a data URL
967         <rdar://problem/7250378>
968         
969         PDF images don't return a color space from CGImageGetColorSpace(),
970         so we need to null-check the return value before use.
971
972         Test: compositing/color-matching/pdf-image-match.html
973
974         * platform/graphics/mac/GraphicsLayerCA.mm:
975         (WebCore::GraphicsLayerCA::setContentsToImage):
976
977 2009-09-25  Darin Adler  <darin@apple.com>
978
979         Reviewed by Geoffrey Garen.
980
981         Null-deref when first access to an Attr node is after its Element is destroyed
982         https://bugs.webkit.org/show_bug.cgi?id=29748
983
984         Test: fast/dom/Attr/access-after-element-destruction.html
985
986         * bindings/js/JSAttrCustom.cpp:
987         (WebCore::JSAttr::markChildren): Added. Keeps the ownerElement alive as
988         long as the Attr is alive.
989
990         * bindings/js/JSNamedNodeMapCustom.cpp:
991         (WebCore::JSNamedNodeMap::markChildren): Added. Keeps the Element alive as
992         long as the NamedNodeMap is alive.
993
994         * dom/Attr.idl: Added CustomMarkFunction attribute.
995
996         * dom/NamedAttrMap.cpp:
997         (WebCore::NamedNodeMap::getAttributeItem): Tweaked formatting.
998         (WebCore::NamedNodeMap::detachFromElement): Call clearAttributes so we don't
999         have attributes hanging around that might need an Attr node created; that way
1000         we won't crash with a null-dereference trying to deal with one of them. This
1001         can't happen when working with JavaScript since the Element will be kept
1002         alive due to the change above.
1003         (WebCore::NamedNodeMap::addAttribute): Fix function name in comment.
1004         (WebCore::NamedNodeMap::removeAttribute): Removed unneeded "+ 1" and added
1005         missing braces.
1006
1007         * dom/NamedAttrMap.h: Made the element function public so it can be used by
1008         the JavaScript binding to keep the Element alive.
1009
1010         * dom/NamedNodeMap.idl: Added CustomMarkFunction attribute.
1011
1012 2009-09-24  Alexey Proskuryakov  <ap@apple.com>
1013
1014         Reviewed by Darin Adler and Sam Weinig.
1015
1016         Onclick not fired for an element copied with cloneContents() or cloneNode()
1017         https://bugs.webkit.org/show_bug.cgi?id=25130
1018
1019         The change here is that JS event listeners don't keep a reference to a global object from
1020         where they were created, and instead take it as a parameter when parsing source code. Also,
1021         the listener creation won't fail just because it happens for an element in a frameless
1022         document.
1023         Thus, moving nodes between documents no longer results in having incorrect registered
1024         lazy event listeners on them.
1025
1026         Tests: fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html
1027                fast/events/attribute-listener-cloned-from-frameless-doc-context.html
1028                fast/events/attribute-listener-cloned-from-frameless-doc.xhtml
1029                fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html
1030                fast/events/attribute-listener-extracted-from-frameless-doc-context.html
1031
1032         * bindings/js/JSEventListener.cpp:
1033         (WebCore::JSEventListener::JSEventListener): Don't take a reference to JSDOMGlobalObject.
1034         (WebCore::JSEventListener::jsFunction): Take ScriptExecutionContext as a parameter for
1035         getting to JSDOMGlobalObject. It's not used in base class, but is in JSLazyEventListner.
1036         (WebCore::JSEventListener::markJSFunction): Don't mark the global object.
1037         (WebCore::JSEventListener::handleEvent): Get global object from ScriptExecutionContext.
1038         (WebCore::JSEventListener::reportError): Ditto.
1039
1040         * bindings/js/JSEventListener.h: (WebCore::JSEventListener::create): Don't keep a reference
1041         to JSDOMGlobalObject.
1042
1043         * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::parseCode): Listener
1044         creation was split between this function and ScriptEventListener; moved it here, as JS
1045         global object can be different now.
1046
1047         * bindings/js/JSLazyEventListener.h: (WebCore::JSLazyEventListener::create): Keep source URL,
1048         which can not be determined at parsing time.
1049
1050         * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): Moved code
1051         for listener creation to JSLazyEventListener. XSSAuditor code remains here, because tests
1052         expect that errors are logged at document parsing time, and because I don't know what other
1053         side effects moving it vould have.
1054
1055         * dom/EventListener.h: handleEvent() and reportError() now take ScriptExecutionContext,
1056         because JSC needs a global context here.
1057
1058         * bindings/js/JSAbstractWorkerCustom.cpp:
1059         (WebCore::JSAbstractWorker::addEventListener):
1060         (WebCore::JSAbstractWorker::removeEventListener):
1061         * bindings/js/JSDOMApplicationCacheCustom.cpp:
1062         (WebCore::JSDOMApplicationCache::addEventListener):
1063         (WebCore::JSDOMApplicationCache::removeEventListener):
1064         * bindings/js/JSDOMGlobalObject.cpp:
1065         (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
1066         * bindings/js/JSDOMWindowCustom.cpp:
1067         (WebCore::JSDOMWindow::addEventListener):
1068         (WebCore::JSDOMWindow::removeEventListener):
1069         * bindings/js/JSEventSourceCustom.cpp:
1070         (WebCore::JSEventSource::addEventListener):
1071         (WebCore::JSEventSource::removeEventListener):
1072         * bindings/js/JSMessagePortCustom.cpp:
1073         (WebCore::JSMessagePort::addEventListener):
1074         (WebCore::JSMessagePort::removeEventListener):
1075         * bindings/js/JSNodeCustom.cpp:
1076         (WebCore::JSNode::addEventListener):
1077         (WebCore::JSNode::removeEventListener):
1078         * bindings/js/JSSVGElementInstanceCustom.cpp:
1079         (WebCore::JSSVGElementInstance::addEventListener):
1080         (WebCore::JSSVGElementInstance::removeEventListener):
1081         * bindings/js/JSWorkerContextCustom.cpp:
1082         (WebCore::JSWorkerContext::addEventListener):
1083         (WebCore::JSWorkerContext::removeEventListener):
1084         * bindings/js/JSXMLHttpRequestCustom.cpp:
1085         (WebCore::JSXMLHttpRequest::addEventListener):
1086         (WebCore::JSXMLHttpRequest::removeEventListener):
1087         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
1088         (WebCore::JSXMLHttpRequestUpload::addEventListener):
1089         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
1090         * bindings/objc/ObjCEventListener.h:
1091         * bindings/objc/ObjCEventListener.mm:
1092         (WebCore::ObjCEventListener::handleEvent):
1093         * bindings/scripts/CodeGeneratorJS.pm:
1094         * dom/EventTarget.cpp:
1095         (WebCore::EventTarget::fireEventListeners):
1096         * inspector/InspectorDOMAgent.cpp:
1097         (WebCore::InspectorDOMAgent::handleEvent):
1098         * inspector/InspectorDOMAgent.h:
1099         * inspector/InspectorDOMStorageResource.cpp:
1100         (WebCore::InspectorDOMStorageResource::handleEvent):
1101         * inspector/InspectorDOMStorageResource.h:
1102         * loader/ImageDocument.cpp:
1103         (WebCore::ImageEventListener::handleEvent):
1104         * svg/animation/SVGSMILElement.cpp:
1105         (WebCore::ConditionEventListener::handleEvent):
1106         * workers/WorkerContext.cpp:
1107         (WebCore::WorkerContext::reportException):
1108         Don't pass global object to JSEventListener::create(), which no longer needs it.
1109         Note that some of these functions still have an early return for null global object, which
1110         can probably be removed in a later patch.
1111         Pass ScriptExecutionContext to EventListener methods that now need it.
1112
1113 2009-09-25  Enrica Casucci  <enrica@apple.com>
1114
1115         Reviewed by Darin Adler, Dan Bernstein, Adele Peterson, and others.
1116
1117         Fix for https://bugs.webkit.org/show_bug.cgi?id=29740
1118         <rdar://problem/7168738> Gmail: After changing a foreground text color, pressing return doesn't apply background to new line
1119
1120         Change the way style is preserved when inserting a new paragraph.
1121         The original code handled insertion at the beginning and at the end of a paragraph as special
1122         cases. The newly created paragraph contained a set of nodes generated starting from the
1123         computed style of the insertion node. This approach has two problems:
1124         1. if the insertion node has a non opaque background color and one of the parent element did have
1125         a solid background color the new paragraph did not have the element with the solid color in the tree.
1126         2. in some circumstances it generated more markup than the original paragraph had (a span with bold, italic,
1127         background color and some font attribute was being reproduced as span + bold + italic + font as separate tags.
1128         The new approach is to recreate in the new paragraph the same hierarchy of nodes found in the
1129         paragraph where the insertion point is.
1130
1131         Test: editing/inserting/insert-bg-font.html
1132
1133         * editing/InsertParagraphSeparatorCommand.cpp:
1134         (WebCore::InsertParagraphSeparatorCommand::getAncestorsInsideBlock): retrieves the list of all the ancestors
1135         between the insert node and the outer block.
1136         (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock): uses the list of ancestors to recreate
1137         in the new paragraph the same element hierarchy present in the starting paragraph.
1138         (WebCore::InsertParagraphSeparatorCommand::doApply): changed the code to handle the general case of insertion
1139         in the middle of the paragraph to use the new methods. Changed the handling of the insertion at the beginning and
1140         at the end of the paragraph to use the new methods instead of applying the calculated style.
1141         * editing/InsertParagraphSeparatorCommand.h: added methods getAncestorsInsideBlock and cloneHierarchyUnderNewBlock.
1142
1143 2009-09-25  Patrick Mueller  <Patrick_Mueller@us.ibm.com>
1144
1145         Reviewed by Timothy Hatcher.
1146
1147         Content-type parameters not taken into account when building form-data
1148         https://bugs.webkit.org/show_bug.cgi?id=28970
1149
1150         existing manual test case extended with new tests
1151
1152         * English.lproj/localizedStrings.js:
1153         * inspector/front-end/ResourceView.js:
1154         (WebInspector.ResourceView.prototype._refreshFormData):
1155         (WebInspector.ResourceView.prototype._refreshParms):
1156         * manual-tests/inspector/display-form-data.html:
1157
1158 2009-09-25  Yuan Song  <song.yuan@ericsson.com>
1159
1160         Reviewed by Darin Adler.
1161
1162         https://bugs.webkit.org/show_bug.cgi?id=14566
1163
1164         Raise SECURITY_ERR exception if an attempt is made to change document.domain to an invalid value.
1165
1166         Test: fast/js/invalid-domain-change-throws-exception.html
1167
1168         * dom/Document.cpp:
1169         (WebCore::Document::setDomain):
1170         * dom/Document.h:
1171         * dom/Document.idl:
1172
1173 2009-09-25  Adam Barth  <abarth@webkit.org>
1174
1175         Reviewed by Dimitri Glazkov.
1176
1177         [V8] Teach ScheduledAction::execute about isolated worlds
1178         https://bugs.webkit.org/show_bug.cgi?id=27703
1179
1180         When setTimeout is called with a string argument in an isolated
1181         world, we now compile the string in the isolated world.
1182
1183         Last time we tried this change, we got a lot of crashes.  This
1184         time we're using a fresh local handle as our context to avoid
1185         trouble if the peristent handle gets disposed before we leave
1186         the context.
1187
1188         Test: fast/dom/timer-clear-interval-in-handler-and-generate-error.html
1189
1190         * bindings/v8/ScheduledAction.cpp:
1191         (WebCore::ScheduledAction::execute):
1192
1193 2009-09-25  Paul Godavari  <paul@chromium.org>
1194
1195         Reviewed by Darin Fisher.
1196
1197         Fix a regression in Mac Chromium popup menus, where the user's
1198         selection was ignored and the popup became unresponsive.
1199         https://bugs.webkit.org/show_bug.cgi?id=29726
1200
1201         The fix is to notify the popup's client that the popup was hidden,
1202         even if the popup has no parent.
1203
1204         * platform/chromium/PopupMenuChromium.cpp:
1205         (WebCore::PopupListBox::hidePopup):
1206
1207 2009-09-25  Alexander Pavlov  <apavlov@chromium.org>
1208
1209         Reviewed by Dan Bernstein.
1210
1211         Enable Pasteboard::writePlainText for Chromium and fix code style nits.
1212         https://bugs.webkit.org/show_bug.cgi?id=29734
1213
1214         * platform/chromium/PasteboardChromium.cpp:
1215         (WebCore::Pasteboard::writePlainText):
1216         * platform/gtk/PasteboardGtk.cpp:
1217         (WebCore::Pasteboard::writePlainText):
1218         (WebCore::Pasteboard::writeURL):
1219         * platform/mac/PasteboardMac.mm:
1220         (WebCore::Pasteboard::writeSelection):
1221         (WebCore::Pasteboard::writePlainText):
1222         (WebCore::Pasteboard::writeURL):
1223         * platform/qt/PasteboardQt.cpp:
1224         (WebCore::Pasteboard::writePlainText):
1225
1226 2009-09-25  Yongjun Zhang  <yongjun.zhang@nokia.com>
1227
1228         Reviewed by Ariya Hidayat.
1229
1230         https://bugs.webkit.org/show_bug.cgi?id=28876
1231         [Qt] reduce peak memory consumption of text decoding.
1232
1233         Chop large input buffer into small buffers to reduce peak memory
1234         during decoding.
1235
1236         * platform/text/qt/TextCodecQt.cpp:
1237         (WebCore::TextCodecQt::decode):
1238
1239 2009-09-24  Jon Honeycutt  <jhoneycutt@apple.com>
1240
1241         Add a mechanism for automatically halting plug-ins.
1242
1243         Reviewed by Oliver Hunt and Alice Liu.
1244
1245         * GNUmakefile.am:
1246
1247         * WebCore.base.exp:
1248         Update export of Page constructor.
1249
1250         * WebCore.gypi:
1251
1252         * WebCore.pro:
1253
1254         * WebCore.vcproj/WebCore.vcproj:
1255         Add PluginHalter.{h,cpp}, PluginHalterClient.h, and
1256         HaltablePlugin.h.
1257
1258         * WebCore.xcodeproj/project.pbxproj:
1259         Add files to Mac project.
1260
1261         * loader/EmptyClients.h:
1262         Added an empty PluginHalterClient.
1263         (WebCore::EmptyPluginHalterClient::shouldHaltPlugin):
1264         Return false.
1265
1266         * page/PluginHalter.cpp: Added.
1267         (WebCore::PluginHalter::PluginHalter):
1268         (WebCore::PluginHalter::didStartPlugin):
1269         Add the object to the plug-in set. If this is the only item in the set,
1270         set m_oldestStartTime to this object's time, and start the timer.
1271         (WebCore::PluginHalter::didStopPlugin):
1272         Remove the plug-in from the set.
1273         (WebCore::PluginHalter::timerFired):
1274         Find the cut-off time as the current time minus the allowed run time;
1275         plug-ins older than this may be halted. Iterate over the plug-ins. Find
1276         the object with the oldest start time that is too young to be halted;
1277         we'll use its start time to set the timer's next fire time. For all
1278         plug-ins that are candidates to be halted, call the
1279         PluginHalterClient's shouldHaltPlugin(). If this function returns true,
1280         call the plug-in's halt() function. Remove these objects from the set
1281         of tracked plug-ins. Call startTimerIfNecessary() to restart the timer.
1282         (WebCore::PluginHalter::startTimerIfNecessary):
1283         If the timer is set to fire, or the set of tracked plug-ins is empty,
1284         return early. Set the timer to fire after the oldest plug-in has run
1285         for the allowed run time.
1286
1287         * page/PluginHalter.h: Added.
1288         (WebCore::PluginHalter::setPluginAllowedRunTime):
1289
1290         * page/PluginHalterClient.h: Added.
1291         (WebCore::PluginHalterClient::~PluginHalterClient):
1292
1293         * page/Page.cpp:
1294         (WebCore::Page::Page):
1295         Initialize m_pluginHalterClient. Call pluginHalterEnabledStateChanged()
1296         to create the PluginHalter if necessary.
1297         (WebCore::Page::pluginHalterEnabledStateChanged):
1298         If plug-in halting is enabled, create the PluginHalter. If it is
1299         disabled, clear it.
1300         (WebCore::Page::pluginAllowedRunTimeChanged):
1301         If there is a plug-in halter, call its setPluginAllowedRunTime().
1302         (WebCore::Page::didStartPlugin):
1303         If there is a plug-in halter, call its didStartPlugin().
1304         (WebCore::Page::didStopPlugin):
1305         If there is a plug-in halter, call its didStopPlugin().
1306
1307         * page/Page.h:
1308         Add a parameter to the Page constructor for the PluginHalterClient.
1309         Added declarations for didStartPlugin() and didStopPlugin(), which are
1310         called when HaltablePlugins are added to or removed from the page. Adds
1311         pluginAllowedRunTimeChanged() and pluginHalterEnabledStateChanged() to
1312         notify the Page when these settings are changed. Added members to hold
1313         the PluginHalter and the PluginHalterClient.
1314
1315         * page/Settings.cpp:
1316         (WebCore::Settings::Settings):
1317         (WebCore::Settings::setPluginHalterEnabled):
1318         If the enabled state has changed, call the Page's
1319         pluginHalterEnabledStateChanged().
1320         (WebCore::Settings::setPluginAllowedRunTime):
1321         Call the Page's pluginAllowedRunTimeChanged().
1322
1323         * page/Settings.h:
1324         (WebCore::Settings::pluginHalterEnabled):
1325         (WebCore::Settings::pluginAllowedRunTime):
1326
1327         * page/HaltablePlugin.h: Added. Defines an interface for plug-ins that
1328         can be automatically halted.
1329         (WebCore::HaltablePlugin::~HaltablePlugin):
1330
1331         * svg/graphics/SVGImage.cpp:
1332         (WebCore::SVGImage::dataChanged):
1333         Pass a dummy PluginHalterClient.
1334
1335 2009-09-24  Simon Fraser  <simon.fraser@apple.com>
1336
1337         Reviewed by Dan Bernstein.
1338
1339         REGRESSION: webkit-transform scale no longer works properly in nightly build
1340         https://bugs.webkit.org/show_bug.cgi?id=29730
1341         
1342         When the initial or final state of a scale animation does not specify a transform,
1343         use a default scale of 1, rather than zero.
1344
1345         Test: compositing/transitions/scale-transition-no-start.html
1346
1347         * platform/graphics/mac/GraphicsLayerCA.mm:
1348         (WebCore::getTransformFunctionValue):
1349
1350 2009-09-24  John Gregg  <johnnyg@google.com>
1351
1352         Reviewed by Eric Seidel.
1353
1354         isEnabled switch for notifications (experimental) in Page Settings
1355         https://bugs.webkit.org/show_bug.cgi?id=28930
1356
1357         Adds a run-time flag in Settings object that controls whether
1358         to expose desktop notifications.
1359
1360         No new test, but test code also modified to set this preference.
1361
1362         * page/DOMWindow.cpp:
1363         (WebCore::DOMWindow::webkitNotifications): check preference before returning notifications object
1364         * page/Settings.cpp:
1365         (WebCore::Settings::Settings):
1366         (WebCore::Settings::setExperimentalNotificationsEnabled):
1367         * page/Settings.h:
1368         (WebCore::Settings::experimentalNotificationsEnabled):
1369
1370 2009-09-24  Dan Bernstein  <mitz@apple.com>
1371
1372         Reviewed by Sam Weinig.
1373
1374         Fix <rdar://problem/7162000> Crash while trying to
1375         calculate the horizontal position of image
1376
1377         Test: fast/inline-block/relative-positioned-rtl-crash.html
1378
1379         * rendering/RenderBox.cpp:
1380         (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Corrected an
1381         isInline() test to isRenderInline(). This is similar to r41259.
1382
1383 2009-09-24  Jessie Berlin  <jberlin@webkit.org>
1384
1385         Reviewed by Timothy Hatcher.
1386
1387         Fix expanding profile call stacks being broken after sorting.
1388         https://bugs.webkit.org/show_bug.cgi?id=26423
1389
1390         * inspector/front-end/ProfileDataGridTree.js:
1391         (WebInspector.ProfileDataGridNode.prototype.sort):
1392         Set shouldRefreshChildren to true on collapsed nodes with children so that expanding it
1393         causes the children to be placed in the right positions.
1394
1395 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
1396
1397         Reviewed by Stephanie Lewis.
1398
1399         Fixed sudden termination console spew due to too many calls to
1400         enableSuddenTermination.
1401         
1402         <rdar://problem/7063125> 10A410: Safari logging enableSuddenTermination errors
1403
1404         * page/DOMWindow.cpp:
1405         (WebCore::removeUnloadEventListener):
1406         (WebCore::removeAllUnloadEventListeners):
1407         (WebCore::removeBeforeUnloadEventListener):
1408         (WebCore::removeAllBeforeUnloadEventListeners): Only
1409         enableSuddenTermination if the set of listeners is empty *and* this
1410         window was in the set. Otherwise, a no-op will cause us to enableSuddenTermination.
1411
1412 2009-09-24  Carol Szabo  <carol.szabo@nokia.com>
1413
1414         Reviewed by Alexey Proskuryakov.
1415
1416         WebKit returns "" instead of null when getting
1417         inexistent, forbidden or invalidly named headers.
1418         https://bugs.webkit.org/show_bug.cgi?id=29140
1419
1420         * xml/XMLHttpRequest.cpp:
1421         (WebCore::XMLHttpRequest::getResponseHeader):
1422         Changed to return null as it should according to the spec.
1423
1424 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
1425
1426         Reviewed by Dimitri Glazkov.
1427
1428         Add GYP generated files to svn:ignore
1429         https://bugs.webkit.org/show_bug.cgi?id=29724
1430
1431         Adding the following files to the svn:ignore list (all in the
1432         WebCore/WebCore.gyp directory)
1433
1434         WebCore.xcodeproj
1435         WebCore.sln
1436         WebCore.vcproj
1437         WebCore_Debug.rules
1438         WebCore_Release.rules
1439         WebCore_Release - no tcmalloc.rules
1440         WebCore_Purify.rules
1441         WebCore.mk
1442         WebCore_Debug_rules.mk
1443         WebCore_Release_rules.mk
1444         WebCore_Release - no tcmalloc_rules.mk
1445         WebCore_Purify_rules.mk
1446         WebCore.scons
1447         WebCore_main.scons
1448
1449         * WebCore.gyp: Changed property svn:ignore.
1450
1451 2009-09-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1452
1453         Unreviewed. Mac build fix.
1454
1455         * page/EventHandler.cpp:
1456         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
1457         remove unused parameter from function signature;
1458
1459 2009-09-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1460
1461         Reviewed by Oliver Hunt.
1462
1463         Implement correct horizontal scrollbar behavior for GTK+ also on
1464         styled scrollbars.
1465
1466         https://bugs.webkit.org/show_bug.cgi?id=29348
1467         [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally
1468
1469         Test: platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html
1470
1471         * page/EventHandler.cpp:
1472         (WebCore::EventHandler::handleWheelEvent): on GTK+, when using the
1473         wheel with the pointer on the horizontal scrollbar, scroll
1474         horizontally;
1475         * platform/PlatformWheelEvent.h:
1476         * platform/gtk/WheelEventGtk.cpp:
1477         (WebCore::PlatformWheelEvent::swapOrientation): allow adding a
1478         vertical scroll to the horizontal one;
1479
1480 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
1481
1482         Reviewed by Eric Seidel.
1483
1484         StorageNamespace::storageArea() should take in a PassRefPtr<StorageOrigin>
1485         https://bugs.webkit.org/show_bug.cgi?id=29290
1486
1487         Modified StorageNamespace::storageArea() to take in a PassRefPtr<StorageOrigin>
1488         per http://webkit.org/coding/RefPtr.html
1489
1490         No behavior change, so no tests.
1491
1492         * storage/StorageNamespace.h:
1493         * storage/StorageNamespaceImpl.cpp:
1494         (WebCore::StorageNamespaceImpl::storageArea):
1495         * storage/StorageNamespaceImpl.h:
1496
1497 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
1498
1499         Reviewed by Sam Weinig.
1500
1501         Added back enable/disableSuddenTermination() functionality I accidentally
1502         removed in my last patch.
1503
1504         * page/DOMWindow.cpp:
1505         (WebCore::addUnloadEventListener):
1506         (WebCore::removeUnloadEventListener):
1507         (WebCore::removeAllUnloadEventListeners):
1508         (WebCore::addBeforeUnloadEventListener):
1509         (WebCore::removeBeforeUnloadEventListener):
1510         (WebCore::removeAllBeforeUnloadEventListeners):
1511         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
1512         (WebCore::DOMWindow::~DOMWindow):
1513         (WebCore::DOMWindow::addEventListener):
1514         (WebCore::DOMWindow::removeEventListener):
1515         (WebCore::DOMWindow::removeAllEventListeners):
1516
1517 2009-09-24  Sam Weinig  <sam@webkit.org>
1518
1519         Reviewed by Steve Falkenburg and Mark Rowe.
1520
1521         Don't pass -F to GCC on non-mac platforms since it is an darwin only.
1522
1523         * DerivedSources.make:
1524
1525 2009-09-24  Sam Weinig  <sam@webkit.org>
1526
1527         Fix windows build.
1528
1529         * dom/Element.idl:
1530
1531 2009-09-23  Stephen White  <senorblanco@chromium.org>
1532
1533         Reviewed by Eric Seidel.
1534
1535         Revert the relevant parts of r47925, and implement an alternate
1536         fix (localize the coordinate check to GraphicsContext::clipPath()).
1537         This fixes http://crbug.com/21174.
1538
1539         Covered by LayoutTests/svg/dynamic-updates/SVGClipPathElement-dom-clipPathUnits-attr.html.
1540
1541         * platform/graphics/skia/GraphicsContextSkia.cpp:
1542         (WebCore::GraphicsContext::clipPath):
1543         * platform/graphics/skia/PlatformContextSkia.cpp:
1544         (PlatformContextSkia::currentPathInLocalCoordinates):
1545
1546 2009-09-24  Brady Eidson  <beidson@apple.com>
1547
1548         Reviewed by Sam Weinig.
1549
1550         Merge changes from Mozilla's FTP directory parser.
1551         <rdar://problem/7227620> and https://bugs.webkit.org/show_bug.cgi?id=29294
1552
1553         FTP layout tests not possible at this time.
1554         https://bugs.webkit.org/show_bug.cgi?id=29719 tracks making them possible.
1555
1556         * loader/FTPDirectoryParser.cpp:
1557         (WebCore::ParsingFailed):
1558         (WebCore::parseOneFTPLine):
1559
1560 2009-09-24  Philippe Normand  <pnormand@igalia.com>
1561
1562         Reviewed by Gustavo Noronha.
1563
1564         [GTK] re-enable some media tests
1565         https://bugs.webkit.org/show_bug.cgi?id=29716
1566
1567         make canPlayType() return "probably" if mime-type is known
1568         and codecs string is not empty. If codecs is empty return
1569         "maybe".
1570
1571         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1572         (WebCore::MediaPlayerPrivate::supportsType):
1573
1574 2009-09-24  Sam Weinig  <sam@webkit.org>
1575
1576         Reviewed by Dan Bernstein.
1577
1578         Fix for https://bugs.webkit.org/show_bug.cgi?id=29703
1579         Add a function to element to check whether it matches a CSS selector
1580
1581         Implement Element.webkitMatchesSelector.
1582
1583         * css/CSSSelectorList.cpp:
1584         (WebCore::forEachTagSelector):
1585         (WebCore::forEachSelector):
1586         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
1587         (WebCore::CSSSelectorList::selectorsNeedNamespaceResolution):
1588         * css/CSSSelectorList.h:
1589         Moved code to iterate the CSSSelectorList and determine if any
1590         selectors need namespace resolution from a static function in
1591         Node.cpp to CSSSelectorList so that it can be used by webkitMatchesSelector
1592         as well as querySelector/querySelectorAll.
1593
1594         * dom/Element.cpp:
1595         (WebCore::Element::webkitMatchesSelector):
1596         * dom/Element.h: 
1597         * dom/Element.idl:
1598         Implement the new function. Handles exceptional cases identically to
1599         querySelector/querySelectorAll.
1600
1601         * dom/Node.cpp:
1602         (WebCore::Node::querySelector):
1603         (WebCore::Node::querySelectorAll):
1604         Moved selectorsNeedNamespaceResolution to CSSSelectorList from here.
1605
1606 2009-09-24  Vitaly Repeshko  <vitalyr@chromium.org>
1607
1608         Reviewed by Dimitri Glazkov.
1609
1610         [V8] Fixed bindings build after http://trac.webkit.org/changeset/48701
1611         https://bugs.webkit.org/show_bug.cgi?id=29713
1612
1613         Got rid of isWindowEvent in function signatures:
1614         * bindings/v8/V8AbstractEventListener.cpp:
1615         (WebCore::V8AbstractEventListener::invokeEventHandler):
1616         (WebCore::V8AbstractEventListener::handleEvent):
1617         (WebCore::V8AbstractEventListener::getReceiverObject):
1618         * bindings/v8/V8AbstractEventListener.h:
1619         * bindings/v8/V8LazyEventListener.cpp:
1620         (WebCore::V8LazyEventListener::callListenerFunction):
1621         * bindings/v8/V8LazyEventListener.h:
1622         * bindings/v8/V8WorkerContextEventListener.cpp:
1623         (WebCore::V8WorkerContextEventListener::handleEvent):
1624         (WebCore::V8WorkerContextEventListener::callListenerFunction):
1625         (WebCore::V8WorkerContextEventListener::getReceiverObject):
1626         * bindings/v8/V8WorkerContextEventListener.h:
1627         * bindings/v8/custom/V8CustomEventListener.cpp:
1628         (WebCore::V8EventListener::callListenerFunction):
1629         * bindings/v8/custom/V8CustomEventListener.h:
1630
1631         Switched to EventTarget methods of adding/removing listeners:
1632         * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
1633         (WebCore::toEventID):
1634         (WebCore::ACCESSOR_SETTER):
1635
1636         * dom/EventTarget.h: Some functions were incorrectly marked
1637         as JSC-specific.
1638
1639 2009-09-24  Pavel Feldman  <pfeldman@chromium.org>
1640
1641         Reviewed by Timothy Hatcher.
1642
1643         Web Inspector: Color-code watch expression errors with red.
1644
1645         https://bugs.webkit.org/show_bug.cgi?id=29707
1646
1647         * inspector/front-end/WatchExpressionsSidebarPane.js:
1648         (WebInspector.WatchExpressionsSection.prototype.update):
1649         (WebInspector.WatchExpressionTreeElement.prototype.update):
1650         * inspector/front-end/inspector.css:
1651
1652 2009-09-24  Pavel Feldman  <pfeldman@chromium.org>
1653
1654         Reviewed by Timothy Hatcher.
1655
1656         Web Inspector: Fix formatting for messages derived from resource warnings,
1657         couple of drive-by formatting fixes.
1658
1659         https://bugs.webkit.org/show_bug.cgi?id=29705
1660
1661         * inspector/InspectorFrontend.cpp:
1662         (WebCore::InspectorFrontend::addMessageToConsole):
1663         * inspector/front-end/ConsoleView.js:
1664         * inspector/front-end/InjectedScript.js:
1665         (InjectedScript._evaluateAndWrap):
1666         * inspector/front-end/WatchExpressionsSidebarPane.js:
1667         (WebInspector.WatchExpressionsSection.prototype.update):
1668
1669 2009-09-22  Pavel Feldman  <pfeldman@chromium.org>
1670
1671         Reviewed by Timothy Hatcher.
1672
1673         WebInspector: Implement InspectorController::copyNode(id).
1674
1675         https://bugs.webkit.org/show_bug.cgi?id=28357
1676
1677         * inspector/InspectorBackend.cpp:
1678         (WebCore::InspectorBackend::copyNode):
1679         * inspector/InspectorBackend.h:
1680         * inspector/InspectorBackend.idl:
1681         * inspector/front-end/ElementsPanel.js:
1682         (WebInspector.ElementsPanel.prototype.handleCopyEvent):
1683
1684 2009-09-24  Oliver Hunt  <oliver@apple.com>
1685
1686         Reviewed by NOBODY(rollout)
1687
1688         Roll out r48712 as it is incorrect.
1689
1690         Overriding getPropertyNames is incorrect.
1691
1692         * bridge/runtime_array.cpp:
1693         * bridge/runtime_array.h:
1694
1695 2009-09-24  Xan Lopez  <xlopez@igalia.com>
1696
1697         Revert r48697, since it broke key handling notification to GTK+.
1698
1699         * platform/gtk/KeyEventGtk.cpp:
1700         (WebCore::keyIdentifierForGdkKeyCode):
1701         (WebCore::singleCharacterString):
1702
1703 2009-09-24  Philippe Normand  <pnormand@igalia.com>
1704
1705         Reviewed by Xan Lopez.
1706
1707         [GTK] GStreamer MediaPlayer is unable to correctly querry duration
1708         https://bugs.webkit.org/show_bug.cgi?id=24639
1709
1710         check duration returned by gst_element_query_duration() only
1711         when using GStreamer < 0.10.23.
1712
1713         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1714         (WebCore::MediaPlayerPrivate::duration):
1715
1716 2009-09-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
1717
1718         Reviewed by Eric Seidel.
1719
1720         The indices of RuntimeArray should be enumerated like for a regular array.
1721         https://bugs.webkit.org/show_bug.cgi?id=29005
1722
1723         * bridge/runtime_array.cpp:
1724         (JSC::RuntimeArray::getPropertyNames):
1725         * bridge/runtime_array.h:
1726
1727 2009-09-23  Alexander Pavlov  <apavlov@chromium.org>
1728
1729         Reviewed by Eric Seidel.
1730
1731         Introduce Pasteboard::writePlaintext(const String&) so that copying
1732         of the inspected elements HTML will be possible in WebInspector.
1733         https://bugs.webkit.org/show_bug.cgi?id=29634
1734
1735         * platform/Pasteboard.h:
1736         * platform/android/TemporaryLinkStubs.cpp:
1737         (Pasteboard::writePlainText):
1738         * platform/chromium/ChromiumBridge.h:
1739         * platform/chromium/PasteboardChromium.cpp:
1740         (WebCore::Pasteboard::writePlainText):
1741         * platform/gtk/PasteboardGtk.cpp:
1742         (WebCore::Pasteboard::writePlainText):
1743         * platform/haiku/PasteboardHaiku.cpp:
1744         (WebCore::Pasteboard::writePlainText):
1745         * platform/mac/PasteboardMac.mm:
1746         (WebCore::Pasteboard::writePlainText):
1747         * platform/qt/PasteboardQt.cpp:
1748         (WebCore::Pasteboard::writePlainText):
1749         * platform/win/PasteboardWin.cpp:
1750         (WebCore::Pasteboard::writeSelection):
1751         (WebCore::Pasteboard::writePlainText):
1752         * platform/wince/PasteboardWince.cpp:
1753         (WebCore::Pasteboard::writePlainText):
1754         * platform/wx/PasteboardWx.cpp:
1755         (WebCore::Pasteboard::writeSelection):
1756         (WebCore::Pasteboard::writePlainText):
1757         (WebCore::Pasteboard::writeURL):
1758
1759 2009-09-24  Oswald Buddenhagen  <oswald.buddenhagen@nokia.com>
1760
1761         Reviewed by Simon Hausmann.
1762
1763         Fix QApp::translate() calls to provide the correct class name without
1764         a trailing comma.
1765
1766         * platform/qt/Localizations.cpp:
1767         (WebCore::localizedMediaTimeDescription):
1768
1769 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
1770
1771         More build fix: Removed JSSharedWorkerContextCustom.cpp from project
1772         files, since it no longer exists in the repository.
1773
1774         * GNUmakefile.am:
1775         * WebCore.gypi:
1776         * WebCore.pro:
1777         * WebCore.vcproj/WebCore.vcproj:
1778
1779 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
1780
1781         Windows build fix: Declare set/unsetPendingActivity public, so
1782         SharedWorkerScriptLoader can call them.
1783
1784         * dom/ActiveDOMObject.h:
1785
1786 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
1787
1788         Fixed a bit of the Windows build.
1789
1790         * workers/SharedWorker.idl: Declare a custom mark function. (I accidentally
1791         removed this in my last patch.)
1792         * WebCore.xcodeproj/project.pbxproj: Added JSSharedWorkerCustom.cpp back
1793         to the build. (I accidentally removed this in my last patch.)
1794
1795 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
1796
1797         32-bit build fix: restore previous cast that I thought was unnecessary.
1798
1799         * xml/XMLHttpRequest.cpp:
1800         (WebCore::XMLHttpRequest::didSendData):
1801         (WebCore::XMLHttpRequest::didReceiveData):
1802
1803 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
1804
1805         Reviewed by Sam Weinig.
1806
1807         Bring a little sanity to this crazy EventTarget world of ours
1808         https://bugs.webkit.org/show_bug.cgi?id=29701
1809
1810         Lots of EventTarget refactoring to achieve a single shared implementation
1811         that fixes some of the performance and correctness bugs of the many individual
1812         implementations, and makes reasoning about EventTargets and EventListeners
1813         much easier.
1814         
1815         The basic design is this:
1816             - EventTarget manages a set of EventListeners.
1817             - onXXX EventListener attributes forward to standard EventTarget APIs.
1818             - Since the onXXX code is repetitive, it is usually done with macros
1819               of the form DEFINE_ATTRIBUTE_EVENT_LISTENER(attributeName).
1820             - EventTarget provides a shared implementation of dispatchEvent,
1821               which subclasses with special event dispatch rules, like Node, override.
1822             - To support Node, which lazily instantiates its EventTarget data,
1823               EventTarget has no data members, and instead makes a virtual call
1824               to get its data from wherever its subclass chose to store it.
1825               
1826         Code that used to call dispatchEvent, passing an ExceptionCode paratmeter,
1827         even though no exception could be thrown, has been changed not to do so,
1828         to improve clarity and performance.
1829         
1830         Code that used to call a special dispatchXXXEvent function, which just
1831         turned around and called dispatchEvent, has been changed to call
1832         dispatchEvent, to improve clarity and performance.
1833
1834         * WebCore.base.exp:
1835         * WebCore.xcodeproj/project.pbxproj: Another day in the life of a WebKit
1836         engineer.
1837
1838         * bindings/js/JSDOMBinding.cpp:
1839         (WebCore::isObservableThroughDOM): Updated for Node API change. Added
1840         "is not in the document but is firing event listeners" as a condition
1841         that makes a Node observable in the DOM, so that event listeners firing
1842         on removed nodes are not destroyed midstream. (This was a long-standing
1843         bug that was somewhat hidden by the old implementation's habit of
1844         copying the RegisteredEventListener vector before firing events, which
1845         would keep almost all the relevant objects from being destroyed.)
1846
1847         * bindings/js/JSEventListener.cpp:
1848         (WebCore::JSEventListener::handleEvent): Removed the isWindowEvent flag
1849         because it was one of the most elaborately planned no-ops in the history
1850         of software crime, and one of the reasons clients thought they needed more
1851         than one dispatchEvent function even though they didn't.
1852         * bindings/js/JSEventListener.h:
1853
1854         * bindings/js/JSDOMWindowCustom.cpp:
1855         (WebCore::JSDOMWindow::markChildren):
1856         (WebCore::JSMessagePort::markChildren):
1857         * bindings/js/JSNodeCustom.cpp:
1858         (WebCore::JSNode::markChildren):
1859         * bindings/js/JSAbstractWorkerCustom.cpp:
1860         * bindings/js/JSDOMApplicationCacheCustom.cpp:
1861         * bindings/js/JSDedicatedWorkerContextCustom.cpp:
1862         * bindings/js/JSEventSourceCustom.cpp:
1863         * bindings/js/JSMessagePortCustom.cpp:
1864         * bindings/js/JSSharedWorkerContextCustom.cpp: Removed.
1865         * bindings/js/JSWebSocketCustom.cpp:
1866         * bindings/js/JSWorkerContextCustom.cpp:
1867         (WebCore::JSWorkerContext::markChildren):
1868         * bindings/js/JSWorkerCustom.cpp:
1869         * bindings/js/JSXMLHttpRequestCustom.cpp:
1870         (WebCore::JSXMLHttpRequest::markChildren):
1871         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
1872         (WebCore::JSXMLHttpRequestUpload::markChildren): EventListener marking is
1873         now autogenerated. Classes that still have custom mark functions for other
1874         reasons now call a shared EventTarget API to mark their EventListeners.
1875
1876         * bindings/objc/ObjCEventListener.h:
1877         * bindings/objc/ObjCEventListener.mm:
1878         (WebCore::ObjCEventListener::handleEvent): Bye bye isWindowEvent.
1879
1880         * bindings/scripts/CodeGeneratorJS.pm: Autogeneration support for
1881         marking and invalidating event listeners.
1882
1883         * dom/CharacterData.cpp:
1884         (WebCore::CharacterData::dispatchModifiedEvent):
1885         * dom/ContainerNode.cpp:
1886         (WebCore::ContainerNode::insertBefore):
1887         (WebCore::ContainerNode::replaceChild):
1888         (WebCore::willRemoveChild):
1889         (WebCore::ContainerNode::appendChild):
1890         (WebCore::dispatchChildInsertionEvents):
1891         (WebCore::dispatchChildRemovalEvents):
1892         * dom/Document.cpp:
1893         (WebCore::Document::removeAllEventListeners):
1894         (WebCore::Document::implicitClose):
1895         (WebCore::Document::setFocusedNode):
1896         (WebCore::Document::dispatchWindowEvent):
1897         (WebCore::Document::dispatchWindowLoadEvent):
1898         (WebCore::Document::finishedParsing):
1899         * dom/Document.h: Use dispatchEvent directly.
1900
1901         * dom/Element.h: Moved a few event listener attributes down from Node,
1902         since they don't apply to all Nodes, only Elements.
1903
1904         * dom/EventListener.h: Removed isWindowEvent parameter.
1905
1906         * dom/EventNames.h: Added the "display" event name, so it works correctly
1907         with attribute macros, and for performance.
1908
1909         * dom/EventTarget.cpp:
1910         (WebCore::forbidEventDispatch):
1911         (WebCore::allowEventDispatch):
1912         (WebCore::eventDispatchForbidden): Made this code (embarrasingly) thread
1913         safe, since it's now called on multiple threads. (Currently, we only forbid
1914         event dispatch on the main thread. If we ever want to forbid event dispatch
1915         on secondary threads, we can improve it then.)
1916
1917         (WebCore::EventTarget::addEventListener):
1918         (WebCore::EventTarget::removeEventListener):
1919         (WebCore::EventTarget::setAttributeEventListener):
1920         (WebCore::EventTarget::getAttributeEventListener):
1921         (WebCore::EventTarget::clearAttributeEventListener):
1922         (WebCore::EventTarget::dispatchEvent):
1923         (WebCore::EventTarget::fireEventListeners):
1924         (WebCore::EventTarget::getEventListeners):
1925         (WebCore::EventTarget::removeAllEventListeners):
1926         * dom/EventTarget.h:
1927         (WebCore::FiringEventEndIterator::FiringEventEndIterator):
1928         (WebCore::EventTarget::ref):
1929         (WebCore::EventTarget::deref):
1930         (WebCore::EventTarget::markEventListeners):
1931         (WebCore::EventTarget::invalidateEventListeners):
1932         (WebCore::EventTarget::isFiringEventListeners):
1933         (WebCore::EventTarget::hasEventListeners): The ONE TRUE IMPLEMENTATION of
1934         EventTarget APIs, crafted from an amalgam of all the different versions
1935         we used to have. The most significant change here is that we no longer
1936         make a copy of an EventListener vector before firing the events in the
1937         vector -- instead, we use a reference to the original vector, along with
1938         a notification mechanism for the unlikely case when an EventListener is
1939         removed from the vector. This substantially reduces malloc, copying, and
1940         refcount overhead, and complexity.
1941
1942         * dom/InputElement.cpp:
1943         (WebCore::InputElement::setValueFromRenderer):
1944         * dom/MessageEvent.h:
1945         (WebCore::MessageEvent::create): Use dispatchEvent directly.
1946
1947         * dom/MessagePort.cpp:
1948         (WebCore::MessagePort::dispatchMessages):
1949         (WebCore::MessagePort::eventTargetData):
1950         (WebCore::MessagePort::ensureEventTargetData):
1951         * dom/MessagePort.h:
1952         (WebCore::MessagePort::setOnmessage):
1953         (WebCore::MessagePort::onmessage):
1954         * dom/MessagePort.idl: Removed custom EventTarget implementation.
1955
1956         * dom/MutationEvent.h:
1957         (WebCore::MutationEvent::create): Added some default values so callers
1958         can construct MutationEvents more easily, without calling a custom dispatch
1959         function.
1960
1961         * dom/Node.cpp:
1962         (WebCore::Node::addEventListener):
1963         (WebCore::Node::removeEventListener):
1964         (WebCore::Node::eventTargetData):
1965         (WebCore::Node::ensureEventTargetData):
1966         (WebCore::Node::handleLocalEvents):
1967         (WebCore::Node::dispatchEvent):
1968         (WebCore::Node::dispatchGenericEvent):
1969         (WebCore::Node::dispatchSubtreeModifiedEvent):
1970         (WebCore::Node::dispatchUIEvent):
1971         (WebCore::Node::dispatchKeyEvent):
1972         (WebCore::Node::dispatchMouseEvent):
1973         (WebCore::Node::dispatchWheelEvent):
1974         (WebCore::Node::dispatchFocusEvent):
1975         (WebCore::Node::dispatchBlurEvent):
1976         * dom/Node.h:
1977         (WebCore::Node::preDispatchEventHandler):
1978         (WebCore::Node::postDispatchEventHandler):
1979         * dom/Node.idl:
1980         * dom/NodeRareData.h:
1981         (WebCore::NodeRareData::eventTargetData):
1982         (WebCore::NodeRareData::ensureEventTargetData): Use the shared EventTarget
1983         interface, and call dispatchEvent directly instead of custom dispatchXXXEvent
1984         functions that just forwarded to dispatchEvent.
1985
1986         * dom/RegisteredEventListener.cpp:
1987         * dom/RegisteredEventListener.h:
1988         (WebCore::RegisteredEventListener::RegisteredEventListener):
1989         (WebCore::operator==): This is just a simple struct now, since we no longer
1990         do a complicated copy / refCount / isRemoved dance just to honor the rule
1991         that an EventListener can be removed during event dispatch.
1992
1993         * history/CachedFrame.cpp:
1994         (WebCore::CachedFrameBase::restore): Removed another custom dispatchEvent.
1995
1996         * html/HTMLBodyElement.cpp:
1997         * html/HTMLBodyElement.h: Use the shared EventTarget API.
1998
1999         * html/HTMLFormControlElement.cpp:
2000         (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent):
2001         (WebCore::HTMLFormControlElement::checkValidity):
2002         * html/HTMLFormElement.cpp:
2003         (WebCore::HTMLFormElement::handleLocalEvents):
2004         (WebCore::HTMLFormElement::prepareSubmit):
2005         (WebCore::HTMLFormElement::reset):
2006         * html/HTMLFormElement.h: Use the standard dispatchEvent API.
2007
2008         * html/HTMLFrameSetElement.cpp:
2009         * html/HTMLFrameSetElement.h: Use the shared EventTarget API.
2010
2011         * html/HTMLImageLoader.cpp:
2012         (WebCore::HTMLImageLoader::dispatchLoadEvent):
2013         * html/HTMLInputElement.cpp:
2014         (WebCore::HTMLInputElement::onSearch):
2015         * html/HTMLMediaElement.cpp:
2016         (WebCore::HTMLMediaElement::loadInternal):
2017         * html/HTMLScriptElement.cpp:
2018         (WebCore::HTMLScriptElement::dispatchLoadEvent):
2019         (WebCore::HTMLScriptElement::dispatchErrorEvent):
2020         * html/HTMLSourceElement.cpp:
2021         (WebCore::HTMLSourceElement::errorEventTimerFired):
2022         * html/HTMLTokenizer.cpp:
2023         (WebCore::HTMLTokenizer::notifyFinished): Use the standard dispatchEvent API.
2024
2025         * inspector/InspectorDOMAgent.cpp:
2026         (WebCore::InspectorDOMAgent::handleEvent):
2027         * inspector/InspectorDOMAgent.h:
2028         * inspector/InspectorDOMStorageResource.cpp:
2029         (WebCore::InspectorDOMStorageResource::handleEvent):
2030         * inspector/InspectorDOMStorageResource.h:
2031         * loader/FrameLoader.cpp:
2032         (WebCore::FrameLoader::stopLoading):
2033         (WebCore::FrameLoader::canCachePageContainingThisFrame):
2034         (WebCore::FrameLoader::logCanCacheFrameDecision):
2035         (WebCore::HashChangeEventTask::performTask):
2036         (WebCore::FrameLoader::pageHidden): No more isWindowEvent.
2037
2038         * loader/ImageDocument.cpp:
2039         (WebCore::ImageEventListener::handleEvent):
2040         * loader/appcache/ApplicationCacheGroup.cpp:
2041         (WebCore::CallCacheListenerTask::performTask):
2042         * loader/appcache/ApplicationCacheHost.cpp:
2043         (WebCore::ApplicationCacheHost::notifyDOMApplicationCache):
2044         * loader/appcache/ApplicationCacheHost.h:
2045         * loader/appcache/DOMApplicationCache.cpp:
2046         (WebCore::DOMApplicationCache::eventTargetData):
2047         (WebCore::DOMApplicationCache::ensureEventTargetData):
2048         * loader/appcache/DOMApplicationCache.h:
2049         * loader/appcache/DOMApplicationCache.idl: Switched to the standard
2050         EventTarget API. As a part of this, I switched this class from using a
2051         custom internal event name enumeration to using the standard EventNames.
2052
2053         * notifications/Notification.cpp:
2054         (WebCore::Notification::eventTargetData):
2055         (WebCore::Notification::ensureEventTargetData):
2056         * notifications/Notification.h:
2057         (WebCore::Notification::scriptExecutionContext):
2058         * notifications/Notification.idl: Switched to the standard EventTarget API.
2059
2060         * page/DOMWindow.cpp:
2061         (WebCore::PostMessageTimer::event):
2062         (WebCore::windowsWithUnloadEventListeners):
2063         (WebCore::windowsWithBeforeUnloadEventListeners):
2064         (WebCore::allowsBeforeUnloadListeners):
2065         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
2066         (WebCore::DOMWindow::pendingUnloadEventListeners):
2067         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): Changed the "pending"
2068         unload / beforeunload listener tracker just to track which windows had
2069         such listeners, instead of actually keeping a copy of the listeners. Now,
2070         this code can use the standard EventTarget API.
2071
2072         (WebCore::DOMWindow::~DOMWindow):
2073         (WebCore::DOMWindow::postMessageTimerFired):
2074         (WebCore::DOMWindow::addEventListener):
2075         (WebCore::DOMWindow::removeEventListener):
2076         (WebCore::DOMWindow::dispatchLoadEvent):
2077         (WebCore::DOMWindow::dispatchEvent):
2078         (WebCore::DOMWindow::removeAllEventListeners):
2079         (WebCore::DOMWindow::captureEvents):
2080         (WebCore::DOMWindow::releaseEvents):
2081         (WebCore::DOMWindow::eventTargetData):
2082         (WebCore::DOMWindow::ensureEventTargetData):
2083         * page/DOMWindow.h:
2084         * page/DOMWindow.idl: Use the standard EventTarget APIs.
2085
2086         * page/EventHandler.cpp:
2087         (WebCore::EventHandler::canMouseDownStartSelect):
2088         (WebCore::EventHandler::canMouseDragExtendSelect):
2089         (WebCore::EventHandler::sendResizeEvent):
2090         (WebCore::EventHandler::sendScrollEvent): Use dispatchEvent directly.
2091
2092         * page/EventSource.cpp:
2093         (WebCore::EventSource::endRequest):
2094         (WebCore::EventSource::didReceiveResponse):
2095         (WebCore::EventSource::parseEventStreamLine):
2096         (WebCore::EventSource::stop):
2097         (WebCore::EventSource::createMessageEvent):
2098         (WebCore::EventSource::eventTargetData):
2099         (WebCore::EventSource::ensureEventTargetData):
2100         * page/EventSource.h:
2101         * page/EventSource.idl: Use the standard EventTarget APIs.
2102
2103         * page/FocusController.cpp:
2104         (WebCore::dispatchEventsOnWindowAndFocusedNode):
2105         (WebCore::FocusController::setFocusedFrame):
2106         * page/Frame.cpp:
2107         (WebCore::Frame::shouldClose):
2108         * page/Frame.h:
2109         * page/Page.cpp:
2110         (WebCore::networkStateChanged):
2111         * page/animation/AnimationController.cpp:
2112         (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
2113         * rendering/RenderListBox.cpp:
2114         (WebCore::RenderListBox::valueChanged):
2115         * rendering/RenderTextControl.cpp:
2116         (WebCore::RenderTextControl::selectionChanged):
2117         * rendering/RenderTextControlMultiLine.cpp:
2118         (WebCore::RenderTextControlMultiLine::subtreeHasChanged): Use dispatchEvent.
2119
2120         * svg/SVGElement.cpp:
2121         (WebCore::hasLoadListener): Rewritten for new EventTarget API.
2122
2123         * svg/SVGElementInstance.cpp:
2124         (WebCore::dummyEventTargetData):
2125         (WebCore::SVGElementInstance::addEventListener):
2126         (WebCore::SVGElementInstance::removeEventListener):
2127         (WebCore::SVGElementInstance::removeAllEventListeners):
2128         (WebCore::SVGElementInstance::dispatchEvent):
2129         (WebCore::SVGElementInstance::eventTargetData):
2130         (WebCore::SVGElementInstance::ensureEventTargetData): Use the EventTarget API.
2131
2132         * svg/SVGElementInstance.h:
2133         * svg/SVGImageLoader.cpp:
2134         (WebCore::SVGImageLoader::dispatchLoadEvent):
2135         * svg/SVGScriptElement.cpp:
2136         (WebCore::SVGScriptElement::dispatchErrorEvent): Use dispatchEvent directly.
2137
2138         * svg/SVGUseElement.cpp:
2139         (WebCore::SVGUseElement::transferEventListenersToShadowTree): Updated for
2140         new EventTarget API.
2141
2142         * svg/animation/SVGSMILElement.cpp:
2143         (WebCore::ConditionEventListener::handleEvent): No more isWindowEvent.
2144
2145         * websockets/WebSocket.cpp:
2146         (WebCore::ProcessWebSocketEventTask::create):
2147         (WebCore::ProcessWebSocketEventTask::performTask):
2148         (WebCore::ProcessWebSocketEventTask::ProcessWebSocketEventTask):
2149         (WebCore::WebSocket::didConnect):
2150         (WebCore::WebSocket::didReceiveMessage):
2151         (WebCore::WebSocket::didClose):
2152         (WebCore::WebSocket::eventTargetData):
2153         (WebCore::WebSocket::ensureEventTargetData):
2154         * websockets/WebSocket.h:
2155         * websockets/WebSocket.idl:
2156         * workers/AbstractWorker.cpp:
2157         (WebCore::AbstractWorker::eventTargetData):
2158         (WebCore::AbstractWorker::ensureEventTargetData):
2159         * workers/AbstractWorker.h:
2160         * workers/AbstractWorker.idl:
2161         * workers/DedicatedWorkerContext.cpp:
2162         * workers/DedicatedWorkerContext.h:
2163         * workers/DedicatedWorkerContext.idl:
2164         * workers/DefaultSharedWorkerRepository.cpp:
2165         (WebCore::SharedWorkerConnectTask::performTask):
2166         (WebCore::SharedWorkerScriptLoader::load):
2167         (WebCore::SharedWorkerScriptLoader::notifyFinished):
2168         * workers/SharedWorker.idl:
2169         * workers/SharedWorkerContext.cpp:
2170         (WebCore::createConnectEvent):
2171         * workers/SharedWorkerContext.h:
2172         * workers/SharedWorkerContext.idl:
2173         * workers/Worker.cpp:
2174         (WebCore::Worker::notifyFinished):
2175         * workers/Worker.h:
2176         * workers/Worker.idl:
2177         * workers/WorkerContext.cpp:
2178         (WebCore::WorkerContext::eventTargetData):
2179         (WebCore::WorkerContext::ensureEventTargetData):
2180         * workers/WorkerContext.h:
2181         * workers/WorkerContext.idl:
2182         * workers/WorkerMessagingProxy.cpp:
2183         (WebCore::MessageWorkerContextTask::performTask):
2184         (WebCore::MessageWorkerTask::performTask):
2185         (WebCore::WorkerExceptionTask::performTask):
2186         * xml/XMLHttpRequest.cpp:
2187         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
2188         (WebCore::XMLHttpRequest::createRequest):
2189         (WebCore::XMLHttpRequest::abort):
2190         (WebCore::XMLHttpRequest::networkError):
2191         (WebCore::XMLHttpRequest::abortError):
2192         (WebCore::XMLHttpRequest::didSendData):
2193         (WebCore::XMLHttpRequest::didReceiveData):
2194         (WebCore::XMLHttpRequest::eventTargetData):
2195         (WebCore::XMLHttpRequest::ensureEventTargetData):
2196         * xml/XMLHttpRequest.h:
2197         * xml/XMLHttpRequest.idl:
2198         * xml/XMLHttpRequestProgressEvent.h:
2199         (WebCore::XMLHttpRequestProgressEvent::create):
2200         * xml/XMLHttpRequestUpload.cpp:
2201         (WebCore::XMLHttpRequestUpload::eventTargetData):
2202         (WebCore::XMLHttpRequestUpload::ensureEventTargetData):
2203         * xml/XMLHttpRequestUpload.h:
2204         * xml/XMLHttpRequestUpload.idl: Use new EventTarget API.
2205
2206 2009-09-23  Kent Tamura  <tkent@chromium.org>
2207
2208         Reviewed by Darin Adler.
2209
2210         - Support for maxLength of <textarea>
2211         - Move numGraphemeClusters() and numCharactersInGraphemeClusters() from InputElement to String.
2212         https://bugs.webkit.org/show_bug.cgi?id=29292
2213
2214         Test: fast/forms/textarea-maxlength.html
2215
2216         * dom/InputElement.cpp:
2217         (WebCore::InputElement::sanitizeUserInputValue):
2218         (WebCore::InputElement::handleBeforeTextInsertedEvent):
2219         * html/HTMLTextAreaElement.cpp:
2220         (WebCore::HTMLTextAreaElement::defaultEventHandler):
2221         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
2222         (WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
2223         (WebCore::HTMLTextAreaElement::maxLength):
2224         (WebCore::HTMLTextAreaElement::setMaxLength):
2225         * html/HTMLTextAreaElement.h:
2226         * html/HTMLTextAreaElement.idl:
2227         * platform/text/PlatformString.h:
2228         * platform/text/String.cpp:
2229         (WebCore::String::numGraphemeClusters):
2230         (WebCore::String::numCharactersInGraphemeClusters):
2231
2232 2009-09-23  Martin Robinson  <martin.james.robinson@gmail.com>
2233
2234         Reviewed by Xan Lopez.
2235
2236         [GTK] REGRESSION: BitmapImage::getGdkPixbuf fails for non-square images
2237         https://bugs.webkit.org/show_bug.cgi?id=29654
2238
2239         Give GDK_Backspace key events the proper text properties.
2240
2241         Instead of adding new tests, this change removes existing tests
2242         from Gtk's skipped list.
2243
2244         * platform/gtk/KeyEventGtk.cpp:
2245         (WebCore::keyIdentifierForGdkKeyCode):
2246         (WebCore::singleCharacterString):
2247
2248 2009-09-23  Sam Weinig  <sam@webkit.org>
2249
2250         Reviewed by Adam Barth.
2251
2252         Fix for https://bugs.webkit.org/show_bug.cgi?id=26989
2253         Should allow navigation of top-level openers
2254         <rdar://problem/7034025>
2255
2256         Allow navigation of cross-origin window.opener if it is top-level frame.
2257
2258         Test: http/tests/security/frameNavigation/cross-origin-opener.html
2259
2260         * loader/FrameLoader.cpp:
2261         (WebCore::FrameLoader::shouldAllowNavigation):
2262
2263 2009-09-23  Marshall Culpepper  <mculpepper@appcelerator.com>
2264
2265         Reviewed by Eric Seidel.
2266
2267         Added $(WebKitLibrariesDir)/include/cairo so cairo.h is found by
2268         default when the necessary dependencies are extracted into the
2269         WebKitLibrariesDir.
2270         https://bugs.webkit.org/show_bug.cgi?id=29661
2271
2272         * WebCore.vcproj/WebCoreCairo.vsprops:
2273
2274 2009-09-23  Darin Adler  <darin@apple.com>
2275
2276         Reviewed by Sam Weinig.
2277
2278         Crash when website does a history.back() followed by an alert()
2279         https://bugs.webkit.org/show_bug.cgi?id=29686
2280         rdar://problem/6984996
2281
2282         When loading is deferred, we need to defer timer-based loads
2283         too, not just networking-driven loads. Otherwise we can get
2284         syncronouse navigation while running a script, which leads to
2285         crashes and other badness.
2286
2287         This patch includes a manual test; an automated test may be
2288         possible some time in the future.
2289
2290         * dom/Document.cpp:
2291         (WebCore::Document::processHttpEquiv): Use scheduleLocationChange
2292         instead of scheduleHTTPRedirection to implement the navigation
2293         needed for x-frame-options.
2294
2295         * loader/FrameLoader.cpp:
2296         (WebCore::FrameLoader::FrameLoader): Updated for data members with
2297         new names and new data members.
2298         (WebCore::FrameLoader::setDefersLoading): When turning deferral
2299         off, call startRedirectionTimer and startCheckCompleteTimer, since
2300         either of them might have been fired and ignored while defersLoading
2301         was true.
2302         (WebCore::FrameLoader::clear): Updated for replacement of the
2303         m_checkCompletedTimer and m_checkLoadCompleteTimer timers.
2304         (WebCore::FrameLoader::allAncestorsAreComplete): Added.
2305         (WebCore::FrameLoader::checkCompleted): Added code to set
2306         m_shouldCallCheckCompleted to false. Changed code that calls
2307         startRedirectionTimer to call it unconditionally, since that
2308         function now knows when to do work and doesn't expect callers
2309         to handle that any more.
2310         (WebCore::FrameLoader::checkTimerFired): Added. Replaces the old
2311         timer fired callbacks. Calls checkCompleted and checkLoadComplete
2312         as appropriate, but not when defersLoading is true.
2313         (WebCore::FrameLoader::startCheckCompleteTimer): Added. Replaces
2314         the two different calls to start timers before. Only starts the
2315         timers if they are needed.
2316         (WebCore::FrameLoader::scheduleCheckCompleted): Changed to call
2317         startCheckCompleteTimer after setting boolean.
2318         (WebCore::FrameLoader::scheduleCheckLoadComplete): Ditto.
2319         (WebCore::FrameLoader::scheduleHistoryNavigation): Removed
2320         canGoBackOrForward check. The logic works more naturally when
2321         we don't do anything until the timer fires.
2322         (WebCore::FrameLoader::redirectionTimerFired): Do nothing if
2323         defersLoading is true. Also moved canGoBackOrForward check here.
2324         (WebCore::FrameLoader::scheduleRedirection): Changed code that
2325         calls startRedirectionTimer to do so unconditionally. That
2326         function now handles the rules about when to start the timer
2327         rather than expecting the caller to do so.
2328         (WebCore::FrameLoader::startRedirectionTimer): Added code to
2329         handle the case where there is no redirection scheduled,
2330         where the timer is already active, or where this is a classic
2331         redirection and there is an ancestor that has not yet completed
2332         loading.
2333         (WebCore::FrameLoader::completed): Call startRedirectionTimer
2334         here directly instead of calling a cover named parentCompleted.
2335         Hooray! One less function in the giant FrameLoader class!
2336         (WebCore::FrameLoader::checkLoadComplete): Added code to set
2337         m_shouldCallCheckLoadComplete to false.
2338
2339         * loader/FrameLoader.h: Replaced the two functions
2340         checkCompletedTimerFired and checkLoadCompleteTimerFired with
2341         one function, checkTimerFired. Removed the parentCompleted
2342         function. Added the startCheckCompleteTimer and
2343         allAncestorsAreComplete functions. Replaced the
2344         m_checkCompletedTimer and m_checkLoadCompleteTimer data
2345         members with m_checkTimer, m_shouldCallCheckCompleted, and
2346         m_shouldCallCheckLoadComplete.
2347
2348         * manual-tests/go-back-after-alert.html: Added.
2349         * manual-tests/resources/alert-and-go-back.html: Added.
2350
2351 2009-09-23  David Kilzer  <ddkilzer@apple.com>
2352
2353         <http://webkit.org/b/29660> Move "Generate 64-bit Export File" build phase script into DerivedSources.make
2354
2355         Reviewed by Mark Rowe.
2356
2357         The "Generate 64-bit Export File" build phase script generated
2358         the WebCore.LP64.exp export file used to link 64-bit WebCore.
2359         Instead of having a separate build phase script, move its
2360         generation into DerivedSources.make where WebCore.exp is
2361         generated.
2362
2363         * DerivedSources.make: Added a rule to make WebCore.LP64.exp.
2364         Added code to append WebCore.PluginHostProcess.exp to
2365         $(WEBCORE_EXPORT_DEPENDENCIES) when WTF_USE_PLUGIN_HOST_PROCESS
2366         is set to 1.
2367         * WebCore.PluginHostProcess.exp: Renamed from WebCore/WebCore.LP64.exp.
2368         * WebCore.xcodeproj/project.pbxproj: Removed the "Generate
2369         64-bit Export File" build phase script. Renamed WebCore.LP64.exp
2370         to WebCore.PluginHostProcess.exp.
2371
2372 2009-09-23  Peter Kasting  <pkasting@google.com>
2373
2374         Reviewed by Dimitri Glazkov.
2375
2376         https://bugs.webkit.org/show_bug.cgi?id=29694
2377         [Chromium] Eliminate dependency on gfx::Rect from ImageSkia.
2378
2379         * platform/graphics/skia/ImageSkia.cpp:
2380         (WebCore::drawResampledBitmap):
2381
2382 2009-09-22  Timothy Hatcher  <timothy@apple.com>
2383
2384         Prevent scrolling multiple elements during latched wheel events.
2385
2386         Reviewed by Anders Carlsson.
2387
2388         * page/EventHandler.cpp:
2389         (WebCore::scrollAndAcceptEvent):
2390         (WebCore::EventHandler::clear):
2391         (WebCore::EventHandler::handleWheelEvent):
2392         * page/EventHandler.h:
2393         * rendering/RenderBox.cpp:
2394         (WebCore::RenderBox::scroll):
2395         * rendering/RenderBox.h:
2396
2397 2009-09-23  Daniel Bates  <dbates@webkit.org>
2398
2399         Reviewed by Adam Barth.
2400
2401         https://bugs.webkit.org/show_bug.cgi?id=29523
2402         
2403         Fixes an issue where a JavaScript URL that was URL-encoded twice can bypass the
2404         XSSAuditor.
2405         
2406         The method FrameLoader::executeIfJavaScriptURL decodes the URL escape 
2407         sequences in a JavaScript URL before it is eventually passed to the XSSAuditor.
2408         Because the XSSAuditor also decodes the URL escape sequences as part of its
2409         canonicalization, the double decoding of a JavaScript URL would
2410         not match the canonicalization of the input parameters.
2411
2412         Tests: http/tests/security/xssAuditor/iframe-javascript-url-url-encoded.html
2413                http/tests/security/xssAuditor/javascript-link-url-encoded.html
2414
2415         * bindings/js/ScriptController.cpp:
2416         (WebCore::ScriptController::evaluate): Moved call to 
2417         XSSAuditor::canEvaluateJavaScriptURL into FrameLoader::executeIfJavaScriptURL.
2418         * bindings/v8/ScriptController.cpp:
2419         (WebCore::ScriptController::evaluate): Ditto.
2420         * loader/FrameLoader.cpp:
2421         (WebCore::FrameLoader::executeIfJavaScriptURL): Modified to call 
2422         XSSAuditor::canEvaluateJavaScriptURL on the JavaScript URL before it is
2423         decoded.
2424
2425 2009-09-22  Dave Hyatt  <hyatt@apple.com>
2426
2427         Reviewed by John Sullivan.
2428
2429         https://bugs.webkit.org/show_bug.cgi?id=29657
2430         Columns don't break properly in positioned elements with a fixed height.  Make sure that
2431         a block is still considered to have columns even when the column count is 1 if the column
2432         width is non-auto.
2433     
2434         Added fast/multicol/positioned-with-constrained-height.html
2435
2436         * rendering/RenderBlock.cpp:
2437         (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
2438
2439 2009-09-23  Holger Hans Peter Freyther  <zecke@selfish.org>
2440
2441         Rubber-stamped by Simon Hausmann.
2442
2443         Add a null check for the Document*. In the mirror benchmarking
2444         application a crash from a call from JavaScript was observed.
2445
2446         I was not able to come up with a test case for this issue.
2447
2448         * platform/qt/CookieJarQt.cpp:
2449         (WebCore::cookieJar):
2450
2451 2009-09-23  Simon Hausmann  <simon.hausmann@nokia.com>
2452
2453         Reviewed by Tor Arne Vestbø.
2454
2455         Fix the Qt/Windows build, after the introduction of
2456         the page client.
2457
2458         * plugins/win/PluginViewWin.cpp:
2459         (windowHandleForPageClient):
2460         (WebCore::PluginView::getValue):
2461         (WebCore::PluginView::forceRedraw):
2462         (WebCore::PluginView::platformStart):
2463
2464 2009-09-23  Gustavo Noronha Silva  <gns@gnome.org>
2465
2466         Reviewed by Xan Lopez.
2467
2468         [GTK] media tests failing after their rework
2469         https://bugs.webkit.org/show_bug.cgi?id=29532
2470
2471         Correctly advertise the mime types used by the common formats used
2472         in the tests.
2473
2474         Tests that regressed, and will pass again:
2475
2476            media/video-canvas-source.html
2477            media/video-controls.html
2478            media/video-currentTime-set2.html
2479            media/video-dom-autoplay.html
2480            media/video-dom-src.html
2481            media/video-error-abort.html
2482            media/video-load-networkState.html
2483            media/video-load-readyState.html
2484            media/video-muted.html
2485            media/video-no-autoplay.html
2486            media/video-pause-empty-events.html
2487            media/video-play-empty-events.html
2488            media/video-seekable.html
2489            media/video-seeking.html
2490            media/video-size.html
2491            media/video-source-type-params.html
2492            media/video-source-type.html
2493            media/video-source.html
2494            media/video-src-change.html
2495            media/video-src-invalid-remove.html
2496            media/video-src-remove.html
2497            media/video-src-set.html
2498            media/video-src-source.html
2499            media/video-src.html
2500            media/video-timeupdate-during-playback.html
2501            media/video-volume.html
2502
2503         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2504         (WebCore::mimeTypeCache):
2505
2506 2009-09-22  Charles Wei  <charles.wei@torchmobile.com.cn>
2507
2508         Reviewed by Eric Seidel.
2509
2510         Fix the crash problem with absolte positioned children in foreignobject
2511         htts://bugs.webkit.org/show_bug.cgi?id=26342
2512
2513         Test: svg/custom/foreignobject-crash-with-absolute-positioned-children.svg
2514
2515         * rendering/RenderForeignObject.h:
2516         (WebCore::RenderForeignObject::isSVGForeignObject):
2517         * rendering/RenderObject.cpp:
2518         (WebCore::RenderObject::containingBlock):
2519         * rendering/RenderObject.h:
2520         (WebCore::RenderObject::isSVGForeignObject):
2521
2522 2009-09-22  Drew Wilson  <atwilson@google.com>
2523
2524         Reviewed by David Levin.
2525
2526         SharedWorkers "name" attribute is now optional.
2527         https://bugs.webkit.org/show_bug.cgi?id=28897
2528
2529         Test: fast/workers/shared-worker-name.html
2530
2531         * bindings/js/JSSharedWorkerConstructor.cpp:
2532         (WebCore::constructSharedWorker):
2533         Default 'name' attribute to empty string if it is not provided.
2534         * bindings/v8/custom/V8SharedWorkerCustom.cpp:
2535         (WebCore::CALLBACK_FUNC_DECL):
2536         Default 'name' attribute to empty string if it is not provided.
2537         * workers/DefaultSharedWorkerRepository.cpp:
2538         (WebCore::SharedWorkerProxy::matches):
2539         Now matches URLs if names are empty strings.
2540         (WebCore::DefaultSharedWorkerRepository::getProxy):
2541         Pass URL in to SharedWorkerProxy::matches().
2542
2543 2009-09-22  Dimitri Glazkov  <dglazkov@chromium.org>
2544
2545         Unreviewed, another build fix.
2546
2547         [Chromium] Add another missing include.
2548         https://bugs.webkit.org/show_bug.cgi?id=29536
2549
2550         * inspector/InspectorController.cpp: Added DOMWindow.h include.
2551
2552 2009-09-22  Dimitri Glazkov  <dglazkov@chromium.org>
2553
2554         Unreviewed, build fix.
2555
2556         [Chromium] Add missing include.
2557         https://bugs.webkit.org/show_bug.cgi?id=29536
2558
2559         * inspector/InspectorDOMStorageResource.cpp: Added DOMWindow.h include.
2560
2561 2009-09-22  Darin Adler  <darin@apple.com>
2562
2563         Reviewed by Sam Weinig.
2564
2565         Tighten up the ScheduledRedirection machinery to prepare for a bug fix
2566         https://bugs.webkit.org/show_bug.cgi?id=29663
2567
2568         * loader/FrameLoader.cpp:
2569         (WebCore::ScheduledRedirection::ScheduledRedirection): Added a boolean,
2570         initialized to false, to keep track if the redirection has been
2571         communicated to the client.
2572         (WebCore::FrameLoader::stopLoading): Tweaked a comment.
2573         (WebCore::FrameLoader::cancelRedirection): Removed code to clear
2574         m_scheduledRedirection.clear since stopRedirectionTimer does that now.
2575         (WebCore::FrameLoader::allChildrenAreComplete): Added.
2576         (WebCore::FrameLoader::checkCompleted): Use allChildrenAreComplete
2577         function for clarity.
2578         (WebCore::FrameLoader::checkCallImplicitClose): Ditto.
2579         (WebCore::FrameLoader::scheduleRedirection): Changed to take a PassOwnPtr.
2580         (WebCore::FrameLoader::startRedirectionTimer): Added code to set the
2581         toldClient flag and not call clientRedirected a second time if it is set.
2582         (WebCore::FrameLoader::stopRedirectionTimer): Changed so this can be safely
2583         called multiple times and it will call clientRedirectCancelledOrFinished
2584         only once.
2585
2586         * loader/FrameLoader.h: Changed scheduleRedirection to be a PassOwnPtr.
2587         Added allChildrenAreComplete function.
2588
2589 2009-09-22  Yury Semikhatsky  <yurys@chromium.org>
2590
2591         Reviewed by Timothy Hatcher.
2592
2593         WebInspector: Migrate Databases tab to InjectedScript /
2594         serialized interaction.
2595
2596         DOMStorage interaction is now serialized into JSON messages
2597         and doesn't require quarantined objects.
2598         
2599         https://bugs.webkit.org/show_bug.cgi?id=28873
2600
2601         * dom/EventListener.h:
2602         (WebCore::EventListener::):
2603         * inspector/InspectorBackend.cpp:
2604         (WebCore::InspectorBackend::selectDOMStorage):
2605         (WebCore::InspectorBackend::getDOMStorageEntries):
2606         (WebCore::InspectorBackend::setDOMStorageItem):
2607         (WebCore::InspectorBackend::removeDOMStorageItem):
2608         * inspector/InspectorBackend.h:
2609         * inspector/InspectorBackend.idl:
2610         * inspector/InspectorController.cpp:
2611         (WebCore::InspectorController::didCommitLoad):
2612         (WebCore::InspectorController::selectDOMStorage):
2613         (WebCore::InspectorController::getDOMStorageEntries):
2614         (WebCore::InspectorController::setDOMStorageItem):
2615         (WebCore::InspectorController::removeDOMStorageItem):
2616         (WebCore::InspectorController::getDOMStorageResourceForId):
2617         * inspector/InspectorController.h:
2618         * inspector/InspectorDOMStorageResource.cpp:
2619         (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
2620         (WebCore::InspectorDOMStorageResource::bind):
2621         (WebCore::InspectorDOMStorageResource::unbind):
2622         (WebCore::InspectorDOMStorageResource::startReportingChangesToFrontend):
2623         (WebCore::InspectorDOMStorageResource::handleEvent):
2624         (WebCore::InspectorDOMStorageResource::operator==):
2625         * inspector/InspectorDOMStorageResource.h:
2626         (WebCore::InspectorDOMStorageResource::cast):
2627         (WebCore::InspectorDOMStorageResource::id):
2628         (WebCore::InspectorDOMStorageResource::domStorage):
2629         * inspector/InspectorFrontend.cpp:
2630         (WebCore::InspectorFrontend::selectDOMStorage):
2631         (WebCore::InspectorFrontend::didGetDOMStorageEntries):
2632         (WebCore::InspectorFrontend::didSetDOMStorageItem):
2633         (WebCore::InspectorFrontend::didRemoveDOMStorageItem):
2634         (WebCore::InspectorFrontend::updateDOMStorage):
2635         * inspector/InspectorFrontend.h:
2636         * inspector/front-end/DOMStorage.js:
2637         (WebInspector.DOMStorage):
2638         (WebInspector.DOMStorage.prototype.get id):
2639         (WebInspector.DOMStorage.prototype.get domStorage):
2640         (WebInspector.DOMStorage.prototype.get isLocalStorage):
2641         (WebInspector.DOMStorage.prototype.getEntriesAsync):
2642         (WebInspector.DOMStorage.prototype.setItemAsync):
2643         (WebInspector.DOMStorage.prototype.removeItemAsync):
2644         * inspector/front-end/DOMStorageDataGrid.js:
2645         (WebInspector.DOMStorageDataGrid):
2646         (WebInspector.DOMStorageDataGrid.prototype._startEditingColumnOfDataGridNode):
2647         (WebInspector.DOMStorageDataGrid.prototype._startEditing):
2648         (WebInspector.DOMStorageDataGrid.prototype._editingCommitted):
2649         (WebInspector.DOMStorageDataGrid.prototype._editingCancelled):
2650         (WebInspector.DOMStorageDataGrid.prototype.deleteSelectedRow):
2651         * inspector/front-end/DOMStorageItemsView.js:
2652         (WebInspector.DOMStorageItemsView.prototype.update):
2653         (WebInspector.DOMStorageItemsView.prototype._showDOMStorageEntries):
2654         (WebInspector.DOMStorageItemsView.prototype._dataGridForDOMStorageEntries):
2655         * inspector/front-end/StoragePanel.js:
2656         (WebInspector.StoragePanel.prototype.show):
2657         (WebInspector.StoragePanel.prototype.reset):
2658         (WebInspector.StoragePanel.prototype.selectDOMStorage):
2659         (WebInspector.StoragePanel.prototype.updateDOMStorage):
2660         (WebInspector.StoragePanel.prototype._domStorageForId):
2661         * inspector/front-end/inspector.js:
2662         (WebInspector.addDOMStorage):
2663         (WebInspector.updateDOMStorage):
2664
2665 2009-09-22  Sam Weinig  <sam@webkit.org>
2666
2667         Reviewed by Alexey Proskuryakov.
2668
2669         Fix for XMLHttpRequest.abort() should destroy the response text.
2670         https://bugs.webkit.org/show_bug.cgi?id=29658
2671         <rdar://problem/5301430>
2672
2673         Clearing the response text after calling XMLHttpRequest.abort() is necessary
2674         per spec and matches Firefox. It is also a potential memory win.
2675
2676         Test: http/tests/xmlhttprequest/abort-should-destroy-responseText.html
2677
2678         * xml/XMLHttpRequest.cpp:
2679         (WebCore::XMLHttpRequest::abort): Clear the response text making sure to
2680         keep the actual ResourceReponse around so that the response status and response
2681         status text are kept around.
2682
2683 2009-09-22  Dimitri Glazkov  <dglazkov@chromium.org>
2684
2685         No review, rolling out r48639.
2686         http://trac.webkit.org/changeset/48639
2687
2688         * bindings/v8/V8GCController.cpp:
2689         (WebCore::ObjectGrouperVisitor::visitDOMWrapper):
2690
2691 2009-09-22  Dumitru Daniliuc  <dumi@chromium.org>
2692
2693         Reviewed by Dimitri Glazkov.
2694
2695         Changing the transaction coordinator to (re-)allow multiple read
2696         transactions on the same database to run concurrently (without
2697         risking a deadlock this time).
2698
2699         https://bugs.webkit.org/show_bug.cgi?id=29115
2700
2701         Tests: storage/read-and-write-transactions-dont-run-together.html
2702                storage/read-transactions-running-concurrently.html
2703
2704         * storage/SQLTransaction.h:
2705         (WebCore::SQLTransaction::isReadOnly): Returns the type of the
2706         transaction.
2707         * storage/SQLTransactionCoordinator.cpp:
2708         (WebCore::SQLTransactionCoordinator::acquireLock): Changed to
2709         allow multiple read transactions on the same DB to run
2710         concurrently.
2711         (WebCore::SQLTransactionCoordinator::releaseLock): Changed to
2712         allow multiple read transactions on the same DB to run
2713         concurrently.
2714         (WebCore::SQLTransactionCoordinator::shutdown): Renamed the map.
2715         * storage/SQLTransactionCoordinator.h:
2716
2717 2009-09-22  Peter Kasting  <pkasting@google.com>
2718
2719         Reviewed by David Levin.
2720
2721         https://bugs.webkit.org/show_bug.cgi?id=29652
2722         Support true system colors for CSS system colors in Chromium/Win.
2723
2724         * rendering/RenderThemeChromiumWin.cpp:
2725         (WebCore::cssValueIdToSysColorIndex):
2726         (WebCore::RenderThemeChromiumWin::systemColor):
2727         * rendering/RenderThemeChromiumWin.h:
2728
2729 2009-09-22  Beth Dakin  <bdakin@apple.com>
2730
2731         Reviewed by Dave Hyatt.
2732
2733         Fix for <rdar://problem/6925121> SAP: Wrong width calculation in 
2734         table with fixed layout
2735         -and corresponding-
2736         https://bugs.webkit.org/show_bug.cgi?id=29501
2737
2738         New Tests:
2739         * fast/table/fixed-table-with-percent-inside-percent-table.html: Added.
2740         * fast/table/fixed-table-with-percent-width-inside-auto-table.html: Added.
2741         * fast/table/fixed-table-with-percent-width-inside-div.html: Added.
2742         * fast/table/fixed-table-with-percent-width-inside-extra-large-div.html: Added.
2743         * fast/table/fixed-table-with-percent-width-inside-fixed-width-table.html: Added.
2744         * fast/table/fixed-table-with-small-percent-width.html: Added.
2745
2746         This new quirk is very similar to an existing one that was 
2747         implemented in revision 4316.
2748         * rendering/FixedTableLayout.cpp:
2749         (WebCore::FixedTableLayout::calcPrefWidths):
2750
2751 2009-09-22  Brian Weinstein  <bweinstein@apple.com>
2752
2753         Reviewed by Timothy Hatcher.
2754
2755         List HTTP status code with response headers in resources tab of Web Inspector.
2756         http://webkit.org/b/19945
2757
2758         This patch adds a new top level list in the resources tab, HTTP Information, that 
2759         for now, contains the Request Method (GET, POST, etc.) and the Status Code (200, 404, etc.).
2760         Additionally, it adds a colored dot next to the requested URL to show the status 
2761         (green for success, orange for redirect, red for error).
2762
2763         * English.lproj/localizedStrings.js:
2764         * inspector/front-end/ImageView.js:
2765         (WebInspector.ImageView):
2766         * inspector/front-end/Images/errorRedDot.png: Added.
2767         * inspector/front-end/Images/successGreenDot.png: Added.
2768         * inspector/front-end/Images/warningOrangeDot.png: Added.
2769         * inspector/front-end/Resource.js:
2770         (WebInspector.Resource.StatusTextForCode):
2771         * inspector/front-end/ResourceView.js:
2772         (WebInspector.ResourceView):
2773         (WebInspector.ResourceView.prototype._refreshURL):
2774         (WebInspector.ResourceView.prototype._refreshHTTPInformation):
2775         * inspector/front-end/inspector.css:
2776
2777 2009-09-22  Brady Eidson  <beidson@apple.com>
2778
2779         Reviewed by Darin Adler.
2780
2781         Back list isn't properly updated for fragment changes after a redirect.
2782         <rdar://problem/6142803> and https://bugs.webkit.org/show_bug.cgi?id=20355
2783
2784         Test: fast/loader/fragment-after-redirect-gets-back-entry.html
2785
2786         * loader/FrameLoader.cpp:
2787         (WebCore::FrameLoader::loadURL): Properly reset the policy FrameLoadType before
2788           consulting the policy delegate for fragment scrolling.
2789
2790 2009-09-22  Darin Fisher  <darin@chromium.org>
2791
2792         Reviewed by Dimitri Glazkov.
2793
2794         Drop down selects get stuck in the non-visible state and cannot be opened.
2795         https://bugs.webkit.org/show_bug.cgi?id=29645
2796
2797         All paths that lead to hiding the popup menu must call popupDidHide on
2798         the PopupMenuClient.  This change makes it so by moving all of the
2799         hiding logic to PopupListBox::hidePopup.
2800
2801         * platform/chromium/PopupMenuChromium.cpp:
2802         (WebCore::PopupContainer::hidePopup):
2803         (WebCore::PopupListBox::hidePopup):
2804         * platform/chromium/PopupMenuChromium.h:
2805
2806 2009-09-22  Patrick Mueller  <Patrick_Mueller@us.ibm.com>
2807
2808         Reviewed by Timothy Hatcher.
2809
2810         WebInspector.log() function not protected if console not yet created
2811         https://bugs.webkit.org/show_bug.cgi?id=29336
2812         
2813         No new tests.  Only affects Web Inspector developers adding logging
2814         to their code during development.
2815
2816         * inspector/front-end/inspector.js:
2817         (WebInspector.log.isLogAvailable):
2818         (WebInspector.log.flushQueue):
2819         (WebInspector.log.flushQueueIfAvailable):
2820         (WebInspector.log.logMessage):
2821         (WebInspector.log):
2822
2823 2009-09-22  Yaar Schnitman  <yaar@chromium.org>
2824
2825         Reviewed by David Levin.
2826
2827         Ported chromium.org's webcore.gyp for the webkit chromium port.
2828
2829         https://bugs.webkit.org/show_bug.cgi?id=29617
2830
2831         * WebCore.gyp/WebCore.gyp: Added.
2832
2833 2009-09-22  Christian Plesner Hansen  <christian.plesner.hansen@gmail.com>
2834
2835         Reviewed by Adam Barth.
2836
2837         [v8] Don't keep clean wrappers artificially alive        
2838         We currently keep all DOM node wrappers alive, even when there are
2839         no more references to them from JS, in case they have properties
2840         that we need to keep around if new JS references are created.
2841         This changes the policy to only keep wrappers artificially alive
2842         if they have changed since they were created. Empty wrappers are
2843         discarded and recreated as needed.
2844         https://bugs.webkit.org/show_bug.cgi?id=29330
2845
2846         * bindings/v8/V8GCController.cpp:
2847         (WebCore::ObjectGrouperVisitor::visitDOMWrapper):
2848
2849 2009-09-22  Pavel Feldman  <pfeldman@chromium.org>
2850
2851         Reviewed by Timothy Hatcher.
2852
2853         Web Inspector: console.count and console.timeEnd
2854         crash when inspector is opened.
2855
2856         https://bugs.webkit.org/show_bug.cgi?id=29632
2857
2858         * inspector/InspectorFrontend.cpp:
2859         (WebCore::InspectorFrontend::addMessageToConsole):
2860
2861 2009-09-22  Adam Barth  <abarth@webkit.org>
2862
2863         Unreviewed.
2864
2865         Fix bogus build fix I did last night.
2866
2867         * bindings/v8/custom/V8DOMWindowCustom.cpp:
2868         (WebCore::V8Custom::WindowSetTimeoutImpl):
2869
2870 2009-09-22  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2871
2872         Reviewed by Simon Hausmann.
2873
2874         NPAPI/Mac: Don't paint plugins if we don't have a CGContextRef
2875
2876         * plugins/mac/PluginViewMac.cpp:
2877
2878 2009-09-22  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
2879
2880         Reivewed by Simon Hausmann.
2881
2882         Fix the Qt/Mac build after r48604 (Implement new QWebPageClient class)
2883
2884         There's no QWidget::x11Info() on Mac, and setPlatformPluginWidget()
2885         takes a QWidget*, not a QWebPageClient*
2886
2887         * plugins/mac/PluginViewMac.cpp:
2888         (WebCore::PluginView::platformStart):
2889
2890 2009-09-21  Adam Barth  <abarth@webkit.org>
2891
2892         Attempted fix for the V8 build.
2893
2894         * bindings/v8/custom/V8DOMWindowCustom.cpp:
2895         (WebCore::V8Custom::WindowSetTimeoutImpl):
2896
2897 2009-09-21  Adam Barth  <abarth@webkit.org>
2898
2899         Reviewed by Sam Weinig.
2900
2901         Don't re-enter JavaScript after performing access checks
2902         https://bugs.webkit.org/show_bug.cgi?id=29531
2903
2904         Moved the access check slightly later in this functions to avoid
2905         re-entering the JavaScript interpreter (typically via toString)
2906         after performing the access check.
2907
2908         I can't really think of a meaningful test for this change.  It's more
2909         security hygiene.
2910
2911         * bindings/js/JSDOMWindowCustom.cpp:
2912         (WebCore::JSDOMWindow::setLocation):
2913         (WebCore::JSDOMWindow::open):
2914         (WebCore::JSDOMWindow::showModalDialog):
2915         * bindings/js/JSLocationCustom.cpp:
2916         (WebCore::JSLocation::setHref):
2917         (WebCore::JSLocation::replace):
2918         (WebCore::JSLocation::assign):
2919         * bindings/v8/custom/V8DOMWindowCustom.cpp:
2920         (WebCore::V8Custom::WindowSetTimeoutImpl):
2921         (WebCore::if):
2922         (CALLBACK_FUNC_DECL):
2923         (V8Custom::WindowSetLocation):
2924         (V8Custom::ClearTimeoutImpl):
2925         * bindings/v8/custom/V8LocationCustom.cpp:
2926         (WebCore::ACCESSOR_SETTER):
2927         (WebCore::CALLBACK_FUNC_DECL):
2928
2929 2009-09-21  Dumitru Daniliuc  <dumi@chromium.org>
2930
2931         Reviewed by Eric Seidel.
2932
2933         Make all write transaction start with a BEGIN IMMEDIATE command
2934         instead of BEGIN.
2935
2936         We cannot test this change in a layout test, because in order to
2937         test it we need to spawn two database threads and execute
2938         transaction steps on these two threads in a very specific order,
2939         which seems impossible to do when they share the same main thread
2940         (as they would in a layout test). The SQLite docs and the case
2941         described in the bug though should be enough proof that we do have
2942         a problem here and that this patch will fix it.
2943
2944         Relevant SQLite documentation:
2945         http://www.sqlite.org/lang_transaction.html
2946         http://www.sqlite.org/lockingv3.html#locking
2947
2948         https://bugs.webkit.org/show_bug.cgi?id=29218
2949
2950         * platform/sql/SQLiteTransaction.cpp:
2951         (WebCore::SQLiteTransaction::SQLiteTransaction): Added a readOnly
2952         parameter.
2953         (WebCore::SQLiteTransaction::begin): Changed to BEGIN IMMEDIATE
2954         for write transactions.
2955         * platform/sql/SQLiteTransaction.h:
2956         * storage/SQLTransaction.cpp:
2957         (WebCore::SQLTransaction::openTransactionAndPreflight): Passing
2958         the read-only flag to the SQLiteTransaction instance.
2959
2960 2009-09-21  Brady Eidson  <beidson@apple.com>
2961
2962         Rubberstamped by Mark Rowe.
2963
2964         * DerivedSources.make: Fix the Xcode build on SnowLeopard.
2965
2966 2009-09-15  John Abd-El-Malek  <jam@chromium.org>
2967
2968         Reviewed by Darin Fisher.
2969
2970         Prevent sleeps in unload handlers.
2971         https://bugs.webkit.org/show_bug.cgi?id=29193
2972
2973         Test: fast/dom/Window/slow_unload_handler.html
2974
2975         * WebCore.gypi:
2976         * bindings/v8/DateExtension.cpp: Added.
2977         (WebCore::DateExtension::DateExtension):
2978         (WebCore::DateExtension::get):
2979         (WebCore::DateExtension::setAllowSleep):
2980         (WebCore::DateExtension::GetNativeFunction):
2981         (WebCore::DateExtension::weakCallback):
2982         (WebCore::DateExtension::GiveEnableSleepDetectionFunction):
2983         (WebCore::DateExtension::OnSleepDetected):
2984         * bindings/v8/DateExtension.h: Added.
2985         * bindings/v8/V8AbstractEventListener.cpp:
2986         (WebCore::V8AbstractEventListener::invokeEventHandler):
2987         * bindings/v8/V8Proxy.cpp:
2988         (WebCore::V8Proxy::createNewContext):
2989         (WebCore::V8Proxy::registerExtensionWithV8):
2990         (WebCore::V8Proxy::registeredExtensionWithV8):
2991         * bindings/v8/V8Proxy.h:
2992
2993 2009-09-21  Jian Li  <jianli@chromium.org>
2994
2995         Reviewed by David Levin.
2996
2997         [V8] Run-time exception in onmessage handler is not forwarded to the
2998         worker object.
2999         https://bugs.webkit.org/show_bug.cgi?id=28980
3000
3001         The previous fix was partially reverted due to a reliability build break
3002         in chromium. The break happens when an exception is thrown without
3003         setting a message. We need to check for this scenario and handle it.
3004
3005         Tested by worker-close.html.
3006
3007         * bindings/v8/V8AbstractEventListener.cpp:
3008         (WebCore::V8AbstractEventListener::invokeEventHandler):
3009         * bindings/v8/V8Utilities.cpp:
3010         (WebCore::reportException):
3011
3012 2009-09-21  Greg Bolsinga  <bolsinga@apple.com>
3013
3014         Reviewed by Simon Fraser & Sam Weinig.
3015
3016         Add ENABLE(ORIENTATION_EVENTS)
3017         https://bugs.webkit.org/show_bug.cgi?id=29508
3018         
3019         See documentation here:
3020         http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW16
3021
3022         * DerivedSources.make: Use new WebCore.OrientationEvents.exp file if ENABLE_ORIENTATION_EVENTS.
3023         Add ENABLE_ORIENTATION_EVENTS to the new ADDITIONAL_IDL_DEFINES variable that is passed to the IDL
3024         code generator. This is because ENABLE_ORIENTATION_EVENTS is not in FEATURE_DEFINES.
3025         * WebCore.OrientationEvents.exp: Added.
3026         * WebCore.xcodeproj/project.pbxproj: Add WebCore.OrientationEvents.exp.
3027         * dom/EventNames.h: Add onorientationchange.
3028         * html/HTMLAttributeNames.in: Ditto.
3029         * html/HTMLBodyElement.cpp: Handle onorientationchange properly.
3030         (WebCore::HTMLBodyElement::parseMappedAttribute):
3031         (WebCore::HTMLBodyElement::onorientationchange):
3032         (WebCore::HTMLBodyElement::setOnorientationchange):
3033         * html/HTMLBodyElement.h: Ditto.
3034         * html/HTMLBodyElement.idl: Ditto.
3035         * html/HTMLFrameSetElement.cpp: Ditto.
3036         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
3037         (WebCore::HTMLFrameSetElement::onorientationchange):
3038         (WebCore::HTMLFrameSetElement::setOnorientationchange):
3039         * html/HTMLFrameSetElement.h: Ditto.
3040         * html/HTMLFrameSetElement.idl: Ditto.
3041         * page/DOMWindow.cpp: Ditto.
3042         (WebCore::DOMWindow::orientation): Calls up the to the Frame for the orientation value.
3043         (WebCore::DOMWindow::onorientationchange):
3044         (WebCore::DOMWindow::setOnorientationchange):
3045         * page/DOMWindow.h: Handle onorientationchange properly.
3046         * page/DOMWindow.idl: Ditto.
3047         * page/Frame.cpp: Ditto.
3048         (WebCore::Frame::Frame):
3049         (WebCore::Frame::sendOrientationChangeEvent):
3050         * page/Frame.h: Ditto.
3051         (WebCore::Frame::orientation):
3052
3053 2009-09-18  Anders Carlsson  <andersca@apple.com>
3054
3055         Try fixing the build again.
3056         
3057         * platform/win/PopupMenuWin.cpp:
3058         (WebCore::PopupMenu::wndProc):
3059
3060 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3061
3062         Reviewed by Timothy Hatcher.
3063
3064         Web Inspector: completions are always evaluated against
3065         window (discarding call frames).
3066
3067         https://bugs.webkit.org/show_bug.cgi?id=29616
3068
3069         * inspector/front-end/ConsoleView.js:
3070         (WebInspector.ConsoleView.prototype.completions):
3071         * inspector/front-end/InjectedScript.js:
3072         (InjectedScript.getCompletions):
3073         * inspector/front-end/ScriptsPanel.js:
3074         (WebInspector.ScriptsPanel.prototype.selectedCallFrameId):
3075
3076 2009-09-21  Brent Fulgham  <bfulgham@webkit.org>
3077
3078         Unreviewed build fix for Windows (Cairo) target.
3079
3080         Add stubs for SocketStream classes added in @r47788, which
3081         broke the WinCairo build.
3082
3083         No new tests. (Build failure).
3084
3085         * WebCore.vcproj/WebCore.vcproj:  Add references to new files
3086           to Cairo build, exclude from standard Apple build.
3087         * platform/network/curl/SocketStreamError.h: Added.
3088         * platform/network/curl/SocketStreamHandle.h: Added.
3089         * platform/network/curl/SocketStreamHandleCurl.cpp: Added.
3090
3091 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3092
3093         Reviewed by Timothy Hatcher.
3094
3095         Web Inspector: Expose InspectorResource fields.
3096
3097         https://bugs.webkit.org/show_bug.cgi?id=29537
3098
3099         * inspector/InspectorResource.cpp:
3100         (WebCore::InspectorResource::sourceString):
3101         (WebCore::InspectorResource::resourceData):
3102         * inspector/InspectorResource.h:
3103         (WebCore::InspectorResource::requestHeaderFields):
3104         (WebCore::InspectorResource::responseHeaderFields):
3105         (WebCore::InspectorResource::responseStatusCode):
3106         (WebCore::InspectorResource::requestMethod):
3107         (WebCore::InspectorResource::requestFormData):
3108
3109 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3110
3111         Reviewed by Timothy Hatcher.
3112
3113         Web Inspector: JS error drilling down childless node.
3114         No need to dispatch double click twice - it is already handled
3115         in TreeElement.treeElementDoubleClicked.
3116
3117         https://bugs.webkit.org/show_bug.cgi?id=22144
3118
3119         * inspector/front-end/ElementsTreeOutline.js:
3120         (WebInspector.ElementsTreeOutline):
3121
3122 2009-09-21  Kenneth Rohde Christiansen  <kenneth@webkit.org>
3123
3124         Reviewed by Simon Hausmann.
3125
3126         Implement new QWebPageClient class and let our classes
3127         QWebViewPrivate and QWebGraphicsItemPrivate inherit from it.
3128
3129         For Qt, platformPageClient() will now return a class derived from
3130         the QWebPageClient, so the patch adapts our Qt hooks to go though
3131         this class and not depend on the QWebView.
3132
3133         * WebCore.pro:
3134         * platform/Widget.h:
3135         * platform/qt/PlatformScreenQt.cpp:
3136         (WebCore::screenDepth):
3137         (WebCore::screenDepthPerComponent):
3138         (WebCore::screenIsMonochrome):
3139         (WebCore::screenRect):
3140         (WebCore::screenAvailableRect):
3141         * platform/qt/PopupMenuQt.cpp:
3142         (WebCore::PopupMenu::show):
3143         * platform/qt/QWebPageClient.h: Added.
3144         * platform/qt/WidgetQt.cpp:
3145         (WebCore::Widget::setCursor):
3146         * plugins/qt/PluginViewQt.cpp:
3147         (WebCore::PluginView::handleKeyboardEvent):
3148         (WebCore::PluginView::getValue):
3149         (WebCore::PluginView::platformStart):
3150
3151 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3152
3153         Reviewed by Timothy Hatcher.
3154
3155         Web Inspector: Evaluating on call frame always returns "undefined".
3156
3157         https://bugs.webkit.org/show_bug.cgi?id=29613
3158
3159         * inspector/front-end/InjectedScript.js:
3160         (InjectedScript.evaluate):
3161         (InjectedScript._evaluateAndWrap):
3162         (InjectedScript._evaluateOn):
3163         (InjectedScript.evaluateInCallFrame):
3164
3165 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3166
3167         Reviewed by Timothy Hatcher.
3168
3169         Web Inspector: Exception formatting is broken in console.
3170
3171         https://bugs.webkit.org/show_bug.cgi?id=29608
3172
3173         * inspector/front-end/ConsoleView.js:
3174         (WebInspector.ConsoleCommandResult):
3175         * inspector/front-end/InjectedScript.js:
3176         (InjectedScript.evaluate):
3177         (InjectedScript.createProxyObject):
3178
3179 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3180
3181         Reviewed by Timothy Hatcher.
3182
3183         Web Inspector: Console object formatting is broken.
3184
3185         https://bugs.webkit.org/show_bug.cgi?id=29607
3186
3187         * inspector/front-end/ConsoleView.js:
3188         (WebInspector.ConsoleMessage.prototype._format):
3189         * inspector/front-end/ObjectProxy.js:
3190         (WebInspector.ObjectProxy.wrapPrimitiveValue):
3191
3192 2009-09-21  Pavel Feldman  <pfeldman@chromium.org>
3193
3194         Reviewed by Timothy Hatcher.
3195
3196         Web Inspector: Crash When Logging an Element Before Opening Inspector
3197
3198         https://bugs.webkit.org/show_bug.cgi?id=29514
3199
3200         * inspector/InspectorController.cpp:
3201         (WebCore::InspectorController::populateScriptObjects):
3202
3203 2009-09-21  Simon Fraser  <simon.fraser@apple.com>
3204
3205         Reviewed by Dan Bernstein.
3206
3207         Incorrect clipping with accelerated compositing content, and position:fixed
3208         https://bugs.webkit.org/show_bug.cgi?id=29347
3209         
3210         Fix the compositing clipping logic to behave correctly when position:fixed
3211         elements clip, by using the new backgroundClipRect() method to determine
3212         when we need to clip, and to compute the clipping layer position.
3213
3214         Test: compositing/overflow/fixed-position-ancestor-clip.html
3215
3216         * rendering/RenderLayerBacking.cpp:
3217         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3218         * rendering/RenderLayerCompositor.cpp:
3219         (WebCore::RenderLayerCompositor::clippedByAncestor):
3220
3221 2009-09-21  Nate Chapin  <japhet@chromium.org>
3222
3223         Reviewed by Adam Barth.
3224
3225         Add back in a special case for window.top in the V8 bindings.
3226
3227         https://bugs.webkit.org/show_bug.cgi?id=29605
3228
3229         Fixes LayoutTests/fast/dom/Window/window-property-shadowing.html in the Chromium port.
3230
3231         * bindings/scripts/CodeGeneratorV8.pm: Ensure window.top is not marked as read only, as this breaks the shadowing disabling.
3232
3233 2009-09-21  Eric Carlson  <eric.carlson@apple.com>
3234
3235         Reviewed by Brady Eidson.
3236
3237         HTMLMediaElement: media file should not reload when page comes out of page cache
3238         https://bugs.webkit.org/show_bug.cgi?id=29604
3239
3240         Test: media/restore-from-page-cache.html
3241
3242         * html/HTMLMediaElement.cpp:
3243         (WebCore::HTMLMediaElement::userCancelledLoad): Do nothing unless the element
3244         is still loading. Only fire an 'emptied' event if the readyState is HAVE_NOTHING,
3245         otherwise set the network state to NETWORK_IDLE.
3246
3247 2009-09-21  Sam Weinig  <sam@webkit.org>
3248
3249         Reviewed by Geoffrey "Sean/Shawn/Shaun" Garen.
3250
3251         Clarify two FIXMEs.
3252
3253         * bindings/js/JSHTMLCollectionCustom.cpp:
3254         (WebCore::getNamedItems):
3255         * bindings/js/JSHTMLFormElementCustom.cpp:
3256         (WebCore::JSHTMLFormElement::nameGetter):
3257
3258 2009-09-21  Darin Fisher  <darin@chromium.org>
3259
3260         Reviewed by Dimitri Glazkov.
3261
3262         Drop down selects fail to close when a value is selected
3263         https://bugs.webkit.org/show_bug.cgi?id=29582
3264
3265         Implement PopupListBox::hidePopup, which was previously
3266         declared but unimplemented.  Removes the declaration of
3267         showPopup since that method is not implemented.
3268
3269         PopupListBox::hidePopup takes care of hiding the popup,
3270         by invoking hidePopup on its parent PopupContainer, and
3271         then informs the PopupMenuClient that popupDidHide.
3272         This mimics the old behavior prior to r48370.
3273
3274         * platform/chromium/PopupMenuChromium.cpp:
3275         (WebCore::PopupListBox::handleKeyEvent):
3276         (WebCore::PopupListBox::abandon):
3277         (WebCore::PopupListBox::acceptIndex):
3278         (WebCore::PopupListBox::hidePopup):
3279
3280 2009-09-21  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>
3281
3282         Rubber-stamped by Simon Hausmann.
3283
3284         [Qt] Windows build fix.
3285         https://bugs.webkit.org/show_bug.cgi?id=29535
3286
3287         * platform/network/qt/DnsPrefetchHelper.cpp: Missing #include "config.h"  added.
3288
3289 2009-09-21  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3290
3291         Unreviewed make dist build fix. Missing files.
3292
3293         * GNUmakefile.am:
3294
3295 2009-09-20  Adam Barth  <abarth@webkit.org>
3296
3297         Reviewed by Maciej Stachowiak.
3298
3299         Crash when clicking link in unload handler
3300         https://bugs.webkit.org/show_bug.cgi?id=29525
3301
3302         Test that the first navigation always wins when the page tries to start
3303         a new navigation in an unload handler.
3304
3305         Tests: fast/loader/unload-form-about-blank.html
3306                fast/loader/unload-form-post-about-blank.html
3307                fast/loader/unload-form-post.html
3308                fast/loader/unload-form.html
3309                fast/loader/unload-hyperlink.html
3310                fast/loader/unload-javascript-url.html
3311                fast/loader/unload-reload.html
3312                fast/loader/unload-window-location.html
3313
3314         * loader/FrameLoader.cpp:
3315         (WebCore::FrameLoader::loadURL):
3316         (WebCore::FrameLoader::loadWithDocumentLoader):
3317
3318 2009-09-18  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3319
3320         Reviewed by Xan Lopez.
3321
3322         [GTK] Sometimes crashes when a page is destroyed/loads another URL while playing video
3323         https://bugs.webkit.org/show_bug.cgi?id=29496
3324
3325         Protect the video sink object, and destroy it in an idle callback
3326         to hopefully avoid a race condition that leads to a crash.
3327
3328         This is already tested by media/video-seekable.html
3329
3330         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3331         (WebCore::idleUnref):
3332         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
3333         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
3334
3335 2009-09-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3336
3337         Unreviewed build fix for GTK+ and a blind one for Qt after r48566.
3338
3339         * GNUmakefile.am:
3340         * WebCore.pro:
3341
3342 2009-09-19  Sam Weinig  <sam@webkit.org>
3343
3344         Reviewed by Oliver Hunt.
3345
3346         Fix for https://bugs.webkit.org/show_bug.cgi?id=29519
3347         Remove JSNameNodeCollection and just use StaticNodeList
3348
3349         * WebCore.vcproj/WebCore.vcproj:
3350         * WebCore.xcodeproj/project.pbxproj:
3351         * WebCoreSources.bkl:
3352         * bindings/js/JSHTMLCollectionCustom.cpp:
3353         (WebCore::getNamedItems):
3354         * bindings/js/JSHTMLFormElementCustom.cpp:
3355         (WebCore::JSHTMLFormElement::nameGetter):
3356         * bindings/js/JSNamedNodesCollection.cpp: Removed.
3357         * bindings/js/JSNamedNodesCollection.h: Removed.
3358
3359 2009-09-19  Daniel Bates  <dbates@webkit.org>
3360
3361         Reviewed by Adam Barth.
3362
3363         https://bugs.webkit.org/show_bug.cgi?id=29511
3364         
3365         Fixes an issue where script code that contains non-ASCII characters may bypass the 
3366         XSSAuditor.
3367         
3368         Before performing a comparison between the script source code and input parameters, we
3369         remove all non-ASCII characters, including non-printable ASCII characters from the
3370         script source code and input parameters.
3371
3372         Tests: http/tests/security/xssAuditor/img-onerror-non-ASCII-char.html
3373                http/tests/security/xssAuditor/img-onerror-non-ASCII-char-default-encoding.html
3374                http/tests/security/xssAuditor/img-onerror-non-ASCII-char2-default-encoding.html
3375                http/tests/security/xssAuditor/img-onerror-non-ASCII-char2.html
3376
3377         * page/XSSAuditor.cpp:
3378         (WebCore::isNonCanonicalCharacter): Modified to remove all non-ASCII characters,
3379         including non-printable ASCII characters.
3380
3381 2009-09-19  Simon Fraser  <simon.fraser@apple.com>
3382
3383         Reviewed by Dan Bernstein.
3384
3385         Incorrect animation with scale(0) transform (singular matrix)
3386         https://bugs.webkit.org/show_bug.cgi?id=29465
3387         
3388         Make accelerated scale() and translate() animations go through the component animation
3389         path (rather than just matrix animation) to avoid problems with singular scale matrices,
3390         and be slightly more efficient.
3391
3392         Test: compositing/transitions/singular-scale-transition.html
3393
3394         * platform/graphics/mac/GraphicsLayerCA.mm:
3395         (WebCore::getTransformFunctionValue):
3396         (WebCore::getValueFunctionNameForTransformOperation):
3397
3398 2009-09-19  Alex Milowski  <alex@milowski.com>
3399
3400         Reviewed by Maciej Stachowiak.
3401
3402         Adds CSS styling and basic DOM element support for MathML
3403
3404         * DerivedSources.make:
3405           Added user stylesheet and tag factory generation
3406
3407         * WebCore.xcodeproj/project.pbxproj:
3408           Added new DOM element code
3409
3410         * css/CSSParser.cpp:
3411         (WebCore::CSSParser::parseAttr):
3412           Added check for document since stylesheet can be added before there is a document
3413
3414         * css/CSSStyleSelector.cpp:
3415         (WebCore::CSSStyleSelector::styleForElement):
3416           Added check to add MathML user agent stylesheet
3417
3418         * css/mathml.css: Added.
3419           MathML user agent stylesheet
3420
3421         * dom/Document.cpp:
3422         (WebCore::Document::createElement):
3423           Added support for creation of MathML DOM objects
3424
3425         * dom/Node.h:
3426         (WebCore::Node::isMathMLElement):
3427           Added check method for whether the node is a MathML node
3428
3429         * mathml: Added.
3430         * mathml/MathMLElement.cpp: Added.
3431         (WebCore::MathMLElement::MathMLElement):
3432         (WebCore::MathMLElement::create):
3433         (WebCore::MathMLElement::createRenderer):
3434         * mathml/MathMLElement.h: Added.
3435         (WebCore::MathMLElement::isMathMLElement):
3436           MathML DOM base class
3437
3438
3439         * mathml/MathMLInlineContainerElement.cpp: Added.
3440         (WebCore::MathMLInlineContainerElement::MathMLInlineContainerElement):
3441         (WebCore::MathMLInlineContainerElement::create):
3442         (WebCore::MathMLInlineContainerElement::createRenderer):
3443         * mathml/MathMLInlineContainerElement.h: Added.
3444           Base class for non-text containers
3445
3446         * mathml/MathMLMathElement.cpp: Added.
3447         (WebCore::MathMLMathElement::MathMLMathElement):
3448         (WebCore::MathMLMathElement::create):
3449         * mathml/MathMLMathElement.h: Added.
3450           Root Math element
3451
3452         * mathml/mathtags.in: Added.
3453           Element list mappings
3454
3455         * page/Frame.cpp:
3456         (WebCore::Frame::Frame):
3457           Added MathML name initialization
3458 2009-09-19  Adam Barth  <abarth@webkit.org>
3459
3460         Reviewed by Oliver Hunt.
3461
3462         Canvas drawn with data URL image raises SECURITY_ERR when toDataUrl() called.
3463         https://bugs.webkit.org/show_bug.cgi?id=29305
3464
3465         We need to special-case data URLs when tainting a canvas because we
3466         treat data URLs has having no security origin, unlike other
3467         browsers.  The reason we do this is to help sites avoid XSS via data
3468         URLs, but that consideration doesn't apply to canvas taint.
3469
3470         Also, we were previously incorrectly taking document.domain state
3471         into account when tainting canvas.
3472
3473         Tests: http/tests/security/canvas-remote-read-data-url-image.html
3474                http/tests/security/canvas-remote-read-data-url-svg-image.html
3475                http/tests/security/canvas-remote-read-remote-image-document-domain.html
3476
3477         * html/canvas/CanvasRenderingContext2D.cpp:
3478         (WebCore::CanvasRenderingContext2D::checkOrigin):
3479         (WebCore::CanvasRenderingContext2D::createPattern):
3480         * page/SecurityOrigin.cpp:
3481         (WebCore::SecurityOrigin::taintsCanvas):
3482         * page/SecurityOrigin.h:
3483
3484 2009-09-18  Simon Fraser  <simon.fraser@apple.com>
3485
3486         Fix stylistic issue raised in code review for previous commit.
3487
3488         * rendering/RenderLayerBacking.cpp:
3489         (WebCore::hasNonZeroTransformOrigin):
3490
3491 2009-09-18  Simon Fraser  <simon.fraser@apple.com>
3492
3493         Reviewed by Dan Bernstein.
3494
3495         Element is misplaced during opacity transition with certain configuration of transform-origin and clipping
3496         https://bugs.webkit.org/show_bug.cgi?id=29495
3497         
3498         If an element has zero size, but has a transform origin with absolute values,
3499         then the transform origin would not be applied because it is implemented via
3500         anchorPoint, which is expressed as a fraction of the layer size.
3501         
3502         Work around this by artificially inflating the size of the backing store when we need to.
3503
3504         Test: compositing/geometry/transfrom-origin-on-zero-size-layer.html
3505
3506         * rendering/RenderLayerBacking.h:
3507         * rendering/RenderLayerBacking.cpp:
3508         (WebCore::RenderLayerBacking::RenderLayerBacking):
3509         Init m_artificiallyInflatedBounds to false.
3510         
3511         (WebCore::hasNonZeroTransformOrigin):
3512         Utility function that describes whether the transform-origin contains non-percentage
3513         x or y offsets.
3514         
3515         (WebCore::RenderLayerBacking::updateCompositedBounds):
3516         New wrapper method around setCompositedBounds() that applies the size inflation
3517         when necessary, setting the m_artificiallyInflatedBounds as appropriate.
3518         
3519         (WebCore::RenderLayerBacking::updateAfterLayout): Call updateCompositedBounds().
3520         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Ditto
3521         
3522         * rendering/RenderLayerCompositor.cpp:
3523         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Ditto
3524         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Ditto
3525
3526 2009-09-18  Antti Koivisto  <antti@apple.com>
3527
3528         Reviewed by Maciej Stachowiak.
3529
3530         https://bugs.webkit.org/show_bug.cgi?id=29512
3531         Don't recalculate style when restoring from the page cache
3532
3533         FrameLoaderClient::forceLayout() also forces style recalc. Instead call FrameView::forceLayout() 
3534         directly to update the scrollbars while keeping the existing style.
3535         
3536         Makes back/forward really fast on complex pages (in cases where page cache works).
3537
3538         * loader/FrameLoader.cpp:
3539         (WebCore::FrameLoader::commitProvisionalLoad):
3540
3541 2009-09-18  Oliver Hunt  <oliver@apple.com>
3542
3543         Reviewed by Geoff Garen.
3544
3545         Implement ES5 Object.defineProperty function
3546         https://bugs.webkit.org/show_bug.cgi?id=29503
3547
3548         Override defineOwnProperty on JSDOMWindowShell to forward appropriately,
3549         and then override defineOwnProperty on JSDOMWindow to disallow cross origin
3550         defineOwnProperty usage.  We also override defineOwnProperty on QuarantinedObjectWrapper
3551         to ensure correct wrapping semantics of quarantined objects.
3552
3553         One major caveat in this patch is that it currently disallows the use
3554         of Object.defineProperty on DOMObjects other than the window due to
3555         the significant work involved in correctly propagating attributes and
3556         ensuring correct semantics on dom objects.
3557
3558         Tests: fast/js/Object-defineProperty.html
3559                http/tests/security/xss-DENIED-defineProperty.html
3560
3561         * bindings/js/JSDOMBinding.cpp:
3562         (WebCore::DOMObject::defineOwnProperty):
3563         * bindings/js/JSDOMBinding.h:
3564         * bindings/js/JSDOMWindowCustom.cpp:
3565         (WebCore::JSDOMWindow::defineGetter):
3566         (WebCore::JSDOMWindow::defineSetter):
3567         (WebCore::JSDOMWindow::defineOwnProperty):
3568         * bindings/js/JSDOMWindowShell.cpp:
3569         (WebCore::JSDOMWindowShell::defineOwnProperty):
3570         (WebCore::JSDOMWindowShell::defineGetter):
3571         (WebCore::JSDOMWindowShell::defineSetter):
3572         * bindings/js/JSDOMWindowShell.h:
3573         * bindings/js/JSLocationCustom.cpp:
3574         (WebCore::JSLocation::defineGetter):
3575         (WebCore::JSLocationPrototype::defineGetter):
3576         * bindings/js/JSQuarantinedObjectWrapper.cpp:
3577         (WebCore::JSQuarantinedObjectWrapper::getOwnPropertyDescriptor):
3578         (WebCore::JSQuarantinedObjectWrapper::defineOwnProperty):
3579         * bindings/js/JSQuarantinedObjectWrapper.h:
3580         * bindings/scripts/CodeGeneratorJS.pm:
3581
3582 2009-09-18  Alexey Proskuryakov  <ap@apple.com>
3583
3584         Reviewed by Darin Adler.
3585
3586         https://bugs.webkit.org/show_bug.cgi?id=29510
3587         Active DOM objects should be suspended while a modal dialog is displayed