2008-05-21 Alp Toker <alp@nuanti.com>
[WebKit.git] / WebCore / ChangeLog
1 2008-05-21  Alp Toker  <alp@nuanti.com>
2
3         Rubber-stamped by Maciej.
4
5         Replace non-standard #pragma marks with comments to avoid compiler
6         warnings.
7
8         * page/InspectorController.cpp:
9
10 === End merge of squirrelfish ===
11
12 2008-05-21  Geoffrey Garen  <ggaren@apple.com>
13
14         Reviewed by Tim Hatcher.
15
16         Merged with trunk WebCore's new debugger.
17
18         * page/InspectorController.cpp:
19         (WebCore::currentCallFrame): Updated to use the DebuggerCallFrame API.
20         (WebCore::InspectorController::pauseInDebugger): Updated for name change
21         explained below.
22         (WebCore::InspectorController::resumeDebugger): ditto
23         (WebCore::InspectorController::didParseSource): Fixed a bug that would
24         produce garbled text in some cases: Don't treat JS source as null-
25         terminated UTF8; it's UTF16.
26
27         * page/JavaScriptCallFrame.cpp:
28         * page/JavaScriptCallFrame.h: Changed this class to do all of its processing
29         through a JavaScriptCore DebuggerCallFrame. We have to copy the DebuggerCallFrame
30         because it's a temporary.
31         (WebCore::JavaScriptCallFrame::update): Added an API for updating a call
32         frame during execution: this is how we handle "with" and "eval".
33
34         * page/JavaScriptDebugServer.cpp: Separated "m_paused" from
35         "m_doneProcessingDebuggerEvents", because they have different semantics:
36         "m_paused" is the flag the debug server uses to indicate that new debugger
37         callbacks should be ignored, because they come from the debugger's own
38         JS code; "m_doneProcessingDebuggerEvents" is the flag the debugger UI
39         uses to indicate that it's done processing events, and would like execution
40         to continue. When these flags were one, the debugger would erroneously
41         process callbacks that ocurred while unwinding from its own JS code.
42
43         (WebCore::toPage): Removed some unnecessary NULL checking. Added some
44         missing NULL checking.
45         
46         (WebCore::JavaScriptDebugServer::pauseIfNeeded): Changed pause tracking
47         to track a JavaScriptCallFrame instead of an ExecState, since ExecState
48         is no longer a unique identifier for a call frame.
49
50         I removed the updateCurrentCallFrame scheme, and replaced it with
51         individual tracking inside these callbacks:
52         
53         (WebCore::JavaScriptDebugServer::callEvent):
54         (WebCore::JavaScriptDebugServer::atStatement):
55         (WebCore::JavaScriptDebugServer::returnEvent):
56         (WebCore::JavaScriptDebugServer::exception):
57         
58         The updateCurrentCallFrame scheme was just too incompatible with the
59         squirrelfish execution model. Everything still works as before, except
60         for eval, which no longer shows up as an independent call frame. We'll
61         need to augment our debugger callbacks to bring back support for that.
62
63         * page/inspector/ScopeChainSidebarPane.js: Updated to use the activation
64         class's new name.
65
66 2008-05-21  Maciej Stachowiak  <mjs@apple.com>
67
68         Reviewed by Oliver.
69
70         - write directly to the slot we used to check for override properties, when possible
71         2.6% speedup on in-browser SunSpider
72
73         * bindings/js/JSDOMWindowCustom.h:
74         (WebCore::JSDOMWindow::customPut):
75
76 2008-05-20  Maciej Stachowiak  <mjs@apple.com>
77
78         Reviewed by Oliver.
79
80         - inline JSDOMWindow security checks
81         0.9% speedup to SunSpider in-browser
82
83         * bindings/js/JSDOMWindowBase.cpp:
84         * bindings/js/JSDOMWindowCustom.h:
85         (WebCore::JSDOMWindowBasePrivate::JSDOMWindowBasePrivate):
86         (WebCore::JSDOMWindowBase::allowsAccessFrom):
87         (WebCore::JSDOMWindowBase::allowsAccessFromNoErrorMessage):
88         (WebCore::JSDOMWindowBase::allowsAccessFromPrivate):
89         * bindings/js/kjs_binding.cpp:
90
91 2008-05-20  Maciej Stachowiak  <mjs@apple.com>
92
93         Reviewed by Adam.
94
95         - use ALWAYS_INLINE on customGetOwnPropertySlot since it wasn't inlining
96         2% speedup to SunSpider in-browser
97
98         * bindings/js/JSDOMWindowCustom.h:
99         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
100
101 2008-05-20  Maciej Stachowiak  <mjs@apple.com>
102
103         Reviewed by Adam.
104
105         - inline JSDOMWindow's customPut and customGetOwnPropertySlot methods
106         1.2% speedup to SunSpider in-browser
107         
108         The approach here is to make the code generator include a
109         JS{classname}Custom.h header in the autogenerated implementation,
110         which we can use to provide inline versions.
111
112         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
113         * bindings/js/JSCSSStyleDeclarationCustom.h: Added.
114         * bindings/js/JSDOMWindowCustom.cpp:
115         * bindings/js/JSDOMWindowCustom.h:
116         (WebCore::asJSDOMWindow):
117         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
118         (WebCore::JSDOMWindow::customPut):
119         * bindings/js/JSHTMLAppletElementCustom.cpp:
120         * bindings/js/JSHTMLAppletElementCustom.h: Added.
121         * bindings/js/JSHTMLEmbedElementCustom.cpp:
122         * bindings/js/JSHTMLEmbedElementCustom.h: Added.
123         * bindings/js/JSHTMLObjectElementCustom.cpp:
124         * bindings/js/JSHTMLObjectElementCustom.h: Added.
125         * bindings/js/JSHistoryCustom.cpp:
126         * bindings/js/JSHistoryCustom.h: Added.
127         * bindings/js/JSLocationCustom.cpp:
128         * bindings/js/JSLocationCustom.h: Added.
129         * bindings/js/JSStorageCustom.cpp:
130         * bindings/js/JSStorageCustom.h: Added.
131         * bindings/scripts/CodeGeneratorJS.pm:
132
133 2008-05-19  Maciej Stachowiak  <mjs@apple.com>
134
135         Reviewed by Anders.
136
137         - inline asDOMWindow (using a new JSDOMWindowCustom.h header) since it is just a cast
138         1% speedup to SunSpider in-browser
139
140         * WebCore.vcproj/WebCore.vcproj:
141         * WebCore.xcodeproj/project.pbxproj:
142         * bindings/js/JSCustomVoidCallback.cpp:
143         * bindings/js/JSCustomXPathNSResolver.cpp:
144         * bindings/js/JSDOMApplicationCacheCustom.cpp:
145         * bindings/js/JSDOMWindowBase.cpp:
146         * bindings/js/JSDOMWindowBase.h:
147         * bindings/js/JSDOMWindowCustom.cpp:
148         * bindings/js/JSDOMWindowCustom.h: Added.
149         (WebCore::asJSDOMWindow):
150         * bindings/js/JSDatabaseCustom.cpp:
151         * bindings/js/JSDocumentCustom.cpp:
152         * bindings/js/JSLocationCustom.cpp:
153         * bindings/js/JSSQLTransactionCustom.cpp:
154         * bindings/js/JSXMLHttpRequestCustom.cpp:
155         * page/JavaScriptDebugServer.cpp:
156
157 2008-05-19  Maciej Stachowiak  <mjs@apple.com>
158
159         Reviewed by Oliver.
160
161         - obtain current inner window of outer window in a more efficient way
162         1.6% speedup to SunSpider in-browser
163
164         * bindings/js/JSDOMWindowBase.cpp:
165         (WebCore::JSDOMWindowBase::allowsAccessFromPrivate):
166
167 2008-05-19  Maciej Stachowiak  <mjs@apple.com>
168
169         Reviewed by Adam.
170
171         - make impl() method for JSWindow inline
172         0.6% speedup to SunSpider in-browser
173
174         * WebCore.base.exp: Remove now-inline symbol
175         * bindings/scripts/CodeGeneratorJS.pm: Make the codegen script inline impl()
176         even for classes with a parent class.
177
178 2008-05-17  Geoffrey Garen  <ggaren@apple.com>
179
180         Reviewed by Oliver Hunt.
181
182         Updated for API changes in KJS::Debugger.
183
184 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
185
186         Reviewed by Oliver Hunt.
187
188         Updated for API changes in KJS::Debugger.
189
190         * page/JavaScriptDebugServer.cpp:
191         (WebCore::JavaScriptDebugServer::callEvent):
192         (WebCore::JavaScriptDebugServer::atStatement):
193         (WebCore::JavaScriptDebugServer::returnEvent):
194         (WebCore::JavaScriptDebugServer::exception):
195         * page/JavaScriptDebugServer.h:
196
197 2008-05-13  Geoffrey Garen  <ggaren@apple.com>
198
199         Reviewed by Oliver Hunt.
200         
201         Updated JavaScriptDebugServer API to accept a SourceProvider instead
202         of a UString, to avoid copying.
203
204         * page/JavaScriptDebugServer.cpp:
205         (WebCore::JavaScriptDebugServer::sourceParsed): Updated this function
206         not to return a value.
207
208 2008-05-10  Maciej Stachowiak  <mjs@apple.com>
209
210         Build fix.
211         
212         - add missing forwarding header
213
214         * ForwardingHeaders/kjs/SourceProvider.h: Added.
215
216 2008-05-10  Maciej Stachowiak  <mjs@apple.com>
217
218         Reviewed by Oliver.
219
220         - JavaScriptGlue part of fix for: "SQUIRRELFISH: function toString broken after calling"
221         https://bugs.webkit.org/show_bug.cgi?id=18869
222
223         * bindings/js/StringSourceProvider.h: Added. SourceProvider subclass backed by a WebCore::String.
224         (WebCore::StringSourceProvider::create):
225         (WebCore::StringSourceProvider::getRange):
226         (WebCore::StringSourceProvider::data):
227         (WebCore::StringSourceProvider::length):
228         (WebCore::StringSourceProvider::StringSourceProvider):
229         * bindings/js/kjs_proxy.cpp:
230         (WebCore::KJSProxy::evaluate): Pass a StringSourceProvider to
231         evaluate() instead of UChar* / length.
232         * html/HTMLScriptElement.cpp:
233         (WebCore::HTMLScriptElement::text): Modified to return the
234         original string as-is when the script element contains only a
235         single text node, to avoid excess memory use.
236         
237         * WebCore.vcproj/WebCore.vcproj: Add new file to build.
238         * WebCore.xcodeproj/project.pbxproj: ditto
239
240 2008-05-09  Oliver Hunt  <oliver@apple.com>
241
242         Reviewed by Geoff.
243
244         Build fixes for SquirrelFish on windows.
245
246         * bindings/js/JSNavigatorCustom.cpp:
247
248 2008-05-08  Geoffrey Garen  <ggaren@apple.com>
249
250         Reviewed by Oliver Hunt.
251
252         Fixed platform/mac/plugins/bindings-test-objc.html.
253         
254         I've restored -[WebScriptObject setException] and
255         +[WebScriptObject throwException].
256         
257         Instead of mucking around in the JavaScript engine's execution state,
258         throwing an exception sets a global exception string, along with the
259         environment in which to throw it. An ObjC callback checks the global
260         exception string and, if it's non-nil and the environment matches the
261         current exceution environment, throws the global exception string as a
262         JS exception.
263
264         I also removed the old currentGlobalObject infrastructure: it's no longer
265         used.
266
267 2008-05-06  Oliver Hunt  <oliver@apple.com>
268
269         Reviewed by Maciej.
270
271         Bug 18866: SQUIRRELFISH: JS/ObjC bridge is broken <https://bugs.webkit.org/show_bug.cgi?id=18866>
272         Bug 18867: SQUIRRELFISH: JS/NPRuntime bridge is broken <https://bugs.webkit.org/show_bug.cgi?id=18867>
273
274         This fixes function binding logic for the ObjC and NPRuntime by
275         replacing incorrect implementations of implementsCall (which is
276         no longer virtual) with implementations of getCallData.
277
278         * bindings/js/JSQuarantinedObjectWrapper.cpp:
279         (WebCore::JSQuarantinedObjectWrapper::getCallData):
280         * bindings/js/JSQuarantinedObjectWrapper.h:
281         * bridge/c/c_instance.cpp:
282         * bridge/c/c_instance.h:
283         * bridge/objc/objc_instance.h:
284         * bridge/objc/objc_instance.mm:
285         * bridge/objc/objc_runtime.h:
286         * bridge/objc/objc_runtime.mm:
287         (ObjcFallbackObjectImp::getCallData):
288         * bridge/runtime.h:
289         * bridge/runtime_object.cpp:
290         (RuntimeObjectImp::getCallData):
291         * bridge/runtime_object.h:
292
293 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
294
295         Build fix: supply a parameter that used to be implicit to
296         Interpreter::evaluate.
297
298 2008-04-30  Geoffrey Garen  <ggaren@apple.com>
299
300         Build fix: #ifdef'd out some code that doesn't work anymore.
301
302         * bindings/objc/WebScriptObject.mm:
303         (+[WebScriptObject throwException:]):
304         (-[WebScriptObject setException:]):
305
306 2008-04-14  Gabor Loki  <loki@inf.u-szeged.hu>
307
308         Reviewed by Geoffrey Garen.
309
310         Bug 18489: Squirrelfish doesn't build on linux
311         <https://bugs.webkit.org/show_bug.cgi?id=18489>
312
313         * WebCore.pro: Add JavaScriptCore/VM into include path
314
315 2008-04-10  Sam Weinig  <sam@webkit.org>
316
317         Reviewed by Geoffrey Garen.
318
319         Adjusted WebCore JS functions to the new "getConstructData" calling convention.
320
321 2008-03-30  Geoffrey Garen  <ggaren@apple.com>
322
323         Reviewed by Oliver Hunt.
324         
325         Adjusted WebCore JS functions to the new "getCallData" calling convention.
326
327 === Start merge of squirrelfish ===
328
329 2008-05-21  Anders Carlsson  <andersca@apple.com>
330
331         Reviewed by Mitz.
332
333         Add IconFetcher implementation.
334
335         * WebCore.base.exp:
336         * WebCore.xcodeproj/project.pbxproj:
337         * html/HTMLLinkElement.h:
338         (WebCore::HTMLLinkElement::isIcon):
339         * loader/icon/IconFetcher.cpp: Added.
340         (WebCore::IconLinkEntry::):
341         (WebCore::IconLinkEntry::IconLinkEntry):
342         (WebCore::IconLinkEntry::type):
343         (WebCore::IconLinkEntry::url):
344         (WebCore::IconLinkEntry::buffer):
345         (WebCore::parseIconLink):
346         (WebCore::IconFetcher::create):
347         (WebCore::IconFetcher::IconFetcher):
348         (WebCore::IconFetcher::~IconFetcher):
349         (WebCore::IconFetcher::cancel):
350         (WebCore::IconFetcher::createIcon):
351         (WebCore::IconFetcher::loadEntry):
352         (WebCore::IconFetcher::loadFailed):
353         (WebCore::IconFetcher::didReceiveResponse):
354         (WebCore::IconFetcher::didReceiveData):
355         (WebCore::IconFetcher::didFinishLoading):
356         (WebCore::IconFetcher::didFail):
357         * loader/icon/IconFetcher.h: Added.
358         (WebCore::IconFetcherClient::~IconFetcherClient):
359
360 2008-05-21  Dan Bernstein  <mitz@apple.com>
361
362         Reviewed by Dave Hyatt.
363
364         - fix https://bugs.webkit.org/show_bug.cgi?id=18352
365           <rdar://problem/5854517> crash loading malicious font
366
367         * platform/graphics/mac/SimpleFontDataMac.mm:
368         (WebCore::SimpleFontData::platformInit): In the case of a custom font,
369         there is no NSFont to base the fallback font on, so get a font based on
370         fallback family name alone.
371
372 2008-05-21  Timothy Hatcher  <timothy@apple.com>
373
374         Adds the files and line numbers to the Profile call tree.
375
376         <rdar://problem/5952924> Inspector needs to show file and line number
377         in the Profile call tree
378
379         Reviewed by Geoff Garen.
380
381         * page/JavaScriptProfileNode.cpp:
382         (WebCore::getFunctionName): Fixes a JSStringRef leak.
383         (WebCore::getURL): Call ProfileNode::url.
384         (WebCore::getLineNumber): Call ProfileNode::lineNumber.
385         (WebCore::ProfileNodeClass): Add the url and lineNumber properties.
386         * page/inspector/ProfileView.js:
387         (WebInspector.ProfileDataGridNode.prototype.createCell): Overload the
388         DataGridNode.createCell and add the file and lineNumber to the
389         cell if the column is the function column.
390         * page/inspector/inspector.css: New styles for the file and line.
391
392 2008-05-21  Timothy Hatcher  <timothy@apple.com>
393
394         Restores logging of console calls to the STDOUT
395         when Interpreter::shouldPrintExceptions() is true.
396
397         <rdar://problem/5636442> REGRESSION: Console.log no longer logs to
398         the system console or terminal
399
400         <rdar://problem/5146079> JavaScript exception logging should print
401         accurate file and line info when called from WebScriptObject
402
403         Reviewed by Adam Roben.
404
405         * bindings/js/JSCustomSQLStatementCallback.cpp:
406         (WebCore::JSCustomSQLStatementCallback::handleEvent): Remove existing
407         printf and check for Interpreter::shouldPrintExceptions() since there is
408         a call to Console::addMessage.
409         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
410         (WebCore::JSCustomSQLStatementErrorCallback::handleEvent): Ditto.
411         * bindings/js/JSCustomSQLTransactionCallback.cpp:
412         (WebCore::JSCustomSQLTransactionCallback::handleEvent): Ditto.
413         * bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
414         (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent): Ditto.
415         * bindings/js/JSCustomVoidCallback.cpp:
416         (WebCore::JSCustomVoidCallback::handleEvent): Ditto.
417         * bindings/js/JSCustomXPathNSResolver.cpp:
418         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): Ditto.
419         * bindings/js/JSDOMWindowBase.cpp:
420         (WebCore::JSDOMWindowBase::printErrorMessage): Ditto.
421         * bindings/js/ScheduledAction.cpp:
422         (WebCore::ScheduledAction::execute): Ditto.
423         * bindings/js/kjs_events.cpp:
424         (WebCore::JSAbstractEventListener::handleEvent): Ditto.
425         * loader/FrameLoader.cpp:
426         (WebCore::FrameLoader::shouldAllowNavigation): Ditto.
427         * bindings/objc/WebScriptObject.mm:
428         (WebCore::addExceptionToConsole): Added helper static function that
429         calls Console::addMessage.
430         (-[WebScriptObject callWebScriptMethod:withArguments:]): Call addExceptionToConsole.
431         (-[WebScriptObject evaluateWebScript:]): Ditto.
432         (-[WebScriptObject setValue:forKey:]): Ditto.
433         (-[WebScriptObject valueForKey:]): Ditto.
434         (-[WebScriptObject removeWebScriptKey:]): Ditto.
435         (-[WebScriptObject webScriptValueAtIndex:]): Ditto.
436         (-[WebScriptObject setWebScriptValueAtIndex:value:]): Ditto.
437         * page/Console.cpp:
438         (WebCore::Console::addMessage): Print the level, message,
439         URL and line number to STDOUT.
440         (WebCore::printToStandardOut): Helper static function that
441         takes a prefix string, ExecState, an argument List and URL.
442         Prints the prefix and loops through the arguments calling
443         toString on each and printing the string. Finally printing
444         the URL and new line.
445         (WebCore::Console::error): Call printToStandardOut.
446         (WebCore::Console::info): Ditto.
447         (WebCore::Console::log): Ditto.
448         (WebCore::Console::assertCondition): Ditto.
449         (WebCore::Console::warn): Ditto.
450
451 2008-05-20  Timothy Hatcher  <timothy@apple.com>
452
453         Changes to work with the new Profiler API. The Profile is now
454         stored by the InspectorController when Console.profileEnd is called.
455         This solves three issues with the previous design. First, we don't
456         keep profiles around unless the Inspector is enabled. Second, we
457         only show Profiles initiated by the Page in it's Inspector, not every
458         Profile for the whole process. Third, we now show Profiles in the
459         Inspector when they are created.
460
461         <rdar://problem/5951562> New profiles aren't added to the Inspector
462         as they finish
463
464         Reviewed by Kevin McCullough.
465
466         * bindings/js/JSConsoleCustom.cpp:
467         (WebCore::JSConsole::profileEnd): Added. Calls impl()->profileEnd()
468         and passes the ExecState and arguments.
469         * page/Console.cpp:
470         (WebCore::Console::profile):
471         (WebCore::Console::profileEnd): Accept the optional title argument
472         and pass it to Profilier::stopProfiling along with the ExecState.
473         Calls InspectorController::addProfile with the result Profile.
474         * page/Console.h:
475         * page/Console.idl: Made profileEnd Custom so we can get the ExecState.
476         * page/InspectorController.cpp:
477         (WebCore::profiles): Renamed from allProfiles. Uses the controller's
478         profiles vector.
479         (WebCore::InspectorController::addProfile): Appends to m_profiles.
480         Calls addScriptProfile if the window is visible.
481         (WebCore::InspectorController::windowScriptObjectAvailable): Renamed
482         allProfiles to profiles.
483         (WebCore::InspectorController::addScriptProfile): Calls addProfile on
484         the JavaScript side.
485         (WebCore::InspectorController::didCommitLoad): Clears m_profiles.
486         * page/InspectorController.h:
487         * page/inspector/ProfilesPanel.js: Populates the profiles sidebar the first
488         time the panel is shown after a rest.
489         * page/inspector/inspector.js: Added addProfile, calls ProfilesPanel's
490         addProfile function.
491
492 2008-05-21  Alexey Proskuryakov  <ap@webkit.org>
493
494         Reviewed by Darin.
495
496         https://bugs.webkit.org/show_bug.cgi?id=19169
497         <rdar://5952342> REGRESSION: nakarte.ru searches don't work
498
499         Test: http/tests/xmlhttprequest/encode-request-url.html
500
501         * platform/KURL.cpp: (WebCore::KURL::init): Don't allow UTF-8 encoded data to be implicitly
502         converted to String, as it will be encoded again by parse().
503
504 2008-05-21  Ariya Hidayat  <ariya.hidayat@trolltech.com>
505
506         Reviewed by Simon.
507
508         For the Qt port, fix building with Qt for Embedded Linux.
509
510         * WebCore.pro:
511
512 2008-05-21  Ariya Hidayat  <ariya.hidayat@trolltech.com>
513
514         Reviewed by Simon.
515
516         For the Qt port, allow building without NPAPI plugin support.
517
518         * WebCore.pro:
519         * plugins/PluginView.h:
520
521 2008-05-20  Kevin McCullough  <kmccullough@apple.com>
522
523         Reviewed by Tim.
524
525         Added all of my personal manual tests for the profiler.
526
527         * manual-tests/inspector/profiler-test-anonymous-event-handler.html: Added.
528         * manual-tests/inspector/profiler-test-anonymous-function-called-from-different-contexts.html: Added.
529         * manual-tests/inspector/profiler-test-anonymous-function-calls-built-in-functions.html: Added.
530         * manual-tests/inspector/profiler-test-anonymous-function-calls-eval.html: Added.
531         * manual-tests/inspector/profiler-test-apply.html: Added.
532         * manual-tests/inspector/profiler-test-built-in-function-calls-anonymous.html: Added.
533         * manual-tests/inspector/profiler-test-built-in-function-calls-user-defined-function.html: Added.
534         * manual-tests/inspector/profiler-test-call.html: Added.
535         * manual-tests/inspector/profiler-test-dead-time.html: Added.
536         * manual-tests/inspector/profiler-test-event-handler.html: Added.
537         * manual-tests/inspector/profiler-test-execution-context-and-eval-on-same-line.html: Added.
538         * manual-tests/inspector/profiler-test-inline-event-handler.html: Added.
539         * manual-tests/inspector/profiler-test-many-calls-in-the-same-scope.html: Added.
540         * manual-tests/inspector/profiler-test-multiple-and-different-scoped-anonymous-function-calls.html: Added.
541         * manual-tests/inspector/profiler-test-multiple-and-different-scoped-function-calls.html: Added.
542         * manual-tests/inspector/profiler-test-multiple-frames.html: Added.
543         * manual-tests/inspector/profiler-test-multiple-windows.html: Added.
544         * manual-tests/inspector/profiler-test-nested-anonymous-functon.html: Added.
545         * manual-tests/inspector/profiler-test-nested-start-and-stop-profiler.html: Added.
546         * manual-tests/inspector/profiler-test-no-execution-context.html: Added.
547         * manual-tests/inspector/profiler-test-one-execution-context.html: Added.
548         * manual-tests/inspector/profiler-test-profile-calls-in-included-file.html: Added.
549         * manual-tests/inspector/profiler-test-profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html: Added.
550         * manual-tests/inspector/profiler-test-profiling-from-a-nested-location.html: Added.
551         * manual-tests/inspector/profiler-test-start-and-stop-profiler-multiple-times.html: Added.
552         * manual-tests/inspector/profiler-test-two-execution-contexts.html: Added.
553         * manual-tests/inspector/profiler-test-user-defined-function-calls-built-in-functions.html: Added.
554         * manual-tests/inspector/resources: Added.
555         * manual-tests/inspector/resources/other-frame.html: Added.
556         * manual-tests/inspector/resources/other-window.html: Added.
557         * manual-tests/inspector/resources/profiler-test-JS-resources.js: Added.
558
559 2008-05-20  Adam Roben  <aroben@apple.com>
560
561         Use KJS::List::getSlice instead of reimplementing it
562
563         Rubberstamped and suggested by Sam Weinig.
564
565         * bindings/js/JSConsoleCustom.cpp:
566         (WebCore::JSConsole::assertCondition):
567
568 2008-05-20  Kevin Calhoun  <kcalhoun@apple.com>
569
570         Reviewed by Darin.
571
572         Fix <rdar://problem/5929010> Adopt new QTKit methods for <video> implementation
573
574         If the class QTVideoRendererWebKitOnly is present use it to render video,
575         otherwise fall back to existing use of QTMovieView/QTMovieContentView.
576
577         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
578         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
579         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
580         (WebCore::MediaPlayerPrivate::createQTMovie):
581         (WebCore::QTVideoRendererClass):
582         (WebCore::MediaPlayerPrivate::detachQTMovieView):
583         (WebCore::MediaPlayerPrivate::createQTVideoRenderer):
584         (WebCore::MediaPlayerPrivate::destroyQTVideoRenderer):
585         (WebCore::MediaPlayerPrivate::setUpVideoRendering):
586         (WebCore::MediaPlayerPrivate::tearDownVideoRendering):
587         (WebCore::MediaPlayerPrivate::load):
588         (WebCore::MediaPlayerPrivate::cancelLoad):
589         (WebCore::MediaPlayerPrivate::setVisible):
590         (WebCore::MediaPlayerPrivate::paint):
591         (-[WebCoreMovieObserver newImageAvailable:]):
592
593 2008-05-19  Adam Roben  <aroben@apple.com>
594
595         Fix Bug 19134: Inspector should support console.assert
596
597         <https://bugs.webkit.org/show_bug.cgi?id=19134>
598
599         Reviewed by Tim Hatcher.
600
601         Test: manual-tests/inspector/console-assert.html
602
603         * bindings/js/JSConsoleCustom.cpp:
604         (WebCore::JSConsole::assertCondition): Added.
605         * bindings/scripts/CodeGeneratorJS.pm: Added parsing of the
606         ImplementationFunction extended attribute, which allows you to
607         override the name of the C++ function used to implement this method.
608         * manual-tests/inspector/console-assert.html: Added.
609         * page/Console.cpp:
610         (WebCore::Console::assertCondition): Added.
611         * page/Console.h:
612         * page/Console.idl: Added assert().
613
614 2008-05-20  Alice Liu  <alice.liu@apple.com>
615
616         Reviewed by Brady.
617
618         fix <rdar://problem/5908580> 10A58: Dictionary Panel hangs in WebCore::Cache::pruneDeadResources()
619
620         * loader/Cache.cpp:
621         (WebCore::Cache::requestUserCSSStyleSheet):
622         Add a call to resourceAccessed() to more closely mirror what is done in requestResource()
623         (WebCore::Cache::insertInLRUList):
624         Assert that any resource in the LRU list has been accessed.  This is early detection of a
625         potential hang later when pruning resources, and also agrees with the early return in 
626         removeFromLRUList().
627
628 2008-05-20  Dan Bernstein  <mitz@apple.com>
629
630         Reviewed by Darin Adler.
631
632         - fix https://bugs.webkit.org/show_bug.cgi?id=17655
633           <rdar://problem/5778077> REGRESSION (3.1.1-TOT): Reproducible crash calling querySelector on viewless Document
634
635         Test: fast/dom/SelectorAPI/viewless-document.html
636
637         * css/CSSStyleSelector.cpp:
638         (WebCore::CSSStyleSelector::CSSStyleSelector): Updated to initialize the
639         selector checker.
640         (WebCore::CSSStyleSelector::init): Removed initialization of
641         m_collectRulesOnly, which is now part of the selector checker.
642         (WebCore::CSSStyleSelector::matchRules): Updated for renames and data
643         moved into the selector checker.
644         (WebCore::CSSStyleSelector::matchRulesForList): Ditto.
645         (WebCore::CSSStyleSelector::initForStyleResolve): Added a PseudoId
646         argument, which is used to initialize a data member of the selector
647         checker. Updated for renames. Removed initialization of m_isXMLDoc
648         because this bit is now initialized only once in the selector checker's
649         constructor.
650         (WebCore::CSSStyleSelector::SelectorChecker::SelectorChecker): Added.
651         (WebCore::CSSStyleSelector::SelectorChecker::checkPseudoState): Changed
652         into a SelectorChecker method.
653         (WebCore::CSSStyleSelector::SelectorChecker::checkSelector): Added. Used
654         by querySelector() and querySelectorAll().
655         (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for data
656         moved into the selector checker.
657         (WebCore::CSSStyleSelector::matchUARules): Ditto.
658         (WebCore::CSSStyleSelector::styleForElement):
659         (WebCore::CSSStyleSelector::pseudoStyleForElement): Ditto. Also removed
660         code that set the parentStyle variable after the last place it is
661         accessed, and changed to ensure that m_style is set early in this
662         function.
663         (WebCore::CSSStyleSelector::adjustRenderStyle): Updated for data moved
664         into the selector checker.
665         (WebCore::CSSStyleSelector::styleRulesForElement): Ditto.
666         (WebCore::CSSStyleSelector::checkSelector): Ditto. Also changed to pass
667         the element's style and the parent style to the selector checker, as
668         well as the dynamic pseudo variable and the selector attributes vector.
669         (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Added
670         arguments for the style of the base element and its parent. When the
671         elementStyle argument is 0, the style is fetched from the element
672         and its parent as needed. Also changed to take a reference to the
673         dynamic pseudo ID and a pointer to the vector of attributes affecting
674         the match.
675         (WebCore::CSSStyleSelector::applyProperty): Updated for data moved
676         into the selector checker.
677         (WebCore::CSSStyleSelector::checkForGenericFamilyChange): Ditto.
678         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize): Ditto.
679         (WebCore::CSSStyleSelector::fontSizeForKeyword): Ditto.
680         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Ditto.
681         (WebCore::CSSStyleSelector::SelectorChecker::allVisitedStateChanged):
682         Changed into a SelectorChecker method.
683         (WebCore::CSSStyleSelector::SelectorChecker::visitedStateChanged):
684         Ditto.
685
686         * css/CSSStyleSelector.h:
687         Added a SelectorChecker class and moved data and methods used in
688         checking selectors into it.
689         (WebCore::CSSStyleSelector::allVisitedStateChanged): Changed to call the
690         SelectorChecker method.
691         (WebCore::CSSStyleSelector::visitedStateChanged): Ditto.
692         * dom/Node.cpp:
693         (WebCore::Node::querySelector): Changed to use a SelectorChecker instead
694         of the document's style selector.
695         * dom/SelectorNodeList.cpp:
696         (WebCore::SelectorNodeList::SelectorNodeList): Ditto.
697
698 2008-05-20  Timothy Hatcher  <timothy@apple.com>
699
700         Implements the Profiles panel and Profile view.
701
702         Reviewed by Kevin McCullough.
703
704         * English.lproj/localizedStrings.js: Added new strings.
705         * page/inspector/Images/profileIcon.png: Added.
706         * page/inspector/Images/profilesIcon.png: Changed. New icon design
707         that fits in with the other toolbar icons.
708         * page/inspector/ProfileView.js:
709         (WebInspector.ProfileView): Remove custom table elements
710         and create a DataGrid. Sorts the profile by descending total time,
711         since the profiles aren't sorted by default.
712         (WebInspector.ProfileView.prototype.refresh): Clears the DataGrid
713         and recreates all the nodes. The selection is preserved.
714         (WebInspector.ProfileView.prototype.refreshShowAsPercents): Traverse
715         all the children and change showTotalTimeAsPercent and showSelfTimeAsPercent
716         to match the ProfileView values. Then call refresh on the child.
717         (WebInspector.ProfileView.prototype._sortData): Determine the sort
718         function to call on the head profile node. Call it and then call
719         refresh to rebuild the DataGrid.
720         (WebInspector.ProfileView.prototype._mouseDownInDataGrid): Return early
721         if the event is not a double-click. When it is a double-click, determine
722         the column that was targeted and if it was total or self toggle the
723         show as percent property. Call refreshShowAsPercents.
724         (WebInspector.ProfileDataGridNode): 
725         (WebInspector.ProfileDataGridNode.prototype.get data): 
726         (WebInspector.ProfileDataGridNode.prototype.expand): 
727         (WebInspector.ProfileDataGridNode.prototype.collapse): 
728         (WebInspector.ProfileDataGridNode.prototype._populate): 
729         * page/inspector/ProfilesPanel.js:
730         (WebInspector.ProfilesPanel): 
731         (WebInspector.ProfilesPanel.prototype.show): Populate the sidebar
732         with all profiles. This is a workaround until the Inspector
733         is told about new profiles.
734         (WebInspector.ProfilesPanel.prototype.reset): Clear the sidebar and
735         profile views.
736         (WebInspector.ProfilesPanel.prototype.handleKeyEvent): Pass the key
737         event to the sidebar.
738         (WebInspector.ProfilesPanel.prototype.addProfile): Create a
739         ProfileSidebarTreeElement object and add it to the sidebar.
740         (WebInspector.ProfilesPanel.prototype.showProfile): Create a ProfileView
741         and show it.
742         (WebInspector.ProfilesPanel.prototype.closeVisibleView): Hide the
743         visible view.
744         (WebInspector.ProfilesPanel.prototype._startSidebarDragging): Call
745         WebInspector.elementDragStart.
746         (WebInspector.ProfilesPanel.prototype._sidebarDragging): Call _updateSidebarWidth.
747         (WebInspector.ProfilesPanel.prototype._endSidebarDragging):
748         Call WebInspector.elementDragEnd.
749         (WebInspector.ProfilesPanel.prototype._updateSidebarWidth): Update the
750         sidebar width based on the passed in value.
751         (WebInspector.ProfileSidebarTreeElement): Subclass WebInspector.SidebarTreeElement.
752         (WebInspector.ProfileSidebarTreeElement.prototype.onselect): Call ProfilesPanel.showProfile.
753         (WebInspector.ProfileSidebarTreeElement.prototype.get mainTitle): Return profile.title.
754         (WebInspector.ProfileSidebarTreeElement.prototype.set mainTitle): Do nothing.
755         (WebInspector.ProfileSidebarTreeElement.prototype.get subtitle): Ditto.
756         (WebInspector.ProfileSidebarTreeElement.prototype.set subtitle): Ditto.
757         * page/inspector/inspector.css: New styles for the profile sidebar
758         item and profile data grid columns.
759         * page/inspector/inspector.js:
760         * page/inspector/utilities.js:
761         (Number.secondsToString): Added a higherResolution argument
762         that returns fractional milliseconds.
763
764 2008-05-20  chris fleizach  <cfleizach@apple.com>
765
766         Reviewed by Darin Adler, Alice Liu
767
768         <rdar://problem/3438014> Might need accessibility solution for context menus in web pages
769         <rdar://problem/5060458> Elements without AXActions should not return kAXErrorFailure
770
771         * page/AccessibilityObject.cpp:
772         (WebCore::AccessibilityObject::clickPoint):
773         * page/AccessibilityObject.h:
774         * page/mac/AccessibilityObjectWrapper.mm:
775         (-[AccessibilityObjectWrapper accessibilityActionNames]):
776         (-[AccessibilityObjectWrapper accessibilityPerformPressAction]):
777         (-[AccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
778         (-[AccessibilityObjectWrapper accessibilityShowContextMenu]):
779         (-[AccessibilityObjectWrapper accessibilityPerformAction:]):
780
781 2008-05-20  Timothy Hatcher  <timothy@apple.com>
782
783         Expose the ProfileNode functionName sorting functions on
784         JavaScriptProfileNode.
785
786         Reviewed by Kevin McCullough.
787
788         * page/JavaScriptProfileNode.cpp:
789         (WebCore::sortFunctionNameDescending): Call ProfileNode.
790         (WebCore::sortFunctionNameAscending): Ditto.
791         (WebCore::ProfileNodeClass): Add static functions.
792
793 2008-05-20  Darin Adler  <darin@apple.com>
794
795         Reviewed by Mitz.
796
797         - a first small step of CSS DOM refactoring -- the eventual goal is to
798           reduce StyleBase and possibly eliminate it, since it has multiple
799           purposes and unneccessarily ties many classes together
800
801         * css/CSSCursorImageValue.cpp:
802         (WebCore::isSVGCursorIdentifier): Mark static so it has internal linkage.
803         (WebCore::resourceReferencedByCursorElement): Ditto.
804         (WebCore::CSSCursorImageValue::CSSCursorImageValue): Removed unused style
805         argument.
806         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): Removed code to
807         check if X and Y changed before changing them -- there's no reason to do
808         that. Removed code that depended on the internals of CSSImageValue. The
809         new code uses only protected functions rather than going right at the
810         fields and uing internal knowledge of the base class.
811         * css/CSSCursorImageValue.h: Added a create function, made constructor
812         private, removed unused style argument.
813
814         * css/CSSImageValue.cpp:
815         (WebCore::CSSImageValue::CSSImageValue): Removed unused style argument.
816         (WebCore::CSSImageValue::cachedImageURL): Added. A protected function for
817         use by CSSCursorImageValue that gives the URL.
818         (WebCore::CSSImageValue::clearCachedImage): Added. A protected function for
819         use by CSSCursorImageValue that clears the CachedImage.
820         * css/CSSImageValue.h: Added create functions, made constructors protected
821         and private, removed unused style argument, made data members private, added
822         some protected functions for use by CSSCursorImageValue.
823
824         * css/CSSImportRule.cpp:
825         (WebCore::CSSImportRule::setCSSStyleSheet): Changed to call checkLoaded on
826         the parent. This is part of preparation to move the checkLoaded function from
827         StyleBase to StyleSheet.
828         (WebCore::CSSImportRule::insertedIntoParent): Changed code to check the URL
829         of the style sheet to use the href function of the style sheet rather than
830         the baseURL function. This eliminates an O(n^2) algorithm here and reduces
831         the use of baseURL, part of preparation to move it from StyleBase
832         to CSSStyleSheet.
833
834         * css/CSSMutableStyleDeclaration.cpp:
835         (WebCore::CSSMutableStyleDeclaration::setImageProperty): Changed to use create
836         function instead of a direct call to new for the CSSImageValue classes.
837         * css/CSSParser.cpp:
838         (WebCore::CSSParser::parseValue): Ditto.
839         (WebCore::CSSParser::parseContent): Ditto.
840         (WebCore::CSSParser::parseFillImage): Ditto.
841         (WebCore::CSSParser::parseBorderImage): Ditto.
842
843         * css/CSSStyleSelector.cpp: Removed unneeded include of CSSImageValue.h.
844         * rendering/style/RenderStyle.h: Removed unneeded include of
845         CSSCursorImageValue.h, which was causing us to rebuild the world way too often.
846
847         * xml/XSLImportRule.cpp:
848         (WebCore::XSLImportRule::setXSLStyleSheet): See change to CSSImportRule above.
849         (WebCore::XSLImportRule::loadSheet): Ditto.
850
851 2008-05-20  Kevin McCullough  <kmccullough@apple.com>
852
853         Rubber stamped by Adam.
854
855         -Minor fix. Should not use a reference since the original may disappear.
856
857         * page/Console.cpp:
858         (WebCore::Console::profile):
859
860 2008-05-20  Kevin Ollivier  <kevino@theolliviers.com>
861
862         wx build fix. userAgent should return a value.
863
864         * plugins/wx/PluginViewWx.cpp:
865         (WebCore::PluginView::userAgent):
866
867 2008-05-19  Timothy Hatcher  <timothy@apple.com>
868
869         Expose the ProfileNode sorting functions on JavaScriptProfileNode.
870
871         Reviewed by Kevin McCullough.
872
873         * page/JavaScriptProfileNode.cpp:
874         (WebCore::sortTotalTimeDescending): Call ProfileNode.
875         (WebCore::sortTotalTimeAscending): Ditto.
876         (WebCore::sortSelfTimeDescending): Ditto.
877         (WebCore::sortSelfTimeAscending): Ditto.
878         (WebCore::sortCallsDescending): Ditto.
879         (WebCore::sortCallsAscending): Ditto.
880         (WebCore::ProfileNodeClass): Add static functions.
881
882 2008-05-19  Timothy Hatcher  <timothy@apple.com>
883
884         * page/InspectorController.cpp: Change the include for
885         JavaScriptProfile.h to sue double quotes instead of backets.
886
887 2008-05-19  Timothy Hatcher  <timothy@apple.com>
888
889         Adds a DataGrid object that is used for multi-column data
890         and can contain hierarchical content with disclosure arrows.
891         A lot of DataGrid was copied from treeoutline.js. This change
892         makes the database views use the DataGrid. It will later be
893         used by the ProfileView.
894
895         Reviewed by Adam Roben.
896
897         * page/inspector/DataGrid.js: Added. Most copied from treeoutline.js
898         and modified to work with table elements.
899         * page/inspector/DatabaseQueryView.js:
900         (WebInspector.DatabaseQueryView.prototype._queryFinished):
901         Call DatabasesPanel.dataGridForResult and adds the inline style to
902         the DataGrid element.
903         * page/inspector/DatabaseTableView.js:
904         (WebInspector.DatabaseTableView.prototype._queryFinished):
905         Call DatabasesPanel.dataGridForResult.
906         * page/inspector/DatabasesPanel.js:
907         (WebInspector.DatabasesPanel.prototype._tableForResult): Removed.
908         (WebInspector.DatabasesPanel.prototype.dataGridForResult): Added.
909         Similar to the previous _tableForResult function, but makes a DataGrid.
910         * page/inspector/inspector.css: Changes to the data-grid
911         style rules.
912         * WebCore.vcproj/WebCore.vcproj: Add DataGrid.js.
913         * page/inspector/WebKit.qrc: Ditto.
914         * page/inspector/inspector.html: Ditto.
915
916 2008-05-19  Kevin McCullough  <kmccullough@apple.com>
917
918         Reviewed by Adam.
919
920         -build fix.
921
922         * bindings/js/JSConsoleCustom.cpp:
923         (WebCore::JSConsole::profile):
924         * page/Console.cpp:
925         (WebCore::Console::profile):
926         * page/Console.h:
927         * page/Console.idl:
928
929 2008-05-19  Alp Toker  <alp@nuanti.com>
930
931         Reviewed by Maciej.
932
933         GTK+/soup fixes:
934
935         Remove the fragment part of the URL since the file backend doesn't
936         deal with it.
937
938         Fix a typo in the cleanup function.
939
940         * platform/network/soup/ResourceHandleSoup.cpp:
941         (WebCore::cleanupGioOperation):
942         (WebCore::ResourceHandle::startGio):
943
944 2008-05-19  Kevin McCullough  <kmccullough@apple.com>
945
946         Reviewed by Adam.
947
948         <rdar://problem/5770054> JavaScript profiler (10928)
949         - Send the executing context to the profiler so it can attribute time
950         correctly to parent functions when calling profile() and profileEnd()
951         while nested.
952
953         * page/Console.cpp:
954         (WebCore::Console::profile):
955         (WebCore::Console::profileEnd):
956         * page/Console.h:
957
958 2008-05-19  Alp Toker  <alp@nuanti.com>
959
960         Reviewed by Anders and Beth.
961
962         http://bugs.webkit.org/show_bug.cgi?id=16495
963         [GTK] Accessibility support with ATK/AT-SPI
964
965         Initial ATK/AT-SPI accessibility support for the GTK+ port.
966
967         * GNUmakefile.am:
968         * page/AccessibilityObject.cpp:
969         (WebCore::AccessibilityObject::AccessibilityObject):
970         (WebCore::AccessibilityObject::detach):
971         * page/AccessibilityObject.h:
972         * page/gtk/AXObjectCacheAtk.cpp: Added.
973         (WebCore::AXObjectCache::detachWrapper):
974         (WebCore::AXObjectCache::attachWrapper):
975         (WebCore::AXObjectCache::postNotification):
976         (WebCore::AXObjectCache::postNotificationToElement):
977         (WebCore::AXObjectCache::handleFocusedUIElementChanged):
978         * page/gtk/AccessibilityObjectWrapperAtk.cpp: Added.
979         (WebCore::):
980         (WebCore::AccessibilityObject::wrapper):
981         (WebCore::AccessibilityObject::setWrapper):
982         * page/gtk/AccessibilityObjectWrapperAtk.h: Added.
983
984 2008-05-19  Anders Carlsson  <andersca@apple.com>
985
986         Reviewed by Adam.
987
988         <rdar://problem/5946454>
989         Support navigator.onLine from HTML5.
990
991         Add Windows NetworkStateNotifier implementation using the IP Helper API.
992
993         * WebCore.vcproj/WebCore.vcproj:
994         * platform/network/NetworkStateNotifier.h:
995         (WebCore::updateState):
996         * platform/network/win/NetworkStateNotifierWin.cpp: Added.
997         (WebCore::NetworkStateNotifier::updateState):
998         (WebCore::NetworkStateNotifier::addressChanged):
999         (WebCore::NetworkStateNotifier::callAddressChanged):
1000         (WebCore::NetworkStateNotifier::addrChangeCallback):
1001         (WebCore::NetworkStateNotifier::registerForAddressChange):
1002         (WebCore::NetworkStateNotifier::NetworkStateNotifier):
1003
1004 2008-05-19  Steve Falkenburg  <sfalken@apple.com>
1005
1006         Disable C4273, C4565 for CSSGrammar.cpp, XPathGrammar.cpp to fix build.
1007         
1008         Reviewed by Adam Roben.
1009
1010         * WebCore.vcproj/WebCore.vcproj:
1011
1012 2008-05-19  Adam Roben  <aroben@apple.com>
1013
1014         Fix Bug 19065: Resources with a space in their URL don't get
1015         error/warning bubbles
1016
1017         <https://bugs.webkit.org/show_bug.cgi?id=19065>
1018
1019         Reviewed by Dan Bernstein.
1020
1021         Test: manual-tests/inspector/errors-with-space in-url.html
1022
1023         * manual-tests/inspector/errors-with-space in-url.html: Added.
1024         * page/Console.cpp:
1025         (WebCore::Console::error):
1026         (WebCore::Console::info):
1027         (WebCore::Console::log):
1028         (WebCore::Console::warn):
1029         Pass the raw URL to the Inspector, not the pretty URL, to match the
1030         URL that was used when initially telling the Inspector about this
1031         resource. We continue to pass the pretty URL to the ChromeClient for
1032         backwards compatibility.
1033
1034 2008-05-19  Stephanie Lewis  <slewis@apple.com>
1035
1036         Reviewed by Darin.
1037
1038         more fast teardown performance work, WebCore plumbing
1039
1040         * page/Chrome.cpp:
1041         (WebCore::Chrome::disableSuddenTermination):
1042         (WebCore::Chrome::enableSuddenTermination):
1043         (WebCore::ChromeClient::disableSuddenTermination):
1044         (WebCore::ChromeClient::enableSuddenTermination):
1045         * page/Chrome.h:
1046         * page/ChromeClient.h:
1047         * page/Page.cpp:
1048         (WebCore::Page::changePendingUnloadEventCount):
1049         (WebCore::Page::changePendingBeforeUnloadEventCount):
1050
1051 2008-05-19  Kuchhal  <kuchal@yahoo.com>
1052
1053         Reviewed by Justin.
1054
1055         <rdar://problem/5863412> Crash when Ctrl C is pressed after a series of specific mouse events (18506)
1056
1057         * editing/markup.cpp:
1058         (WebCore::createMarkup): Null check.
1059
1060 2008-05-19  Chris Fleizach  <cfleizach@apple.com>
1061
1062         Reviewed by Beth Dakin.
1063
1064         <rdar://problem/5912195> CrashTracer: [USER] 1 crash in Mail at -[AccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]
1065
1066         * page/mac/AccessibilityObjectWrapper.mm:
1067         (visiblePositionForTextMarker):
1068
1069 2008-05-19  Ada Chan  <adachan@apple.com>
1070
1071         Added CookieStorageWin.h/cpp, introducing methods to get/set the current CFHTTPCookieStorageRef.
1072         When setting cookies-related attributes in CFURLRequest, make sure we get them from the
1073         current CFHTTPCookieStorageRef.  Also, set the cookie storage in CFURLRequest.
1074
1075         Reviewed by Steve Falkenburg.
1076
1077         * WebCore.vcproj/WebCore.vcproj:
1078         * platform/network/cf/ResourceHandleCFNet.cpp:
1079         (WebCore::makeFinalRequest):
1080         * platform/network/cf/ResourceRequestCFNet.cpp:
1081         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1082         * platform/network/win/CookieJarCFNetWin.cpp:
1083         (WebCore::setCookies):
1084         (WebCore::cookies):
1085         (WebCore::cookiesEnabled):
1086         * platform/network/win/CookieStorageWin.cpp: Added.
1087         (WebCore::currentCookieStorage):
1088         (WebCore::setCurrentCookieStorage):
1089         * platform/network/win/CookieStorageWin.h: Added.
1090
1091 2008-05-19  Alexey Proskuryakov  <ap@webkit.org>
1092
1093         Reviewed by Darin.
1094
1095         http://bugs.webkit.org/show_bug.cgi?id=18308
1096         SVG Encoding error with fill attribute
1097
1098         This is caused by problems with data: URL loading. Besides what is fixed by this patch,
1099         I filed <rdar://problem/5845875> for CFNetwork.
1100
1101         While at it, fixed a related javascript: URL issue.
1102
1103         Tests: fast/loader/data-url-encoding-html.html
1104                fast/loader/data-url-encoding-svg.html
1105                fast/loader/javascript-url-encoding.html
1106
1107         * platform/KURL.cpp:
1108         (WebCore::KURL::parse): Fix a FIXME, use UTF-8 instead of dropping high bytes. This fixes
1109         javascript: URL handling.
1110         (WebCore::encodeRelativeString): Like mailto: URLs, data: ones are all UTF-8. Restructured
1111         the code to not search for "#" if both parts are to be encoded as UTF-8 anyway.
1112
1113 2008-05-19  Alexey Proskuryakov  <ap@webkit.org>
1114
1115         Reviewed by Darin.
1116
1117         https://bugs.webkit.org/show_bug.cgi?id=18421
1118         <rdar://problem/5857369> XMLHttpRequest does not properly encode & and < in outgoing messages
1119
1120         Test: http/tests/xmlhttprequest/serialize-document.html
1121
1122         * bindings/js/JSXMLHttpRequestCustom.cpp:
1123         (WebCore::JSXMLHttpRequest::send): Use createMarkup() instead of Document::toString().
1124
1125         * dom/Attr.cpp:
1126         * dom/Attr.h:
1127         * dom/Document.cpp:
1128         * dom/Document.h:
1129         * dom/DocumentFragment.cpp:
1130         * dom/DocumentFragment.h:
1131         * dom/Element.cpp:
1132         * dom/Element.h:
1133         * dom/Entity.cpp:
1134         * dom/Entity.h:
1135         * dom/EntityReference.cpp:
1136         * dom/EntityReference.h:
1137         * dom/Node.h:
1138         * dom/Text.cpp:
1139         * dom/Text.h:
1140         * html/HTMLElement.cpp:
1141         * html/HTMLElement.h:
1142         Removed most Node::toString() methods, which were massively wrong, and only used for
1143         XMLHttpRequest::send(). The remanining ones are still used in markup.cpp, but should probably
1144         be folded into it for consistency.
1145
1146 2008-05-19  Anders Carlsson  <andersca@apple.com>
1147
1148         Fix Windows build.
1149         
1150         * plugins/win/PluginViewWin.cpp:
1151         (WebCore::PluginView::userAgentStatic):
1152         (WebCore::PluginView::getValueStatic):
1153         (WebCore::PluginView::getValue):
1154
1155 2008-05-19  Chris Fleizach  <cfleizach@apple.com>
1156
1157         Reviewed by Darin Adler.
1158
1159         <rdar://problem/5935694> AX: crash in text marker range
1160
1161         * page/mac/AccessibilityObjectWrapper.mm:
1162         (textMarkerRangeFromMarkers):
1163
1164 2008-05-19  Darin Adler  <darin@apple.com>
1165
1166         - fix WebKit build
1167
1168         * WebCore.xcodeproj/project.pbxproj: Make CSSReflectionDirection.h "private" instead of "project".
1169
1170 2008-05-19  chris fleizach  <cfleizach@apple.com>
1171
1172         Reviewed by Darin Adler
1173
1174         <rdar://problem/5700830> VO: VoiceOver should fall back to title attr if form element is not labeled
1175
1176         * page/AccessibilityRenderObject.cpp:
1177         (WebCore::AccessibilityRenderObject::title):
1178
1179 2008-05-19  Darin Adler  <darin@apple.com>
1180
1181         Reviewed by Mitz.
1182
1183         - tweak CSSReflectValue, possibly fixing the leaks seen on the buildbot
1184
1185         * WebCore.vcproj/WebCore.vcproj: Added CSSReflectionDirection.h. 
1186         * WebCore.xcodeproj/project.pbxproj: Ditto.
1187         * css/CSSReflectionDirection.h: Added.
1188
1189         * css/CSSComputedStyleDeclaration.cpp:
1190         (WebCore::valueForReflection): Changed to use CSSReflectValue::create.
1191         * css/CSSParser.cpp:
1192         (WebCore::CSSParser::parseReflect): Ditto.
1193
1194         * css/CSSReflectValue.h: Added a create function. Got rid of the setter
1195         functions, which had const PassRefPtr& arguments -- those probably caused
1196         the leaks although I'm not exactly sure why. Made the contructor and all
1197         the data members private.
1198
1199         * rendering/style/RenderStyle.h: Changed to include CSSReflectionDirection.h
1200         instead of CSSReflectValue.h so we can tweak CSSReflectValue without
1201         recompiling the world.
1202
1203 2008-05-19  Holger Hans Peter Freyther  <zecke@selfish.org>
1204
1205         Rubber Stamped by Simon.
1206
1207         Enforce the WebKit Coding Style.
1208
1209         * plugins/PluginView.cpp:
1210         (WebCore::PluginView::load):
1211         (WebCore::PluginView::setValue):
1212         * plugins/gtk/PluginViewGtk.cpp:
1213         (WebCore::PluginView::setFocus):
1214         (WebCore::PluginView::show):
1215         (WebCore::PluginView::hide):
1216         (WebCore::PluginView::attachToWindow):
1217         (WebCore::PluginView::detachFromWindow):
1218         (WebCore::PluginView::getValueStatic):
1219         (WebCore::PluginView::getValue):
1220         * plugins/qt/PluginViewQt.cpp:
1221         (WebCore::PluginView::updateWindow):
1222         (WebCore::PluginView::detachFromWindow):
1223         (WebCore::PluginView::handlePostReadFile):
1224         (WebCore::PluginView::getValueStatic):
1225         (WebCore::PluginView::getValue):
1226
1227 2008-05-14  Marc Ordinas i Llopis  <marc.ordinasillopis@collabora.co.uk>
1228
1229         Reviewed by Holger.
1230
1231         https://bugs.webkit.org/show_bug.cgi?id=18882
1232         https://bugs.webkit.org/show_bug.cgi?id=18892
1233         Based also on work by Chris Lord.
1234         
1235         Provides support for NPAPI plugins that pass NULL as their instance
1236         info. There are two kinds:
1237         - Some call NPN_UserAgent and NPN_GetValue before a PluginView has
1238         been created. For those we provide static versions of those functions.
1239         - Others call NPN_* functions with a NULL instance inside NPP_*
1240         calls, for those we've added extra currentPluginView guards.
1241
1242         * plugins/PluginView.cpp: Add additional currentPluginView guards and
1243         some small style changes.
1244         (WebCore::PluginView::start):
1245         (WebCore::PluginView::performRequest):
1246         (WebCore::PluginView::bindingInstance):
1247         (WebCore::PluginView::handlePost):
1248         * plugins/PluginView.h: Added static versions of NPN_UserAgent and
1249         NPN_GetValue.
1250         * plugins/gtk/PluginViewGtk.cpp: Add additional currentPluginView
1251         guards and some small style changes.
1252         (WebCore::PluginView::setNPWindowRect):
1253         (WebCore::PluginView::stop):
1254         (WebCore::PluginView::userAgentStatic): Added to deal with plugins
1255         that query this before having a PluginView.
1256         (WebCore::PluginView::getValueStatic): Added to deal with plugins
1257         that call this before we have created a PluginView.
1258         (WebCore::PluginView::getValue): Moved some code to getValueStatic.
1259         (WebCore::PluginView::init):
1260         * plugins/npapi.cpp: Call PluginView::userAgentStatic
1261         and PluginView::getValueStatic if no PluginView is
1262         present.
1263         (NPN_UserAgent):
1264         (NPN_GetValue):
1265         * plugins/qt/PluginPackageQt.cpp:
1266         (WebCore::PluginPackage::fetchInfo): Corrected split args because ignoring
1267         empty entries crashed.
1268         (WebCore::PluginPackage::load): Resolve all symbols when loading plugins
1269         to protect against XPCOM dependencies.
1270         * plugins/qt/PluginViewQt.cpp: Add additional currentPluginView guards and
1271         some small style changes.
1272         (WebCore::PluginView::updateWindow):
1273         (WebCore::PluginView::setNPWindowRect):
1274         (WebCore::PluginView::stop):
1275         (WebCore::PluginView::userAgentStatic): Added to deal with plugins
1276         that query this before having a PluginView.
1277         (WebCore::PluginView::handlePostReadFile):
1278         (WebCore::PluginView::getValueStatic): Added to deal with plugins
1279         that call this before we have created a PluginView.
1280         (WebCore::PluginView::getValue): Moved some code to getValueStatic.
1281         (WebCore::PluginView::init): m_needsXEmbed init was moved to constructor.
1282
1283 2008-05-19  Alp Toker  <alp@nuanti.com>
1284
1285         GTK+ build fix on Mac. Conditionalize XP_UNIX use.
1286
1287         * plugins/gtk/PluginPackageGtk.cpp:
1288         (WebCore::PluginPackage::fetchInfo):
1289         (WebCore::PluginPackage::load):
1290         * plugins/gtk/PluginViewGtk.cpp:
1291
1292 2008-05-18  Chris Fleizach  <cfleizach@apple.com>
1293
1294         Reviewed by Darin Adler
1295
1296         <rdar://problem/5942076> WebKit can no longer find URL links with VoiceOVer-U command (19100)
1297
1298         * page/AccessibilityObject.h:
1299
1300 2008-05-18  Darin Adler  <darin@apple.com>
1301
1302         Reviewed by Sam.
1303
1304         - fix <rdar://problem/5943569> crash due to stale ownerNode pointer
1305
1306         Test: fast/dom/StyleSheet/ownerNode-lifetime.html
1307
1308         * bindings/js/JSStyleSheetCustom.cpp:
1309         (WebCore::JSStyleSheet::mark): Added code to mark ownerNode. Includes a comment about how
1310         it would be even better to solve this in the DOM rather than just in the JavaScript binding.
1311
1312         * css/StyleSheet.idl: Added CustomMarkFunction attribute.
1313
1314 2008-05-18  Brady Eidson  <beidson@apple.com>
1315
1316         Reviewed by Sam Weinig
1317
1318         Fix for https://bugs.webkit.org/show_bug.cgi?id=19111
1319         Allow `delete storage.itemName` syntax as an alias for `storage.removeItem("itemName")`
1320
1321         Tests: storage/domstorage/localstorage/delete-removal.html
1322                storage/domstorage/sessionstorage/delete-removal.html
1323
1324         * bindings/js/JSStorageCustom.cpp:
1325         (WebCore::JSStorage::deleteProperty): Only do the delete for non-built in properties
1326         * storage/Storage.idl:
1327
1328 2008-05-17  Sam Weinig  <sam@webkit.org>
1329
1330         Reviewed by Mark Rowe.
1331
1332         Re-factor core setRequestHeader logic into setRequestHeaderInternal.
1333
1334         * xml/XMLHttpRequest.cpp:
1335         (WebCore::XMLHttpRequest::sameOriginRequest):
1336         (WebCore::XMLHttpRequest::setRequestHeader):
1337         (WebCore::XMLHttpRequest::setRequestHeaderInternal):
1338         * xml/XMLHttpRequest.h:
1339
1340 2008-05-17  Sam Weinig  <sam@webkit.org>
1341
1342         Reviewed by Mark Rowe.
1343
1344         Differentiate between cancelation errors and generic network error in XHR.
1345
1346         * loader/FrameLoader.cpp:
1347         (WebCore::FrameLoader::requestFromDelegate):
1348         (WebCore::FrameLoader::cancelledError):
1349         * platform/network/ResourceErrorBase.h:
1350         (WebCore::ResourceErrorBase::setIsCancelation):
1351         (WebCore::ResourceErrorBase::isCancelation):
1352         (WebCore::ResourceErrorBase::ResourceErrorBase):
1353         Add state that differentiates between errors created by cancelation and those made
1354         by all other generic network errors as this differentiation is needed by some specs.
1355
1356         * xml/XMLHttpRequest.cpp:
1357         (WebCore::XMLHttpRequest::open):
1358         (WebCore::XMLHttpRequest::loadRequestSynchronously):
1359         (WebCore::XMLHttpRequest::clearResponseEntityBody):
1360         (WebCore::XMLHttpRequest::genericError):
1361         (WebCore::XMLHttpRequest::networkError):
1362         (WebCore::XMLHttpRequest::abortError):
1363         (WebCore::XMLHttpRequest::didFail):
1364         * xml/XMLHttpRequest.h:
1365         * xml/XMLHttpRequestException.h:
1366         (WebCore::XMLHttpRequestException::):
1367         * xml/XMLHttpRequestException.idl:
1368         Add ABORT_ERR. This error cannot be raised with the current WebKit architecture
1369         as it requires the ability to cancel a synchronous XHR, which we cannot currently
1370         do.  It may be possible in the future though.
1371
1372 2008-05-17  Mark Rowe  <mrowe@apple.com>
1373
1374         Reviewed by Sam Weinig.
1375
1376         Including wtf/Platform.h or using any of the macros it defines in headers that may be
1377         included from outside of the WebKit project causes any project using those headers to
1378         fail to build.
1379
1380         * page/mac/WebDashboardRegion.h:
1381
1382 2008-05-17  Sam Weinig  <sam@webkit.org>
1383
1384         Reviewed by Brady Eidson.
1385
1386         Re-factor send() logic a little to make adding cross-site requests easier.
1387
1388         * xml/XMLHttpRequest.cpp:
1389         (WebCore::XMLHttpRequest::send):
1390         (WebCore::XMLHttpRequest::sameOriginRequest):
1391         (WebCore::XMLHttpRequest::loadRequestSynchronously):
1392         (WebCore::XMLHttpRequest::loadRequestAsynchronously):
1393         * xml/XMLHttpRequest.h:
1394
1395 2008-05-16  Anders Carlsson  <andersca@apple.com>
1396
1397         Reviewed by Mitz.
1398
1399         Copy appcache headers.
1400         
1401         * WebCore.vcproj/WebCore.vcproj:
1402
1403 2008-05-16  Antti Koivisto  <antti@apple.com>
1404
1405         Reviewed by Anders.
1406         
1407         Fix <rdar://problem/5934400> 
1408         Movie controller does not update on first load of http://www.apple.com/getamac/ads/
1409         
1410         The issue is that we execute scripts while there are still pending stylesheet loads.
1411         If the script depends on a stylesheet having been applied it may fail.
1412         
1413         This will make external script execution block on external stylesheet loads. A full
1414         fix (as discussed with Hyatt) will also need to block inline script execution.
1415
1416         Test: http/tests/local/stylesheet-and-script-load-order-http.html
1417
1418         * html/HTMLTokenizer.cpp:
1419         (WebCore::HTMLTokenizer::notifyFinished):
1420
1421 2008-05-16  chris fleizach  <cfleizach@apple.com>
1422
1423         Reviewed by Jon Honeycutt
1424
1425         <rdar://problem/5582483> Mail compose area needs to allow AXValue to be settable
1426
1427         * page/AccessibilityRenderObject.cpp:
1428         (WebCore::AccessibilityRenderObject::isReadOnly):
1429         (WebCore::AccessibilityRenderObject::canSetValueAttribute):
1430
1431 2008-05-16  Stephanie Lewis  <slewis@apple.com>
1432
1433         Reviewed by Maciej.
1434
1435         track onbeforeunlaod event counts. Pretty much identical to unload event tracking.
1436         Also rename methods from onunload tracking to be more clear.
1437
1438         increment/decrement event counts when onunload and onbeforeunload events are added/removed
1439         * dom/Document.cpp:
1440         (WebCore::Document::removeHTMLWindowEventListener):
1441         (WebCore::Document::addWindowEventListener):
1442         (WebCore::Document::removeWindowEventListener):
1443         (WebCore::Document::addPendingFrameUnloadEventCount):
1444         (WebCore::Document::removePendingFrameUnloadEventCount):
1445         (WebCore::Document::addPendingFrameBeforeUnloadEventCount):
1446         (WebCore::Document::removePendingFrameBeforeUnloadEventCount):
1447         * dom/Document.h:
1448         
1449         clear onunload count after unload events are dispatched
1450         * loader/FrameLoader.cpp:
1451         (WebCore::FrameLoader::stopLoading):
1452
1453         track onunload and onbeforeunload event counts for each frame
1454         * page/EventHandler.cpp:
1455         (WebCore::EventHandler::EventHandler):
1456         (WebCore::EventHandler::addPendingFrameUnloadEventCount):
1457         (WebCore::EventHandler::removePendingFrameUnloadEventCount):
1458         (WebCore::EventHandler::clearPendingFrameUnloadEventCount):
1459         (WebCore::EventHandler::pendingFrameBeforeUnloadEventCount):
1460         (WebCore::EventHandler::addPendingFrameBeforeUnloadEventCount):
1461         (WebCore::EventHandler::removePendingFrameBeforeUnloadEventCount):
1462         (WebCore::EventHandler::clearPendingFrameBeforeUnloadEventCount):
1463         * page/EventHandler.h:
1464         
1465         clear unbeforeunload count after unbeforeunload events are detached
1466         * page/Frame.cpp:
1467         (WebCore::Frame::shouldClose):
1468
1469         track total event count at page level
1470         * page/Page.cpp:
1471         (WebCore::Page::Page):
1472         (WebCore::Page::changePendingUnloadEventCount):
1473         (WebCore::Page::pendingBeforeUnloadEventCount):
1474         (WebCore::Page::changePendingBeforeUnloadEventCount):
1475         * page/Page.h:
1476
1477 2008-05-16  Anders Carlsson  <andersca@apple.com>
1478
1479         Reviewed by Mitz.
1480
1481         <rdar://problem/5787788>
1482         REGRESSION: fast/loader/xmlhttprequest-missing-file-exception.html fails on Windows.
1483         
1484         Replicate the Mac behavior when a sync load fails.
1485         
1486         * platform/network/cf/ResourceHandleCFNet.cpp:
1487         (WebCore::ResourceHandle::loadResourceSynchronously):
1488
1489 2008-05-16  Anders Carlsson  <andersca@apple.com>
1490
1491         Reviewed by Brady.
1492
1493         Parse and set the headers on the response.
1494
1495         * loader/appcache/ApplicationCacheStorage.cpp:
1496         (WebCore::ApplicationCacheStorage::store):
1497         (WebCore::parseHeader):
1498         (WebCore::parseHeaders):
1499         (WebCore::ApplicationCacheStorage::loadCache):
1500
1501 2008-05-16  Timothy Hatcher  <timothy@apple.com>
1502
1503         Adds the "this" object to the Local scope section of the
1504         Scope Variables pane.
1505
1506         <rdar://problem/5774773> Web Inspector doesn't show the "this"
1507         object in its variables list (10438)
1508
1509         Reviewed by Oliver Hunt.
1510
1511         * bindings/js/JSJavaScriptCallFrameCustom.cpp:
1512         (WebCore::JSJavaScriptCallFrame::thisObject): Returns the thisObject
1513         of the JavaScriptCallFrame impl. Returns jsNull if the impl is invalid.
1514         * page/JavaScriptCallFrame.cpp:
1515         (WebCore::JavaScriptCallFrame::thisObject): Return the thisValue from
1516         the ExecState. Return 0 if m_exec is null.
1517         * page/JavaScriptCallFrame.h:
1518         * page/JavaScriptCallFrame.idl: Add thisObject.
1519         * page/inspector/ObjectPropertiesSection.js:
1520         (WebInspector.ObjectPropertiesSection): Adds two new arguments.
1521         The ignoreHasOwnProperty tells the section to show all properties,
1522         including inherited ones. And extraProperties is an object of
1523         additional properties to show.
1524         (WebInspector.ObjectPropertiesSection.prototype): Honor the
1525         extraProperties and ignoreHasOwnProperty properties.
1526         * page/inspector/ScopeChainSidebarPane.js:
1527         (WebInspector.ScopeChainSidebarPane.prototype.update): Add a this
1528         property to an extra object that is passed to the ObjectPropertiesSection.
1529         Also pass true for ignoreHasOwnProperty since we want to show all properties.
1530
1531 2008-05-16  Anders Carlsson  <andersca@apple.com>
1532
1533         Reviewed by Brady.
1534
1535         Add mimeType and textEncodingName to the resource table.
1536         
1537         * loader/appcache/ApplicationCacheStorage.cpp:
1538         (WebCore::ApplicationCacheStorage::openDatabase):
1539         (WebCore::ApplicationCacheStorage::store):
1540         (WebCore::ApplicationCacheStorage::loadCache):
1541
1542 2008-05-16  Kevin McCullough  <kmccullough@apple.com>
1543
1544         Reviewed by Tim.
1545
1546         <rdar://problem/5770054> JavaScript profiler (10928)
1547         Use a Vector instead of a Deque since we don't use the extra capabilities
1548         of the Deque.
1549
1550         * page/JavaScriptProfileNode.cpp:
1551         (WebCore::getChildren):
1552         (WebCore::toJS):
1553
1554 2008-05-16  Anders Carlsson  <andersca@apple.com>
1555
1556         Reviewed by Brady.
1557
1558         Add a version table to the database.
1559
1560         * loader/appcache/ApplicationCacheStorage.cpp:
1561         (WebCore::ApplicationCacheStorage::verifySchemaVersion):
1562         (WebCore::ApplicationCacheStorage::openDatabase):
1563         * loader/appcache/ApplicationCacheStorage.h:
1564
1565 2008-05-16  Timothy Hatcher  <timothy@apple.com>
1566
1567         Adds the ability to evaluate expressions in the local scope
1568         of the selected call frame.
1569
1570         https://bugs.webkit.org/show_bug.cgi?id=19052
1571
1572         Reviewed by Geoff Garen.
1573
1574         * bindings/js/JSJavaScriptCallFrameCustom.cpp:
1575         (WebCore::JSJavaScriptCallFrame::evaluate): Pass the exception
1576         from evaluate to the calling ExecState.
1577         * page/JavaScriptCallFrame.cpp:
1578         (WebCore::JavaScriptCallFrame::evaluate): Added an exception out
1579         argument. Simplified the code by calling KJS:eval directly.
1580         * page/JavaScriptCallFrame.h: Change evalutate to take an exception
1581         out argument.
1582         * page/inspector/Console.js: Check if the debugger is paused and
1583         call evaluateInSelectedCallFrame on the Scripts panel.
1584         * page/inspector/ScriptsPanel.js: Added a paused getter and
1585         evaluateInSelectedCallFrame which does the evaluation and updates
1586         the scope variables pane afterwards.
1587
1588 2008-05-16  Timothy Hatcher  <timothy@apple.com>
1589
1590         Fixed the bug where the Inspector node highlight would not show
1591         in the correct place for nodes in frames.
1592
1593         <rdar://problem/5712834> Elements in iframes are highlighted incorrectly (14408)
1594
1595         Reviewed by John Sullivan.
1596
1597         * page/InspectorController.cpp:
1598         (WebCore::convertFromFrameToMainFrame): Helper function to convert
1599         IntRect coordinates from one frame to the main frame.
1600         (WebCore::InspectorController::drawNodeHighlight): Call the
1601         convertFromFrameToMainFrame helper for all the rects we get from
1602         the node since they are in the owner frame's coordinate space.
1603
1604 2008-05-16  Julien Chaffraix  <jchaffraix@webkit.org>
1605
1606         Reviewed by Eric.
1607
1608         Preparatory work for bug 9191: JS*ElementWrapperFactory should be autogenerated
1609
1610         Make video tags use a header guard so that make_names.pl for factory generation.
1611
1612         - Add video tag guard in HTMLTagNames.in & give an extraDefines parameter to make_names.pl
1613         when generating HTMLNames.
1614
1615         - Modify the different build systems to accomodate the new parameter.
1616
1617         - Small make_names.pl clean up (mainly code generated coding style issue).
1618
1619         * DerivedSources.make: Add HTML_FLAGS and pass it to make_names.pl
1620         if it is defined (similar to SVG) 
1621
1622         * GNUmakefile.am: Add HTML_FEATURES & HTML_FLAGS and pass it to
1623         make_names.pl if HTML_FLAGS is defined.
1624
1625         * WebCore.pro: Pass $${DEFINES} to make_names.pl.
1626
1627         * dom/make_names.pl: 
1628         * html/HTMLElement.cpp:
1629         (WebCore::inlineTagList): Add ENABLE(VIDEO) guard.
1630         * html/HTMLTagNames.in: Ditto.
1631
1632 2008-05-16  Anders Carlsson  <andersca@apple.com>
1633
1634         Reviewed by Mitz.
1635
1636         Fire progress events.
1637         
1638         * loader/appcache/ApplicationCacheGroup.cpp:
1639         (WebCore::ApplicationCacheGroup::startLoadingEntry):
1640
1641 2008-05-16  Anders Carlsson  <andersca@apple.com>
1642
1643         Reviewed by John.
1644
1645         Handle the case where the main resource load is cancelled while the cache attempt is in progress.
1646         
1647         * loader/DocumentLoader.cpp:
1648         (WebCore::DocumentLoader::mainReceivedError):
1649         Tell the group that the main resource failed to load.
1650         
1651         * loader/appcache/ApplicationCacheGroup.cpp:
1652         (WebCore::ApplicationCacheGroup::failedLoadingMainResource):
1653         Call cacheUpdateFailed.
1654         
1655         (WebCore::ApplicationCacheGroup::cacheUpdateFailed):
1656         Stop loading if the update failed.
1657         
1658         * loader/appcache/ApplicationCacheGroup.h:
1659
1660 2008-05-16  Chris Fleizach  <cfleizach@apple.com>
1661
1662         Reviewed by Alice Liu
1663
1664         <rdar://problem/5710317> REGRESSION:Selecting ranges of text should be possible using the keyboard (15310)
1665
1666         * WebCore.base.exp:
1667         * editing/VisiblePosition.cpp:
1668         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
1669         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
1670         * page/AXObjectCache.cpp:
1671         * page/AXObjectCache.h:
1672         (WebCore::AXObjectCache::enableEnhancedUserInterfaceAccessibility):
1673         (WebCore::AXObjectCache::accessibilityEnabled):
1674         (WebCore::AXObjectCache::accessibilityEnhancedUserInterfaceEnabled):
1675         * page/AccessibilityRenderObject.cpp:
1676         (WebCore::AccessibilityRenderObject::visiblePositionRange):
1677         (WebCore::AccessibilityRenderObject::doSetAXSelectedTextMarkerRange):
1678         (WebCore::AccessibilityRenderObject::addChildren):
1679         (WebCore::AccessibilityRenderObject::actionVerb):
1680         * page/EventHandler.cpp:
1681         (WebCore::EventHandler::handleKeyboardSelectionMovement):
1682         (WebCore::EventHandler::defaultKeyboardEventHandler):
1683         * page/EventHandler.h:
1684
1685 2008-05-15  Ariya Hidayat  <ariya.hidayat@trolltech.com>
1686
1687         Reviewed by Simon.
1688
1689         Since WebKitGtk is fully using autotools now, clean-up the .pro/.pri files
1690         from gtk-port.
1691
1692         * WebCore.pro:
1693
1694 2008-05-16  Simon Hausmann  <hausmann@webkit.org>
1695
1696         Fix the Gtk build.
1697
1698         * GNUmakefile.am: Added rendering/style to the include paths.
1699
1700 2008-05-16  Simon Hausmann  <hausmann@webkit.org>
1701
1702         Fix the Qt build.
1703
1704         * WebCore.pro: Added rendering/style to the include paths
1705         * page/AXObjectCache.cpp:
1706         (WebCore::AXObjectCache::handleActiveDescendantChanged): Don't compile
1707         this method unless a17n is enabled.
1708
1709 2008-05-15  Rob Buis  <buis@kde.org>
1710
1711         Reviewed by Dave Hyatt.
1712
1713         https://bugs.webkit.org/show_bug.cgi?id=17433
1714         getComputedStyle() -> clip returns empty string
1715
1716         Make getComputedStyle return a shape value for clip
1717         if it is set.
1718
1719         Tests: fast/css/getPropertyValue-clip.html
1720
1721         * css/CSSComputedStyleDeclaration.cpp:
1722         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1723
1724 2008-05-15  Kevin Ollivier  <kevino@theolliviers.com>
1725
1726         wx build fix. Add rendering/style to includes dir.
1727
1728         * webcore-base.bkl:
1729
1730 2008-05-15  Alice Liu  <alice.liu@apple.com>
1731
1732         Reviewed by Beth Dakin.
1733
1734         Fixed <rdar://problem/5882283> Implement ARIA aria-activedescendant
1735         Also added support for aria roles listbox and option, and aria-selected, 
1736         and aria-multiselectable for listboxes
1737
1738         * dom/Element.cpp:
1739         (WebCore::Element::attributeChanged):
1740         * dom/Element.h:
1741         * dom/StyledElement.cpp:
1742         (WebCore::StyledElement::attributeChanged):
1743         * html/HTMLAttributeNames.in:
1744         * page/AXObjectCache.cpp:
1745         (WebCore::AXObjectCache::handleActiveDescendantChanged):
1746         * page/AXObjectCache.h:
1747         (WebCore::AXObjectCache::accessibilityEnabled):
1748         (WebCore::AXObjectCache::handleActiveDescendantChanged):
1749         * page/AccessibilityListBox.cpp:
1750         (WebCore::AccessibilityListBox::selectedChildren):
1751         (WebCore::AccessibilityListBox::visibleChildren):
1752         * page/AccessibilityListBox.h:
1753         * page/AccessibilityListBoxOption.h:
1754         (WebCore::AccessibilityListBoxOption::selectedChildren):
1755         (WebCore::AccessibilityListBoxOption::visibleChildren):
1756         * page/AccessibilityObject.cpp:
1757         * page/AccessibilityObject.h:
1758         (WebCore::AccessibilityObject::isListBox):
1759         (WebCore::AccessibilityObject::shouldFocusActiveDescendant):
1760         (WebCore::AccessibilityObject::activeDescendant):
1761         (WebCore::AccessibilityObject::handleActiveDescendantChanged):
1762         * page/AccessibilityRenderObject.cpp:
1763         (WebCore::AccessibilityRenderObject::title):
1764         (WebCore::AccessibilityRenderObject::accessibilityShouldUseUniqueId):
1765         (WebCore::AccessibilityRenderObject::focusedUIElement):
1766         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant):
1767         (WebCore::AccessibilityRenderObject::activeDescendant):
1768         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
1769         (WebCore::RoleEntry::):
1770         (WebCore::AccessibilityRenderObject::ariaRoleAttribute):
1771         (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
1772         (WebCore::AccessibilityRenderObject::selectedChildren):
1773         (WebCore::AccessibilityRenderObject::ariaListboxVisibleChildren):
1774         (WebCore::AccessibilityRenderObject::visibleChildren):
1775         * page/AccessibilityRenderObject.h:
1776         (WebCore::AccessibilityRenderObject::isDetached):
1777         * page/mac/AccessibilityObjectWrapper.mm:
1778         (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
1779
1780 2008-05-15  Timothy Hatcher  <timothy@apple.com>
1781
1782         Adds an error and warning count indicator at the bottom right in the
1783         Inspector's status bar.
1784
1785         https://bugs.webkit.org/show_bug.cgi?id=18650
1786
1787         Initial implementation by Adam Roben.
1788         Reviewed by Sam Weinig.
1789
1790         Test: manual-tests/inspector/error-warning-count.html
1791
1792         * English.lproj/localizedStrings.js: Added new strings.
1793         * manual-tests/inspector/error-warning-count.html: Added.
1794         * page/inspector/Console.js:
1795         (WebInspector.Console.prototype.show): Don't do anything if visible.
1796         (WebInspector.Console.prototype.hide): Don't do anything if hidden.
1797         Temporally set properties and classes to mimic the post-animation
1798         values so panels like Elements in their updateStatusBarItems call will
1799         size things to fit the final location. 
1800         * page/inspector/ElementsPanel.js:
1801         (WebInspector.ElementsPanel.prototype.updateBreadcrumbSizes):
1802         Account for the #error-warning-count width when sizing breadcrumbs. 
1803         * page/inspector/Resource.js:
1804         (WebInspector.Resource.prototype.set errors): Update the global error count.
1805         (WebInspector.Resource.prototype.set warnings): Update the global warning count.
1806         * page/inspector/inspector.css: Make .hidden's display property
1807         !important to ensure things really hide, and added styling for the new
1808         #error-warning-count element.
1809         * page/inspector/inspector.html: Added an #error-warning-count div
1810         in the #anchored-status-bar-items div.
1811         * page/inspector/inspector.js:
1812         (WebInspector.get errors): Added.
1813         (WebInspector.set errors): Added. Calls _updateErrorAndWarningCounts.
1814         (WebInspector.get warnings): Added.
1815         (WebInspector.set warnings): Added. Calls _updateErrorAndWarningCounts.
1816         (WebInspector._updateErrorAndWarningCounts): Added. Update the
1817         #error-warning-count div with the current error/warning count.
1818         (WebInspector.loaded): Add a click event listener to the
1819         #error-warning-count element that will show the Console. Call
1820         _updateErrorAndWarningCounts to display the initial error/warning counts.
1821
1822 2008-05-15  Timothy Hatcher  <timothy@apple.com>
1823
1824         Fixes a bug in the view source parsing of text within <script>,
1825         <style>, <xmp>, <textarea> and other special tags. The text was
1826         being parsed as HTML and would be syntax highlighted if a "<"
1827         was encountered.
1828
1829         <rdar://problem/5790805> Inspector's source view missing some words,
1830         doubles others in JS source in <script> tag (17752)
1831
1832         Reviewed by Dave Hyatt.
1833
1834         Added test: fast/frames/viewsource-plain-text-tags.html
1835
1836         * html/HTMLTokenizer.cpp:
1837         (WebCore::HTMLTokenizer::scriptHandler): Set scriptCodeSize and
1838         scriptCodeResync to zero before an early return in view source mode.
1839         This was causing text from a previous script tag to show up in
1840         then next style tag.
1841         (WebCore::HTMLTokenizer::parseTag): Enter an if block in view source
1842         mode even if n is null. The n is property guarded in other places
1843         and not used by view source mode. Removes a redundant null check on n.
1844         Add a new null check of n before setting scriptSrcCharset. Other code
1845         in HTMLTokenizer is already guarded for this code path. 
1846
1847 2008-05-15  Timothy Hatcher  <timothy@apple.com>
1848
1849         Changes the Web Inspector node highlight to be less aggressive
1850         and only highlight when hovering over the selected node in the DOM
1851         tree or breadcrumbs. You can highlight on hover for any node if
1852         you hold down the Alt/Option key while hovering.
1853
1854         Reviewed by Kevin McCullough.
1855
1856         * page/inspector/ElementsPanel.js:
1857         * page/inspector/inspector.js:
1858
1859 2008-05-15  Stephanie Lewis  <slewis@apple.com>
1860
1861         Fix windows build
1862
1863         * loader/FrameLoader.cpp:
1864         (WebCore::FrameLoader::stopLoading):
1865
1866 2008-05-15  Stephanie Lewis  <slewis@apple.com>
1867
1868         Reviewed by Anders.
1869         
1870         export a symbol needed for fast teardown
1871
1872         * WebCore.base.exp:
1873
1874 2008-05-15  Stephanie Lewis  <slewis@apple.com>
1875
1876         Reviewed by Anders.
1877
1878         Keep track on pending unload event counts
1879
1880         No change in behavior so no new tests, but I am dumping the 
1881         unload event count to track the new variable.
1882
1883         * WebCore.base.exp:
1884
1885         increment/decrement the count when an event is added/removed
1886         * dom/Document.cpp:
1887         (WebCore::Document::removeHTMLWindowEventListener):
1888         (WebCore::Document::addWindowEventListener):
1889         (WebCore::Document::removeWindowEventListener):
1890         (WebCore::Document::setPendingFrameUnloadEventCount):
1891         * dom/Document.h:
1892
1893         set the count to 0 for each frame after the unload event has been dispatched
1894         * loader/FrameLoader.cpp:
1895         (WebCore::FrameLoader::stopLoading):
1896
1897         keep track of the number of pending unload events for the eventHandler's frame
1898         * page/EventHandler.cpp:
1899         (WebCore::EventHandler::EventHandler):
1900        (WebCore::EventHandler::pendingFrameUnloadEventCount):
1901         (WebCore::EventHandler::setPendingFrameUnloadEventCount):
1902         * page/EventHandler.h:
1903
1904         keep track of the total number of pending unload events for all of the frames
1905         * page/Page.cpp:
1906         (WebCore::Page::Page):
1907         (WebCore::Page::pendingUnloadEventCount):
1908         (WebCore::Page::setPendingUnloadEventCount):
1909         * page/Page.h:
1910
1911 2008-05-15  Steve Falkenburg  <sfalken@apple.com>
1912
1913         Fix build.
1914
1915         * WebCore.vcproj/WebCore.vcproj:
1916
1917 2008-05-15  Steve Falkenburg  <sfalken@apple.com>
1918
1919         Fix build.
1920
1921         * WebCore.vcproj/WebCore.vcproj:
1922
1923 2008-05-15  Steve Falkenburg  <sfalken@apple.com>
1924
1925         Fix build.
1926
1927         * WebCore.vcproj/WebCore.vcproj:
1928
1929 2008-05-15  David Kilzer  <ddkilzer@apple.com>
1930
1931         Bug 19085: font-family: initial sets font-family differently than font: initial
1932
1933         <https://bugs.webkit.org/show_bug.cgi?id=19085>
1934         <rdar://problem/5939391>
1935
1936         Reviewed by David Hyatt.
1937
1938         Test: fast/css/font-family-initial.html
1939
1940         * css/CSSStyleSelector.cpp:
1941         (WebCore::CSSStyleSelector::applyProperty): Don't set family if first
1942         family of initial font description is empty.
1943
1944 2008-05-15  David Hyatt  <hyatt@apple.com>
1945
1946         Move RenderStyle into a new subdirectory, rendering/style/, in preparation for breaking it up into
1947         a bunch of smaller files.
1948
1949         Reviewed by Dan Bernstein
1950
1951         * GNUmakefile.am:
1952         * WebCore.pro:
1953         * WebCore.vcproj/WebCore.vcproj:
1954         * WebCore.xcodeproj/project.pbxproj:
1955         * WebCoreSources.bkl:
1956         * rendering/RenderStyle.cpp: Removed.
1957         * rendering/RenderStyle.h: Removed.
1958         * rendering/style: Added.
1959         * rendering/style/RenderStyle.cpp: Copied from rendering/RenderStyle.cpp.
1960         * rendering/style/RenderStyle.h: Copied from rendering/RenderStyle.h.
1961
1962 2008-05-15  David Kilzer  <ddkilzer@apple.com>
1963
1964         Fix leaks when stopping a page from loading
1965
1966         Patch suggested by Antti.  Reviewed by Antti.
1967
1968         * loader/DocLoader.cpp:
1969         (WebCore::DocLoader::clearPreloads): If a resource is in m_preloads but
1970         never made it to the cache, delete it to prevent it from leaking.
1971
1972 2008-05-15  Julien Chaffraix  <jchaffraix@webkit.org>
1973
1974         Reviewed by Darin.
1975
1976         https://bugs.webkit.org/show_bug.cgi?id=13942
1977         ASSERTION FAILED: !attrName.contains('/') in HTMLTokenizer.cpp:132 when loading http://bamanzi.blogeden.cn/
1978
1979         In HTML, when an attribute was null (for example when we parse '="somevalue"'
1980         (attribute forgotten or there is a space between the attribute and the '=')),
1981         the fallback was to assign the value to the attribute. However if the value was
1982         a url or did contain a '/', we would trigger the assertion.
1983
1984         To avoid that, we check the value before assigning it now and do not assign it
1985         if it means adding a '/'.
1986
1987         Test: fast/parser/assertion-empty-attribute.html
1988
1989         * html/HTMLTokenizer.cpp:
1990         (WebCore::HTMLTokenizer::parseTag): Add check for '/' in value before
1991         assigning it to an attribute when the attribute is null.
1992
1993 2008-05-15  Kevin Ollivier  <kevino@theolliviers.com>
1994
1995         wx build fix for recent breakages. Add EventLoopWx.cpp, update the Bakefiles,
1996         and add stubs for new Plugins functions. Also move plugin functions outside of
1997         TemporaryLinkStubs.cpp so that they are more noticeable.
1998
1999         * WebCoreSources.bkl:
2000         * platform/wx/EventLoopWx.cpp: Added.
2001         (WebCore::EventLoop::cycle):
2002         * platform/wx/TemporaryLinkStubs.cpp:
2003         * plugins/wx: Added.
2004         * plugins/wx/PluginDataWx.cpp: Added.
2005         (WebCore::PluginData::initPlugins):
2006         (WebCore::PluginData::refresh):
2007         * plugins/wx/PluginDatabaseWx.cpp: Added.
2008         (WebCore::PluginDatabase::getPluginPathsInDirectories):
2009         (WebCore::PluginDatabase::defaultPluginDirectories):
2010         (WebCore::PluginDatabase::isPreferredPluginDirectory):
2011         * plugins/wx/PluginPackageWx.cpp: Added.
2012         (WebCore::PluginPackage::determineQuirks):
2013         (WebCore::PluginPackage::fetchInfo):
2014         (WebCore::PluginPackage::load):
2015         (WebCore::PluginPackage::hash):
2016         (WebCore::PluginPackage::equal):
2017         (WebCore::PluginPackage::compareFileVersion):
2018         * plugins/wx/PluginViewWx.cpp: Added.
2019         (WebCore::PluginView::updateWindow):
2020         (WebCore::PluginView::setFocus):
2021         (WebCore::PluginView::show):
2022         (WebCore::PluginView::hide):
2023         (WebCore::PluginView::paint):
2024         (WebCore::PluginView::handleKeyboardEvent):
2025         (WebCore::PluginView::handleMouseEvent):
2026         (WebCore::PluginView::setParent):
2027         (WebCore::PluginView::setNPWindowRect):
2028         (WebCore::PluginView::attachToWindow):
2029         (WebCore::PluginView::detachFromWindow):
2030         (WebCore::PluginView::stop):
2031         (WebCore::PluginView::userAgent):
2032         (WebCore::PluginView::handlePostReadFile):
2033         (WebCore::PluginView::getValue):
2034         (WebCore::PluginView::invalidateRect):
2035         (WebCore::PluginView::invalidateRegion):
2036         (WebCore::PluginView::forceRedraw):
2037         (WebCore::PluginView::~PluginView):
2038         (WebCore::PluginView::init):
2039         * webcore-wx.bkl:
2040
2041 2008-05-15  Adam Treat  <treat@kde.org>
2042
2043         Reviewed by Simon.
2044
2045         Don't try to setCompositionMode for devices that do not support PorterDuff
2046
2047         * platform/graphics/qt/GraphicsContextQt.cpp:
2048         (WebCore::TransparencyLayer::TransparencyLayer):
2049         (WebCore::GraphicsContext::strokeRect):
2050         (WebCore::GraphicsContext::clip):
2051
2052 2008-05-15  Adele Peterson  <adele@apple.com>
2053
2054         Reviewed and landed by Alexey.
2055
2056         Use TextIterator in +[NSAttributedString _web_attributedStringFromRange:].
2057
2058         * WebCore.base.exp: Exported TextIterator methods.
2059
2060 2008-05-15  Simon Hausmann  <hausmann@webkit.org>
2061
2062         Fix the Qt build by adding NetworkStateNotifier.cpp to the build.
2063
2064         * WebCore.pro:
2065
2066 2008-05-14  Dan Bernstein  <mitz@apple.com>
2067
2068         Reviewed by Mark Rowe.
2069
2070         - fix <rdar://problem/5907633> Memory corruption after closing a document that uses box-reflect
2071
2072         Test: fast/reflections/teardown-crash.html
2073
2074         * rendering/RenderLayer.cpp:
2075         (WebCore::RenderLayer::~RenderLayer): Changed to not call removeLayers()
2076         on the reflection if the document is being destroyed, because in that
2077         case the layer tree is not being maintained.
2078
2079 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
2080
2081         Reviewed by Tim.
2082
2083         <rdar://problem/5770054> JavaScript profiler (10928)
2084         - Expose the new Profiler functions to the WebInspector.
2085
2086         * page/JavaScriptProfileNode.cpp:
2087         (WebCore::getTotalPercent):
2088         (WebCore::getSelfPercent):
2089         (WebCore::ProfileNodeClass):
2090
2091 2008-05-14  Timothy Hatcher  <timothy@apple.com>
2092
2093         Fixes a crash in JavaScriptDebugServer::returnEvent when debugging
2094         code that contains an eval. This change makes stepping into eval
2095         code work as expected.
2096
2097         http://bugs.webkit.org/show_bug.cgi?id=19038
2098
2099         Reviewed by Kevin McCullough.
2100
2101         Tested with: manual-tests/inspector/returnEvent-crash.html
2102
2103         * manual-tests/inspector/returnEvent-crash.html: Added.
2104         * page/JavaScriptDebugServer.cpp:
2105         (WebCore::JavaScriptDebugServer::sourceParsed): Adds #ifdefed
2106         debugging code to prevent the sourceID and URL.
2107         (WebCore::updateCurrentCallFrame): Added. A helper function that
2108         is called from all 4 of the debugger hooks below. This function will
2109         update and/or create JavaScriptCallFrames to match the exec state,
2110         sourceID and lineNumber passed into it. Contains #ifdefed debugging
2111         code that was helpful while fixing this bug.
2112         (WebCore::JavaScriptDebugServer::callEvent): Call updateCurrentCallFrame
2113         before pauseIfNeeded.
2114         (WebCore::JavaScriptDebugServer::atStatement): Ditto.
2115         (WebCore::JavaScriptDebugServer::returnEvent): Ditto.
2116         (WebCore::JavaScriptDebugServer::exception): Ditto.
2117
2118 2008-05-14  Alp Toker  <alp@nuanti.com>
2119
2120         GTK+ build fix for r33457. Add NetworkStateNotifier.cpp to the build.
2121
2122         * GNUmakefile.am:
2123
2124 2008-05-14  Alp Toker  <alp@nuanti.com>
2125
2126         GTK+ build fix. Include value.h from kjs, not JavaScriptCore.
2127
2128         * page/JavaScriptProfile.cpp:
2129         * page/JavaScriptProfileNode.cpp:
2130
2131 2008-05-14  Adam Roben  <aroben@apple.com>
2132
2133         Windows release build fix
2134
2135         * WebCore.vcproj/WebCore.vcproj: Make sure the warnings we disable on
2136         XPathGrammar.cpp are disabled for all configurations, not just
2137         Debug_Internal.
2138
2139 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
2140
2141         Reviewed by Sam.
2142
2143         <rdar://problem/5770054> JavaScript profiler (10928)
2144         - Rename FunctionCallProfile to ProfileNode
2145
2146         * ForwardingHeaders/profiler/FunctionCallProfile.h: Removed.
2147         * ForwardingHeaders/profiler/ProfileNode.h: Copied from ForwardingHeaders/profiler/FunctionCallProfile.h.
2148         * GNUmakefile.am:
2149         * WebCore.pro:
2150         * WebCore.vcproj/WebCore.vcproj:
2151         * WebCore.xcodeproj/project.pbxproj:
2152         * WebCoreSources.bkl:
2153         * page/JavaScriptFunctionCallProfile.cpp: Removed.
2154         * page/JavaScriptFunctionCallProfile.h: Removed.
2155         * page/JavaScriptProfile.cpp:
2156         * page/JavaScriptProfileNode.cpp: Copied from page/JavaScriptFunctionCallProfile.cpp.
2157         (WebCore::ProfileNodeCache):
2158         (WebCore::getFunctionName):
2159         (WebCore::getTotalTime):
2160         (WebCore::getSelfTime):
2161         (WebCore::getNumberOfCalls):
2162         (WebCore::getChildren):
2163         (WebCore::finalize):
2164         (WebCore::ProfileNodeClass):
2165         (WebCore::toJS):
2166         * page/JavaScriptProfileNode.h: Copied from page/JavaScriptFunctionCallProfile.h.
2167
2168 2008-05-13  Beth Dakin  <bdakin@apple.com>
2169
2170         Reviewed by Brady.
2171
2172         This patch adds support for the ARIA progressbar role and the 
2173         following ARIA states (ie HTML attributes): aria-checked, aria-
2174         level, aria-pressed, aria-valuenow, aria-valuemin, and aria-
2175         valuemax.
2176
2177         * html/HTMLAttributeNames.in:
2178         * page/AccessibilityObject.h:
2179         (WebCore::AccessibilityObject::isProgressIndicator):
2180         (WebCore::AccessibilityObject::valueForRange):
2181         (WebCore::AccessibilityObject::maxValueForRange):
2182         (WebCore::AccessibilityObject::minValueForRange):
2183         * page/AccessibilityRenderObject.cpp:
2184         (WebCore::AccessibilityRenderObject::isProgressIndicator):
2185         (WebCore::AccessibilityRenderObject::isPressed): Check the aria-
2186         pressed attribute if this is an ARIA button.
2187         (WebCore::AccessibilityRenderObject::headingLevel): Check the aria-
2188         level attribute if this is an ARIA heading.
2189         (WebCore::AccessibilityRenderObject::intValue): Check the aria-
2190         checked attribute if this is an ARIA radio button or checkbox.
2191         (WebCore::AccessibilityRenderObject::valueForRange):
2192         (WebCore::AccessibilityRenderObject::maxValueForRange):
2193         (WebCore::AccessibilityRenderObject::minValueForRange):
2194         (WebCore::RoleEntry::):
2195         (WebCore::AccessibilityRenderObject::canSetValueAttribute):
2196         * page/AccessibilityRenderObject.h:
2197         * page/mac/AccessibilityObjectWrapper.mm:
2198         (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
2199         (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
2200
2201 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
2202
2203         Reviewed by John.
2204
2205         -<rdar://problem/5770054> JavaScript profiler (10928)
2206         Use the FunctionCallProfile's new total and self time functions.
2207
2208         * page/JavaScriptFunctionCallProfile.cpp:
2209         (WebCore::getTotalTime):
2210         (WebCore::getSelfTime):
2211
2212 2008-05-14  Anders Carlsson  <andersca@apple.com>
2213
2214         Reviewed by Adam.
2215
2216         Don't try to store the resource data if it's empty.
2217         
2218         * loader/appcache/ApplicationCacheStorage.cpp:
2219         (WebCore::ApplicationCacheStorage::store):
2220
2221 2008-05-14  Adam Roben  <aroben@apple.com>
2222
2223         Windows build fix
2224
2225         * platform/network/NetworkStateNotifier.cpp: Added a missing #include.
2226         * platform/network/NetworkStateNotifier.h:
2227         (WebCore::NetworkStateNotifier::NetworkStateNotifier): Removed 'void'
2228         return type from the constructor, and fixed the spelling of a member
2229         variable.
2230
2231 2008-05-14  Kevin McCullough  <kmccullough@apple.com>
2232
2233         Reviewed by Adam.
2234
2235         <rdar://problem/5770054> JavaScript profiler (10928)
2236         - Add support for interacting with the JavaScriptCore profiler.
2237
2238         * ForwardingHeaders/profiler/FunctionCallProfile.h: Added.
2239         * ForwardingHeaders/profiler/Profile.h: Added.
2240         * GNUmakefile.am: Add the new files to all the projects.
2241         * WebCore.pro:
2242         * WebCore.vcproj/WebCore.vcproj:
2243         * WebCore.xcodeproj/project.pbxproj:
2244         * WebCoreSources.bkl:
2245         * page/InspectorController.cpp: Add the ability to retrieve all of the
2246         profiles in JavaScript from the InspectorController.
2247         (WebCore::allProfiles):
2248         (WebCore::InspectorController::windowScriptObjectAvailable):
2249         * page/JavaScriptFunctionCallProfile.cpp: Added. Wrapper around the JSC
2250         FunctionCallProfile.
2251         (WebCore::functionCallProfileCache): This cache makes sure we don't
2252         needlessly create duplicate wrappers around the same
2253         FunctionCallProfile*.
2254         (WebCore::getFunctionName): Callback to return the name of the function.
2255         (WebCore::getTotalTime): Callback to return the total time spent in the
2256         function.
2257         (WebCore::getSelfTime): Callback to return the time spent in self (total
2258         - time in children) in the function.
2259         (WebCore::getNumberOfCalls): Callback to return the number of times this
2260         function was called.
2261         (WebCore::getChildren): Callback to return the children of this function
2262         where the children are the functions this function called.
2263         (WebCore::finalize): Cleanup.
2264         (WebCore::functionCallProfileClass): Define the JSClassRef for this
2265         object.
2266         (WebCore::toJS): Create a conversion function to make a usable JSValue
2267         to wrap the FunctionCallProfile in JSC.
2268         * page/JavaScriptFunctionCallProfile.h: Added.
2269         * page/JavaScriptProfile.cpp: Added. Wrapper around the JSC Profile.
2270         (WebCore::profileCache): This cache makes sure we don't needlessly
2271         create duplicate wrappers aroudn the same Profile*.
2272         (WebCore::getHeadCallback): Callback to return the head of the graph of
2273         the functions profiled durring this profile's run.
2274         (WebCore::finalize):
2275         (WebCore::profileClass): Define the JSClassRef for this object.
2276         (WebCore::toJS): Create a conversion function to make a usable JSValue
2277         to wrap the Profile from JSC.
2278         * page/JavaScriptProfile.h: Added.
2279
2280 2008-05-14  David Hyatt  <hyatt@apple.com>
2281
2282         Fix for bug https://bugs.webkit.org/show_bug.cgi?id=16130.
2283
2284         Opacity, transforms, reflections and masks should not honor z-index unless the element is also
2285         positioned.  Always reset to auto if the element is not positioned (and then the following code will
2286         adjust auto to 0 as needed).
2287
2288         Reviewed by Dan Bernstein
2289
2290         * css/CSSStyleSelector.cpp:
2291         (WebCore::CSSStyleSelector::adjustRenderStyle):
2292
2293 2008-05-14  Anders Carlsson  <andersca@apple.com>
2294
2295         Reviewed by Brady.
2296
2297         <rdar://problem/5931742> Support navigator.onLine from HTML5
2298         
2299         * WebCore.vcproj/WebCore.vcproj:
2300         * WebCore.xcodeproj/project.pbxproj:
2301         Add NetworkStateNotifier files.
2302         
2303         * dom/EventNames.h:
2304         Add offline and online events.
2305         
2306         * page/Navigator.cpp:
2307         (WebCore::Navigator::onLine):
2308         * page/Navigator.h:
2309         * page/Navigator.idl:
2310         Add navigator.onLine.
2311         
2312         * page/Page.cpp:
2313         (WebCore::networkStateChanged):
2314         Dispatch offline/online events to all frames.
2315         
2316         (WebCore::Page::Page):
2317         Set state change callback.
2318         
2319         * platform/network/NetworkStateNotifier.cpp: Added.
2320         * platform/network/NetworkStateNotifier.h: Added.
2321
2322         * platform/network/mac/NetworkStateNotifierMac.cpp: Added.
2323         Mac network state notifier.
2324
2325 2008-05-14  Adam Roben  <aroben@apple.com>
2326
2327         Fix Bug 18888: REGRESSION (r32731): console.log always prints
2328         "undefined"
2329
2330         <https://bugs.webkit.org/show_bug.cgi?id=18888>
2331
2332         Reviewed by Tim Hatcher.
2333
2334         Tested by pre-existing
2335         manual-tests/inspector/console-log-formatting.html.
2336
2337         * page/inspector/Console.js:
2338         (WebInspector.ConsoleMessage.prototype._format): Changed to explicitly
2339         wrap Console._format instead of using bind to do it. Using bind was
2340         causing us to pass plainText in as the first parameter instead of as
2341         the second.
2342
2343 2008-05-14  Timothy Hatcher  <timothy@apple.com>
2344
2345         Fixes the bug where stepping out of a function would show the wrong
2346         call stack (would look like it stepped out twice.)
2347
2348         Reviewed by Adam Roben.
2349
2350         * page/JavaScriptDebugServer.cpp:
2351         (WebCore::JavaScriptDebugServer::returnEvent):
2352         Call pauseIfNeeded before setting m_currentCallFrame to the caller.
2353
2354 2008-05-14  Stephanie Lewis  <slewis@apple.com>
2355    
2356         Fix 64bit build
2357
2358         * plugins/PluginView.h:
2359
2360 2008-05-14  David Kilzer  <ddkilzer@apple.com>
2361
2362         REGRESSION (r26474): WebKit fails jQuery test 64 core module: text(String) subtest 1 Check escaped text (createTextNode)
2363
2364         <https://bugs.webkit.org/show_bug.cgi?id=18976>
2365         <rdar://problem/5924793>
2366
2367         Reviewed by Darin.
2368
2369         Tests: fast/dom/dom-parse-serialize-expected.txt:
2370                fast/xsl/xslt-processor-expected.txt:
2371                fast/xsl/xslt-text-expected.txt:
2372
2373         Commit r26474 removed escaping of '>' characters to '&gt;' in serialized
2374         HTML content, which broke one jQuery test.  This change restores that
2375         serialization behavior to both attributes and content for consistency.
2376
2377         * editing/markup.cpp:
2378         (WebCore::appendAttributeValue): Escape '>' as '&gt;'.
2379         (WebCore::escapeContentText): Ditto.
2380         (WebCore::appendEscapedContent): Ditto.  This is the bug fix for the jQuery test.
2381
2382 2008-05-14  Adam Roben  <aroben@apple.com>
2383
2384         Fix Bug 19051: REGRESSION (r33447): Assertion in
2385         JSDebugServer::removeListener closing tab with Inspector open
2386
2387         <https://bugs.webkit.org/show_bug.cgi?id=19051>
2388
2389         m_inspectedPage is now cleared when the Page is destroyed, which never
2390         used to happen. Some of InspectorController's code was not prepared
2391         for this.
2392
2393         Reviewed by Dave Hyatt.
2394
2395         * page/InspectorController.cpp:
2396         (WebCore::InspectorController::~InspectorController): Removed a call
2397         to stopDebugging and added an assertion. Debugging should have already
2398         been stopped by this point.
2399         (WebCore::InspectorController::inspectedPageDestroyed): Moved here
2400         from the header file. Added a call to stopDebugging.
2401         (WebCore::InspectorController::enabled): Return false if our inspected
2402         Page has already been destroyed, since we can't really do much at this
2403         point anyway.
2404         (WebCore::InspectorController::didCommitLoad):
2405         (WebCore::InspectorController::didLoadResourceFromMemoryCache):
2406         (WebCore::InspectorController::identifierForInitialRequest):
2407         (WebCore::InspectorController::startDebuggingAndReloadInspectedPage):
2408         (WebCore::InspectorController::stopDebugging):
2409         (WebCore::InspectorController::drawNodeHighlight):
2410         Assert that m_inspectedPage hasn't been cleared.
2411         * page/InspectorController.h:
2412
2413 2008-05-14  Justin Garcia  <justin.garcia@apple.com>
2414
2415         Reviewed by Darin.
2416
2417         <rdar://problem/5914803> Improve performance of WebCore::Editor::setComposition
2418
2419         * editing/Editor.cpp:
2420         (WebCore::Editor::confirmComposition): Remove the previous composition
2421         when we insert the new one, not with a separate, slower, delete operation.
2422         (WebCore::Editor::setComposition): Ditto.
2423         * editing/InsertTextCommand.cpp:
2424         (WebCore::InsertTextCommand::performTrivialReplace): Remove the selected
2425         text with a low level operation that doesn't perform a layout and insert
2426         the new text in a way that won't trigger a layout from the removal.
2427         (WebCore::InsertTextCommand::input): Call the optimized replace.
2428         * editing/InsertTextCommand.h:
2429         * editing/htmlediting.cpp:
2430         (WebCore::isTabSpanNode): Check to see if the node is a span, to avoid 
2431         the expense of getAttribute in the common case.
2432         * page/Frame.cpp:
2433         (WebCore::Frame::selectionLayoutChanged): Selection::start() and end()
2434         will already be at VisiblePosition deepEquivalents. Selection::validate()
2435         ensures this.
2436
2437 2008-05-14  Adam Roben  <aroben@apple.com>
2438
2439         Make the Inspector able to handle being reloaded
2440
2441         When Reload was selected from the context menu in the Inspector, the
2442         Inspector window would close and never be openable again. Now it
2443         closes, then reopens when the page finishes loading.
2444
2445         Reviewed by Tim Hatcher.
2446
2447         * page/InspectorController.cpp:
2448         (WebCore::InspectorController::close): Removed code that cleared out
2449         m_page. This is now handled by pageDestroyed.
2450         * page/InspectorController.h:
2451         (WebCore::InspectorController::inspectedPageDestroyed): Added.
2452         * page/Page.cpp:
2453         (WebCore::Page::~Page): Fixed a bug and added a call to the new
2454         inspectedPageDestroyed. If we have a parent InspectorController, that
2455         means that we are the Page in the Inspector's window (i.e., we are the
2456         Inspector's UI), so when we are destroyed we should call
2457         InspectorController::pageDestroyed. We also need to call
2458         inspectedPageDestroyed on our own InspectorController so that it won't
2459         try to call into us.
2460
2461 2008-05-14  Timothy Hatcher  <timothy@apple.com>
2462
2463         Add pause on exception support to the Inspector debugger
2464         with a toggle buttons to enable or disable it.
2465
2466         Reviewed by Adam Roben.
2467
2468         * page/InspectorController.cpp:
2469         (WebCore::pauseOnExceptions): Call the InspectorController.
2470         (WebCore::setPauseOnExceptions): Ditto.
2471         (WebCore::InspectorController::windowScriptObjectAvailable): Add the new
2472         setPauseOnExceptions and pauseOnExceptions functions to the JS class.
2473         (WebCore::InspectorController::pauseOnExceptions): Call JavaScriptDebugServer.
2474         (WebCore::InspectorController::setPauseOnExceptions): Ditto.
2475         * page/InspectorController.h:
2476         * page/JavaScriptDebugServer.cpp:
2477         (WebCore::JavaScriptDebugServer::setPauseOnExceptions): Set m_pauseOnExceptions.
2478         (WebCore::JavaScriptDebugServer::exception): Check m_pauseOnExceptions
2479         and set m_pauseOnNextStatement to true before calling pauseIfNeeded.
2480         * page/JavaScriptDebugServer.h:
2481         * page/inspector/Images/pauseOnExceptionButtons.png: Added.
2482         * page/inspector/ScriptsPanel.js: Adds a status bar button that calls
2483         the new InspectorController functions.
2484         * page/inspector/inspector.css: New styles.
2485
2486 2008-05-14  Timothy Hatcher  <timothy@apple.com>
2487
2488         Rename the Scope Chain pane to Scope Variables. Name the global
2489         object Global. Name objects before the locals "With Block".
2490         Name colsure scopes "Closure". Name any element or document
2491         after Local, "Event Target" and "Event Document", respectfully.
2492
2493         Reviewed by Adam Roben.
2494
2495         * English.lproj/localizedStrings.js: Add new strings.
2496         * page/inspector/ObjectPropertiesSection.js:
2497         (WebInspector.ObjectPropertiesSection): Add a new argument that is used
2498         for the empty placeholder text.
2499         (WebInspector.ObjectPropertiesSection.prototype.onpopulate): Use the
2500         empty placeholder text.
2501         * page/inspector/ScopeChainSidebarPane.js:
2502         (WebInspector.ScopeChainSidebarPane): Rename Scope Chain to Scope Variables.
2503         (WebInspector.ScopeChainSidebarPane.prototype.update): Use the object name as
2504         the subtitle. Use "Global" for the global object title. Use "With Block" for
2505         the title of objects before the locals. Use "No Variables" for the empty
2506         placeholder text for locals.
2507
2508 2008-05-14  Michael A. Puls II  <shadow2531@gmail.com>
2509
2510         Reviewed by Alexey.
2511
2512         Fix for https://bugs.webkit.org/show_bug.cgi?id=16923 
2513         Attr nodes with a value of "" should not have any childNodes
2514         
2515         In Opera, Firefox and IE, when an attribute node has a value
2516         of "", the attribute node doesn't have any childNodes. This
2517         is true in WebKit also, but not when you assign "" to the
2518         Attr's value when the existing value is non-empty.
2519         
2520         Test: fast/dom/attribute-empty-value-no-children.html
2521
2522         * dom/Attr.cpp: (WebCore::Attr::setValue): Use createTextChild(), which only appends
2523         a child text node if the value being assigned is not empty.
2524
2525 2008-05-14  Julien Chaffraix  <jchaffraix@webkit.org>
2526
2527         Reviewed by Eric.
2528
2529         GCC 4.3 build fix.
2530         Removes some compiler warnings.
2531
2532         * dom/Document.h:
2533         (WebCore::FormElementKey::hashTableDeletedValue): GCC complained about the const keyword
2534         so remove it as it is only used inside FormElementKey.
2535
2536         * html/HTMLSelectElement.cpp:
2537         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Correct coding style (removes
2538         a warning too).
2539
2540         * loader/appcache/ApplicationCacheResource.cpp: Include stdio.h for gcc4.3 build.
2541
2542         * plugins/PluginPackage.cpp:
2543         (WebCore::PluginPackage::PluginPackage): Changed initialization order in the constructor.
2544         * plugins/PluginView.cpp:
2545         (WebCore::PluginView::PluginView): Ditto.
2546         * plugins/PluginView.h:
2547         * xml/AccessControlList.cpp: Include stdio.h
2548         * xml/AccessItem.cpp: Ditto.
2549         * xml/AccessItemRule.cpp: Ditto.
2550
2551 2008-05-14  Ariya Hidayat  <ariya.hidayat@trolltech.com>
2552
2553         Reviewed by Simon.
2554
2555         Qt build fix. Add JSJavaScriptCallFrameCustom.cpp to the build
2556         and implemented EventLoopQt.
2557
2558         * WebCore.pro:
2559         * platform/qt/EventLoopQt.cpp: Added.
2560
2561 2008-05-14  Ariya Hidayat  <ariya.hidayat@trolltech.com>
2562
2563         Reviewed by Simon.
2564
2565         Qt build fix. Add JavaScriptCallFrame.{idl,cpp} to the build.
2566
2567         * WebCore.pro:
2568
2569 2008-05-13  Dan Bernstein  <mitz@apple.com>
2570
2571         Reviewed by John Sullivan.
2572
2573         - Windows part of <rdar://problem/5725912> improve render quality of transformed text
2574
2575         * platform/graphics/win/FontCGWin.cpp:
2576         (WebCore::Font::drawGlyphs): Added call to
2577         wkSetCGContextFontRenderingStyle().
2578
2579 2008-05-13  Alp Toker  <alp@nuanti.com>
2580
2581         GTK+ build fix. Implement EventLoopGtk.cpp.
2582
2583         * GNUmakefile.am:
2584         * platform/gtk/EventLoopGtk.cpp: Added.
2585         (WebCore::EventLoop::cycle):
2586
2587 2008-05-13  Alp Toker  <alp@nuanti.com>
2588
2589         GTK+ build fix. Fix IDL filename typo and add JavaScriptCallFrame.cpp
2590         to the build.
2591
2592         * GNUmakefile.am:
2593
2594 2008-05-13  Matt Lilek  <webkit@mattlilek.com>
2595
2596         Not reviewed, partial Gtk build fix.
2597
2598         * GNUmakefile.am:
2599
2600 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2601
2602         Fixes a crash when stepping out in the Inspector's debugger.
2603
2604         http://bugs.webkit.org/show_bug.cgi?id=19037
2605
2606         Reviewed by Dan Bernstein.
2607
2608         * page/InspectorController.cpp:
2609         (WebCore::currentCallFrame): Adds a null check of currentCallFrame,
2610         since it can be null. Also returns JSNull to better signify this.
2611         * page/inspector/ScriptsPanel.js: Updates the debugger interface
2612         when stepping so the currentCallFrame isn't accessed when not paused.
2613         Adds a _clearInterface function to remove duplicate code.
2614
2615 2008-05-13  chris fleizach  <cfleizach@apple.com>
2616
2617         Reviewed by Beth Dakin
2618
2619         <rdar://problem/5932677> AX: Submit buttons aren't returning AXTitle
2620
2621         * page/AccessibilityRenderObject.cpp:
2622         (WebCore::AccessibilityRenderObject::title):
2623
2624 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2625
2626         Adds an overlay window that covers the scripts panel and
2627         informs the user that they need to attach the debugger.
2628         Provides an "Attach Debugger" button below the info text.
2629
2630         Reviewed by Dan Bernstein.
2631
2632         * English.lproj/localizedStrings.js: New strings.
2633         * page/inspector/ScriptsPanel.js:
2634         (WebInspector.ScriptsPanel): Create the overlay elements and
2635         append to the main panel element.
2636         * page/inspector/inspector.css: New styles for the over lay elements.
2637
2638 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2639
2640         Fixes the assertion and crash that would happen when inspecting a element from a frame.
2641         This change makes JSInspectedObjectWrapper pass unwrapped objects around for global objects
2642         that share the same page group identifier. Also returns jsUndefined() instead of 0 to prevent
2643         crashing in release builds if the page groups don't match.
2644
2645         Passes all the tests in: manual-tests/inspector-wrappers
2646
2647         Reviewed by Adam Roben.
2648
2649         * bindings/js/JSInspectedObjectWrapper.cpp:
2650         (WebCore::JSInspectedObjectWrapper::prepareIncomingValue): Return jsUndefined() instead of 0.
2651         Call allowsUnwrappedAccessFrom instead of unwrappedExecStateMatches.
2652         * bindings/js/JSQuarantinedObjectWrapper.cpp:
2653         (WebCore::JSQuarantinedObjectWrapper::allowsUnwrappedAccessFrom): Renamed from unwrappedExecStateMatches.
2654         Return true if the pageGroupIdentifier of both wrappers match.
2655         (WebCore::JSQuarantinedObjectWrapper::callAsFunction): Return jsUndefined() instead of 0.
2656         * bindings/js/JSQuarantinedObjectWrapper.h: Renamed unwrappedExecStateMatches to allowsUnwrappedAccessFrom.
2657
2658 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2659
2660         Fixes the hang that could happen when option-clicking to expand
2661         a disclosure triangle in the Properties pane. This change limits
2662         the recursion depth when expanding the tree elements.
2663
2664         <rdar://problem/5847681> Safari hangs when option-clicking a
2665         disclosure triangle in the Inspector's Properties pane
2666
2667         Reviewed by John Sullivan.
2668
2669         * page/inspector/treeoutline.js:
2670         (TreeElement.prototype.expandRecursively): Pass an empty info object to
2671         traverseNextTreeElement to get the depthChange value. This is used to
2672         compute a current depth. If the depth exceeds the maxDepth argument, the
2673         item isn't expanded and children wont be populated when traverseNextTreeElement
2674         is called until the depth goes below the maxDepth.
2675         (TreeElement.prototype.traverseNextTreeElement): Added a new info
2676         argument that can be optionally used to return extra info like depth change.
2677
2678 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2679
2680         Adds info text to panes and sections in the Inspector's sidebars
2681         that would normally be empty. These help the user know why there
2682         is nothing in these sections.
2683
2684         Reviewed by John Sullivan.
2685
2686         * English.lproj/localizedStrings.js: Add strings.
2687         * page/inspector/BreakpointsSidebarPane.js: Adds "No Breakpoints".
2688         * page/inspector/CallStackSidebarPane.js: Adds "Not Paused".
2689         * page/inspector/ObjectPropertiesSection.js: Adds "No Properties".
2690         * page/inspector/ScopeChainSidebarPane.js: Adds "Not Paused".
2691         * page/inspector/inspector.css: Adds style rules for the info elements.
2692
2693 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2694
2695         Implements the rest of the Scripts panel to get the debugger
2696         mostly working. "Basic debugging seems to work."
2697
2698         Reviewed by Geoff Garen.
2699
2700         * English.lproj/localizedStrings.js: Adds new strings.
2701         * page/inspector/Resource.js:
2702         (WebInspector.Resource.prototype.get scripts): Returns _scripts and 
2703         creates it lazily.
2704         (WebInspector.Resource.prototype.addScript): Add the script object to the
2705         front of the _scripts array.
2706         (WebInspector.Resource.prototype.removeAllScripts): Removed all the scripts
2707         and removes the resource back-reference.
2708         (WebInspector.Resource.prototype.removeScript): Removes the script and
2709         breaks the resource back-reference.
2710         * page/inspector/ResourceView.js:
2711         (WebInspector.ResourceView): Adds a reminder comment.
2712         (WebInspector.ResourceView.prototype.get headersVisible): Returns _headersVisible. 
2713         (WebInspector.ResourceView.prototype.set headersVisible): Stubs out
2714         a setter that currently just sets _headersVisible. Has a comment that
2715         points out this needs implemented when network headers are added.
2716         * page/inspector/ResourcesPanel.js:
2717         (WebInspector.ResourcesPanel.prototype.show): Sets the headersVisible property of
2718         the visible view to true and shows it again, in case it was being shown in Scripts.
2719         (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded):
2720         Copies the headersVisible property from the old view to the new view.
2721         (WebInspector.ResourcesPanel.prototype.showResource): Sets the headersVisible
2722         property to true before showing.
2723         * page/inspector/ScriptView.js:
2724         (WebInspector.ScriptView): Passes in _addBreakpoint for the add breakpoint delegate.
2725         (WebInspector.ScriptView.prototype._addBreakpoint): Calls ScriptsPanel's addBreakpoint
2726         for the current Script.sourceID and line.
2727         * page/inspector/ScriptsPanel.js:
2728         (WebInspector.ScriptsPanel): 
2729         (WebInspector.ScriptsPanel.prototype.show): Sets the headersVisible property of
2730         the visible view to false and shows it again, in case it was being shown in Resources.
2731         (WebInspector.ScriptsPanel.prototype.addScript): Makes a new Script object and
2732         adds it to a Resource if one is found. Registers any breakpoint that match
2733         the new Script's source URL, and sets the sourceID of the breakpoints.
2734         (WebInspector.ScriptsPanel.prototype.addBreakpoint): Adds the breakpoint to the
2735         BreakpointsSidebarPane. Also adds it to _breakpointsURLMap so it can be found
2736         later in addScript by URL. Finally adds the breakpoint to the SourceFrame that
2737         represents the resources or script.
2738         (WebInspector.ScriptsPanel.prototype.removeBreakpoint): Removes the breakpoint from
2739         the BreakpointsSidebarPane, _breakpointsURLMap and SourceFrame.
2740         (WebInspector.ScriptsPanel.prototype.debuggerPaused): Update the debugger
2741         state variables, the buttons and the CallStackSidebarPane.
2742         (WebInspector.ScriptsPanel.prototype.reset): Clears and resets debugger
2743         and interface state.
2744         (WebInspector.ScriptsPanel.prototype.get visibleView): Returns _visibleView.
2745         (WebInspector.ScriptsPanel.prototype.set visibleView): Sets _visibleView and
2746         calls hide on the old view and show on the new view.
2747         (WebInspector.ScriptsPanel.prototype.showScript): Calls _showScriptOrResource.
2748         (WebInspector.ScriptsPanel.prototype.showResource): Ditto.
2749         (WebInspector.ScriptsPanel.prototype.scriptViewForScript): Lazily creates a
2750         ScriptView for the Script and returns it. 
2751         (WebInspector.ScriptsPanel.prototype.sourceFrameForScript): Returns the SourceFrame
2752         for the Script.
2753         (WebInspector.ScriptsPanel.prototype._sourceFrameForScriptOrResource): Returns the
2754         SourceFrame based on the type of object passed in.
2755         (WebInspector.ScriptsPanel.prototype._showScriptOrResource): Shows the view based on
2756         the type of object passed in. If the object is a resource and there are breakpoints
2757         defined for that Resource URL, then populate the SourceFrame with the breakpoints.
2758         (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu): Adds a script to the 
2759         files menu. If the Script is part of a resource, that resource is added.
2760         (WebInspector.ScriptsPanel.prototype._removeScriptFromFilesMenu): Remove a script from
2761         the files menu. If that script is part of a resource and it is the last script of that
2762         resource, then remove the whole resource.
2763         (WebInspector.ScriptsPanel.prototype._clearCurrentExecutionLine): Clears the execution
2764         line from the SourceFrame that is showing it.
2765         (WebInspector.ScriptsPanel.prototype._callFrameSelected): Event listener for when the
2766         call frame changes in the CallStackSidebarPane. Triggers updates to the ScopeChainSidebarPane
2767         and the visible view.
2768         (WebInspector.ScriptsPanel.prototype._changeVisibleFile): Event listener for the change state
2769         of the files select element.
2770         (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons): Update more of the 
2771         buttons to reflect the current debugger state. Updates the status text too.
2772         (WebInspector.ScriptsPanel.prototype._toggleDebugging): Reset the UI and state when
2773         the debugger is attached/detached.
2774         (WebInspector.ScriptsPanel.prototype._togglePause): Call InspectorController.resumeDebugger or
2775         InspectorController.pauseInDebugger depending on the paused state.
2776         (WebInspector.ScriptsPanel.prototype._stepOverClicked): Call InspectorController.stepOverStatementInDebugger.
2777         (WebInspector.ScriptsPanel.prototype._stepIntoClicked): Call InspectorController.stepIntoStatementInDebugger.
2778         (WebInspector.ScriptsPanel.prototype._stepOutClicked): InspectorController.stepOutOfFunctionInDebugger.
2779         * page/inspector/SourceView.js:
2780         (WebInspector.SourceView): Passes in _addBreakpoint for the add breakpoint delegate.
2781         (WebInspector.SourceView.prototype._addBreakpoint): Calls ScriptsPanel's addBreakpoint
2782         for the nearest Script's sourceID and passed in line.
2783         * page/inspector/inspector.css: New style rules for the UI changes.
2784         * page/inspector/inspector.js:
2785         (WebInspector.loaded): Add the ScriptsPanel to the panels list.
2786         (WebInspector.parsedScriptSource): Call ScriptsPanel.addScript.
2787         (WebInspector.failedToParseScriptSource): Ditto.
2788         (WebInspector.pausedScript): Call ScriptsPanel.debuggerPaused.
2789
2790 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2791
2792         Adds implementations of the Scope Chain and Call Stack sidebar panes.
2793         These panes use the JSJavaScriptCallFrame object that will be passed
2794         to the update functions.
2795
2796         Reviewed by Kevin McCullough.
2797
2798         * English.lproj/localizedStrings.js: Adds new strings.
2799         * WebCore.vcproj/WebCore.vcproj: Adds new files.
2800         * page/inspector/CallStackSidebarPane.js:
2801         (WebInspector.CallStackSidebarPane.prototype.update): Walk the 
2802         caller chain of the call frame and make placards for each.
2803         (WebInspector.CallStackSidebarPane.prototype.get selectedCallFrame):
2804         Return _selectedCallFrame. 
2805         (WebInspector.CallStackSidebarPane.prototype.set selectedCallFrame):
2806         Set _selectedCallFrame and dispatch the "call frame selected" event.
2807         (WebInspector.CallStackSidebarPane.prototype._placardSelected):
2808         Set the selectedCallFrame based on the clicked placard.
2809         * page/inspector/Placard.js: Added. A user interface object that can
2810         be used to show a title and a subtitle block with a selected state.
2811         * page/inspector/ScopeChainSidebarPane.js: Added.
2812         (WebInspector.ScopeChainSidebarPane): Call the base object and set the title.
2813         (WebInspector.ScopeChainSidebarPane.prototype.update): Iterate over the
2814         call frame's scope chain and make ObjectPropertiesSections for each.
2815         * page/inspector/SidebarPane.js:
2816         (WebInspector.SidebarPane.prototype): Inherit from WebInspector.Object.
2817         * page/inspector/WebKit.qrc: Add new files.
2818         * page/inspector/inspector.css: Add placard styles.
2819         * page/inspector/inspector.html: Add new files.
2820
2821 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2822
2823         Fixes the bug where SourceViews would be blank if shown before
2824         the Resource finished loading.
2825
2826         <rdar://problem/5807420> Safari's Web Inspector won't display the
2827         contents of some CSS and JS files
2828
2829         Reviewed by Kevin McCullough.
2830
2831         * page/inspector/Resource.js:
2832         (WebInspector.Resource.prototype.set finished): Dispatch the finished event
2833         (WebInspector.Resource.prototype): Inherit from WebInspector.Object.prototype.
2834         * page/inspector/SourceView.js:
2835         (WebInspector.SourceView): Register for the finished event on the resource.
2836         When the event fires, setup the source frame and deregister the event.
2837
2838 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2839
2840         Factored most of SourceView out into SourceFrame so it can be shared
2841         by the new ScriptView. Added the ScriptView class to be used for
2842         scripts that arn't Resources (like eval code.) Added a simple Script
2843         object that hold the data from the debugger parsedSource hooks. A
2844         ScriptView holds a Script object, and uses it for source data.
2845
2846         Added breakpoint and execution line support to the SourceFrame
2847         where they are visually represented in the source.
2848
2849         Reviewed by Kevin McCullough.
2850
2851         * page/inspector/inspector.js:
2852         (WebInspector.performSearch): Change the caller of sourceFrameForResource
2853         to use the SourceFrame result's element property.
2854         * page/inspector/ResourcesPanel.js: Use the new SourceFrame.
2855         * page/inspector/Script.js: Added.
2856         * page/inspector/ScriptView.js: Added.
2857         * page/inspector/SourceFrame.js: Added.
2858         * page/inspector/SourceView.js: Use the new SourceFrame.
2859         * WebCore.vcproj/WebCore.vcproj: Add new files.
2860         * page/inspector/WebKit.qrc: Ditto.
2861         * page/inspector/inspector.html: Ditto.
2862
2863 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2864
2865         Adds a Breakpoint object and basic add/remove functions on
2866         BreakpointsSidebarPane that call the InspectorController to
2867         add/remove the breakpoint.
2868
2869         Reviewed by Kevin McCullough.
2870
2871         * page/inspector/Breakpoint.js:
2872         (WebInspector.Breakpoint): 
2873         (WebInspector.Breakpoint.prototype.get enabled): Return _enabled.
2874         (WebInspector.Breakpoint.prototype.set enabled): Set _enabled and
2875         dispatch the enabled/disabled event to listeners.
2876         * page/inspector/BreakpointsSidebarPane.js:
2877         (WebInspector.BreakpointsSidebarPane): Add a breakpoints array.
2878         (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint):
2879         Adds the breakpoint to the breakpoints array. Registers for the disabled
2880         and enabled event types. Call InspectorController.addBreakpoint if attached.
2881         (WebInspector.BreakpointsSidebarPane.prototype.removeBreakpoint):
2882         Removes the breakpoint from the breakpoints array. Deregisters for the disabled
2883         and enabled event types. Call InspectorController.removeBreakpoint if attached.
2884         (WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
2885         Call InspectorController.addBreakpoint or InspectorController.removeBreakpoint
2886         depending on the enabled state of the breakpoint.
2887         * WebCore.vcproj/WebCore.vcproj: Add new files.
2888         * page/inspector/WebKit.qrc: Ditto.
2889         * page/inspector/inspector.html: Ditto.
2890
2891 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2892
2893         Make addSourceToFrame not dependent on InspectorResource so it
2894         can be used to add source of a passed in string and mime-type to
2895         a frame. Added addResourceSourceToFrame for use by SourceView.
2896
2897         Also fixes an assertion because of an incorrect static_cast of identifiers
2898         to unsigned long long, when they can be unsigned.
2899
2900         Reviewed by Geoff Garen.
2901
2902         * page/InspectorController.cpp:
2903         (WebCore::addSourceToFrame): Helper function used by addSourceToFrame
2904         and addResourceSourceToFrame.
2905         (WebCore::addSourceToFrame): Generalized to take a source and mime-type string.
2906         (WebCore::addResourceSourceToFrame): Renamed from addSourceToFrame.
2907         (WebCore::getResourceDocumentNode): Fixes the static_cast to be long long.
2908         (WebCore::InspectorController::windowScriptObjectAvailable): Adds
2909         addResourceSourceToFrame to the JavaScript class.
2910         * page/inspector/SourceView.js: Use the new addResourceSourceToFrame.
2911
2912 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2913
2914         Add debugger related functions to the InspectorController and
2915         expose them to the JavaScript side of InspectorController.
2916
2917         Reviewed by Geoff Garen.
2918
2919         * page/InspectorController.cpp:
2920         (WebCore::jsStringRef): Added helper to convert a UString to a JSStringRef.
2921         (WebCore::currentCallFrame): Call InspectorController::currentCallFrame.
2922         (WebCore::pauseInDebugger): Call InspectorController::pauseInDebugger.
2923         (WebCore::resumeDebugger): Call InspectorController::resumeDebugger.
2924         (WebCore::stepOverStatementInDebugger): Call InspectorController::stepOverStatementInDebugger.
2925         (WebCore::stepIntoStatementInDebugger): Call InspectorController::stepIntoStatementInDebugger.
2926         (WebCore::stepOutOfFunctionInDebugger): Call InspectorController::stepOutOfFunctionInDebugger.
2927         (WebCore::addBreakpoint): Call InspectorController::addBreakpoint.
2928         (WebCore::removeBreakpoint): Call InspectorController::removeBreakpoint.
2929         (WebCore::InspectorController::windowScriptObjectAvailable): Add the new functions to the
2930         InspectorController JavaScript class.
2931         (WebCore::InspectorController::startDebuggingAndReloadInspectedPage): Clear breakpoints.
2932         (WebCore::InspectorController::currentCallFrame): Return the currentCallFrame from the
2933         JavaScriptDebugServer.
2934         (WebCore::InspectorController::pauseInDebugger): Call JavaScriptDebugServer's pauseOnNextStatement.
2935         (WebCore::InspectorController::resumeDebugger): Call JavaScriptDebugServer's resume.
2936         (WebCore::InspectorController::stepOverStatementInDebugger):  Call JavaScriptDebugServer's stepOverStatement.
2937         (WebCore::InspectorController::stepIntoStatementInDebugger): Call JavaScriptDebugServer's stepIntoStatement.
2938         (WebCore::InspectorController::stepOutOfFunctionInDebugger): Call JavaScriptDebugServer's stepOutOfFunction.
2939         (WebCore::InspectorController::addBreakpoint): Call JavaScriptDebugServer's addBreakpoint.
2940         (WebCore::InspectorController::removeBreakpoint): Call JavaScriptDebugServer's removeBreakpoint.
2941         (WebCore::InspectorController::didParseSource): Call into the Inspector's JavaScript.
2942         (WebCore::InspectorController::failedToParseSource): Ditto.
2943         (WebCore::InspectorController::didPause): Ditto.
2944         * page/InspectorController.h: Add new functions.
2945
2946 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2947
2948         Implements more debugger APIs on JavaScriptDebugServer and reduces
2949         the number of callbacks to JavaScriptDebugListeners. These changes
2950         will better facilitate debugger optimizations when SquirrelFish merges.
2951
2952         Reviewed by Kevin McCullough.
2953
2954         * page/InspectorController.cpp:
2955         (WebCore::InspectorController::didParseSource): Removed the ExecState.
2956         (WebCore::InspectorController::failedToParseSource): Ditto.
2957         (WebCore::InspectorController::didPause): Added.
2958         * page/InspectorController.h: Changed the JavaScriptDebugListener functions.
2959         * page/JavaScriptDebugListener.h: Removed some callbacks and added didPause.
2960         * page/JavaScriptDebugServer.cpp:
2961         (WebCore::JavaScriptDebugServer::JavaScriptDebugServer): Initialize new data members.
2962         (WebCore::JavaScriptDebugServer::~JavaScriptDebugServer): Delete all values of m_breakpoints.
2963         (WebCore::JavaScriptDebugServer::removeListener): Call resume if the last listener was removed.
2964         (WebCore::JavaScriptDebugServer::hasListenersInterestedInPage): Returns true if there are any
2965         global listeners or a listener for the page.
2966         (WebCore::JavaScriptDebugServer::addBreakpoint): Adds and entry to m_breakpoints.
2967         (WebCore::JavaScriptDebugServer::removeBreakpoint): Removes a entry in m_breakpoints.
2968         (WebCore::JavaScriptDebugServer::hasBreakpoint):  Checks if there is a breakpoint for the
2969         sourceID and line.
2970         (WebCore::JavaScriptDebugServer::clearBreakpoints): Removed all breakpoints.
2971         (WebCore::JavaScriptDebugServer::pauseOnNextStatement): Sets m_pauseOnNextStatement to true.
2972         (WebCore::JavaScriptDebugServer::resume): Sets m_paused to false.
2973         (WebCore::JavaScriptDebugServer::stepIntoStatement): Calls resume and sets
2974         m_pauseOnNextStatement to true.
2975         (WebCore::JavaScriptDebugServer::stepOverStatement): Calls resume and sets m_pauseOnExecState to
2976         the current call frame's ExecState.
2977         (WebCore::JavaScriptDebugServer::stepOutOfFunction): Calls resume and sets m_pauseOnExecState to
2978         the current call frame's caller ExecState.
2979         (WebCore::JavaScriptDebugServer::currentCallFrame): Returns m_currentCallFrame if paused.
2980         (WebCore::dispatchDidParseSource): Removed the ExecState argument.
2981         (WebCore::dispatchFailedToParseSource): Ditto.
2982         (WebCore::JavaScriptDebugServer::sourceParsed): Doesn't pass the ExecState to dispatchDidParseSource
2983         or dispatchFailedToParseSource.
2984         (WebCore::dispatchFunctionToListeners):
2985         (WebCore::JavaScriptDebugServer::dispatchFunctionToListeners): Removes all the arguments passed
2986         to the callback.
2987         (WebCore::JavaScriptDebugServer::setJavaScriptPaused): Various overloaded functions
2988         to pause parts of WebCore to prevent JavaScript execution while paused.
2989         (WebCore::JavaScriptDebugServer::pauseIfNeeded): Decides if the debugger should pause based
2990         on the passed in ExecState, source ID and line number. This checks for breakpoints, stepping, etc.
2991         Calls didPause on all the listeners and spins a EventLoop until resume is called.
2992         (WebCore::JavaScriptDebugServer::callEvent): Call pauseIfNeeded.
2993         (WebCore::JavaScriptDebugServer::atStatement): Ditto.
2994         (WebCore::JavaScriptDebugServer::returnEvent): Ditto.
2995         (WebCore::JavaScriptDebugServer::exception): Ditto.
2996         * page/JavaScriptDebugServer.h: Added new functions.
2997
2998 2008-05-13  Timothy Hatcher  <timothy@apple.com>
2999
3000         Change View.show to call detach if the parentNode dosen't
3001         match before appending to the passed in parent element.
3002         This also prevents appending to the same parent element
3003         multiple times.
3004
3005         Reviewed by John Sullivan.
3006
3007         * page/inspector/FontView.js:
3008         (WebInspector.FontView.prototype.show): Pass the parent element to View.show.
3009         * page/inspector/ResourceView.js: Optimize the attach method to no append if
3010         there is a parentNode already.
3011         * page/inspector/SourceView.js: Ditto.
3012         * page/inspector/View.js: Call detach before appending if the parentNode
3013         doesn't match the passed in element.
3014
3015 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3016
3017         Optimize the panel attach method to no append if there is a
3018         parentNode already.
3019
3020         Reviewed by Adam Roben.
3021
3022         * page/inspector/Panel.js:
3023         (WebInspector.Panel.prototype.attach): Don't append to main-panels
3024         if the panel element already has a parentNode.
3025
3026 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3027
3028         Add Widget::isPluginView so the JavaScriptDebugServer can identify
3029         plugins that need to be paused during debugging. This will be used
3030         in a upcoming commit.
3031
3032         Reviewed by Kevin McCullough.
3033
3034         * platform/Widget.h: Add isPluginView. Return false.
3035         * plugins/PluginView.h: Add isPluginView. Return true.
3036
3037 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3038
3039         Adds an event loop abstraction to platform. This abstraction will be
3040         used by the JavaScriptDebugServer to implement pausing.
3041
3042         Reviewed by Kevin McCullough.
3043
3044         * platform/EventLoop.h: Added.
3045         (WebCore::EventLoop::EventLoop):
3046         (WebCore::EventLoop::ended): Return m_ended.
3047         * platform/mac/EventLoopMac.mm: Added.
3048         (WebCore::EventLoop::cycle): Call nextEventMatchingMask and then sendEvent.
3049         * platform/win/EventLoopWin.cpp: Added.
3050         (WebCore::EventLoop::cycle): Call GetMessage, TranslateMessage and DispatchMessage.
3051         * WebCore.xcodeproj/project.pbxproj: Add new files.
3052         * WebCore.vcproj/WebCore.vcproj: Ditto.
3053
3054 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3055
3056         Breaks out ObjectPropertiesSection from PropertiesSidebarPane
3057         so it can be used by the Scripts panel's Scope Chain pane.
3058
3059         Rubber-stamped by Adam Roben.
3060
3061         * page/inspector/ObjectPropertiesSection.js: Added.
3062         * page/inspector/PropertiesSidebarPane.js: Moved ObjectPropertiesSection
3063         to ObjectPropertiesSection.js.
3064         * WebCore.vcproj/WebCore.vcproj: Add the new file.
3065         * page/inspector/WebKit.qrc: Ditto.
3066         * page/inspector/inspector.html: Ditto.
3067
3068 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3069
3070         Add a helper function to the Inspector's Array prototype
3071         that will remove any identical values/objects from the array.
3072
3073         Reviewed by Kevin McCullough.
3074
3075         * page/inspector/utilities.js:
3076         (Array.prototype.remove): Iterate over the array and strict
3077         compare to the passed in value. If they match, splice that index
3078         out of the array. If onlyFirst is true, return after the first splice.
3079
3080 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3081
3082         Adds a JavaScriptCallFrame object and JavaScript binding with an IDL.
3083         This object will expose the stack to the Inspector's debugger.
3084
3085         Reviewed by Adam Roben.
3086
3087         * DerivedSources.make: Add JavaScriptCallFrame.
3088         * bindings/js/JSJavaScriptCallFrameCustom.cpp: Added.
3089         (WebCore::JSJavaScriptCallFrame::evaluate): Calls impl evaluate and returns the result.
3090         (WebCore::JSJavaScriptCallFrame::scopeChain): Makes an array of the ScopeChain.
3091         * page/JavaScriptCallFrame.cpp: Added.
3092         (WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
3093         (WebCore::JavaScriptCallFrame::caller): Returns m_caller.
3094         (WebCore::JavaScriptCallFrame::functionName): Returns the function
3095         name from the ExecState if this is not global code or anonymous.
3096         (WebCore::JavaScriptCallFrame::evaluate): Evaluates a script string
3097         in the scope of the call frame.
3098         * page/JavaScriptCallFrame.h: Added.
3099         (WebCore::JavaScriptCallFrame::create): Call the ctor can return in a PassRefPtr.
3100         (WebCore::JavaScriptCallFrame::invalidate): Sets m_mexec to 0. This prevents a
3101         stale ExecState from being accessed after the lifetime of the ExecState.
3102         (WebCore::JavaScriptCallFrame::isValid): Checks if m_exec is 0.
3103         (WebCore::JavaScriptCallFrame::execState): Returns m_exec.
3104         (WebCore::JavaScriptCallFrame::sourceIdentifier): Returns m_sourceID.
3105         (WebCore::JavaScriptCallFrame::line): Returns m_line.
3106         (WebCore::JavaScriptCallFrame::setLine): Sets m_line.
3107         (WebCore::JavaScriptCallFrame::scopeChain): Returns by reference m_exec->scopeChain().
3108         * page/JavaScriptCallFrame.idl: Added.
3109         * WebCore.xcodeproj/project.pbxproj: Add new files.
3110         * WebCore.vcproj/WebCore.vcproj: Ditto.
3111
3112 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3113
3114         Add a new WebInspector.Object base class that will be used for
3115         a few objects in the Web Inspector to support listeners on any
3116         object. This will help add more abstraction to the Inspector.
3117
3118         Reviewed by Adam Roben.
3119
3120         * page/inspector/Object.js: Added.
3121         (WebInspector.Object): Does nothing.
3122         (WebInspector.Object.prototype.addEventListener): Adds the listener to
3123         the _listeners map by type. Supports a this object argument, for easy
3124         addition of listeners without the need for bind.
3125         (WebInspector.Object.prototype.removeEventListener): Remove the listener
3126         from the _listeners map. If the listener is null and the thisObject was
3127         passed, remove any listener for that thisObject.
3128         (WebInspector.Object.prototype.dispatchEventToListeners): Sends an event
3129         for a type to all listeners for that type. Mimics some of the DOMEvent
3130         methods and properties for the event object passed to the listeners.
3131         * WebCore.vcproj/WebCore.vcproj: Add new files.
3132         * page/inspector/WebKit.qrc: Ditto.
3133         * page/inspector/inspector.html: Ditto.
3134
3135 2008-05-13  Timothy Hatcher  <timothy@apple.com>
3136
3137         Update the view source CSS to better match the new Inspector mock-ups.
3138
3139         Reviewed by Kevin McCullough.
3140
3141         * css/view-source.css:
3142
3143 2008-05-13  John Sullivan  <sullivan@apple.com>
3144
3145         Reviewed by Dan Bernstein and Kevin Decker
3146         
3147         - fixed <rdar://problem/5879597> reproducible crash in HTMLSelectElement::typeAheadFind
3148
3149         Test: fast/forms/select-type-ahead-list-box-no-selection.html
3150
3151         * html/HTMLSelectElement.cpp:
3152         (WebCore::HTMLSelectElement::typeAheadFind):
3153         When there's no initially-selected element, we were accessing index -1. Check for this
3154         case and start at 0.
3155
3156 2008-05-13  Sam Weinig  <sam@webkit.org>
3157
3158         Reviewed by Dan Bernstein.
3159
3160         Small cleanup to XMLHttpRequest in preparation for Access Control changes.
3161
3162         * xml/XMLHttpRequest.cpp:
3163         (WebCore::XMLHttpRequest::XMLHttpRequest):
3164         (WebCore::XMLHttpRequest::~XMLHttpRequest):
3165         (WebCore::XMLHttpRequest::open):
3166         (WebCore::XMLHttpRequest::send):
3167         (WebCore::XMLHttpRequest::internalAbort):
3168         (WebCore::XMLHttpRequest::processSyncLoadResults):
3169         (WebCore::XMLHttpRequest::didFinishLoading):
3170         (WebCore::XMLHttpRequest::didReceiveResponse):
3171         (WebCore::XMLHttpRequest::didReceiveData):
3172         * xml/XMLHttpRequest.h:
3173
3174 2008-05-13  chris fleizach  <cfleizach@apple.com>
3175
3176         Beth Dakin
3177
3178         <rdar://problem/5701210> VO: If image is missing, VoiceOver does not speak the alternative text.
3179
3180         * page/AccessibilityRenderObject.cpp:
3181         (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
3182
3183 2008-05-13  chris fleizach  <cfleizach@apple.com>
3184
3185         Beth Dakin
3186
3187         <rdar://problem/5908446> AX: webkit needs to return blockquote information for all AX objects, not just in AXTextMarker info
3188
3189         * page/mac/AccessibilityObjectWrapper.mm:
3190         (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
3191         (-[AccessibilityObjectWrapper accessibilityAttributeValue:]):
3192
3193 2008-05-13  Alexey Proskuryakov  <ap@webkit.org>
3194
3195         Reviewed by John Sullivan.
3196
3197         <rdar://problem/4852077> REGRESSION: The content of the HTML file which is saved as Thai
3198         (ISO 8859-11) disappear.
3199
3200         <rdar://problem/5842597> Thai ISO-8859-11 should be upgraded to Windows-874
3201
3202         Test: fast/encoding/char-decoding.html
3203
3204         * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::registerExtendedEncodingNames):
3205         Register ISO-8859-11, which doesn't have a standard IANA name, despite following
3206         the usual 8859 naming scheme. Also, made TIS-620 map to windows-874-2000 explicitly.
3207
3208 2008-05-13  chris fleizach  <cfleizach@apple.com>
3209
3210         Reviewed by Beth Dakin
3211
3212         <rdar://problem/5471973> Some AXLinks are not getting AXTitles though there is title text
3213
3214         * page/AccessibilityRenderObject.cpp:
3215         (WebCore::AccessibilityRenderObject::title):
3216
3217 2008-05-13  Alexey Proskuryakov  <ap@webkit.org>
3218
3219         Reviewed by Eric Seidel.
3220
3221         https://bugs.webkit.org/show_bug.cgi?id=18681
3222         <rdar://problem/5888130> WebKit should not remove BOM characters from content.
3223
3224         We were only trying to match Firefox, and it doesn't do this any more.
3225
3226         Tests: fast/encoding/bom-in-content.html
3227                fast/encoding/bom-in-content-utf16.html
3228
3229         * platform/text/TextDecoder.cpp: (WebCore::TextDecoder::checkForBOM): Skip the BOM if it's
3230         at the start of input stream.
3231
3232         * platform/text/TextCodec.cpp:
3233         * platform/text/TextCodec.h:
3234         * platform/text/TextCodecICU.cpp:
3235         (WebCore::TextCodecICU::decode):
3236         * platform/text/TextCodecUTF16.cpp:
3237         (WebCore::TextCodecUTF16::decode):
3238         * platform/text/mac/TextCodecMac.cpp:
3239         (WebCore::TextCodecMac::decode):
3240         Don't remove the BOM.
3241
3242 2008-05-13  Anders Carlsson  <andersca@apple.com>
3243
3244         Reviewed by Darin.
3245
3246         Don't crash when a document loader is destroyed while an initial caching attempt
3247         is in progress.
3248
3249         * loader/appcache/ApplicationCacheGroup.cpp:
3250         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
3251         Stop loading.
3252         
3253         (WebCore::ApplicationCacheGroup::stopLoading):
3254         New method that stops a cache update.
3255         
3256         (WebCore::ApplicationCacheGroup::documentLoaderDestroyed):
3257         Delete ourselves here.
3258         
3259         * loader/appcache/ApplicationCacheGroup.h:
3260
3261 2008-05-13  Alexey Proskuryakov  <ap@webkit.org>
3262
3263         Reviewed by Darin.
3264
3265         <rdar://problem/5841351> Turkish ISO 8859-9 encoding should be treated as windows-1254
3266
3267         Match IE and upgrade ISO-8859-9 to windows-1254, which is its strict superset.
3268
3269         Test: fast/encoding/char-decoding.html
3270
3271         * platform/text/TextCodecICU.cpp:
3272         (WebCore::TextCodecICU::registerExtendedEncodingNames): Register the standard name
3273         unconditionally. Previously, we registered windows-949-2000 as a special case that lacked 
3274         an IANA standard name, and got away with not registering GBK because it happened
3275         to be reported by ICU normally earlier than any encoding upgraded to it.
3276
3277 2008-05-13  Tor Arne Vestbø  <tavestbo@trolltech.com>
3278
3279         Reviewed by Simon
3280
3281         Fix QtWebKit build on Qt embedded.
3282
3283         * WebCore.pro:
3284         * platform/FileSystem.h:
3285         * platform/qt/FileSystemQt.cpp:
3286
3287 2008-05-13  Ariya Hidayat  <ariya.hidayat@trolltech.com>
3288
3289         Reviewed by Simon.
3290
3291         For Gtk/X11 and Qt/X11, use a more extensive plug-ins scan directories set
3292
3293         * plugins/PluginDatabase.cpp:
3294         (WebCore::addMozillaPluginDirectories):
3295         (WebCore::PluginDatabase::isPreferredPluginDirectory):
3296
3297 2008-05-12  Adam Roben  <aroben@apple.com>
3298
3299         Turn on warnings as errors in WebCore.vcproj
3300
3301         Rubberstamped by Anders Carlsson.
3302
3303         * WebCore.vcproj/WebCore.vcproj: Also let VS reformat the file as it
3304         saw fit. The important part is the removal of the WarnAsError="false"
3305         lines.
3306
3307 2008-05-12  Adam Roben  <aroben@apple.com>
3308
3309         Fix a MSVC warning in PluginViewWin
3310
3311         Reviewed by Anders Carlsson.
3312
3313         Test: http/tests/plugins/post-url-file.html
3314
3315         * plugins/win/PluginViewWin.cpp:
3316         (WebCore::PluginView::handlePostReadFile): Added a missing return
3317         statement.
3318
3319 2008-05-12  Adam Roben  <aroben@apple.com>
3320
3321         Fix a MSVC warning in GetEOTHeader
3322
3323         Reviewed by Dan Bernstein.
3324
3325         * platform/graphics/win/GetEOTHeader.cpp:
3326         (WebCore::getEOTHeader): MSVC complains that having a 0-sized array in
3327         a struct is a non-standard extension. I've replaced the 0-sized arrays
3328         with arrays of 1 element, and replaced sizeof(structType) with
3329         offsetof(structType, arrayMember).
3330
3331 2008-05-09  Adam Roben  <aroben@apple.com>
3332
3333         Fix a MSVC warning in TextCodecICU
3334
3335         Reviewed by John Sullivan and Dan Bernstein.
3336
3337         * platform/text/TextCodecICU.cpp:
3338         (WebCore::ErrorCallbackSetter::~ErrorCallbackSetter):
3339         UCNV_SUB_STOP_ON_ILLEGAL is a string literal, so using == with it
3340         doesn't really do what we want. Use strcmp instead. It's OK to pass an
3341         unknown value to strcmp here since 1) UCNV_SUB_STOP_ON_ILLEGAL is only
3342         a single character long so we're not going to ready more than 2 bytes
3343         from oldContext, and 2) we're inside an ASSERT which will cause a
3344         crash anyway if it fails.
3345
3346 2008-05-09  Adam Roben  <aroben@apple.com>
3347
3348         Fix a MSVC warning in CSSComputedStyleDeclaration
3349
3350         Reviewed by Geoff Garen.
3351
3352         * css/CSSComputedStyleDeclaration.cpp:
3353         (WebCore::valueForRepeatRule): Removed some unreachable code.
3354
3355 2008-05-09  Adam Roben  <aroben@apple.com>
3356
3357         Fix a MSVC warning in InlineTextBox
3358
3359         Reviewed by Dan Bernstein.
3360
3361         * rendering/InlineTextBox.cpp:
3362         (WebCore::InlineTextBox::paint): Initialize some variables that MSVC
3363         isn't smart enough to figure out will always be initialized in the
3364         cases where they are used.
3365
3366 2008-05-09  Adam Roben  <aroben@apple.com>
3367
3368         Fix a MSVC warning in Position
3369
3370         Reviewed by Darin Adler.
3371
3372         * dom/Position.cpp:
3373         (WebCore::Position::getInlineBoxAndOffset): Use parentheses to make
3374         the precedence of our expressions explicit.
3375
3376 2008-05-09  Adam Roben  <aroben@apple.com>
3377
3378         Fix a MSVC warning in String
3379
3380         Reviewed by Geoff Garen.
3381
3382         * platform/text/String.cpp:
3383         (WebCore::toIntegralType): Disable a bogus warning about using unary -
3384         on an unsigned value. MSVC isn't smart enough to figure out that
3385         isNegative will always be false when value is unsigned.
3386
3387 2008-05-09  Adam Roben  <aroben@apple.com>
3388
3389         Fix a MSVC warning in XMLHttpRequest
3390
3391         Reviewed by Geoff Garen.
3392
3393         * xml/XMLHttpRequest.cpp:
3394         (WebCore::XMLHttpRequest::XMLHttpRequest): Added static_cast<unsigned
3395         long>.
3396
3397 2008-05-12  Anders Carlsson  <andersca@apple.com>
3398
3399         Reviewed by Adam.
3400
3401         Handle the case when a resource with the same URL as the manifest is listed in the manifest.
3402
3403         * loader/appcache/ApplicationCacheGroup.cpp:
3404         (WebCore::ApplicationCacheGroup::addEntry):
3405
3406 2008-05-12  Sam Weinig  <sam@webkit.org>
3407
3408         Reviewed by Dan Bernstein.
3409
3410         Add parsing of AccessControlHeader and AccessItemRule.
3411
3412         * xml/AccessControlList.cpp:
3413         (WebCore::AccessControlList::parseAccessControlHeader): When multiple http headers are sent
3414         in the response, the engine will concatenate them with commas separating the rules.  This simply
3415         reverses that process by splitting on the commas.
3416         (WebCore::AccessControlList::show):
3417         * xml/AccessControlList.h:
3418         * xml/AccessItem.cpp:
3419         (WebCore::AccessItem::AccessItem):
3420         (WebCore::AccessItem::show):
3421         * xml/AccessItem.h:
3422         (WebCore::AccessItem::isValid):
3423         * xml/AccessItemRule.cpp:
3424         (WebCore::skipLWS):
3425         (WebCore::AccessItemRule::parseAccessItemRule): Parse the rule according to the BNF provided by
3426         the Access Control spec.
3427         (WebCore::AccessItemRule::parsePatternList):
3428         (WebCore::AccessItemRule::invalidate):
3429         (WebCore::AccessItemRule::show):
3430         * xml/AccessItemRule.h:
3431
3432 2008-05-12  David Kilzer  <ddkilzer@apple.com>
3433
3434         Fix logic error in DocLoader::clearPreloads()
3435
3436         Reviewed by Antti.
3437
3438         * loader/DocLoader.cpp:
3439         (WebCore::DocLoader::clearPreloads): Be sure to decrease the preload count for
3440         the cached resource before trying to remove it from the cache.  A non-zero
3441         preload count can prevent the resource from being removed from the cache.
3442
3443 2008-05-12  Anders Carlsson  <andersca@apple.com>
3444
3445         Reviewed by Adam.
3446
3447         Handle empty manifest files without crashing.
3448         
3449         * loader/appcache/ApplicationCacheGroup.cpp:
3450         (WebCore::ApplicationCacheGroup::startLoadingEntry):
3451
3452 2008-05-12  Alp Toker  <alp@nuanti.com>
3453
3454         GTK+ build fix for breakage in r33056. Include limits.h for INT_MAX.
3455
3456         * platform/graphics/FontCache.h:
3457
3458 2008-05-12  Anders Carlsson  <andersca@apple.com>
3459
3460         Reviewed by Adam.
3461
3462         Add user agent to requests when loading/updating the cache.
3463     
3464         * loader/FrameLoader.h:
3465         * loader/appcache/ApplicationCacheGroup.cpp:
3466         (WebCore::ApplicationCacheGroup::update):
3467         (WebCore::ApplicationCacheGroup::startLoadingEntry):
3468
3469 2008-05-12  Anders Carlsson  <andersca@apple.com>
3470
3471         Reviewed by Adam.
3472
3473         Make it possible to perform synchronous loads from the application cache.
3474         
3475         * loader/DocumentLoader.cpp:
3476         (WebCore::DocumentLoader::shouldLoadResourceFromApplicationCache):
3477         Factor out code from scheduleApplicationCacheLoad in its own method.
3478         
3479         (WebCore::DocumentLoader::scheduleApplicationCacheLoad):
3480         Call shouldLoadResourceFromApplicationCache here instead.
3481         
3482         * loader/DocumentLoader.h:
3483         
3484         * loader/FrameLoader.cpp:
3485         (WebCore::FrameLoader::loadResourceSynchronously):
3486         Call shouldLoadResourceFromApplicationCache.
3487
3488 2008-05-12  Dan Bernstein  <mitz@apple.com>
3489
3490         Reviewed by Ada Chan and Sam Weinig.
3491
3492         - WebCore changes for https://bugs.webkit.org/show_bug.cgi?id=17097
3493           <rdar://problem/5715471> CGFontRefs (and HFONTs on Windows) leak because FontCache grows without bound
3494
3495         Added a way for clients to let the cache know that they no longer need
3496         font data, which lets the cache release it. Changed clients to track
3497         most of the font data they get from the cache so that they can later
3498         release it. Some instances of font data -- namely, those used for system
3499         font fallback -- are still not tracked and will therefore remain in the
3500         cache indefinitely.
3501
3502         * WebCore.base.exp: Added exports for WebCoreStatistics in WebKit.
3503
3504         * platform/graphics/Font.cpp:
3505         (WebCore::Font::Font): Changed to use FontFallbackList::create().
3506         (WebCore::Font::update): Ditto.
3507
3508         * platform/graphics/FontCache.cpp:
3509         (WebCore::FontCache::getCachedFontData): Added code to track the number
3510         of times a SimpleFontData instance has been requested from the cache,
3511         remove requested instances from the inactive list, and purge inactive
3512         font data if the inactive list has grown above its maximum allowed size.
3513         (WebCore::FontCache::releaseFontData): Added. Called by clients to let
3514         the cache know that they no longer need the font data. Adds the font
3515         data to the inactive list if the last client has released it.
3516         (WebCore::FontCache::purgeInactiveFontData): Added. Removes inactive
3517         font data from the cache (and the inactive list).
3518         (WebCore::FontCache::fontDataCount): Added to provide statistics.
3519         (WebCore::FontCache::inactiveFontDataCount): Ditto.
3520
3521         * platform/graphics/FontCache.h:
3522
3523         * platform/graphics/FontData.h:
3524         (WebCore::FontData::FontData): Added a member variable to store the
3525         highest glyph page tree level in which there is a node for this FontData.
3526         This is used to limit the depth of the search when pruning glyph page
3527         trees.
3528         (WebCore::FontData::setMaxGlyphPageTreeLevel): Added this accessor.
3529         (WebCore::FontData::maxGlyphPageTreeLevel): Ditto.
3530
3531         * platform/graphics/FontFallbackList.cpp:
3532         (WebCore::FontFallbackList::FontFallbackList): Changed to start with a
3533         refcount of 1.
3534         (WebCore::FontFallbackList::invalidate): Added a call to
3535         releaseFontData().
3536         (WebCore::FontFallbackList::releaseFontData): Added. Lets the font cache
3537         know that we no longer need the FontData in our font list.
3538         (WebCore::FontFallbackList::fontDataAt): Changed to record in the font
3539         list whether the font data is a custom font data or not.
3540         (WebCore::FontFallbackList::setPlatformFont): Ditto.
3541
3542         * platform/graphics/FontFallbackList.h:
3543         (WebCore::FontFallbackList::create): Added and made the constructor
3544         private.
3545         (WebCore::FontFallbackList::~FontFallbackList): Added a call to
3546         releaseFontData().
3547
3548         * platform/graphics/GlyphPageTreeNode.cpp:
3549         (WebCore::GlyphPageTreeNode::treeGlyphPageCount): Added to provide
3550         statistics.
3551         (WebCore::GlyphPageTreeNode::pageCount): Ditto.
3552
3553         (WebCore::GlyphPageTreeNode::pruneTreeFontData): Added.
3554         (WebCore::GlyphPageTreeNode::getChild): Added code to update the font
3555         data's maximum glyph page tree level.
3556         (WebCore::GlyphPageTreeNode::pruneFontData): Added.
3557
3558         * platform/graphics/GlyphPageTreeNode.h:
3559
3560         * platform/graphics/SimpleFontData.cpp:
3561         (WebCore::SimpleFontData::~SimpleFontData): Added code to let the font
3562         cache know that we no longer need the small caps font data and to prune
3563         the glyph page trees.
3564
3565 2008-05-12  Anders Carlsson  <andersca@apple.com>
3566
3567         Reviewed by Alexey.
3568
3569         Add ApplicationCacheStorage::empty() method which will empty
3570         the application cache database.
3571         
3572         * WebCore.base.exp:
3573         * loader/appcache/ApplicationCache.cpp:
3574         (WebCore::ApplicationCache::clearStorageID):
3575         * loader/appcache/ApplicationCache.h:
3576         * loader/appcache/ApplicationCacheGroup.cpp:
3577         (WebCore::ApplicationCacheGroup::clearStorageID):
3578         * loader/appcache/ApplicationCacheGroup.h:
3579         * loader/appcache/ApplicationCacheResource.h:
3580         (WebCore::ApplicationCacheResource::clearStorageID):
3581         * loader/appcache/ApplicationCacheStorage.cpp:
3582         (WebCore::ApplicationCacheStorage::empty):
3583         * loader/appcache/ApplicationCacheStorage.h:
3584
3585 2008-05-12  Anders Carlsson  <andersca@apple.com>
3586
3587         Reviewed by John.
3588
3589         Don't throw an exception if the string passed in is an invalid URL.
3590         
3591         * loader/appcache/DOMApplicationCache.cpp:
3592         (WebCore::DOMApplicationCache::remove):
3593
3594 2008-05-12  Anders Carlsson  <andersca@apple.com>
3595
3596         Reviewed by Mitz.
3597
3598         Add the variable enums for getting the input vtables.
3599         
3600         * bridge/npapi.h:
3601
3602 2008-05-12  Adam Roben  <aroben@apple.com>
3603
3604         Windows build fix
3605
3606         * WebCorePrefix.cpp: Touched this so that it will rebuild now that
3607         ENABLE_CROSS_DOCUMENT_MESSAGING has been removed.
3608
3609 2008-05-12  Alexey Proskuryakov  <ap@webkit.org>
3610
3611         Roll out recent  threading changes (r32807, r32810, r32819, r32822) to simplify
3612         SquirrelFish merging.
3613
3614         * bindings/js/GCController.cpp:
3615         (WebCore::collect):
3616         (WebCore::GCController::gcTimerFired):
3617         (WebCore::GCController::garbageCollectNow):
3618         * bindings/js/JSAudioConstructor.cpp:
3619         (WebCore::JSAudioConstructor::JSAudioConstructor):
3620         * bindings/js/JSCSSRuleCustom.cpp:
3621         (WebCore::toJS):
3622         *