2009-04-15 Eric Roman <eroman@chromium.org>
[WebKit-https.git] / WebCore / ChangeLog
1 2009-04-15  Eric Roman  <eroman@chromium.org>
2
3         Reviewed by Darin Adler.
4
5         https://bugs.webkit.org/show_bug.cgi?id=25194
6
7         Fix a caller of Settings::javaScriptCanOpenWindowsAutomatically() to
8         use the new name.
9
10         * bindings/v8/custom/V8DOMWindowCustom.cpp:
11
12 2009-04-14  Alexey Proskuryakov  <ap@webkit.org>
13
14         Rubber-stamped by Darin Adler.
15
16         Don't keep platform objects for authentication challenge in ResourceHandleInternal.
17         We already have a copy in AuthenticationChallenge object.
18
19         * platform/network/ResourceHandle.cpp:
20         (WebCore::ResourceHandle::clearAuthentication):
21         * platform/network/ResourceHandleInternal.h:
22         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
23         * platform/network/cf/ResourceHandleCFNet.cpp:
24         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
25         (WebCore::ResourceHandle::receivedCredential):
26         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
27         (WebCore::ResourceHandle::receivedCancellation):
28         * platform/network/mac/ResourceHandleMac.mm:
29         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
30         (WebCore::ResourceHandle::didCancelAuthenticationChallenge):
31         (WebCore::ResourceHandle::receivedCredential):
32         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
33         (WebCore::ResourceHandle::receivedCancellation):
34
35 2009-04-14  Geoffrey Garen  <ggaren@apple.com>
36
37         Reviewed by Sam Weinig.
38
39         Nixed some now-defunct autogeneration code.
40
41         * bindings/scripts/CodeGeneratorJS.pm:
42
43 2009-04-14  Eric Carlson  <eric.carlson@apple.com>
44
45         Reviewed by Alexey Proskuryakov.
46         
47         Fix <rdar://problem/6755724> <audio> and <video> elements can reference local 
48         file:/// URLs from remote in Safari
49
50         Tests: http/tests/security/local-video-poster-from-remote.html
51                http/tests/security/local-video-source-from-remote.html
52                http/tests/security/local-video-src-from-remote.html
53
54         * html/HTMLMediaElement.cpp:
55         (WebCore::HTMLMediaElement::loadResource): Don't pass url to media engine unless loader->canLoad()
56         says it is OK.
57
58 2009-04-14  Sam Weinig  <sam@webkit.org>
59
60         Reviewed by Darin Adler.
61
62         Part of <rdar://problem/6150868>
63         Fix incorrect handling of content that needs to go into the head element
64         once the head element has been removed.
65
66         Test: fast/parser/head-content-after-head-removal.html
67
68         * html/HTMLParser.cpp:
69         (WebCore::HTMLParser::HTMLParser): Remove unneeded initializer of m_head.
70         (WebCore::HTMLParser::handleError): Update since m_head is now a RefPtr.
71         (WebCore::HTMLParser::createHead): Ditto.
72         * html/HTMLParser.h: Make m_head a RefPtr.
73
74 2009-04-14  Geoffrey Garen  <ggaren@apple.com>
75
76         Used svn merge -r42529:42528 to roll out my last patch because it broke
77         the build.
78
79         * bindings/js/JSDOMGlobalObject.cpp:
80         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
81         (WebCore::JSDOMGlobalObject::findJSProtectedEventListener):
82         (WebCore::JSDOMGlobalObject::findOrCreateJSProtectedEventListener):
83         (WebCore::JSDOMGlobalObject::jsProtectedEventListeners):
84         (WebCore::JSDOMGlobalObject::jsProtectedInlineEventListeners):
85         * bindings/js/JSDOMGlobalObject.h:
86
87 2009-04-14  Geoffrey Garen  <ggaren@apple.com>
88
89         Reviewed by Sam Weinig.
90
91         Nixed some now-dead code related to protected event listeners.
92
93         * bindings/js/JSDOMGlobalObject.cpp:
94         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
95         * bindings/js/JSDOMGlobalObject.h:
96
97 2009-04-14  Geoffrey Garen  <ggaren@apple.com>
98
99         Reviewed by Sam Weinig.
100
101         More fix for https://bugs.webkit.org/show_bug.cgi?id=21260
102         Unbounded memory growth when churning elements with anonymous event handler functions
103
104         Stop using protected event listeners on SVGElementInstance.
105
106         * bindings/js/JSSVGElementInstanceCustom.cpp:
107         (WebCore::JSSVGElementInstance::mark): Mark our event listeners, since
108         they're not protected anymore.
109
110         (WebCore::JSSVGElementInstance::addEventListener):
111         (WebCore::JSSVGElementInstance::removeEventListener): Make unprotected
112         event listeners, since we mark them now.
113
114         * bindings/scripts/CodeGeneratorJS.pm: Autogenerate event listener
115         invalidation for SVGElementInstance.
116
117         * svg/SVGElementInstance.h:
118         (WebCore::SVGElementInstance::eventListeners): Added an accessor, for
119         the sake of autogenerated code.
120
121         * svg/SVGElementInstance.idl: Removed the ProtectedEventListener attribute
122         from event listener properties. Added a CustomMarkFunction attribute,
123         since we need to mark our event listeners.
124
125 2009-04-14  Steve Falkenburg  <sfalken@apple.com>
126
127         Windows build fix.
128
129         * WebCore.vcproj/WebCore.vcproj:
130
131 2009-04-14  Steve Falkenburg  <sfalken@apple.com>
132
133         Add header guards to WebCore forwarding headers.
134         
135         Speeds up WebCore debug build on Windows by 12% on my system,
136         since Visual Studio appears to not optimize for standard header
137         guards in included files.
138         
139         Rubber stamped by Ada Chan.
140
141         * ForwardingHeaders/debugger/Debugger.h:
142         * ForwardingHeaders/debugger/DebuggerActivation.h:
143         * ForwardingHeaders/debugger/DebuggerCallFrame.h:
144         * ForwardingHeaders/interpreter/CallFrame.h:
145         * ForwardingHeaders/interpreter/Interpreter.h:
146         * ForwardingHeaders/masm/X86Assembler.h:
147         * ForwardingHeaders/parser/Parser.h:
148         * ForwardingHeaders/parser/SourceCode.h:
149         * ForwardingHeaders/parser/SourceProvider.h:
150         * ForwardingHeaders/pcre/pcre.h:
151         * ForwardingHeaders/profiler/Profile.h:
152         * ForwardingHeaders/profiler/ProfileNode.h:
153         * ForwardingHeaders/profiler/Profiler.h:
154         * ForwardingHeaders/runtime/ArgList.h:
155         * ForwardingHeaders/runtime/ArrayPrototype.h:
156         * ForwardingHeaders/runtime/BooleanObject.h:
157         * ForwardingHeaders/runtime/CallData.h:
158         * ForwardingHeaders/runtime/Collector.h:
159         * ForwardingHeaders/runtime/CollectorHeapIterator.h:
160         * ForwardingHeaders/runtime/Completion.h:
161         * ForwardingHeaders/runtime/ConstructData.h:
162         * ForwardingHeaders/runtime/DateInstance.h:
163         * ForwardingHeaders/runtime/Error.h:
164         * ForwardingHeaders/runtime/FunctionConstructor.h:
165         * ForwardingHeaders/runtime/FunctionPrototype.h:
166         * ForwardingHeaders/runtime/Identifier.h:
167         * ForwardingHeaders/runtime/InitializeThreading.h:
168         * ForwardingHeaders/runtime/InternalFunction.h:
169         * ForwardingHeaders/runtime/JSArray.h:
170         * ForwardingHeaders/runtime/JSByteArray.h:
171         * ForwardingHeaders/runtime/JSFunction.h:
172         * ForwardingHeaders/runtime/JSGlobalData.h:
173         * ForwardingHeaders/runtime/JSGlobalObject.h:
174         * ForwardingHeaders/runtime/JSLock.h:
175         * ForwardingHeaders/runtime/JSNumberCell.h:
176         * ForwardingHeaders/runtime/JSObject.h:
177         * ForwardingHeaders/runtime/JSString.h:
178         * ForwardingHeaders/runtime/JSValue.h:
179         * ForwardingHeaders/runtime/Lookup.h:
180         * ForwardingHeaders/runtime/ObjectPrototype.h:
181         * ForwardingHeaders/runtime/Operations.h:
182         * ForwardingHeaders/runtime/PropertyMap.h:
183         * ForwardingHeaders/runtime/PropertyNameArray.h:
184         * ForwardingHeaders/runtime/Protect.h:
185         * ForwardingHeaders/runtime/PrototypeFunction.h:
186         * ForwardingHeaders/runtime/StringObject.h:
187         * ForwardingHeaders/runtime/StringObjectThatMasqueradesAsUndefined.h:
188         * ForwardingHeaders/runtime/StringPrototype.h:
189         * ForwardingHeaders/runtime/Structure.h:
190         * ForwardingHeaders/runtime/SymbolTable.h:
191         * ForwardingHeaders/runtime/UString.h:
192         * ForwardingHeaders/wrec/WREC.h:
193         * ForwardingHeaders/wtf/ASCIICType.h:
194         * ForwardingHeaders/wtf/AlwaysInline.h:
195         * ForwardingHeaders/wtf/Assertions.h:
196         * ForwardingHeaders/wtf/ByteArray.h:
197         * ForwardingHeaders/wtf/CurrentTime.h:
198         * ForwardingHeaders/wtf/Deque.h:
199         * ForwardingHeaders/wtf/DisallowCType.h:
200         * ForwardingHeaders/wtf/FastMalloc.h:
201         * ForwardingHeaders/wtf/Forward.h:
202         * ForwardingHeaders/wtf/GetPtr.h:
203         * ForwardingHeaders/wtf/HashCountedSet.h:
204         * ForwardingHeaders/wtf/HashFunctions.h:
205         * ForwardingHeaders/wtf/HashMap.h:
206         * ForwardingHeaders/wtf/HashSet.h:
207         * ForwardingHeaders/wtf/HashTable.h:
208         * ForwardingHeaders/wtf/HashTraits.h:
209         * ForwardingHeaders/wtf/ListHashSet.h:
210         * ForwardingHeaders/wtf/ListRefPtr.h:
211         * ForwardingHeaders/wtf/Locker.h:
212         * ForwardingHeaders/wtf/MainThread.h:
213         * ForwardingHeaders/wtf/MathExtras.h:
214         * ForwardingHeaders/wtf/MessageQueue.h:
215         * ForwardingHeaders/wtf/Noncopyable.h:
216         * ForwardingHeaders/wtf/NotFound.h:
217         * ForwardingHeaders/wtf/OwnArrayPtr.h:
218         * ForwardingHeaders/wtf/OwnPtr.h:
219         * ForwardingHeaders/wtf/PassRefPtr.h:
220         * ForwardingHeaders/wtf/Platform.h:
221         * ForwardingHeaders/wtf/PtrAndFlags.h:
222         * ForwardingHeaders/wtf/RandomNumber.h:
223         * ForwardingHeaders/wtf/RefCounted.h:
224         * ForwardingHeaders/wtf/RefCountedLeakCounter.h:
225         * ForwardingHeaders/wtf/RefPtr.h:
226         * ForwardingHeaders/wtf/RetainPtr.h:
227         * ForwardingHeaders/wtf/StdLibExtras.h:
228         * ForwardingHeaders/wtf/StringExtras.h:
229         * ForwardingHeaders/wtf/ThreadSpecific.h:
230         * ForwardingHeaders/wtf/Threading.h:
231         * ForwardingHeaders/wtf/TypeTraits.h:
232         * ForwardingHeaders/wtf/UnusedParam.h:
233         * ForwardingHeaders/wtf/Vector.h:
234         * ForwardingHeaders/wtf/VectorTraits.h:
235         * ForwardingHeaders/wtf/dtoa.h:
236         * ForwardingHeaders/wtf/unicode/Collator.h:
237         * ForwardingHeaders/wtf/unicode/UTF8.h:
238         * ForwardingHeaders/wtf/unicode/Unicode.h:
239         * ForwardingHeaders/wtf/unicode/icu/UnicodeIcu.h:
240
241 2009-04-14  Sam Weinig  <sam@webkit.org>
242
243         Reviewed by Adele Peterson.
244
245         Use a template function to generalize the way we create non-caching
246         JS function getters.
247
248         * bindings/js/JSDOMWindowCustom.cpp:
249         * bindings/js/JSDOMWindowCustom.h:
250         (WebCore::nonCachingStaticFunctionGetter):
251         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
252
253 2009-04-14  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
254
255         Reviewed by George Staikos.
256
257         https://bugs.webkit.org/show_bug.cgi?id=25099
258
259         When creating a QNetworkRequest make sure to populate the
260         CacheLoadControlAttribute with the value set by the ResourceRequest::cachePolicy() so that the cache will be used as WebKit expects.
261
262         * WebKit/qt/tests/qwebpage/tst_qwebpage.cpp:
263         (tst_QWebPage::requestCache):
264
265         * platform/network/qt/ResourceRequestQt.cpp:
266         (WebCore::ResourceRequest::toNetworkRequest):
267
268 2009-04-14  Timothy Hatcher  <timothy@apple.com>
269
270         Fix a world leak caused by opening the Web Inspector. This was
271         a regression caused by the InspectorController becoming refcounted.
272
273         <rdar://problem/6782944>
274
275         Reviewed by Darin Adler.
276
277         * bindings/js/ScriptObject.cpp:
278         (WebCore::ScriptGlobalObject::get): Renamed to better match the
279         other functions.
280         (WebCore::ScriptGlobalObject::remove): Added. Deletes the property.
281         * bindings/js/ScriptObject.h:
282         * inspector/InspectorController.cpp:
283         (WebCore::InspectorController::~InspectorController): Do less work
284         at destruction time since the object lifetime is tied to JS GC.
285         Assert that inspectedPageDestroyed cleared everything needed.
286         (WebCore::InspectorController::inspectedPageDestroyed): Do most
287         of the work that ~InspectorController was doing.
288         (WebCore::InspectorController::scriptObjectReady): Renamed getObject.
289
290 2009-04-14  Antony Sargent  <asargent@chromium.org>
291
292         Reviewed by Dimitri Glazkov.
293
294         This is some cleanup motivated by the crash in http://crbug.com/9775 , which 
295         happens because of calling window.open inside a window.onload handler. 
296
297         These changes are just part of the fix, along with some asserts to help prevent
298         breakage on future changes. 
299
300         https://bugs.webkit.org/show_bug.cgi?id=25132
301
302         * bindings/v8/V8EventListenerList.cpp:
303         (WebCore::V8EventListenerList::add):
304         (WebCore::V8EventListenerList::remove):
305         (WebCore::V8EventListenerList::clear):
306         * bindings/v8/V8EventListenerList.h:
307         (WebCore::V8EventListenerList::size):
308
309 2009-04-14  Evan Martin  <evan@chromium.org>
310
311         Reviewed by Darin Adler.
312
313         https://bugs.webkit.org/show_bug.cgi?id=25142
314         Fix a race that can occur between flex and the perl script that parses
315         its output.
316
317         * css/maketokenizer: Consume all input.
318
319 2009-04-14  Rohit Rao  <rohitrao@google.com>
320
321         Reviewed by Dan Bernstein.
322
323         https://bugs.webkit.org/show_bug.cgi?id=25184
324         Do not change the text color for selected text in Mac Chromium.
325
326         * rendering/RenderThemeChromiumMac.h:
327         (WebCore::RenderThemeChromiumMac::supportsSelectionForegroundColors):
328         Now returns false, matching the behavior of Safari on Mac.
329
330 2009-04-14  Justin Garcia  <justin.garcia@apple.com>
331
332         Reviewed by Eric Seidel.
333
334         https://bugs.webkit.org/show_bug.cgi?id=25172
335         Extra partial layout during the first keypress in an empty block
336         
337         Determining if a placeholder needs to be removed requires the creation of a VisiblePosition 
338         which was triggering layout before we were finished modifying the DOM for the insert operation.
339         
340         Find out if we need to remove a placeholder near the start of the operation, and if we do remember 
341         where it's located.  Then, later, remove it along with all of the other DOM operations we perform.
342         
343         Renamed lineBreakExistsAtPosition to lineBreakExistsAtVisiblePosition and added a lineBreakExistsAtPosition
344         that takes in a Position.  In InsertTextCommand, we can use the latter, since we normalize manually.
345         
346         removePlaceholderAt now takes in a Position that it assumes has already been checked for a placeholder.
347         
348         No test added as this only effects performance.
349
350         * editing/BreakBlockquoteCommand.cpp:
351         (WebCore::BreakBlockquoteCommand::doApply):
352         * editing/CompositeEditCommand.cpp:
353         (WebCore::CompositeEditCommand::removePlaceholderAt):
354         (WebCore::CompositeEditCommand::moveParagraphs):
355         (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
356         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
357         * editing/CompositeEditCommand.h:
358         * editing/DeleteSelectionCommand.cpp:
359         (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
360         (WebCore::DeleteSelectionCommand::doApply):
361         * editing/FormatBlockCommand.cpp:
362         (WebCore::FormatBlockCommand::doApply):
363         * editing/InsertLineBreakCommand.cpp:
364         (WebCore::InsertLineBreakCommand::doApply):
365         * editing/InsertParagraphSeparatorCommand.cpp:
366         (WebCore::InsertParagraphSeparatorCommand::doApply):
367         * editing/InsertTextCommand.cpp:
368         (WebCore::InsertTextCommand::input):
369         * editing/htmlediting.cpp:
370         (WebCore::lineBreakExistsAtVisiblePosition):
371         (WebCore::lineBreakExistsAtPosition):
372         * editing/htmlediting.h:
373
374 2009-04-14  Adam Roben  <aroben@apple.com>
375
376         Remove support for profile-guided optimization on Windows
377
378         Rubber-stamped by Steve Falkenburg.
379
380         * WebCore.vcproj/WebCore.vcproj: Removed the Release_PGO
381         configuration.
382
383 2009-04-14  Dmitry Titov  <dimich@chromium.org>
384
385         Reviewed by Dimitri Glazkov.
386
387         https://bugs.webkit.org/show_bug.cgi?id=25163
388         Upstream fix for releasing v8 objects on worker thread termination in Chromium.
389
390         * bindings/v8/V8DOMMap.cpp:
391         (WebCore::domDataList): Now uses Vector instead of HashMap.
392         (WebCore::domDataListMutex):
393         (WebCore::ThreadSpecificDOMData::ThreadSpecificDOMData):  remove usage of currentThread();
394         (WebCore::ThreadSpecificDOMData::~ThreadSpecificDOMData): ditto.
395         (WebCore::NonMainThreadSpecificDOMData::~NonMainThreadSpecificDOMData): moved call to removeAllDOMObjectsInCurrentThread() to ~WorkerScriptController.
396         (WebCore::handleWeakObjectInOwningThread):
397         (WebCore::derefDelayedObjects):
398         (WebCore::removeAllDOMObjectsInCurrentThread): not static anymore.
399         * bindings/v8/V8DOMMap.h:
400         * bindings/v8/WorkerContextExecutionProxy.cpp:
401         (WebCore::WorkerContextExecutionProxy::dispose): removed code that avoided dual-dereference of WorkerContext.
402         (WebCore::WorkerContextExecutionProxy::initContextIfNeeded): this ref() is countered in removeAllDOMObjectsInCurrentThread(), when the WorkerContext is removed from the v8 map.
403         * bindings/v8/WorkerScriptController.cpp:
404         (WebCore::WorkerScriptController::~WorkerScriptController):
405
406 2009-04-14  Adam Roben  <aroben@apple.com>
407
408         Fix Bug 25183: Split up WebCore.vcproj's settings into vsprops files
409
410         <https://bugs.webkit.org/show_bug.cgi?id=25183>
411
412         WebCore.vcproj now uses a set of .vsprops files to store most of its
413         settings.
414
415         Reviewed by Darin Adler.
416
417         * WebCore.vcproj/WebCore.vcproj: Moved settings from here into the new
418         .vsprops files.
419
420         * WebCore.vcproj/WebCoreCFNetwork.vsprops: Added. Contains settings
421         for ports that build against CFNetwork.
422         * WebCore.vcproj/WebCoreCG.vsprops: Added. Contains settings for ports
423         that build against CoreGraphics.
424         * WebCore.vcproj/WebCoreCURL.vsprops: Added. Contains settings for
425         ports that build against libcurl.
426         * WebCore.vcproj/WebCoreCairo.vsprops: Added. Contains settings for
427         ports that build against Cairo.
428         * WebCore.vcproj/WebCoreCommon.vsprops: Added. Contains settings
429         shared by all ports.
430         * WebCore.vcproj/WebCoreMediaQT.vsprops: Added. Contains settings for
431         ports that use QTMovieWin to implement the MediaPlayerPrivate
432         interface.
433         * WebCore.vcproj/WebCorePthreads.vsprops: Added. Contains settings for
434         ports that build against pthreads.
435
436 2009-04-14  Alexey Proskuryakov  <ap@webkit.org>
437
438         Reviewed by Darin Adler.
439
440         http/tests/xmlhttprequest/basic-auth.html fails on Tiger.
441
442         Turns out that NSURLCredentialPersistenceNone doesn't work on Tiger, so we have to use
443         session persistence.
444
445         * platform/network/mac/ResourceHandleMac.mm:
446         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Route the credential through
447         receivedCredential(), ensuring that the Tiger-specific need to use session credentials
448         is honored.
449         (WebCore::ResourceHandle::receivedCredential): On Tiger, change PersistenceNone to
450         PersistenceForSession, because the former doesn't work.
451
452 2009-04-14  Adele Peterson  <adele@apple.com>
453
454         Reviewed by Darin Adler.
455
456         Fix for <rdar://problem/6703873> Triple-click quoted line and type Return creates an extra quoted blank line
457
458         Test: editing/inserting/6703873.html
459
460         * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply):
461         If the startNode's original parent is now empty, we can remove it.  Its already been cloned and copied with the startNode,
462         so we only need to keep it around if it actually holds some original content, otherwise it will look like an extra empty 
463         container in the document.
464
465 2009-04-14  Xan Lopez  <xlopez@igalia.com>
466
467         Reviewed by Holger Freyther.
468
469         https://bugs.webkit.org/show_bug.cgi?id=21546
470         [GTK] ATK accessibility enhancements
471
472         Add a proper implementation of AtkText::get_text and
473         AtkText::get_character_count, which takes into account non
474         TextControl text. With this the 'Text' field in Accerciser's
475         Interface Viewer is filled correctly.
476
477         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
478
479 2009-04-14  Xan Lopez  <xlopez@igalia.com>
480
481         Reviewed by Holger Freyther.
482
483         https://bugs.webkit.org/show_bug.cgi?id=21546
484         [GTK] ATK accessibility enhancements
485
486         Remove some dead code and g_return_if_fail from static functions.
487
488         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
489
490 2009-04-14  Xan Lopez  <xlopez@igalia.com>
491
492         Reviewed by Holger Freyther.
493
494         https://bugs.webkit.org/show_bug.cgi?id=21546
495         [GTK] ATK accessibility enhancements
496
497         Also implement text interface for StaticTextRole, which covers
498         most of the text in web pages.
499
500         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
501
502 2009-04-14  Alexey Proskuryakov  <ap@webkit.org>
503
504         Another Windows build fix.
505
506         * platform/network/cf/ResourceHandleCFNet.cpp:
507         (WebCore::WebCoreSynchronousLoader::load):
508
509 2009-04-14  Alexey Proskuryakov  <ap@webkit.org>
510
511         Windows build fix.
512
513         * platform/network/cf/ResourceHandleCFNet.cpp:
514         (WebCore::WebCoreSynchronousLoader::willSendRequest):
515         (WebCore::WebCoreSynchronousLoader::didReceiveChallenge):
516
517 2009-04-13  Alexey Proskuryakov  <ap@webkit.org>
518
519         Reviewed by Sam Weinig.
520
521         <rdar://problem/6698851> Implement XMLHttpRequest withCredentials attribute
522
523         * WebCore.xcodeproj/project.pbxproj: Made ThreadableLoader.h private, as enum definitions
524         from it are now used in otehr private headers.
525
526         * xml/XMLHttpRequest.h:
527         * xml/XMLHttpRequest.idl:
528         Added withCredentials attribute. When it is false (default), neither credentials nor cookies
529         are sent with cross origin requests, When it is true, those are sent, but the server needs
530         to allow handling results via Access-Control-Allow-Credentials header. It was always possible
531         to send a cross-site request with credentials via IFRAME or IMG, so this just adds a way to
532         read results, as long as the server reports that it's allowed.
533         Having the default set to false ensures that requests won't fail unexpectedly because of
534         stored credentials and cookies for other resources in the target protection space.
535
536         * xml/XMLHttpRequest.cpp:
537         (WebCore::XMLHttpRequest::loadRequestSynchronously): Allow stored credentials for same origin
538         requests, and for cross origin ones that have withCredentials attribute set. Such code already
539         existed for cookies (but it's simpler, because we could just set a ResourceRequest flag).
540         (WebCore::XMLHttpRequest::loadRequestAsynchronously): Ditto.
541
542         * platform/network/ResourceHandle.h: Added willSendRequest() - just like for other callbacks,
543         is is easier to have code in the class. Also, loadResourceSynchronously() now takes a
544         StoredCredentials option, matching async case.
545
546         * platform/network/ResourceHandleClient.h:
547         (WebCore::ResourceHandleClient::receivedCredential): Removed. This method could never be
548         called, and no client used it.
549         (WebCore::ResourceHandleClient::receivedRequestToContinueWithoutCredential): Ditto.
550
551         * platform/network/ResourceHandleInternal.h:
552         (WebCore::ResourceHandleInternal::ResourceHandleInternal): Split username and password out
553         of request URL. We want to always get a callback for credentials to manage them in WebCore,
554         so network back-end shouldn't see them too early.
555
556         * platform/network/ResourceRequestBase.cpp:
557         (WebCore::ResourceRequestBase::removeCredentials):
558         * platform/network/ResourceRequestBase.h:
559         Added a removeCredentials() method that removes login and password parts from request URL.
560
561         * platform/network/mac/ResourceHandleMac.mm:
562         (WebCoreCredentialStorage): Added a simple storage class for per-session credentials.
563         (WebCore::ResourceHandle::loadResourceSynchronously): Pass allowStoredCredentials through.
564         (WebCore::ResourceHandle::willSendRequest): On a redirect, credentials should be replaced.
565         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Try credentials from the URL
566         and per-session credentials. Code was partially moved from Obj-C callback.
567         (WebCore::ResourceHandle::receivedCredential): Intercept per-session credentials and store
568         them in WebCore storage.
569         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]): Don't
570         store the redirected URL - we only needed credentials, which are now stored separately.
571         (-[WebCoreResourceHandleAsDelegate connection:didReceiveAuthenticationChallenge:]): Removed
572         code that was setting credentials from URL. First, the code is now in ResourceHandle, and
573         also, it wasn't actually needed in Leopard release before this patch, see <rdar://problem/5298142>.
574         (-[WebCoreSynchronousLoader dealloc]): Release credentials. Note that unlike ResourceHandle,
575         this class still needs to track URL for checking whether a redirect is allowed. This is
576         not a great solution, and we should unify client code to use the same checks in sync and
577         async cases.
578         (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): Just like in
579         async case, put credentials aside to ensure that network back-end asks for them.
580         (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]): Use credentials
581         from URL, or from WebCore storage.
582         (-[WebCoreSynchronousLoader connectionShouldUseCredentialStorage:]): Don't use stored
583         credentials when not allowed to.
584         (+[WebCoreSynchronousLoader loadRequest:allowStoredCredentials:returningResponse:error:]):
585         Put credentials aside to ensure that network back-end asks for them.
586
587         * platform/network/cf/ResourceHandleCFNet.cpp:
588         (WebCore::WebCoreCredentialStorage::set):
589         (WebCore::WebCoreCredentialStorage::get):
590         (WebCore::willSendRequest):
591         (WebCore::ResourceHandle::start):
592         (WebCore::ResourceHandle::willSendRequest):
593         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
594         (WebCore::ResourceHandle::receivedCredential):
595         (WebCore::ResourceHandle::loadResourceSynchronously):
596         (WebCore::WebCoreSynchronousLoader::willSendRequest):
597         (WebCore::WebCoreSynchronousLoader::didReceiveChallenge):
598         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
599         (WebCore::WebCoreSynchronousLoader::load):
600         Same changes as in Mac case.
601
602         * platform/network/curl/ResourceHandleCurl.cpp:
603         (WebCore::ResourceHandle::loadResourceSynchronously):
604         * platform/network/qt/ResourceHandleQt.cpp:
605         (WebCore::ResourceHandle::loadResourceSynchronously):
606         * platform/network/soup/ResourceHandleSoup.cpp:
607         (WebCore::ResourceHandle::loadResourceSynchronously):
608         Trying not to break the build.
609
610         * dom/XMLTokenizerLibxml2.cpp: (WebCore::openFunc):
611         * xml/XSLTProcessor.cpp: (WebCore::docLoaderFunc):
612         Unconditionally allow stored credentials for these, as they only support same origin loads.
613
614         * workers/WorkerContext.cpp: (WebCore::WorkerContext::importScripts):
615         WorkerContext.importScripts() can be cross-origin, but sending credentials with it is no worse
616         than sending them with <script src=...>, so this is also unconditionally allowed.
617
618         * loader/DocumentThreadableLoader.cpp:
619         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Pass through storedCredentials.
620         (WebCore::DocumentThreadableLoader::create): Ditto.
621         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Save storedCredentials and
622         sameOrigin flags foruse in callbacks.
623         (WebCore::DocumentThreadableLoader::willSendRequest): Assert that loaders aren't all confused.
624         (WebCore::DocumentThreadableLoader::didSendData): Ditto.
625         (WebCore::DocumentThreadableLoader::didReceiveResponse): Ditto.
626         (WebCore::DocumentThreadableLoader::didReceiveData): Ditto.
627         (WebCore::DocumentThreadableLoader::didFinishLoading): Ditto.
628         (WebCore::DocumentThreadableLoader::didFail): Ditto.
629         (WebCore::DocumentThreadableLoader::getShouldUseCredentialStorage): Don't use credential
630         storage if that's not allowed by the code that invoked DocumentThreadableLoader.
631         (WebCore::DocumentThreadableLoader::didReceiveAuthenticationChallenge): Simulate a failure
632         and cancel the request if we are about to ask the user for credentials for a cross-origin
633         request, which is forbidden by CORS (and would have been very confusing if allowed).
634         (WebCore::DocumentThreadableLoader::receivedCancellation): Assert that loaders aren't all confused.
635
636         * loader/DocumentThreadableLoader.h: Updated for the new flags (storedCredentials and
637         sameOrigin) that affect the loader. Eventually, we need to move all CORS logic from XHR here.
638
639         * loader/ThreadableLoader.h: (StoredCredentials): Added another flag that affects loader
640         behavior. We should combine all of these into a structure, and use it for sync requests, too.
641
642         * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadResourceSynchronously):
643         * loader/FrameLoader.h:
644         * loader/ThreadableLoader.cpp:
645         (WebCore::ThreadableLoader::create):
646         (WebCore::ThreadableLoader::loadResourceSynchronously):
647         * loader/WorkerThreadableLoader.cpp:
648         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
649         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
650         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
651         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader):
652         * loader/WorkerThreadableLoader.h:
653         (WebCore::WorkerThreadableLoader::create):
654         Pass through storedCredentials.
655
656 2009-04-13  David Hyatt  <hyatt@apple.com>
657
658         Reviewed by Cameron Zwarich.
659
660         Remove an outdated comment in ScrollView.h
661
662         * platform/ScrollView.h:
663
664 2009-04-13  Eric Carlson  <eric.carlson@apple.com>
665
666         Reviewed by Mark Rowe.
667
668         https://bugs.webkit.org/show_bug.cgi?id=25177
669
670         QTTrack's -media method always return NULL in 64-bit QTKit, so
671         MediaPlayerPrivate::disableUnsupportedTracks should use 
672         QTTrackMediaTypeAttribute to get a track's type.
673
674         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
675         (WebCore::MediaPlayerPrivate::disableUnsupportedTracks):
676
677 2009-04-13  Geoffrey Garen  <ggaren@apple.com>
678
679         Reviewed by Cameron Zwarich.
680
681         More fix for https://bugs.webkit.org/show_bug.cgi?id=21260
682         Unbounded memory growth when churning elements with anonymous event handler functions
683
684         Stop using protected event listeners on the window object.
685
686         * bindings/js/JSDOMWindowCustom.cpp:
687         (WebCore::JSDOMWindow::mark): Mark our event listeners, since they're
688         no longer protected.
689
690         (WebCore::JSDOMWindow::addEventListener):
691         (WebCore::JSDOMWindow::removeEventListener): Create unprotected event
692         listeners, since we mark them now.
693
694         * bindings/js/JSEventListener.h: Made some functions public so
695         DOMWindow could call them.
696
697         * bindings/js/JSNodeCustom.cpp: Moved markEventListeners to a header,
698         so it could be shared.
699
700         * bindings/scripts/CodeGeneratorJS.pm: Generate event listener marking
701         and invalidating code for the DOMWindow.
702
703         * dom/RegisteredEventListener.h:
704         (WebCore::markEventListeners):
705         (WebCore::invalidateEventListeners): Added helper functions.
706
707         * page/DOMWindow.idl: Make the window's event listener attributes not
708         protected.
709
710 2009-04-13  Eric Carlson  <eric.carlson@apple.com>
711
712         Reviewed by Mark Rowe.
713         
714         https://bugs.webkit.org/show_bug.cgi?id=25155
715
716         OS X standalone media documents should not switch from <video> to <embed> when 
717         QTKit load state is QTMovieLoadStateLoading as that happens frequently when a loading
718         with a slow network connection or when a movie is not saved fast-start.
719
720         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
721         (WebCore::MediaPlayerPrivate::updateStates): Don't open movie with plug-in when QTKit's
722         loadstate is QTMovieLoadStateLoading, wait until it drops below QTMovieLoadStateError.
723
724 2009-04-13  Dmitry Titov  <dimich@chromium.org>
725
726         Reviewed by Darin Adler.
727
728         https://bugs.webkit.org/show_bug.cgi?id=24453
729         REGRESSION: If setTimeout is called on a iframe's window, the DOM changes to
730         the main document that timer callback makes are not flushed.
731
732         * bindings/js/ScheduledAction.cpp:
733         (WebCore::ScheduledAction::execute):
734         Use Document::updateStyleForAllDocuments() instead of document->updateStyleIfNeeded()
735         since timers may affect documents other then their own.
736
737 2009-04-13  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
738
739         Reviewed by David Hyatt.
740
741         Check document for nullity to avoid crashing on GTK+, when
742         creating the WebView.
743
744         * page/FrameView.cpp:
745         (WebCore::FrameView::needsLayout):
746
747 2009-04-13  Ada Chan  <adachan@apple.com>
748
749         Forgot to capitalize the "US".
750
751         * platform/text/win/TextBreakIteratorInternalICUWin.cpp:
752         (WebCore::currentTextBreakLocaleID):
753
754 2009-04-13  Ada Chan  <adachan@apple.com>
755
756         <rdar://problem/6564956> URL field double-click selects entire domain, rather than single word or entire URL
757         Revert back to the old word breaking behavior by using en_US_POSIX locale.        
758
759         Reviewed by Steve Falkenburg.
760
761         * platform/text/win/TextBreakIteratorInternalICUWin.cpp:
762         (WebCore::currentTextBreakLocaleID):
763
764 2009-04-13  Darin Adler  <darin@apple.com>
765
766         Reviewed by Dan Bernstein.
767
768         * platform/cf/BinaryPropertyList.cpp: Added comment.
769         * platform/cf/BinaryPropertyList.h: Fixed mistakes in comments.
770
771 2009-04-13  Darin Adler  <darin@apple.com>
772
773         Reviewed by Dan Bernstein.
774
775         Bug 25158: hit testing doesn't work right in some cases involving anonymous blocks
776         https://bugs.webkit.org/show_bug.cgi?id=25158
777         rdar://problem/6769693
778
779         Test: editing/selection/click-after-nested-block.html
780
781         * rendering/RenderBlock.cpp:
782         (WebCore::isChildHitTestCandidate): Added. Helper so the two loops in positionForPoint
783         can share code.
784         (WebCore::RenderBlock::positionForPoint): Removed unneeded special case for first
785         child box. Changed special case for last child box to propertly handle the various
786         types of child box that are not hit test candidates (the same ones already handled
787         by the hit test loop below), adding in a loop so we find the last candidate.
788
789 2009-04-13  David Hyatt  <hyatt@apple.com>
790
791         Reviewed by Sam Weinig.
792
793         Fix for https://bugs.webkit.org/show_bug.cgi?id=25125.  Rework scrolling so that a layout happens first when
794         it's already needed so that the code doesn't end up making bad decisions based off invalid document sizes.
795
796         * WebCore.base.exp:
797         * page/FrameView.h:
798         (WebCore::FrameView::visibleContentsResized):
799         * platform/ScrollView.cpp:
800         (WebCore::ScrollView::ScrollView):
801         (WebCore::ScrollView::updateScrollbars):
802         * platform/ScrollView.h:
803
804 2009-04-13  Adam Roben  <aroben@apple.com>
805
806         Add SharedBuffer::wrapCFData
807
808         This is the CF-equivalent of wrapNSData.
809
810         Reviewed by Brady Eidson.
811
812         * platform/SharedBuffer.h:
813         * platform/cf/SharedBufferCF.cpp:
814         (WebCore::SharedBuffer::wrapCFData):
815
816 2009-04-13  Dan Bernstein  <mitz@apple.com>
817
818         - build fix
819
820         * page/EventHandler.cpp:
821         (WebCore::documentPointForWindowPoint):
822
823 2009-04-13  Antti Koivisto  <antti@apple.com>
824
825         Reviewed by Darin Adler.
826
827         <rdar://problem/6740294> Increase the connection count per host
828         
829         Try to use six connections per host if possible.
830
831         * WebCore.base.exp:
832         * loader/loader.cpp:
833         (WebCore::Loader::Loader):
834         * platform/mac/WebCoreSystemInterface.h:
835         * platform/mac/WebCoreSystemInterface.mm:
836         * platform/network/ResourceRequestBase.cpp:
837         (WebCore::initMaximumHTTPConnectionCountPerHost):
838         * platform/network/ResourceRequestBase.h:
839         * platform/network/mac/ResourceRequestMac.mm:
840         (WebCore::initMaximumHTTPConnectionCountPerHost):
841
842 2009-04-13  Justin Garcia  <justin.garcia@apple.com>
843
844         Reviewed by Adele Peterson.
845
846         https://bugs.webkit.org/show_bug.cgi?id=25153
847         Can't place the caret into text field that scrolls the window on focus
848         
849         We refetch the target node in the shadow node case, and when we do so the window coordinate for the mouse event may
850         be invalid because of scrolling that the focus handler did.  Cache the document point (that we derived from the window
851         coordinate) and use that any time we refetch.
852
853         * page/EventHandler.cpp:
854         (WebCore::documentPointForWindowPoint):
855         (WebCore::EventHandler::handleMousePressEvent):
856         (WebCore::EventHandler::prepareMouseEvent):
857
858 2009-04-13  Sam Weinig  <sam@webkit.org>
859
860         Reviewed by Geoffrey Garen.
861
862         Rename JavaScriptCanOpenWindowsAutomatically to javaScriptCanOpenWindowsAutomatically
863         to conform to our style guidelines.
864
865         * page/DOMWindow.cpp:
866         (WebCore::DOMWindow::allowPopUp):
867         * page/Settings.h:
868         (WebCore::Settings::javaScriptCanOpenWindowsAutomatically):
869
870 2009-04-13  Geoffrey Garen  <ggaren@apple.com>
871
872         Mac build fix: Made another header private.
873
874         * WebCore.xcodeproj/project.pbxproj:
875
876 2009-04-13  Jian Li  <jianli@chromium.org>
877
878         Reviewed by Darin Fisher.
879
880         https://bugs.webkit.org/show_bug.cgi?id=25121
881         Upstream changes to handle error messages from V8 when running worker script.
882
883         * bindings/v8/WorkerContextExecutionProxy.cpp:
884         (WebCore::reportFatalErrorInV8):
885         (WebCore::handleConsoleMessage):
886         (WebCore::WorkerContextExecutionProxy::WorkerContextExecutionProxy):
887         (WebCore::WorkerContextExecutionProxy::dispose):
888         (WebCore::WorkerContextExecutionProxy::initV8IfNeeded):
889         (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
890         (WebCore::WorkerContextExecutionProxy::evaluate):
891         * bindings/v8/WorkerContextExecutionProxy.h:
892
893 2009-04-13  Geoffrey Garen  <ggaren@apple.com>
894
895         Build fix: Made setInlineEventListenerForType not inline, since Document
896         calls it now. Made RegisteredEventListener.h a private header on Mac,
897         so WebKit can use it.
898
899         * page/DOMWindow.cpp:
900         (WebCore::DOMWindow::setInlineEventListenerForType):
901
902 2009-04-13  Dan Bernstein  <mitz@apple.com>
903
904         Reviewed by Sam Weinig.
905
906         - fix <rdar://problem/6404439> REGRESSION: Overlapping text and other
907           layout issues in View Sample feature of MYOB FIrstEdge v3
908
909         * page/Navigator.cpp:
910         (WebCore::shouldHideFourDot): Added "tdqm_loader.js" to the list of
911         JavaScript files this quirk applies to.
912
913 2009-04-13  Sam Weinig  <sam@webkit.org>
914
915         Reviewed by Oliver Hunt.
916
917         Move open and showModalDialog functions out of JSDOMWindowBase
918         and into JSDOMWindow by partially generating them.
919
920         This slightly changes the behavior of getting window.showModalDialog
921         when the embedding app does not support it to return undefined regardless
922         of shadowing.  This should not be an issue in a practice, but will be addressed
923         when we add a generic way to handle runtime specialization of property
924         access.
925
926         * DerivedSources.make: Remove JSDOMWindowBase.lut.h
927         * WebCore.xcodeproj/project.pbxproj: Ditto.
928         * bindings/js/JSDOMWindowBase.cpp:
929         (WebCore::):
930         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Move canShowModalDialog check from
931         here to JSDOMWindow::customGetOwnPropertySlot.
932         (WebCore::JSDOMWindowBase::put): Remove dead code.
933         * bindings/js/JSDOMWindowCustom.cpp:
934         (WebCore::createWindow):
935         (WebCore::JSDOMWindow::open):
936         (WebCore::JSDOMWindow::showModalDialog):
937         * bindings/js/JSDOMWindowCustom.h:
938         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
939         * page/DOMWindow.cpp:
940         (WebCore::DOMWindow::parseModalDialogFeatures): Move from JSDOMWindowBase.
941         (WebCore::DOMWindow::allowPopUp): Ditto.
942         (WebCore::DOMWindow::canShowModalDialog): Ditto.
943         (WebCore::DOMWindow::canShowModalDialogNow): Ditto.
944         * page/DOMWindow.h:
945         * page/DOMWindow.idl:
946
947 2009-04-13  Geoffrey Garen  <ggaren@apple.com>
948
949         Reviewed by Sam Weinig.
950
951         Moved storage for window event listeners into the window object.
952
953         * bindings/js/JSDOMWindowCustom.cpp:
954         (WebCore::JSDOMWindow::addEventListener):
955         (WebCore::JSDOMWindow::removeEventListener): Add / remove window event
956         listeners to / from the window object.
957
958         * dom/Document.cpp:
959         (WebCore::Document::removeAllEventListeners):
960         (WebCore::Document::clear):
961         (WebCore::Document::setWindowInlineEventListenerForTypeAndAttribute): Moved
962         a bunch of code to the DOMWindow class, and left behind a few calls through
963         to DOMWindow, to support legacy clients. (Eventually, these will go away, too.)
964
965         * dom/Document.h: ditto.
966
967         * dom/Node.cpp:
968         (WebCore::Node::dispatchGenericEvent):
969         (WebCore::Node::dispatchWindowEvent): Dipatch window events on the window
970         object, not the document.
971
972         * dom/Node.h:
973         * dom/RegisteredEventListener.h: Moved RegisteredEventListenerVector
974         declaration, since it's required in more places now.
975
976         * history/CachedFrame.cpp:
977         (WebCore::CachedFrame::clear): Updated for rename. Also, remove event
978         listeners before detaching and clearing the document's window pointer,
979         since the the document needs its window pointer in order to tell the window
980         to clear its event listeners.
981
982         * loader/FrameLoader.cpp:
983         (WebCore::FrameLoader::stopLoading):
984         (WebCore::FrameLoader::canCachePageContainingThisFrame):
985         (WebCore::FrameLoader::logCanCacheFrameDecision): Updated for rename, and
986         movement of window event listeners into the window.
987
988         * loader/ImageDocument.cpp:
989         (WebCore::ImageDocument::createDocumentStructure): Updated for movement
990         of window event listeners into the window.
991
992         * page/DOMWindow.cpp:
993         (WebCore::DOMWindow::handleEvent):
994         (WebCore::DOMWindow::addEventListener):
995         (WebCore::DOMWindow::removeEventListener):
996         (WebCore::DOMWindow::removeAllEventListeners):
997         (WebCore::DOMWindow::hasEventListener):
998         (WebCore::DOMWindow::setInlineEventListenerForType):
999         (WebCore::DOMWindow::removeInlineEventListenerForType):
1000         (WebCore::DOMWindow::inlineEventListenerForType):
1001         (WebCore::DOMWindow::addPendingFrameUnloadEventCount):
1002         (WebCore::DOMWindow::removePendingFrameUnloadEventCount):
1003         (WebCore::DOMWindow::addPendingFrameBeforeUnloadEventCount):
1004         (WebCore::DOMWindow::removePendingFrameBeforeUnloadEventCount):
1005         * page/DOMWindow.h: Moved a bunch of code to the DOMWindow class, from the Document.
1006
1007         * page/Frame.cpp:
1008         (WebCore::Frame::shouldClose): Updated for movement of window event listeners into the window.
1009
1010 2009-04-13  Greg Bolsinga  <bolsinga@apple.com>
1011
1012         Reviewed by Sam Weinig.
1013
1014         https://bugs.webkit.org/show_bug.cgi?id=25149
1015
1016         The Geolocation timer needs to start after the UA has granted permission.
1017
1018         * bindings/js/JSGeolocationCustom.cpp: Use PassRefPtr<PositionOptions>
1019         (WebCore::JSGeolocation::getCurrentPosition):
1020         (WebCore::JSGeolocation::watchPosition):
1021         * page/Geolocation.cpp: Add a RefPtr<PositionOptions> so it can be used
1022         later when the timer is started. Change PositionOptions* to PassRefPtr<PositionOptions>
1023         where needed.
1024         (WebCore::Geolocation::GeoNotifier::GeoNotifier):
1025         (WebCore::Geolocation::GeoNotifier::startTimer):
1026         (WebCore::Geolocation::getCurrentPosition):
1027         (WebCore::Geolocation::watchPosition):
1028         (WebCore::Geolocation::setIsAllowed): Start the timer is the UA allows
1029         (WebCore::Geolocation::startTimer):
1030         (WebCore::Geolocation::startTimersForOneShots):
1031         (WebCore::Geolocation::startTimersForWatchers):
1032         (WebCore::Geolocation::startTimers):
1033         * page/Geolocation.h:
1034         (WebCore::Geolocation::GeoNotifier::create):
1035
1036 2009-04-13  Pamela Greene  <pam@chromium.org>
1037
1038         Reviewed by Darin Fisher.
1039
1040         Fix Chromium (V8) build by renaming methods to match changes
1041         in http://trac.webkit.org/changeset/42377.
1042
1043         https://bugs.webkit.org/show_bug.cgi?id=25141
1044
1045         * bindings/v8/ScheduledAction.cpp:
1046      (WebCore::ScheduledAction::execute): updateRendering() -> updateStyleIfNeeded()
1047         * bindings/v8/V8AbstractEventListener.cpp:
1048         (WebCore::V8AbstractEventListener::handleEvent): updateDocumentsRendering() -> updateStyleForAllDocuments()
1049
1050 2009-04-13  Darin Fisher  <darin@chromium.org>
1051
1052         Reviewed by Darin Adler.
1053
1054         https://bugs.webkit.org/show_bug.cgi?id=25136
1055         CRASH in DocumentLoader::removeSubresourceLoader due to null m_frame
1056
1057         Test: fast/frames/frame-unload-crash.html
1058
1059         * loader/DocumentLoader.cpp:
1060         (WebCore::DocumentLoader::updateLoading): Added null check of m_frame.
1061
1062 2009-04-13  Sam Weinig  <sam@webkit.org>
1063
1064         Reviewed by Tim Hatcher.
1065
1066         Put the MessagePort constructor back in ENABLE_CHANNEL_MESSAGING.
1067
1068         * page/DOMWindow.idl:
1069
1070 2009-04-13  Greg Bolsinga  <bolsinga@apple.com>
1071
1072         Fix GTK build break.
1073
1074         * platform/gtk/GeolocationServiceGtk.cpp:
1075         (WebCore::GeolocationServiceGtk::updatePosition):
1076
1077 2009-04-13  David Hyatt  <hyatt@apple.com>
1078
1079         Reviewed by Darin Adler and Dan Bernstein.
1080
1081         Assertion in updateStyleForAllDocuments.  Make sure to unscheduleStyleRecalc when an object goes into
1082         the page cache.  Disallow scheduling of style recalcs on a document that is already in the page cache.
1083         Schedule a style recalc if needed when an object comes out of the page cache.
1084
1085         * dom/Document.cpp:
1086         (WebCore::Document::scheduleStyleRecalc):
1087         (WebCore::Document::setInPageCache):
1088
1089 2009-04-13  Timothy Hatcher  <timothy@apple.com>
1090
1091         Correctly sort (program) scripts in the Scripts panel popup menu.
1092
1093         Reviewed by Ada Chan.
1094
1095         * inspector/front-end/ScriptsPanel.js:
1096         (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu): Refactor the code
1097         and sort "(program)" options by the sourceID to maintain some order.
1098         * inspector/front-end/utilities.js:
1099         (indexOfObjectInListSortedByFunction): Fix a bug where identical objects would cause
1100         an incorrect return value that confuses insertionIndexForObjectInListSortedByFunction.
1101         Just set 'first' and break so the correct result will be returned.
1102
1103 2009-04-13  Greg Bolsinga  <bolsinga@apple.com>
1104
1105         Reviewed by Darin Adler.
1106
1107         https://bugs.webkit.org/show_bug.cgi?id=24770
1108         
1109         Add custom code for Coordinates that returns null when required by the
1110         Geolocation spec.
1111         
1112         http://dev.w3.org/geo/api/spec-source.html#coordinates
1113
1114         * WebCore.xcodeproj/project.pbxproj:
1115         * bindings/js/JSCoordinatesCustom.cpp: Added.
1116         (WebCore::JSCoordinates::altitude): returns null if the value cannot be provided.
1117         (WebCore::JSCoordinates::altitudeAccuracy): Ditto
1118         (WebCore::JSCoordinates::heading): Ditto
1119         (WebCore::JSCoordinates::speed): Ditto
1120         * page/Coordinates.h:
1121         (WebCore::Coordinates::create): Add 'canProvide' parameters and values
1122         (WebCore::Coordinates::canProvideAltitude):
1123         (WebCore::Coordinates::canProvideAltitudeAccuracy):
1124         (WebCore::Coordinates::canProvideHeading):
1125         (WebCore::Coordinates::canProvideSpeed):
1126         (WebCore::Coordinates::Coordinates):
1127         * page/Coordinates.idl: specify custom getters
1128         * platform/mac/GeolocationServiceMac.mm: Set the values correctly if they cannot be provided.
1129         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
1130
1131 2009-04-13  Adele Peterson  <adele@apple.com>
1132
1133         Reviewed by Darin Adler.
1134
1135         Fix for <rdar://problem/5510537> Typing return at start of block quote yields empty quoted line
1136
1137         Test: editing/inserting/5510537.html
1138
1139         * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): If the break insertion position
1140         is at the beginning of the topmost quote, then just insert the <br> before the blockquote.  Otherwise, if the break
1141         insertion position is at the beginning of any quote, adjust the position so the break comes before the current quote level
1142         so we don't end up with an empty line in that quote in addition to the new line we're adding with the <br>.
1143
1144 2009-04-11  Darin Adler  <darin@apple.com>
1145
1146         Reviewed by Dan Bernstein.
1147
1148         Fix problem when encoding history files with duplicate integer arrays near the end of the file.
1149         This results in an assertion failure, and if assertions are turned off, corrupted output.
1150
1151         When writing an integer array it's important not to add an object reference to the
1152         aggregate buffer. The writing of the array does not depend on the aggregate buffer. But,
1153         more importantly, it's possible this instance integer array is a duplicate and won't be
1154         written out. If so, there's no guarantee there's enough space in the aggregate buffer to
1155         store the object references (the references will be ignored). In some cases the aggregate
1156         buffer can then overrun the data being written; normally this is prevented by the fact that
1157         the data being written will include a copy of the aggregate buffer.
1158
1159         Also removed a bit of unneeded dead code to handle the integer -1.
1160
1161         * platform/cf/BinaryPropertyList.cpp:
1162         (WebCore::BinaryPropertyListPlan::BinaryPropertyListPlan): Removed unneeded
1163         m_integerNegativeOneObjectReference, since property lists support only non-negative integers.
1164         (WebCore::BinaryPropertyListPlan::writeInteger): Removed support for
1165         m_integerNegativeOneObjectReference.
1166         (WebCore::BinaryPropertyListPlan::integerObjectReference): Ditto.
1167         (WebCore::BinaryPropertyListSerializer::writeIntegerWithoutAddingAggregateObjectReference):
1168         Added. Factored out most of writeInteger, for use in writeIntegerArray, without calling
1169         addAggregateObjectReference.
1170         (WebCore::BinaryPropertyListSerializer::writeInteger): Changed to call the new
1171         writeIntegerWithoutAddingAggregateObjectReference function.
1172         (WebCore::BinaryPropertyListSerializer::writeIntegerArray): Call the new
1173         writeIntegerWithoutAddingAggregateObjectReference function and therefore remove the
1174         code to save and restore m_currentAggregateBufferByte, which is no longer needed.
1175
1176 2009-04-13  Holger Hans Peter Freyther  <zecke@selfish.org>
1177
1178         Unreviewed Qt build fix.
1179
1180         * platform/graphics/qt/FontQt.cpp:
1181         (WebCore::Font::floatWidthForComplexText):
1182
1183 2009-04-12  Sam Weinig  <sam@webkit.org>
1184
1185         Reviewed by Mark Rowe.
1186
1187         Move the event and crypto attributes and the captureEvents and releaseEvents
1188         functions out of JSDOMWindowBase by partially generating them.
1189
1190         * bindings/js/JSDOMGlobalObject.cpp:
1191         (WebCore::JSDOMGlobalObject::currentEvent): Make const.
1192         * bindings/js/JSDOMGlobalObject.h:
1193         * bindings/js/JSDOMWindowBase.cpp:
1194         * bindings/js/JSDOMWindowCustom.cpp:
1195         (WebCore::JSDOMWindow::crypto): Not implemented.
1196         (WebCore::JSDOMWindow::event):
1197         (WebCore::JSDOMWindow::captureEvents): Not implemented.
1198         (WebCore::JSDOMWindow::releaseEvents): Ditto.
1199         * page/DOMWindow.idl:
1200
1201 2009-04-12  Sam Weinig  <sam@webkit.org>
1202
1203         Reviewed by Mark Rowe.
1204
1205         Move more attributes out of JSDOMWindowBase by
1206         partially generating them.
1207
1208         - Expose the MessagePort constructor.
1209
1210         * bindings/js/JSDOMGlobalObject.h:
1211         (WebCore::getDOMConstructor):
1212         * bindings/js/JSDOMWindowBase.cpp:
1213         (setJSDOMWindowBaseEvent):
1214         * bindings/js/JSDOMWindowCustom.cpp:
1215         (WebCore::JSDOMWindow::image):
1216         (WebCore::JSDOMWindow::option):
1217         (WebCore::JSDOMWindow::audio):
1218         (WebCore::JSDOMWindow::webKitPoint):
1219         (WebCore::JSDOMWindow::webKitCSSMatrix):
1220         (WebCore::JSDOMWindow::xMLHttpRequest):
1221         (WebCore::JSDOMWindow::xSLTProcessor):
1222         (WebCore::JSDOMWindow::messageChannel):
1223         (WebCore::JSDOMWindow::worker):
1224         * page/DOMWindow.idl:
1225
1226 2009-04-12  Timothy Hatcher  <timothy@apple.com>
1227
1228         A resource's filename is not correct after a redirect in the Inspector.
1229
1230         Reviewed by Dan Bernstein.
1231
1232         * inspector/InspectorResource.cpp:
1233         (WebCore::InspectorResource::updateScriptObject): Fix a typo in the
1234         lastPathComponent property name.
1235
1236 2009-04-12  Adele Peterson  <adele@apple.com>
1237
1238         Reviewed by Darin Adler.
1239
1240         Test: editing/inserting/6609479-1.html
1241
1242         Follow-up to <rdar://problem/6609479>.
1243
1244         Before my last change, a Mail blockquote would've been broken up earlier, and you would've been guaranteed that the inserted content
1245         was at the start of a paragraph.  Now we need to check for that explicitly, and only merge the start of the inserted content if it is 
1246         at the start of a paragraph.
1247
1248         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::shouldMergeStart):
1249
1250 2009-04-11  Adele Peterson  <adele@apple.com>
1251
1252         Reviewed by Dan Bernstein.
1253
1254         Fix for <rdar://problem/6609479> Pressing return inside a table cell that's inside quoted content will split the table
1255
1256         Test: editing/inserting/6609479.html
1257
1258         Don't break a blockquote if pasting or inserting into a table.
1259
1260         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
1261         * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
1262
1263 2009-04-11  Dan Bernstein  <mitz@apple.com>
1264
1265         Reviewed by Darin Adler.
1266
1267         - fix <rdar://problem/6643103> Unscaled values from body.scrollHeight
1268
1269         Test: fast/css/zoom-body-scroll.html
1270
1271         Adjust scroll{Left,Top,Width,Height} values for zoom in getters and
1272         setters.
1273
1274         * html/HTMLBodyElement.cpp:
1275         (WebCore::adjustForZoom):
1276         (WebCore::HTMLBodyElement::scrollLeft):
1277         (WebCore::HTMLBodyElement::setScrollLeft):
1278         (WebCore::HTMLBodyElement::scrollTop):
1279         (WebCore::HTMLBodyElement::setScrollTop):
1280         (WebCore::HTMLBodyElement::scrollHeight):
1281         (WebCore::HTMLBodyElement::scrollWidth):
1282
1283 2009-04-10  Timothy Hatcher  <timothy@apple.com>
1284
1285         Allow page navigation and reload while stopped at a breakpoint.
1286
1287         <rdar://problem/6781108> Having a breakpoint active prevents page reload
1288
1289         Reviewed by Darin Adler.
1290
1291         * inspector/InspectorController.cpp:
1292         (WebCore::InspectorController::didContinue): Call the resumedScript function.
1293         * inspector/InspectorController.h: Added didContinue.
1294         * inspector/JavaScriptDebugListener.h: Ditto.
1295         * inspector/JavaScriptDebugServer.cpp:
1296         (WebCore::JavaScriptDebugServer::pauseIfNeeded): Call didContinue on the listeners.
1297         * inspector/front-end/ScriptsPanel.js:
1298         (WebInspector.ScriptsPanel.prototype.debuggerResumed): Update the interface and state.
1299         * inspector/front-end/inspector.js:
1300         (WebInspector.resumedScript): Call ScriptsPanel.debuggerResumed.
1301         * loader/FrameLoader.cpp:
1302         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Call resumeDebugger.
1303
1304 2009-04-10  Sam Weinig  <sam@webkit.org>
1305
1306         Reviewed by Adele Peterson.
1307
1308         Remove unused include for JSLock.
1309
1310         * page/mac/FrameMac.mm:
1311
1312 2009-04-10  Sam Weinig  <sam@webkit.org>
1313
1314         Reviewed by Darin Adler.
1315
1316         Add back the keepAlive timer for after the script execution to
1317         protect the callers of evaluate, as was part of the original intent
1318         of timer.
1319
1320         * bindings/js/ScriptController.cpp:
1321         (WebCore::ScriptController::evaluate):
1322         * page/mac/FrameMac.mm:
1323
1324 2009-04-10  Chris Marrin  <cmarrin@apple.com>
1325
1326         Reviewed by Simon Fraser.
1327
1328         Fixed https://bugs.webkit.org/show_bug.cgi?id=25137
1329
1330         If we reload, the animation controller sticks around and has
1331         a stale animation time. So the needed delay is computed wrong.
1332         I added a reset of the animation timer on load.
1333
1334         I did not do a test case because this only happens on reload so I
1335         couldn't make an automated test. I tried using an iframe and using
1336         reload() but that doesn't tickle the bug.
1337
1338         * dom/Document.cpp:
1339         (WebCore::Document::implicitOpen):
1340
1341 2009-04-10  Grace Kloba  <klobag@gmail.com>
1342
1343         Reviewed by Darin Adler.
1344
1345         Move WORKERS header files inside ENABLE(WORKERS).
1346         So if WORKERS is not enabled and the generated files are not generated, the build is still working.
1347
1348         * bindings/js/JSDOMGlobalObject.cpp:
1349         * bindings/js/JSMessageChannelConstructor.cpp:
1350         * bindings/js/ScheduledAction.cpp:
1351
1352 2009-04-10  Darin Adler  <darin@apple.com>
1353
1354         Reviewed by Brady Eidson.
1355
1356         <rdar://problem/6773515> crash in push_heap inside WebCore when printing
1357
1358         The crash was due to manipulating a timer on a different thread than the one it was created on.
1359         This adds some diagnostics so we'll catch that kind of mistake immediately.
1360
1361         * platform/Timer.cpp:
1362         (WebCore::TimerBase::TimerBase): Store the thread identifier in debug versions.
1363         (WebCore::TimerBase::start): Assert it's the same thread the timer was created on.
1364         (WebCore::TimerBase::stop): Ditto.
1365         (WebCore::TimerBase::isActive): Ditto.
1366         (WebCore::TimerBase::setNextFireTime): Ditto.
1367
1368         * platform/Timer.h: Added the thread identifier data member.
1369
1370 2009-04-10  Chris Marrin  <cmarrin@apple.com>
1371
1372         Reviewed by Dan Bernstein
1373
1374         https://bugs.webkit.org/show_bug.cgi?id=25108
1375
1376         If you remove a class with a transition while that transition is running
1377         the animation timer will continue to fire after the transition is finished.
1378         This has no visual indication, but it does drain the processor. And in some
1379         cases it might even cause a glitch in future animations. Unfortunately there
1380         is no way to test this without putting in printfs.
1381
1382         This happens because the animation logic is never traversed after a transition
1383         is removed, so we never get a chance to cleanup. So I added cleanup in the logic
1384         that fires the dispatch of the last style change when the animation finishes.
1385
1386         Test: transitions/remove-transition-style.html
1387
1388         * page/animation/AnimationController.cpp:
1389         (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
1390         * page/animation/CompositeAnimation.cpp:
1391         (WebCore::CompositeAnimation::updateTransitions):
1392         (WebCore::CompositeAnimation::animate):
1393         (WebCore::CompositeAnimation::cleanupFinishedAnimations):
1394         * page/animation/CompositeAnimation.h:
1395
1396 2009-04-10  Sam Weinig  <sam@webkit.org>
1397
1398         Reviewed by Geoffrey Garen.
1399
1400         Fix for <rdar://problem/6648858>
1401         CrashTracer: [REGRESSION(Safari 4)] 60 crashes in Safari at com.apple.WebCore • WebCore::ScriptController::evaluate + 241
1402
1403         The Frame (and therefore ScriptController) were being destroyed
1404         during JavaScript execution causing the JSDOMWindowShell to become
1405         null.
1406
1407         * bindings/js/ScriptController.cpp:
1408         (WebCore::ScriptController::evaluate): Use a RefPtr to protect the Frame
1409         instead of the keep-alive timer, since a nested event loop used from with-in 
1410         JavaScript execution could cause the timer to fire before returning.
1411
1412 2009-04-10  Dimitri Glazkov  <dglazkov@chromium.org>
1413
1414         Reviewed by Timothy Hatcher.
1415
1416         https://bugs.webkit.org/show_bug.cgi?id=25133
1417         Fix an error in InspectorController's bindings, clean up a few header
1418         includes, make empty object construction in ScriptObject less ambiguous.
1419
1420         * bindings/js/JSInspectorControllerCustom.cpp:
1421         (WebCore::JSInspectorController::setSetting): Send correct argument from
1422             the bindings.
1423         * bindings/js/ScriptObject.cpp:
1424         (WebCore::ScriptObject::createNew): Added.
1425         * bindings/js/ScriptObject.h: Removed constructor, added decl for createNew.
1426         * inspector/ConsoleMessage.cpp: Remove unused header.
1427         * inspector/ConsoleMessage.h: Ditto.
1428         * inspector/InspectorResource.cpp:
1429         (WebCore::createHeadersObject): Changed to use ScriptObject::createNew.
1430
1431 2009-04-10  Chris Marrin  <cmarrin@apple.com>
1432
1433         Reviewed by Simon Fraser.
1434
1435         Fixed https://bugs.webkit.org/show_bug.cgi?id=25134
1436
1437         This both fixes a bug where I was not sending in the right time
1438         to continue the animation and was not recomputing current time
1439         when coming out of suspend.
1440
1441         * page/animation/AnimationBase.cpp:
1442         (WebCore::AnimationBase::updateStateMachine):
1443         * page/animation/AnimationController.cpp:
1444         (WebCore::AnimationControllerPrivate::suspendAnimations):
1445         (WebCore::AnimationControllerPrivate::resumeAnimations):
1446
1447 2009-04-10  Adam Roben  <aroben@apple.com>
1448
1449         Give Windows's <select> popup menus drop shadows
1450
1451         Rubber-stamped by Steve Falkenburg.
1452
1453         No test possible.
1454
1455         * platform/win/PopupMenuWin.cpp:
1456         (WebCore::registerPopup): Use the CS_DROPSHADOW window class style.
1457
1458 2009-04-10  Timothy Hatcher  <timothy@apple.com>
1459
1460         Fix a bug in the Web Inspector where it would show scripts
1461         from previous pages when toggling the debugger off and back on.
1462
1463         https://bugs.webkit.org/show_bug.cgi?id=25095
1464         rdar://problem/6769970
1465
1466         Reviewed by John Sullivan.
1467
1468         * bindings/js/ScriptCachedFrameData.cpp:
1469         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): Null out the
1470         debugger for the scriptController. This balances the attachDebugger
1471         that was already in ScriptCachedFrameData::restore.
1472         (WebCore::ScriptCachedFrameData::restore): Clean up an if statement.
1473         * bindings/js/ScriptController.cpp:
1474         (WebCore::ScriptController::clearWindowShell): Clear the debugger from
1475         the current window before setting the new window.
1476         * inspector/JavaScriptDebugServer.cpp:
1477         (WebCore::JavaScriptDebugServer::recompileAllJSFunctions): Only accumulate
1478         source providers for code associated this as the debugger.
1479
1480 2009-04-10  Pierre d'Herbemont  <pdherbemont@apple.com>
1481
1482         Reviewed by Adele Peterson.
1483
1484         <rdar://problem/6646998> Avoid starting QTKitServer if possible
1485         When possible avoid asking QTKit for the MIME types that require QTKitServer
1486         when running 64-bit.
1487
1488         * WebCore.base.exp: Added new entry point.
1489
1490         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1491         (WebCore::addFileTypesToCache): Add an NSArray of types to the cache.
1492         (WebCore::mimeCommonTypesCache): Add all "common" QTKit types to the cache.
1493         (WebCore::mimeModernTypesCache): Add only "modern" QTKit types to the cache (this list does 
1494         not start QTKitServer if it is not already running).
1495         (WebCore::MediaPlayerPrivate::getSupportedTypes): Refactored.
1496         (WebCore::MediaPlayerPrivate::supportsType): Look in list of "modern" types first to avoid
1497         starting QTKitServer if possible.
1498
1499         * platform/mac/WebCoreSystemInterface.h: Add wkQTIncludeOnlyModernMediaFileTypes.
1500         * platform/mac/WebCoreSystemInterface.mm: Ditto.
1501
1502 2009-04-10  Adam Roben  <aroben@apple.com>
1503
1504         Turn on window animations for <select> popup menus
1505
1506         We turned these off back when <select> popup menus were partially
1507         transparent. Now that they're opaque, there's no reason not to
1508         animate them.
1509
1510         Reviewed by Steve Falkenburg.
1511
1512         No test possible.
1513
1514         * platform/win/PopupMenuWin.cpp:
1515         (WebCore::PopupMenu::show): Remove the #ifdef that was disabling the
1516         window animation.
1517
1518 2009-04-10  Dan Bernstein  <mitz@apple.com>
1519
1520         Reviewed by Sam Weinig.
1521
1522         - fix a regression from r42379 which made zero-width characters affect
1523           line height
1524
1525         Test: fixes fast/text/wide-zero-width-space.html
1526
1527         * platform/graphics/mac/FontMacATSUI.mm:
1528         (WebCore::overrideLayoutOperation): Add to the fallback font list set
1529         here, and only if the glyph is not zero-width...
1530         (WebCore::ATSULayoutParameters::initialize): ...instead of doing it
1531         here. This matches WidthIterator's behavior.
1532
1533 2009-04-10  Darin Fisher  <darin@chromium.org>
1534
1535         Fixing build bustage caused by warnings being treated as errors.
1536         1- A local variable was only be used inside a debug assertion, which
1537            caused grief for the release build.
1538         2- Missing initializer for member 'DocumentMarker::activeMatch'
1539
1540         * dom/Document.cpp:
1541         (WebCore::Document::addMarker):
1542         (WebCore::Document::setMarkersActive):
1543
1544 2009-04-10  Finnur Thorarinsson  <finnur.webkit@gmail.com>
1545
1546         Reviewed by John Sullivan.
1547
1548         Fixing: https://bugs.webkit.org/show_bug.cgi?id=25117
1549         (TextMatches don't have a concept of active match)
1550
1551         For the ports that use the DocumentMarker as highlighting for FindInPage it is
1552         useful to have a flag that specifies which marker is active, so it can be drawn
1553         in a different color.
1554
1555         This allows me to remove the hack to use the SelectionController to highlight
1556         the active match (in the ChromiumWin port).
1557
1558         * dom/Document.cpp:
1559         (WebCore::Document::setMarkersActive):
1560         * dom/Document.h:
1561         * dom/DocumentMarker.h:
1562         * rendering/InlineTextBox.cpp:
1563         (WebCore::InlineTextBox::paintTextMatchMarker):
1564         * rendering/RenderTheme.cpp:
1565         (WebCore::RenderTheme::platformActiveTextSearchHighlightColor):
1566         (WebCore::RenderTheme::platformInactiveTextSearchHighlightColor):
1567         * rendering/RenderTheme.h:
1568         * rendering/RenderThemeChromiumWin.cpp:
1569         (WebCore::RenderThemeChromiumWin::platformActiveSelectionBackgroundColor):
1570         (WebCore::RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor):
1571         (WebCore::RenderThemeChromiumWin::platformActiveTextSearchHighlightColor):
1572         (WebCore::RenderThemeChromiumWin::platformInactiveTextSearchHighlightColor):
1573         * rendering/RenderThemeChromiumWin.h:
1574
1575 2009-04-10  Pamela Greene  <pam@chromium.org>
1576
1577         Reviewed by Dimitri Glazkov.
1578
1579         Build fix for Chromium.
1580         https://bugs.webkit.org/show_bug.cgi?id=12440
1581
1582         * page/chromium/FrameChromium.cpp:
1583         (WebCore::computePageRectsForFrame): change docWidth() to overflowWidth()
1584
1585 2009-04-09  David Hyatt  <hyatt@apple.com>
1586
1587         Reviewed by Oliver Hunt
1588
1589         Add a timer for style recalc (similar to the one used for scheduling layouts).  For now in order
1590         to reduce the risk of regressions, I have left in all the synchronous machinery for updating style
1591         following DOM events and JavaScript timeouts.  Eventually these calls will be removed.
1592
1593         Where the timer will really kick in and be useful is for clients that do style changes from
1594         Objective-C DOM bindings or that execute JavaScript to manipulate style from the JavaScriptCore C API.
1595
1596         * dom/ContainerNode.cpp:
1597         (WebCore::ContainerNode::insertBefore):
1598         (WebCore::ContainerNode::replaceChild):
1599         (WebCore::ContainerNode::removeChild):
1600         (WebCore::ContainerNode::appendChild):
1601         * dom/Document.cpp:
1602         (WebCore::Document::Document):
1603         (WebCore::Document::~Document):
1604         (WebCore::Document::scheduleStyleRecalc):
1605         (WebCore::Document::unscheduleStyleRecalc):
1606         (WebCore::Document::styleRecalcTimerFired):
1607         (WebCore::Document::updateStyleForAllDocuments):
1608         (WebCore::Document::detach):
1609         * dom/Document.h:
1610         * dom/Node.cpp:
1611         (WebCore::Node::setNeedsStyleRecalc):
1612         (WebCore::Node::lazyAttach):
1613
1614 2009-04-09  Oliver Hunt  <oliver@apple.com>
1615
1616         Reviewed by Gavin Barraclough.
1617
1618         <rdar://problem/6586787> JS debugger does not work in 64-bit
1619
1620         Don't truncate the source id in JSCallFrame
1621
1622         * inspector/JavaScriptCallFrame.h:
1623
1624 2009-04-09  Adam Roben  <aroben@apple.com>
1625
1626         Start compiling HistoryPropertyList on Windows
1627
1628         Reviewed by Darin Adler.
1629
1630         * WebCore.vcproj/WebCore.vcproj: Added HistoryPropertyList and its
1631         dependencies to the project. Copy headers from history/cf to
1632         $WebKitOutputDir.
1633         * history/cf/HistoryPropertyList.cpp: Added StringExtras.h so that
1634         this file will compile on Windows.
1635
1636 2009-04-09  Dan Bernstein  <mitz@apple.com>
1637
1638         Reviewed by Dave Hyatt.
1639
1640         - fix <rdar://problem/6166612> Text boxes' metrics should be based on
1641           the actual fonts used in them, not just the primary font
1642
1643         Covered by many existing layout tests
1644
1645         * platform/graphics/Font.cpp:
1646         (WebCore::Font::floatWidth): Added a fallbackFonts parameter. If the
1647         platform supports collecting fallback fonts in its complex font path
1648         and fallbackFonts is not null, all fallback fonts used for the text run
1649         will be added to it.
1650
1651         * platform/graphics/Font.h:
1652         (WebCore::Font::width): Ditto.
1653
1654         * platform/graphics/FontFastPath.cpp:
1655         (WebCore::Font::glyphDataForCharacter): Removed an unnecessary namespace
1656         qualifier.
1657         (WebCore::Font::floatWidthForSimpleText): Added a fallbackFonts
1658         parameter, which is passed down to WidthIterator.
1659
1660         * platform/graphics/WidthIterator.cpp:
1661         (WebCore::WidthIterator::WidthIterator): Added a fallbackFonts parameter
1662         and used it to initialize the m_fallbackFonts member.
1663         (WebCore::WidthIterator::advance): Track the fonts being used and add
1664         any fallback fonts to the m_fallbackFonts set. Make sure to only add
1665         non-small-caps fonts.
1666
1667         * platform/graphics/WidthIterator.h:
1668
1669         * platform/graphics/chromium/FontChromiumWin.cpp:
1670         (WebCore::Font::canReturnFallbackFontsForComplexText): Added an
1671         implementation that returns false, meaning this platform's
1672         implementation of floatWidthForComplexText() does not populate the
1673         fallbackFonts set.
1674         (WebCore::Font::floatWidthForComplexText): Updated for the new
1675         prototype.
1676
1677         * platform/graphics/chromium/FontLinux.cpp: Ditto.
1678
1679         * platform/graphics/gtk/FontGtk.cpp: Ditto.
1680
1681         * platform/graphics/mac/CoreTextController.cpp:
1682         (WebCore::CoreTextController::CoreTextController): Added a fallbackFonts
1683         parameter and used it to initialize the m_fallbackFonts member.
1684         (WebCore::CoreTextController::collectCoreTextRunsForCharacters): Add
1685         fallback fonts to m_fallbackFonts.
1686
1687         * platform/graphics/mac/CoreTextController.h:
1688
1689         * platform/graphics/mac/FontMac.mm:
1690         (WebCore::Font::canReturnFallbackFontsForComplexText): Added an
1691         implementation that returns true, indicating that the Mac
1692         implementations of floatWidthForComplexText() populate the fallbackFonts
1693         set.
1694         * platform/graphics/mac/FontMacATSUI.mm:
1695         (WebCore::ATSULayoutParameters::ATSULayoutParameters): Added a
1696         fallbackFonts parameter and used it to initialize the m_fallbackFonts
1697         member.
1698         (WebCore::ATSULayoutParameters::initialize): Add fallback fonts to
1699         m_fallbackFonts.
1700         (WebCore::Font::floatWidthForComplexText): Added a fallbackFonts
1701         parameter, which is passed down to ATSULayoutParameters.
1702
1703         * platform/graphics/mac/FontMacCoreText.cpp:
1704         (WebCore::Font::floatWidthForComplexText): Added a fallbackFonts
1705         parameter, which is passed down to CoreTextController.
1706
1707         * platform/graphics/win/FontWin.cpp:
1708         (WebCore::Font::canReturnFallbackFontsForComplexText): Added an
1709         implementation that returns true, indicating that the
1710         UniscribeController-based implementations of floatWidthForComplexText()
1711         populate the fallbackFonts set.
1712         (WebCore::Font::floatWidthForComplexText): Added a fallbackFonts
1713         parameter, which is passed down to UniscribeController.
1714
1715         * platform/graphics/win/UniscribeController.cpp:
1716         (WebCore::UniscribeController::UniscribeController): Added a
1717         fallbackfonts parameter and used it to initialize m_fallbackFonts.
1718         (WebCore::UniscribeController::advance): Add fallback fonts to
1719         m_fallbackFonts.
1720
1721         * platform/graphics/win/UniscribeController.h:
1722         
1723         * platform/graphics/wx/FontWx.cpp:
1724         (WebCore::Font::canReturnFallbackFontsForComplexText): Added an
1725         implementation that returns false, meaning this platform's
1726         implementation of floatWidthForComplexText() does not populate the
1727         fallbackFonts set.
1728         (WebCore::Font::floatWidthForComplexText): Updated for the new
1729         prototype.
1730
1731         * rendering/InlineFlowBox.cpp:
1732         (WebCore::InlineFlowBox::computeLogicalBoxHeights): For an InlineTextBox
1733         with multiple fonts, compute a common baseline and line height by
1734         considering all fonts' ascents and descents (and line spacing, if
1735         applicable).
1736
1737         * rendering/InlineTextBox.cpp:
1738         (WebCore::InlineTextBox::setFallbackFonts): Added. Temporarily stores
1739         the set of fallback fonts in a vector.
1740         (WebCore::InlineTextBox::takeFallbackFonts): Added. Returns the fallback
1741         fonts previously stored and removes them from storage.
1742
1743         * rendering/InlineTextBox.h:
1744
1745         * rendering/RenderText.cpp:
1746         (WebCore::RenderText::RenderText): Initialized the
1747         m_knownNotToUseFallbackFonts to false.
1748         (WebCore::RenderText::styleDidChange): Reset
1749         m_knownNotToUseFallbackFonts to false if the style difference is such that
1750         affects layout.
1751         (WebCore::RenderText::widthFromCache): Added a fallbackFonts parameter,
1752         which is passed down to Font::width().
1753         (WebCore::RenderText::trimmedPrefWidths): Updated for the change to
1754         widthFromCache().
1755         (WebCore::RenderText::calcPrefWidths): Made this call a private version
1756         of calcPrefWidths() that takes a fallbackFonts parameter and set the
1757         m_knownNotToUseFallbackFonts to true if the set comes back empty.
1758         The private version passes the fallbackFonts set to widthFromCache().
1759         (WebCore::RenderText::setText): Reset m_knownNotToUseFallbackFonts to
1760         false.
1761         (WebCore::RenderText::createFallbackFontMetricsBox): Added.
1762         (WebCore::RenderText::width): Added a fallbackFonts parameter, which is
1763         passed down to calcPrefWidths(), widthFromCache() and Font::width().
1764         Set m_knownNotToUseFallbackFonts to true when appropriate.
1765
1766         * rendering/RenderText.h:
1767
1768         * rendering/bidi.cpp:
1769         (WebCore::RenderBlock::constructLine): Added an assertion and a continue
1770         statement to remove one level of indentation.
1771         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Temporarily
1772         store the set of fallback fonts in the InlineTextBox.
1773         (WebCore::RenderBlock::computeVerticalPositionsForLine): Added an
1774         assertion.
1775
1776 2009-04-09  David Hyatt  <hyatt@apple.com>
1777
1778         Reviewed by Adam Roben
1779
1780         Rename all of the changed()/setChanged()/setDocumentChanged() methods to mention style recalc
1781         explicitly instead.
1782
1783         * bindings/js/JSCustomPositionCallback.cpp:
1784         (WebCore::JSCustomPositionCallback::handleEvent):
1785         * bindings/js/JSCustomPositionErrorCallback.cpp:
1786         (WebCore::JSCustomPositionErrorCallback::handleEvent):
1787         * bindings/js/JSCustomSQLStatementCallback.cpp:
1788         (WebCore::JSCustomSQLStatementCallback::handleEvent):
1789         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
1790         (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
1791         * bindings/js/JSCustomSQLTransactionCallback.cpp:
1792         (WebCore::JSCustomSQLTransactionCallback::handleEvent):
1793         * bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
1794         (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
1795         * bindings/js/JSCustomVoidCallback.cpp:
1796         (WebCore::JSCustomVoidCallback::handleEvent):
1797         * bindings/js/JSCustomXPathNSResolver.cpp:
1798         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1799         * bindings/js/JSEventListener.cpp:
1800         (WebCore::JSAbstractEventListener::handleEvent):
1801         * bindings/js/ScheduledAction.cpp:
1802         (WebCore::ScheduledAction::execute):
1803         * bindings/js/ScriptControllerMac.mm:
1804         (WebCore::updateStyleIfNeededForBindings):
1805         (WebCore::ScriptController::initJavaJSBindings):
1806         * css/CSSMutableStyleDeclaration.cpp:
1807         (WebCore::CSSMutableStyleDeclaration::removeProperty):
1808         (WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc):
1809         (WebCore::CSSMutableStyleDeclaration::setProperty):
1810         (WebCore::CSSMutableStyleDeclaration::setStringProperty):
1811         (WebCore::CSSMutableStyleDeclaration::setImageProperty):
1812         (WebCore::CSSMutableStyleDeclaration::parseDeclaration):
1813         (WebCore::CSSMutableStyleDeclaration::addParsedProperties):
1814         (WebCore::CSSMutableStyleDeclaration::setCssText):
1815         (WebCore::CSSMutableStyleDeclaration::merge):
1816         (WebCore::CSSMutableStyleDeclaration::removePropertiesInSet):
1817         * css/CSSMutableStyleDeclaration.h:
1818         * css/CSSStyleSelector.cpp:
1819         (WebCore::CSSStyleSelector::SelectorChecker::allVisitedStateChanged):
1820         (WebCore::CSSStyleSelector::SelectorChecker::visitedStateChanged):
1821         * css/CSSVariablesDeclaration.cpp:
1822         (WebCore::CSSVariablesDeclaration::removeVariable):
1823         (WebCore::CSSVariablesDeclaration::setVariable):
1824         (WebCore::CSSVariablesDeclaration::setNeedsStyleRecalc):
1825         * css/CSSVariablesDeclaration.h:
1826         * dom/ContainerNode.cpp:
1827         (WebCore::ContainerNode::insertBefore):
1828         (WebCore::ContainerNode::replaceChild):
1829         (WebCore::ContainerNode::removeChild):
1830         (WebCore::ContainerNode::appendChild):
1831         (WebCore::ContainerNode::detach):
1832         (WebCore::ContainerNode::setFocus):
1833         (WebCore::ContainerNode::setActive):
1834         (WebCore::ContainerNode::setHovered):
1835         * dom/Document.cpp:
1836         (WebCore::Document::Document):
1837         (WebCore::Document::~Document):
1838         (WebCore::Document::scheduleStyleRecalc):
1839         (WebCore::Document::unscheduleStyleRecalc):
1840         (WebCore::Document::recalcStyle):
1841         (WebCore::Document::updateStyleIfNeeded):
1842         (WebCore::Document::updateStyleForAllDocuments):
1843         (WebCore::Document::updateLayout):
1844         (WebCore::Document::implicitClose):
1845         (WebCore::Document::prepareMouseEvent):
1846         (WebCore::Document::setFocusedNode):
1847         (WebCore::Document::setCSSTarget):
1848         * dom/Document.h:
1849         * dom/Element.cpp:
1850         (WebCore::Element::recalcStyle):
1851         (WebCore::checkForSiblingStyleChanges):
1852         * dom/InputElement.cpp:
1853         (WebCore::InputElement::parseMaxLengthAttribute):
1854         * dom/MouseRelatedEvent.cpp:
1855         (WebCore::MouseRelatedEvent::receivedTarget):
1856         * dom/Node.cpp:
1857         (WebCore::Node::Node):
1858         (WebCore::Node::setNeedsStyleRecalc):
1859         (WebCore::Node::lazyAttach):
1860         (WebCore::Node::dispatchGenericEvent):
1861         * dom/Node.h:
1862         (WebCore::Node::needsStyleRecalc):
1863         (WebCore::Node::childNeedsStyleRecalc):
1864         (WebCore::Node::setChildNeedsStyleRecalc):
1865         * dom/OptionElement.cpp:
1866         (WebCore::OptionElement::setSelectedState):
1867         * dom/ScriptElement.cpp:
1868         (WebCore::ScriptElementData::evaluateScript):
1869         * dom/StyledElement.cpp:
1870         (WebCore::StyledElement::attributeChanged):
1871         (WebCore::StyledElement::classAttributeChanged):
1872         (WebCore::StyledElement::parseMappedAttribute):
1873         * dom/Text.cpp:
1874         (WebCore::Text::recalcStyle):
1875         * dom/XMLTokenizer.cpp:
1876         (WebCore::XMLTokenizer::insertErrorMessageBlock):
1877         * editing/DeleteButtonController.cpp:
1878         (WebCore::DeleteButtonController::enable):
1879         * editing/Editor.cpp:
1880         (WebCore::Editor::setBaseWritingDirection):
1881         * editing/SelectionController.cpp:
1882         (WebCore::SelectionController::nodeWillBeRemoved):
1883         (WebCore::SelectionController::layout):
1884         (WebCore::SelectionController::focusedOrActiveStateChanged):
1885         * html/HTMLAnchorElement.cpp:
1886         (WebCore::HTMLAnchorElement::parseMappedAttribute):
1887         * html/HTMLElement.cpp:
1888         (WebCore::HTMLElement::setInnerText):
1889         (WebCore::HTMLElement::isContentEditable):
1890         (WebCore::HTMLElement::isContentRichlyEditable):
1891         (WebCore::HTMLElement::contentEditable):
1892         * html/HTMLEmbedElement.cpp:
1893         (WebCore::HTMLEmbedElement::updateWidget):
1894         * html/HTMLFormControlElement.cpp:
1895         (WebCore::HTMLFormControlElement::parseMappedAttribute):
1896         * html/HTMLFrameSetElement.cpp:
1897         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
1898         (WebCore::HTMLFrameSetElement::recalcStyle):
1899         * html/HTMLInputElement.cpp:
1900         (WebCore::HTMLInputElement::parseMappedAttribute):
1901         (WebCore::HTMLInputElement::setChecked):
1902         (WebCore::HTMLInputElement::setIndeterminate):
1903         (WebCore::HTMLInputElement::setValue):
1904         (WebCore::HTMLInputElement::setAutofilled):
1905         * html/HTMLMediaElement.cpp:
1906         (WebCore::HTMLMediaElement::finishParsingChildren):
1907         * html/HTMLObjectElement.cpp:
1908         (WebCore::HTMLObjectElement::updateWidget):
1909         (WebCore::HTMLObjectElement::finishParsingChildren):
1910         (WebCore::HTMLObjectElement::childrenChanged):
1911         * html/HTMLSelectElement.cpp:
1912         (WebCore::HTMLSelectElement::recalcStyle):
1913         (WebCore::HTMLSelectElement::restoreState):
1914         (WebCore::HTMLSelectElement::setRecalcListItems):
1915         (WebCore::HTMLSelectElement::reset):
1916         (WebCore::HTMLSelectElement::typeAheadFind):
1917         * html/HTMLTableElement.cpp:
1918         (WebCore::setTableCellsChanged):
1919         (WebCore::HTMLTableElement::parseMappedAttribute):
1920         * html/HTMLTextAreaElement.cpp:
1921         (WebCore::HTMLTextAreaElement::setValue):
1922         * loader/FrameLoader.cpp:
1923         (WebCore::FrameLoader::stopLoading):
1924         (WebCore::FrameLoader::executeScript):
1925         (WebCore::FrameLoader::gotoAnchor):
1926         * page/DOMWindow.cpp:
1927         (WebCore::DOMWindow::alert):
1928         (WebCore::DOMWindow::confirm):
1929         (WebCore::DOMWindow::prompt):
1930         * page/EventHandler.cpp:
1931         (WebCore::EventHandler::hoverTimerFired):
1932         * page/FrameView.cpp:
1933         (WebCore::FrameView::layout):
1934         (WebCore::FrameView::needsLayout):
1935         * page/animation/AnimationBase.cpp:
1936         (WebCore::AnimationBase::setNeedsStyleRecalc):
1937         (WebCore::AnimationBase::updateStateMachine):
1938         * page/animation/AnimationBase.h:
1939         * page/animation/AnimationController.cpp:
1940         (WebCore::AnimationControllerPrivate::AnimationControllerPrivate):
1941         (WebCore::AnimationControllerPrivate::clear):
1942         (WebCore::AnimationControllerPrivate::updateAnimationTimer):
1943         (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
1944         (WebCore::AnimationControllerPrivate::startupdateStyleIfNeededDispatcher):
1945         (WebCore::AnimationControllerPrivate::addEventToDispatch):
1946         (WebCore::AnimationControllerPrivate::addNodeChangeToDispatch):
1947         (WebCore::AnimationControllerPrivate::animationTimerFired):
1948         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
1949         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
1950         (WebCore::AnimationControllerPrivate::addToStartTimeResponseWaitList):
1951         (WebCore::AnimationController::cancelAnimations):
1952         * page/animation/AnimationControllerPrivate.h:
1953         * page/animation/ImplicitAnimation.cpp:
1954         (WebCore::ImplicitAnimation::sendTransitionEvent):
1955         * page/animation/KeyframeAnimation.cpp:
1956         (WebCore::KeyframeAnimation::endAnimation):
1957         (WebCore::KeyframeAnimation::sendAnimationEvent):
1958         * rendering/RenderObject.cpp:
1959         (WebCore::RenderObject::updateDragState):
1960         * rendering/RenderView.cpp:
1961         (WebCore::RenderView::selectionBounds):
1962         * svg/SVGAElement.cpp:
1963         (WebCore::SVGAElement::svgAttributeChanged):
1964         * svg/SVGAnimationElement.cpp:
1965         (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
1966         * svg/SVGCursorElement.cpp:
1967         (WebCore::SVGCursorElement::svgAttributeChanged):
1968         * svg/SVGElementInstance.cpp:
1969         (WebCore::SVGElementInstance::setNeedsUpdate):
1970         * svg/SVGForeignObjectElement.cpp:
1971         (WebCore::addCSSPropertyAndNotifyAttributeMap):
1972         * svg/SVGStopElement.cpp:
1973         (WebCore::SVGStopElement::parseMappedAttribute):
1974         * svg/SVGStyledElement.cpp:
1975         (WebCore::SVGStyledElement::parseMappedAttribute):
1976         * svg/SVGUseElement.cpp:
1977         (WebCore::SVGUseElement::svgAttributeChanged):
1978         (WebCore::SVGUseElement::childrenChanged):
1979         (WebCore::SVGUseElement::recalcStyle):
1980         * svg/animation/SMILTimeContainer.cpp:
1981         (WebCore::SMILTimeContainer::updateAnimations):
1982         * wml/WMLAElement.cpp:
1983         (WebCore::WMLAElement::parseMappedAttribute):
1984         * wml/WMLInputElement.cpp:
1985         (WebCore::WMLInputElement::setValue):
1986         (WebCore::WMLInputElement::parseMappedAttribute):
1987         * wml/WMLNoopElement.cpp:
1988         (WebCore::WMLNoopElement::insertedIntoDocument):
1989
1990 2009-04-09  Brett Wilson  <brettw@chromium.org>
1991
1992         Reviewed by Darin Fisher.
1993
1994         When there is a shadow set but it specifies "no shadow", clear the
1995         shadow shader. This will prevent Chromium from thinking there's a
1996         shadow and using the Skia codepath rather than Windows.
1997
1998         * platform/graphics/skia/GraphicsContextSkia.cpp:
1999         (WebCore::GraphicsContext::setPlatformShadow):
2000
2001 2009-04-09  Eric Seidel  <eric@webkit.org>
2002
2003         Reviewed by Simon Fraser.
2004
2005         Crash when accessing svg.viewport on a detached SVGSVGElement
2006         https://bugs.webkit.org/show_bug.cgi?id=25105
2007
2008         * svg/SVGSVGElement.cpp:
2009         (WebCore::SVGSVGElement::isOutermostSVG): return "true" that we are the "outermost" SVG element if we have no parent.  (The spec is unclear as to what behavior we should have in this case, and I doubt anyone cares for now).
2010
2011 2009-04-09  Jian Li  <jianli@chromium.org>
2012
2013         Reviewed by Dimitri Glazkov.
2014
2015         https://bugs.webkit.org/show_bug.cgi?id=25084
2016         Upstream changes to V8 bindings for XHR so that it can work under either DOMWindow or WorkerContext.
2017
2018         * bindings/v8/WorkerContextExecutionProxy.cpp:
2019         (WebCore::WorkerContextExecutionProxy::dispose):
2020         (WebCore::WorkerContextExecutionProxy::retrieve):
2021         (WebCore::WorkerContextExecutionProxy::initContextIfNeeded):
2022         (WebCore::WorkerContextExecutionProxy::findOrCreateEventListenerHelper):
2023         (WebCore::WorkerContextExecutionProxy::FindOrCreateEventListener):
2024         (WebCore::WorkerContextExecutionProxy::findOrCreateObjectEventListener):
2025         * bindings/v8/WorkerContextExecutionProxy.h:
2026         * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
2027         (WebCore::CALLBACK_FUNC_DECL):
2028         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
2029         (WebCore::getEventListener):
2030         (WebCore::ACCESSOR_SETTER):
2031         (WebCore::CALLBACK_FUNC_DECL):
2032
2033 2009-04-09  Darin Adler  <darin@apple.com>
2034
2035         Reviewed by Anders Carlsson and Sam Weinig.
2036
2037         Part of <rdar://problem/5438063> Saving history containing 100,000 entries causes pauses of 2s while browsing
2038
2039         Longer term solution is to change the design so Safari doesn't read and write all of history.
2040         This patch is step one: Do the serializing, which is done on the main thread, much faster.
2041
2042         * WebCore.base.exp: Added new entry points.
2043         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2044
2045         * history/cf: Added.
2046
2047         * history/cf/HistoryPropertyList.cpp: Added.
2048         * history/cf/HistoryPropertyList.h: Added. Code to write history files. In the future we'll also
2049         have code for reading here too.
2050
2051         * platform/cf/BinaryPropertyList.cpp: Added.
2052         * platform/cf/BinaryPropertyList.h: Added. Code to write binary property list files.
2053
2054 2009-04-09  Simon Fraser  <simon.fraser@apple.com>
2055
2056         Reviewed by Antti Koivisto
2057
2058         https://bugs.webkit.org/show_bug.cgi?id=25122
2059
2060         If deferred repainting is active, we need to ensure that there are no repaints
2061         pending at the end of layoutIfNeededRecursive, which is called just before
2062         painting via -viewWillDraw.
2063
2064         * page/FrameView.cpp:
2065         (WebCore::FrameView::layoutIfNeededRecursive):
2066
2067 2009-04-09  John Grabowski  <jrg@chromium.org>
2068
2069         Reviewed by Darin Fisher.
2070
2071         https://bugs.webkit.org/show_bug.cgi?id=25117
2072         Fix Mac Chromium form controls.
2073
2074         * rendering/RenderThemeChromiumMac.mm:
2075         When rendering native controls in Mac Chromium, use a clean NSGraphicsContext.
2076         Properly save and restore native graphics context.
2077         (WebCore::RenderThemeChromiumMac::paintCheckbox):
2078         (WebCore::RenderThemeChromiumMac::paintRadio):
2079         (WebCore::RenderThemeChromiumMac::paintMenuList):
2080         (WebCore::RenderThemeChromiumMac::paintSearchFieldCancelButton):
2081         (WebCore::RenderThemeChromiumMac::paintSearchFieldResultsDecoration):
2082         (WebCore::RenderThemeChromiumMac::paintSearchFieldResultsButton):
2083
2084 2009-04-09  Drew Wilson  <atwilson@google.com>
2085
2086         Reviewed by Alexey Proskuryakov.
2087
2088         https://bugs.webkit.org/show_bug.cgi?id=25030
2089         Refactor MessagePort code to enable Chrome to use a MessagePortProxy object
2090         instead of a real MessagePort for the entangledPort, since it could
2091         theoretically live in a separate process.
2092
2093         The goal of this refactoring is to remove all assumptions that the object
2094         representing the entangled port is actually of type MessagePort. All
2095         operations that were previously directly modifying private MessagePort member
2096         variables in the entangled port (i.e. entangle(), postMessage()) have been changed
2097         to invoke functions in the  MessagePortProxy interface instead which will allow
2098         the Chrome bindings to proxy these calls to another process.
2099
2100         No new layout tests, as this is just a refactoring with no bug fixes
2101         or new functionality.
2102
2103         * GNUmakefile.am:
2104         * WebCore.vcproj/WebCore.vcproj:
2105         * WebCore.xcodeproj/project.pbxproj:
2106         * bindings/js/JSMessagePortCustom.cpp:
2107         (WebCore::JSMessagePort::mark):
2108         * dom/MessagePort.cpp:
2109         (WebCore::MessagePort::clone):
2110         (WebCore::MessagePort::postMessage):
2111         (WebCore::MessagePort::deliverMessage):
2112         (WebCore::MessagePort::startConversation):
2113         (WebCore::MessagePort::close):
2114         (WebCore::MessagePort::entangle):
2115         (WebCore::MessagePort::unentangle):
2116         * dom/MessagePort.h:
2117         (WebCore::MessagePort::entangledPort):
2118         * dom/MessagePortProxy.h: Added.
2119         (WebCore::MessagePortProxy::~MessagePortProxy):
2120
2121 2009-04-08  Sam Weinig  <sam@webkit.org>
2122
2123         Reviewed by Geoffrey "Big Boy" Garen.
2124
2125         Fix for <rdar://problem/5745677> Possible to stop load during an unload event
2126         Also fixes https://bugs.webkit.org/show_bug.cgi?id=20605
2127
2128         Tests: fast/events/stop-load-in-unload-handler-using-document-write.html
2129                fast/events/stop-load-in-unload-handler-using-window-stop.html
2130
2131         Don't allow calling methods that would stop the new load inside the unload
2132         event.
2133
2134         * loader/FrameLoader.cpp:
2135         (WebCore::FrameLoader::FrameLoader):
2136         (WebCore::FrameLoader::stopLoading):
2137         (WebCore::FrameLoader::stopAllLoaders):
2138         * loader/FrameLoader.h:
2139
2140 2009-04-09  David Kilzer  <ddkilzer@apple.com>
2141
2142         Reinstating <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
2143
2144         Rolled r42345 back in.  The build failure was caused by an
2145         internal script which had not been updated the same way that
2146         build-webkit was updated.
2147
2148         * Configurations/WebCore.xcconfig:
2149         * DerivedSources.make:
2150         * bindings/objc/DOM.mm:
2151         (WebCore::createElementClassMap):
2152         (+[DOMNode _wrapNode:WebCore::]):
2153         * bindings/objc/DOMCSS.mm:
2154         (+[DOMCSSValue _wrapCSSValue:WebCore::]):
2155         * bindings/objc/DOMEvents.mm:
2156         (+[DOMEvent _wrapEvent:WebCore::]):
2157         * bindings/objc/DOMInternal.h:
2158         * bindings/objc/ExceptionHandlers.mm:
2159         (WebCore::raiseDOMException):
2160         * html/HTMLEmbedElement.idl:
2161         * html/HTMLFrameElement.idl:
2162         * html/HTMLIFrameElement.idl:
2163         * html/HTMLObjectElement.idl:
2164
2165 2009-04-09  Simon Fraser  <simon.fraser@apple.com>
2166
2167         Reviewed by Darin Adler
2168
2169         https://bugs.webkit.org/show_bug.cgi?id=25109
2170
2171         Eliminate CompositeAnimationPrivate, which was a needless level
2172         of abstraction. Remove the methods like addToStyleAvailableWaitList()
2173         that simply turn around and call the animation controller.
2174         
2175         Rename animationControllerPriv() to animationController().
2176         Rename willNeedService() to timeToNextService().
2177
2178         * page/animation/AnimationBase.cpp:
2179         (WebCore::AnimationBase::~AnimationBase):
2180         (WebCore::AnimationBase::updateStateMachine):
2181         (WebCore::AnimationBase::timeToNextService):
2182         (WebCore::AnimationBase::beginAnimationUpdateTime):
2183         * page/animation/AnimationBase.h:
2184         * page/animation/AnimationController.cpp:
2185         (WebCore::AnimationControllerPrivate::updateAnimationTimer):
2186         * page/animation/CompositeAnimation.cpp:
2187         (WebCore::CompositeAnimation::~CompositeAnimation):
2188         (WebCore::CompositeAnimation::clearRenderer):
2189         (WebCore::CompositeAnimation::updateTransitions):
2190         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2191         (WebCore::CompositeAnimation::animate):
2192         (WebCore::CompositeAnimation::getAnimatedStyle):
2193         (WebCore::CompositeAnimation::setAnimating):
2194         (WebCore::CompositeAnimation::timeToNextService):
2195         (WebCore::CompositeAnimation::getAnimationForProperty):
2196         (WebCore::CompositeAnimation::cleanupFinishedAnimations):
2197         (WebCore::CompositeAnimation::suspendAnimations):
2198         (WebCore::CompositeAnimation::resumeAnimations):
2199         (WebCore::CompositeAnimation::overrideImplicitAnimations):
2200         (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations):
2201         (WebCore::CompositeAnimation::isAnimatingProperty):
2202         (WebCore::CompositeAnimation::pauseAnimationAtTime):
2203         (WebCore::CompositeAnimation::pauseTransitionAtTime):
2204         (WebCore::CompositeAnimation::numberOfActiveAnimations):
2205         * page/animation/CompositeAnimation.h:
2206         (WebCore::CompositeAnimation::animationController):
2207         (WebCore::CompositeAnimation::isSuspended):
2208         (WebCore::CompositeAnimation::hasAnimations):
2209         (WebCore::CompositeAnimation::CompositeAnimation):
2210         * page/animation/ImplicitAnimation.cpp:
2211         (WebCore::ImplicitAnimation::sendTransitionEvent):
2212         (WebCore::ImplicitAnimation::timeToNextService):
2213         * page/animation/ImplicitAnimation.h:
2214         * page/animation/KeyframeAnimation.cpp:
2215         (WebCore::KeyframeAnimation::sendAnimationEvent):
2216         (WebCore::KeyframeAnimation::timeToNextService):
2217         * page/animation/KeyframeAnimation.h:
2218
2219 2009-04-09  Alexey Proskuryakov  <ap@webkit.org>
2220
2221         Reverting <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings.
2222         It broke Mac build, and I don't know how to fix it.
2223
2224         * Configurations/WebCore.xcconfig:
2225         * DerivedSources.make:
2226         * bindings/objc/DOM.mm:
2227         (WebCore::createElementClassMap):
2228         (+[DOMNode _wrapNode:WebCore::]):
2229         * bindings/objc/DOMCSS.mm:
2230         (+[DOMCSSValue _wrapCSSValue:WebCore::]):
2231         * bindings/objc/DOMEvents.mm:
2232         (+[DOMEvent _wrapEvent:WebCore::]):
2233         * bindings/objc/DOMInternal.h:
2234         * bindings/objc/ExceptionHandlers.mm:
2235         (WebCore::raiseDOMException):
2236         * html/HTMLEmbedElement.idl:
2237         * html/HTMLFrameElement.idl:
2238         * html/HTMLIFrameElement.idl:
2239         * html/HTMLObjectElement.idl:
2240
2241 2009-04-09  Xan Lopez  <xlopez@igalia.com>
2242
2243         Unreviewed build fix.
2244
2245         RenderView::docWidth() was made private by r42334. That commit
2246         changes its usage for overflowWidth(), so do that here too.
2247
2248         * page/PrintContext.cpp:
2249         (WebCore::PrintContext::computePageRects):
2250
2251 2009-04-09  Xan Lopez  <xlopez@igalia.com>
2252
2253         Reviewed by Holger Freyther.
2254
2255         https://bugs.webkit.org/show_bug.cgi?id=21546
2256         [GTK] ATK accessibility enhancements
2257
2258         Based on a patch by Alp Toker.
2259
2260         Implement AtkObject::ref_state_set. Still quite a few states not
2261         implemented.
2262
2263         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
2264
2265 2009-04-09  Xan Lopez  <xlopez@igalia.com>
2266
2267         Reviewed by Holger Freyther.
2268
2269         https://bugs.webkit.org/show_bug.cgi?id=21546
2270         [GTK] ATK accessibility enhancements
2271
2272         Based on a patch by Alp Toker.
2273
2274         Move fallback object creation to its own function, as it will be
2275         used in several places.
2276
2277         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
2278         (fallbackObject):
2279
2280 2009-04-09  Xan Lopez  <xlopez@igalia.com>
2281
2282         Reviewed by Holger Freyther.
2283
2284         https://bugs.webkit.org/show_bug.cgi?id=21546
2285         [GTK] ATK accessibility enhancements
2286
2287         Based on a patch by Alp Toker.
2288
2289         Move AccessibilityObject methods to their file.
2290
2291         * page/gtk/AccessibilityObjectAtk.cpp:
2292         (WebCore::AccessibilityObject::wrapper):
2293         (WebCore::AccessibilityObject::setWrapper):
2294         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
2295
2296 2009-04-09  Xan Lopez  <xlopez@igalia.com>
2297
2298         Reviewed by Holger Freyther.
2299
2300         https://bugs.webkit.org/show_bug.cgi?id=21546
2301         [GTK] ATK accessibility enhancements
2302
2303         Rework accessibility type generation code, based on Mozilla a11y
2304         implementation.
2305
2306         Have one base a11y type, and generate derived types that implement
2307         only the necessary interfaces at runtime, based on the specific
2308         object we are wrapping. This allows to save a lot of code while
2309         covering all possible cases.
2310
2311         * page/gtk/AccessibilityObjectWrapperAtk.cpp:
2312
2313 2009-04-09  Eric Seidel  <eric@webkit.org>
2314
2315         Reviewed by Oliver Hunt.
2316
2317         Fix document.implementation.createDocument(null, "a:b") not to crash!
2318         https://bugs.webkit.org/show_bug.cgi?id=25096
2319
2320         Test: fast/dom/DOMImplementation/createDocument-namespace-err.html
2321
2322         * dom/ContainerNode.cpp:
2323         (WebCore::ContainerNode::addChild): add ASSERT() to give a better crash next time
2324         * dom/DOMImplementation.cpp:
2325         (WebCore::DOMImplementation::createDocument): check the exception code before using the result
2326
2327 2009-04-08  Adam Roben  <aroben@apple.com>
2328
2329         Make <select>s in application chrome documents match the Vista system
2330         dialog look
2331
2332         Reviewed by Dave Hyatt.
2333
2334         * rendering/RenderThemeWin.cpp:
2335         (WebCore::documentIsInApplicationChromeMode): Added this simple helper
2336         function.
2337         (WebCore::RenderThemeWin::getThemeData): In application chrome mode,
2338         the drop down button never uses any look but the "normal" look.
2339         (WebCore::RenderThemeWin::paintMenuList): In application chrome mode,
2340         use the "readonly" style to match system dialogs.
2341
2342 2009-04-08  Adam Roben  <aroben@apple.com>
2343
2344         Fix <rdar://6592515> Crash closing tab with Top Sites or Cover Flow
2345         showing after clicking "Go Back" in phishing alert
2346
2347         RenderButton's m_timer is not stopped when its Document enters the
2348         page cache. When the WebView was torn down, the timer would fire after
2349         the Frame's Page had been destroyed, leading to a crash. This patch
2350         just makes the timer do nothing when it fires. Making the timer not
2351         fire when in the page cache is covered by bug 25110.
2352
2353         Reviewed by Dave Hyatt.
2354
2355         No test possible.
2356
2357         * rendering/RenderButton.cpp:
2358         (WebCore::RenderButton::timerFired): Do nothing when we're in the page
2359         cache.
2360
2361 2009-04-09  David Hyatt  <hyatt@apple.com>
2362
2363         Reviewed by Adam Roben
2364
2365         Fix bugs where we would mistakenly turn off blitting for iframes if an external paint
2366         caused the checks to be triggered too early in the loading process of the frame.
2367
2368         * rendering/RenderBoxModelObject.cpp:
2369         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2370
2371 2009-04-08  Simon Fraser  <simon.fraser@apple.com>
2372
2373         Reviewed by Cameron Zwarich
2374
2375         https://bugs.webkit.org/show_bug.cgi?id=25106
2376         
2377         Fix signature of virtual function on AnimationBase so that it matches
2378         those in the derived classes, by removing unused parameter.
2379         
2380         * page/animation/AnimationBase.h:
2381         (WebCore::AnimationBase::endAnimation):
2382
2383 2009-04-08  David Kilzer  <ddkilzer@apple.com>
2384
2385         <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
2386
2387         Reviewed by Darin Adler and Maciej Stachowiak.
2388
2389         Introduce the ENABLE_SVG_DOM_OBJC_BINDINGS feature define so
2390         that SVG DOM Objective-C bindings may be optionally disabled.
2391
2392         * Configurations/WebCore.xcconfig: Added
2393         ENABLE_SVG_DOM_OBJC_BINDINGS variable and use it in
2394         FEATURE_DEFINES and EXCLUDED_SOURCE_FILE_NAMES.  When SVG DOM
2395         Objective-C bindings are disabled, two generated header files no
2396         longer exist and none of the generated DOMSVG*.mm files should
2397         be compiled.
2398         * DerivedSources.make: All of the WebCore.SVG*.exp files contain
2399         SVG DOM Objective-C bindings classes, so exclude them unless
2400         ENABLE_SVG_DOM_OBJC_BINDINGS is set.
2401         * bindings/objc/DOM.mm: Switched from using ENABLE(SVG) to using
2402         ENABLE(SVG_DOM_OBJC_BINDINGS).
2403         (WebCore::createElementClassMap):
2404         (+[DOMNode _wrapNode:WebCore::]):
2405         * bindings/objc/DOMCSS.mm: Ditto.
2406         (+[DOMCSSValue _wrapCSSValue:WebCore::]):
2407         * bindings/objc/DOMEvents.mm: Ditto.
2408         (+[DOMEvent _wrapEvent:WebCore::]):
2409         * bindings/objc/DOMInternal.h: Ditto.
2410         * bindings/objc/ExceptionHandlers.mm: Added use of
2411         ENABLE(SVG_DOM_OBJC_BINDINGS).
2412         (WebCore::raiseDOMException):
2413         * html/HTMLEmbedElement.idl: Excluded -getSVGDocument method
2414         in generated Objective-C DOM classes if SVG DOM Objective-C
2415         bindings are disabled.
2416         * html/HTMLFrameElement.idl: Ditto.
2417         * html/HTMLIFrameElement.idl: Ditto.
2418         * html/HTMLObjectElement.idl: Ditto.
2419
2420 2009-04-08  Dan Bernstein  <mitz@apple.com>
2421
2422         Reviewed by Sam Weinig.
2423
2424         - limit the workaround for <rdar://problem/5781372> to Mac OS X versions
2425           that need it
2426
2427         * platform/mac/WebFontCache.mm:
2428         (fixUpWeight): Changed this function to be a no-op post-Leopard.
2429
2430 2009-04-08  Dan Bernstein  <mitz@apple.com>
2431
2432         Reviewed by Dave Hyatt.
2433
2434         - fix <rdar://problem/6771547> Appending to a RenderText causes all its
2435           lines to be dirtied
2436
2437         Test: fast/repaint/text-append-dirty-lines.html
2438
2439         * rendering/RenderText.cpp:
2440         (WebCore::RenderText::setTextWithOffset): If no text boxes intersected
2441         with or came after the new text, dirty the last root box, since the new
2442         text may begin there. Having at least one dirty line prevents the
2443         incorrect dirtying of all lines later during layoutInlineChildren().
2444
2445 2009-04-08  Darin Fisher  <darin@chromium.org>
2446
2447         Reviewed by Eric Seidel.
2448
2449         https://bugs.webkit.org/show_bug.cgi?id=25100
2450
2451         Fixes a Chromium-specific crash in WebCore::ImageBuffer::context that
2452         occurs when rendering semi-transparent RTL text.
2453
2454         Test: fast/text/complex-text-opacity.html
2455
2456         * platform/graphics/chromium/FontChromiumWin.cpp: Handle RTL when computing text bounds.
2457         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::estimateTextBounds):
2458
2459 2009-04-08  David Hyatt  <hyatt@apple.com>
2460
2461         Reviewed by Beth Dakin
2462
2463         Fix a porting error in my previous patch.  A != was supposed to be an ==.
2464
2465         * platform/ScrollView.cpp:
2466         (WebCore::ScrollView::updateScrollbars):
2467
2468 2009-04-08  David Hyatt  <hyatt@apple.com>
2469
2470         Reviewed by Adam Roben and Darin Adler
2471
2472         Fix for https://bugs.webkit.org/show_bug.cgi?id=12440, repaints inconsistent for
2473         fixed positioned elements.
2474
2475         Rewrite the updateScrollers method to be more correct in its results.
2476
2477         Test: fast/block/positioning/fixed-positioning-scrollbar-bug.html
2478
2479         * dom/Document.cpp:
2480         (WebCore::Document::recalcStyle):
2481         (WebCore::Document::implicitClose):
2482         * page/FrameView.cpp:
2483         (WebCore::FrameView::createScrollbar):
2484         (WebCore::FrameView::layout):
2485         (WebCore::FrameView::adjustPageHeight):
2486         * page/FrameView.h:
2487         * page/win/FrameWin.cpp:
2488         (WebCore::computePageRectsForFrame):
2489         * platform/ScrollView.cpp:
2490         (WebCore::ScrollView::ScrollView):
2491         (WebCore::ScrollView::updateScrollbars):
2492         * platform/ScrollView.h:
2493         * rendering/RenderView.cpp:
2494         (WebCore::RenderView::layout):
2495         (WebCore::RenderView::docHeight):
2496         (WebCore::RenderView::docWidth):
2497         * rendering/RenderView.h:
2498
2499 2009-04-08  Sam Weinig  <sam@webkit.org>
2500
2501         Reviewed by Anders Carlsson.
2502
2503         Fix for <rdar://problem/6226200> Implement Microsoft's X-FRAME-OPTIONS anti-framing defense
2504
2505         Tests: http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
2506                http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html
2507                http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
2508                http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
2509                http/tests/security/XFrameOptions/x-frame-options-deny.html
2510                http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow.html
2511                http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
2512
2513         * dom/Document.cpp:
2514         (WebCore::Document::processHttpEquiv): Stop the current load and redirect to about:blank
2515         if an X-FRAME-OPTIONS <meta> tag http-equiq dictates we should.
2516         * loader/FrameLoader.cpp:
2517         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions): Add logic to parse
2518         the X-FRAME-OPTIONS parameter.
2519         * loader/FrameLoader.h:
2520         * loader/MainResourceLoader.cpp:
2521         (WebCore::MainResourceLoader::didReceiveResponse): Stop the current load if framed and
2522         a X-FRAME-OPTIONS header and its parameter dictate that we should.
2523
2524 2009-04-08  Adam Roben  <aroben@apple.com>
2525
2526         Fix http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html on Windows
2527
2528         Reviewed by Sam Weinig.
2529
2530         * platform/network/cf/ResourceHandleCFNet.cpp:
2531         (WebCore::ResourceHandle::loadResourceSynchronously): Mimic the
2532         ResourceHandleMac code by propagating the CFError's error code for
2533         kCFErrorDomainCFNetwork errors to the ResourceResponse.
2534
2535 2009-04-08  Anders Carlsson  <andersca@apple.com>
2536
2537         Try to fix the PPC build.
2538         
2539         * plugins/npfunctions.h:
2540
2541 2009-04-08  Darin Adler  <darin@apple.com>
2542
2543         Reviewed by Sam Weinig.
2544
2545         <rdar://problem/5908616> tokenizer resizer should handle edge cases consistently
2546
2547         * html/HTMLTokenizer.cpp:
2548         (WebCore::HTMLTokenizer::enlargeBuffer): Handle edge cases the same way as a failed fastMalloc.
2549         (WebCore::HTMLTokenizer::enlargeScriptBuffer): Ditto.
2550
2551 2009-04-08  David Hyatt  <hyatt@apple.com>
2552
2553         Reviewed by Darin Adler
2554
2555         Make sure that cloneNode works with SVG attributes that require synchronization.  This fixes
2556         issues with <use> element shadow tree cloning where the clones can end up not obtaining the
2557         correct attribute values.
2558
2559         A subsequent patch of mine will expose this problem and cause it to be covered by existing
2560         layout tests, so no test is required at this time for this problem.
2561
2562         * dom/Element.cpp:
2563         (WebCore::Element::cloneElementWithoutChildren):
2564
2565 2009-04-08  Dimitri Glazkov  <dglazkov@chromium.org>
2566
2567         Reviewed by Timothy Hatcher.
2568
2569         https://bugs.webkit.org/show_bug.cgi?id=25093
2570         REGRESSION: some scripts are showing in the Inspector with only "true"
2571         as the source.
2572
2573         * inspector/InspectorController.cpp:
2574         (WebCore::InspectorController::didParseSource): Fixed conversion issue.
2575         (WebCore::InspectorController::failedToParseSource): Ditto.
2576
2577 2009-04-08  Adam Barth  <abarth@webkit.org>
2578
2579         Reviewed by Alexey Proskuryakov.
2580
2581         https://bugs.webkit.org/show_bug.cgi?id=24904
2582
2583         Verify the MIME type of stylesheets (in standards mode) by looking
2584         at the Content-Type header directly.  This bypasses any content
2585         sniffing that might be confusing the issue.
2586
2587         Test: http/tests/mime/standard-mode-loads-stylesheet-without-content-type-header.html
2588
2589         * loader/CachedCSSStyleSheet.cpp:
2590         (WebCore::CachedCSSStyleSheet::canUseSheet):
2591
2592 2009-04-08  Eric Carlson  <eric.carlson@apple.com>
2593
2594         Reviewed by Simon Fraser.
2595
2596         https://bugs.webkit.org/show_bug.cgi?id=25041
2597         <rdar://problem/6697754>
2598         Bug 25041: HTMLMediaElement: OSX autoplay broken by r41907
2599         
2600         OSX media player should set readyState to HAVE_ENOUGH_DATA when the movie's load state
2601         reaches QTMovieLoadStatePlaythroughOK, not when the entire file has been downloaded,
2602         so autoplay can begin when it should.
2603
2604         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2605         (WebCore::MediaPlayerPrivate::updateStates): Set readState to 
2606         HAVE_ENOUGH_DATA when QTMovie load state reaches QTMovieLoadStatePlaythroughOK.
2607         (WebCore::MediaPlayerPrivate::paint): Add braces missed in r42203.
2608
2609 2009-04-08  Alexey Proskuryakov  <ap@webkit.org>
2610
2611         Reviewed by David Kilzer. Based on a patch by Grace Kloba.
2612
2613         https://bugs.webkit.org/show_bug.cgi?id=24656
2614         cacheControlContainsNoCache() in ResourceResponseBase.h is wrong
2615
2616         * platform/network/ResourceResponseBase.cpp:
2617         (WebCore::ResourceResponseBase::parseCacheControlDirectives): Removed misused code for
2618         parsing directive values, fixing parsing of directives that we care about.
2619
2620         * platform/network/ResourceResponseBase.h:
2621         (WebCore::ResourceResponseBase::cacheControlContainsNoCache): Fixed a copy/paste mistake,
2622         m_cacheControlContainsMustRevalidate was returned instead of m_cacheControlContainsNoCache.
2623
2624 2009-04-08  Adam Roben  <aroben@apple.com>
2625
2626         Make text fields match the system look on Vista
2627
2628         Reviewed by Dave Hyatt.
2629
2630         * rendering/RenderThemeWin.cpp:
2631         (WebCore::RenderThemeWin::getThemeData): Use the new-to-Vista
2632         EP_EDITBORDER_NOSCROLL part for text fields.
2633
2634 2009-04-07  Alexey Proskuryakov  <ap@webkit.org>
2635
2636         Reviewed by Maciej Stachowiak.
2637
2638         https://bugs.webkit.org/show_bug.cgi?id=24957
2639         REGRESSION: Google calendar widget no longer shows upcoming events
2640
2641         Test: http/tests/xmlhttprequest/authorization-header.html
2642
2643         * xml/XMLHttpRequest.cpp:
2644         (WebCore::XMLHttpRequestStaticData::XMLHttpRequestStaticData): Removed Authorization from
2645         the list of forbidden headers.
2646
2647 2009-04-07  miggilin  <mr.diggilin@gmail.com>
2648
2649         Reviewed by Kevin Ollivier.
2650
2651         Remove no longer needed debug warning and Windows-specific codepaths
2652         (as we now use the Safari/Win port's timer there)
2653
2654         https://bugs.webkit.org/show_bug.cgi?id=25070
2655
2656         * platform/wx/SharedTimerWx.cpp:
2657         (WebCore::setSharedTimerFireTime):
2658
2659
2660 2009-04-07  Adam Roben  <aroben@apple.com>
2661
2662         Fix many <video> regression tests on Windows
2663
2664         Reviewed by Dave Hyatt.
2665
2666         * platform/graphics/win/QTMovieWin.cpp:
2667         (QTMovieWin::getNaturalSize): Call GetMovieNaturalBoundsRect, which
2668         returns the movie's natural bounds (duh), rather than GetMovieBox,
2669         which returns the movie's current displayed size/position.
2670
2671 2009-04-07  Brady Eidson  <beidson@apple.com>
2672
2673         Reviewed by Darin Adler and Sam Weinig
2674
2675         <rdar://problem/5968249> "Private Browsing" doesn't affect HTML 5 LocalStorage
2676
2677         The expected behavior for persistent storage when private browsing mode is undefined by the spec.
2678         For now we're going with a "read-only when in private browsing" policy until we can get feedback
2679         and/or get the behavior specified in the spec.
2680
2681         Note that I purposefully made the change to restrict SessionStorage to read-only, also, with the
2682         understanding that the spec allows for SessionStorage to persist across relaunches, even though
2683         our implementation currently doesn't do this.
2684
2685         * dom/DOMCoreException.idl: Add some new ExceptionCodes defined in HTML5, one of which is needed
2686           for LocalStorage changes (QUOTA_EXCEEDED_ERR)
2687         * dom/ExceptionCode.cpp: 
2688         * dom/ExceptionCode.h:
2689
2690         * storage/StorageArea.cpp:
2691         (WebCore::StorageArea::internalSetItem): If private browsing is enabled, throw the QUOTA_EXCEEDED_ERR
2692           exception as the spec allows.
2693         (WebCore::StorageArea::internalRemoveItem): If private browsing is enabled, silently fail to remove
2694           the item.
2695         (WebCore::StorageArea::internalClear): If private browsing is enabled, silently fail to clear the area.
2696
2697 2009-04-07  Dean Jackson  <dino@apple.com>
2698
2699         Reviewed by Simon Fraser.
2700
2701         <rdar://problem/6148255>
2702
2703         Standalone media documents can not always handle everything
2704         using a <video> element. In these cases switch to an <embed>
2705         element that uses the QuickTime plugin, in the hope that it
2706         will have more luck. Typical media types that trigger this
2707         are streamed media and QTVR.
2708
2709         Equivalent Windows fix to come once reviewed. Note also that
2710         this area of code needs a cleanup:
2711         https://bugs.webkit.org/show_bug.cgi?id=25085
2712
2713         * html/HTMLMediaElement.cpp:
2714         (WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks):
2715         * html/HTMLMediaElement.h:
2716         * loader/MediaDocument.cpp:
2717         (WebCore::MediaDocument::mediaElementSawUnsupportedTracks):
2718         (WebCore::MediaDocument::replaceVideoWithEmbed):
2719         * loader/MediaDocument.h:
2720             - removes the <video> element and puts in an <embed>
2721         * platform/graphics/MediaPlayer.h:
2722         (WebCore::MediaPlayerClient::mediaPlayerSawUnsupportedTracks):
2723             - new internal method for flagging a problem
2724         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2725         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2726         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2727         (WebCore::MediaPlayerPrivate::updateStates):
2728             - looks for the types of content we don't handle
2729         (WebCore::MediaPlayerPrivate::rateChanged):
2730         (WebCore::MediaPlayerPrivate::sizeChanged):
2731         (WebCore::MediaPlayerPrivate::timeChanged):
2732         (WebCore::MediaPlayerPrivate::didEnd):
2733         (WebCore::MediaPlayerPrivate::disableUnsupportedTracks):
2734         (WebCore::MediaPlayerPrivate::sawUnsupportedTracks):
2735             - inform the MediaClient that we have a potential problem
2736
2737 2009-04-07  Dan Bernstein  <mitz@apple.com>
2738
2739         Reviewed by Darin Adler.
2740
2741         - fix <rdar://problem/6767428> Resurrect
2742           +[WebFontCache fontWithFamily:traits:size:] for clients that call it
2743           directly
2744
2745         WebFontCache is a class in the WebCore framework and is not WebKit API,
2746         but apparently (perhaps mistakenly) some clients call this private
2747         interface.
2748
2749         This change resurrects the interface and gives it reasonable behavior
2750         (however, note that WebCore will not call the old interface, so hacks that
2751         override it will have no effect on WebKit clients).
2752
2753         * platform/mac/WebFontCache.h:
2754         * platform/mac/WebFontCache.mm:
2755         (+[WebFontCache fontWithFamily:traits:size:]): Added. Call through to
2756         +fontWithFamily:traits:weight:size:.
2757
2758 2009-04-07  David Hyatt  <hyatt@apple.com>
2759
2760         Reviewed by Adam Roben
2761
2762         Fix ScrollView's algorithm that determines whether or not to show scrollbars.  There was a bug
2763         with the method mainly because RenderView will size itself to the viewport's size, making it
2764         impossible to really know the document's "true" size.
2765
2766         In order to solve this problem ScrollView now has a minimumContentsSize method.  This method
2767         returns the document size excluding the RenderView from the calculation.  This width/height
2768         is now cached on RenderView in m_docWidth/m_docHeight member variables.
2769
2770         * WebCore.base.exp:
2771         * page/FrameView.cpp:
2772         (WebCore::FrameView::adjustPageHeight):
2773         (WebCore::FrameView::minimumContentsSize):
2774         * page/FrameView.h:
2775         * platform/ScrollView.cpp:
2776         (WebCore::ScrollView::updateScrollbars):
2777         * platform/ScrollView.h:
2778         (WebCore::ScrollView::minimumContentsSize):
2779         * rendering/RenderView.cpp:
2780         (WebCore::RenderView::layout):
2781         (WebCore::RenderView::calcDocHeight):
2782         (WebCore::RenderView::calcDocWidth):
2783         * rendering/RenderView.h:
2784         (WebCore::RenderView::docWidth):
2785         (WebCore::RenderView::docHeight):
2786
2787 2009-04-07  Dimitri Glazkov  <dglazkov@chromium.org>
2788
2789         Build fix, not reviewed.
2790
2791         * WebCore.xcodeproj/project.pbxproj: Made ScriptObject.h private.
2792
2793 2009-04-07  Dimitri Glazkov  <dglazkov@chromium.org>
2794
2795         Reviewed by Timothy Hatcher.
2796
2797         https://bugs.webkit.org/show_bug.cgi?id=25063
2798         Refactor InspectorController to use ScriptObject/State.
2799
2800         * GNUmakefile.am: Added ScriptState.cpp.
2801         * WebCore.pro: Ditto.
2802         * WebCore.vcproj/WebCore.vcproj: Ditto.
2803         * WebCore.xcodeproj/project.pbxproj: Ditto.
2804         * WebCoreSources.bkl: Ditto.
2805         * bindings/js/JSInspectorControllerCustom.cpp:
2806         (WebCore::JSInspectorController::addSourceToFrame): Fixed argument index typo.
2807         * bindings/js/ScriptFunctionCall.cpp:
2808         (WebCore::ScriptFunctionCall::call): Added reportExceptions parameter.
2809         (WebCore::ScriptFunctionCall::construct): Ditto.
2810         * bindings/js/ScriptFunctionCall.h: Ditto.
2811         * bindings/js/ScriptObject.cpp:
2812         (WebCore::handleException): Added exception-reporting heloper.
2813         (WebCore::ScriptObject::set): Changed to use handleException.
2814         (WebCore::ScriptGlobalObject::set): Ditto,
2815         * bindings/js/ScriptObject.cpp: Added ScriptGlobalObject.
2816         (WebCore::ScriptGlobalObject::set): Added.
2817         (WebCore::ScriptGlobalObject::getObject): Added.
2818         * bindings/js/ScriptObject.h: Added ScriptGlobalObject decls.
2819         (WebCore::ScriptGlobalObject::ScriptGlobalObject): Added.
2820         * bindings/js/ScriptState.cpp: Added.
2821         * bindings/js/ScriptState.h: Added scriptStateFromPage decl.
2822         * inspector/ConsoleMessage.cpp:
2823         (WebCore::ConsoleMessage::addToConsole): Changed to not report exceptions
2824             to avoid re-entrancy.
2825         * inspector/InspectorController.cpp: Refactored to use ScriptState/Object.
2826         * inspector/InspectorController.h: Ditto.
2827
2828 2009-04-07  Adam Langley  <agl@google.com>
2829
2830         Reviewed by Darin Fisher.
2831
2832         https://bugs.webkit.org/show_bug.cgi?id=25083
2833
2834         Skia was previously calculating the leading value incorrectly, leading
2835         us to add fHeight to get the height of a line of text. Now that Skia
2836         is calculating fLeading correctly, we can remove fHeight.
2837
2838         This doesn't affect any layout tests.
2839
2840         * platform/graphics/chromium/SimpleFontDataLinux.cpp:
2841         (WebCore::SimpleFontData::platformInit):
2842
2843 2009-04-07  Brian Weinstein  <bweinstein@gmail.com>
2844
2845         Reviewed by Darin Adler.
2846
2847         https://bugs.webkit.org/show_bug.cgi?id=24851
2848
2849         This fix removes the status code from the status message in a ResourceResponse, which allows a few more tests in http to pass.
2850
2851         * platform/network/cf/ResourceResponseCFNet.cpp:
2852         (WebCore::ResourceResponse::platformLazyInit):
2853
2854 2009-04-07  Adam Langley  <agl@google.com>
2855
2856         Reviewed by Darin Fisher.
2857
2858         https://bugs.webkit.org/show_bug.cgi?id=25081
2859
2860         Skia is changing from reporting the XRange to reporting the XMin and
2861         XMax.  Obviously these are equivalent, but other users of the metrics
2862         need the two numbers to be separate.
2863
2864         This doesn't affect any layout tests.
2865
2866         * platform/graphics/chromium/SimpleFontDataLinux.cpp:
2867         (WebCore::SimpleFontData::platformInit):
2868
2869 2009-04-07  Adam Roben  <aroben@apple.com>
2870
2871         Make the look of <select>s match the system look on Vista
2872
2873         Reviewed by Dave Hyatt.
2874
2875         * rendering/RenderThemeWin.cpp: Added new constants.
2876         (WebCore::RenderThemeWin::getThemeData): On Vista, use the
2877         CP_DROPDOWNBUTTONRIGHT part for drop down buttons.
2878         (WebCore::RenderThemeWin::paintMenuList): On Vista, use the CP_BORDER
2879         part to draw the border of <select>s.
2880         (WebCore::RenderThemeWin::paintMenuListButton): On Vista, outset the
2881         drop down button to make its border coincide with the <select>'s
2882         border.
2883
2884 2009-04-07  Adam Roben  <aroben@apple.com>
2885
2886         Move isRunningOnVistaOrLater to a shared location
2887
2888         Rubber-stamped in advance by Dave Hyatt.
2889
2890         * WebCore.vcproj/WebCore.vcproj: Added SystemInfo.{cpp,h}, and let VS
2891         have its way with the rest of the file.
2892         * platform/win/ScrollbarThemeWin.cpp: Moved isRunningOnVistaOrLater
2893         from here...
2894         * platform/win/SystemInfo.cpp: Added.
2895         (WebCore::isRunningOnVistaOrLater): ...to here.
2896         * platform/win/SystemInfo.h: Added.
2897
2898 2009-04-07  Paul Godavari  <paul@chromium.org>
2899
2900         Reviewed by Darin Fisher.
2901
2902         https://bugs.webkit.org/show_bug.cgi?id=24692
2903         Enable PopupMenuChromium to handle HTML select popups using native
2904         cocoa controls on the Mac, all other platforms are unchanged.
2905
2906         We also split out the storage container for the popup menu items
2907         so that ChromeClientChromium can access them for forwarding to
2908         the embedding host (Chromium.app or test_shell).
2909
2910         * page/chromium/ChromeClientChromium.h:
2911         * platform/chromium/PopupMenuChromium.cpp:
2912         (WebCore::PopupListBox::items):
2913         (WebCore::PopupContainer::PopupContainer):
2914         (WebCore::PopupContainer::~PopupContainer):
2915         (WebCore::PopupContainer::showPopup):
2916         (WebCore::PopupContainer::showExternal):
2917         (WebCore::PopupContainer::menuItemHeight):
2918         (WebCore::popupData):
2919         (WebCore::PopupListBox::pointToRowIndex):
2920         (WebCore::PopupListBox::getRowBounds):
2921         (WebCore::PopupListBox::isSelectableItem):
2922         (WebCore::PopupListBox::updateFromElement):
2923         (WebCore::PopupListBox::layout):
2924         (WebCore::PopupListBox::clear):
2925         (WebCore::PopupMenu::show):
2926         * platform/chromium/PopupMenuChromium.h:
2927         (WebCore::PopupItem::):
2928         (WebCore::PopupItem::PopupItem):
2929
2930 2009-04-07  Geoffrey Garen  <ggaren@apple.com>
2931
2932         Reviewed by Oliver Hunt.
2933         
2934         Added some double-checking to event handler marking. Now, when the
2935         wrapper that's responsible for marking an event handler's JavaScript
2936         function gets collected, it clears the event handler's JavaScript function
2937         so we won't dereference it after it's collected.
2938         
2939         In theory, we would never dereference a JavaScript event handler after
2940         its node's wrapper was collected anyway, but it's nice to be safe.
2941
2942         * bindings/js/JSDOMApplicationCacheCustom.cpp:
2943         (WebCore::JSDOMApplicationCache::mark):
2944         * bindings/js/JSEventListener.cpp:
2945         (WebCore::JSEventListener::JSEventListener):
2946         (WebCore::JSEventListener::jsFunction):
2947         (WebCore::JSEventListener::invalidateJSFunction):
2948         (WebCore::JSEventListener::markJSFunction):
2949         * bindings/js/JSEventListener.h:
2950         * bindings/js/JSMessagePortCustom.cpp:
2951         (WebCore::JSMessagePort::mark):
2952         * bindings/js/JSNodeCustom.cpp:
2953         (WebCore::markEventListeners):
2954         * bindings/js/JSWorkerContextCustom.cpp:
2955         (WebCore::JSWorkerContext::mark):
2956         * bindings/js/JSWorkerCustom.cpp:
2957         (WebCore::JSWorker::mark):
2958         * bindings/js/JSXMLHttpRequestCustom.cpp:
2959         (WebCore::JSXMLHttpRequest::mark):
2960         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
2961         (WebCore::JSXMLHttpRequestUpload::mark):
2962         * bindings/scripts/CodeGeneratorJS.pm:
2963         * dom/EventListener.h:
2964         (WebCore::EventListener::invalidateJSFunction):
2965         (WebCore::EventListener::markJSFunction):
2966         (WebCore::markIfNotNull):
2967
2968 2009-04-07  David Levin  <levin@chromium.org>
2969
2970         Build fix.
2971
2972         r44280 undid the change in r42268 that made CookieJar.h private.
2973         This redoes the change.
2974
2975         * WebCore.xcodeproj/project.pbxproj:
2976
2977 2009-04-07  Jian Li  <jianli@chromium.org>
2978
2979         Reviewed by Darin Fisher.
2980
2981         Upstream changes to WorkerContextExecutionProxy for enabling V8 preemption.
2982         https://bugs.webkit.org/show_bug.cgi?id=25034
2983
2984         * bindings/v8/WorkerContextExecutionProxy.cpp:
2985         (WebCore::WorkerContextExecutionProxy::evaluate):
2986
2987 2009-04-07  Dan Bernstein  <mitz@apple.com>
2988
2989         Reviewed by Darin Adler.
2990
2991         - fix <rdar://problem/6764359> Thai word selection misbehaves for the
2992           last sentence in the document
2993
2994         Test: editing/selection/thai-word-at-document-end.html
2995
2996         * editing/visible_units.cpp:
2997             - Added a BoundarySearchContextAvailability enum used to indicate
2998             whether the caller to a boundary search function may be able to provide
2999             additional text in the search direction and call again.
3000             - Added a named type for the boundary search function signature. Changed
3001             the signature to take a context availability parameter and a boolean
3002             out parameter indicating whether more context is needed to perform
3003             the search.
3004         (WebCore::previousBoundary): If the beginning of the range was reached
3005             but the last search wanted more context, perform the search again, this
3006             time indicating that there is no earlier text.
3007         (WebCore::nextBoundary): Similarly, in the other direction.
3008         (WebCore::startWordBoundary): Check whether more context may be available
3009             and ask for more context if needed.
3010         (WebCore::endWordBoundary): Ditto.
3011         (WebCore::previousWordPositionBoundary): Ditto.
3012         (WebCore::nextWordPositionBoundary): Ditto.
3013         (WebCore::startSentenceBoundary):  Updated signature.
3014         (WebCore::endSentenceBoundary): Ditto.
3015         (WebCore::previousSentencePositionBoundary): Ditto.
3016         (WebCore::nextSentencePositionBoundary): Ditto.
3017
3018 2009-04-07  Geoffrey Garen  <ggaren@apple.com>
3019
3020         Rubber stamped by Sam Weinig.
3021         
3022         A little renaming:
3023         
3024         function => jsFunction
3025         listener => jsFunction
3026
3027         * bindings/js/JSEventListener.cpp:
3028         (WebCore::JSAbstractEventListener::handleEvent):
3029         (WebCore::JSEventListener::JSEventListener):
3030         (WebCore::JSEventListener::~JSEventListener):
3031         (WebCore::JSEventListener::jsFunction):
3032         (WebCore::JSEventListener::mark):
3033         (WebCore::JSProtectedEventListener::JSProtectedEventListener):
3034         (WebCore::JSProtectedEventListener::~JSProtectedEventListener):
3035         (WebCore::JSProtectedEventListener::jsFunction):
3036         * bindings/js/JSEventListener.h:
3037         (WebCore::JSProtectedEventListener::create):
3038         * bindings/js/JSLazyEventListener.cpp:
3039         (WebCore::JSLazyEventListener::jsFunction):
3040         (WebCore::JSLazyEventListener::parseCode):
3041         * dom/EventListener.h:
3042         (WebCore::EventListener::jsFunction):
3043
3044 2009-04-07  Brady Eidson  <beidson@apple.com>
3045
3046         Reviewed by Darin Adler
3047
3048         While working on <rdar://problem/5968249>, noticed some glaring problems with LocalStorage.
3049
3050         * page/DOMWindow.cpp:
3051         (WebCore::DOMWindow::localStorage): Return the cached m_localStorage object if it exists to 
3052           avoid creating multiple representations for the same underlying StorageArea.
3053         * page/DOMWindow.h:
3054         (WebCore::DOMWindow::optionalLocalStorage): Return m_localStorage, not m_sessionStorage.
3055
3056 2009-04-07  Darin Adler  <darin@apple.com>
3057
3058         Roll out incorrect build fix.
3059
3060         * WebCore.NPAPI.exp: Reverted.
3061
3062 2009-04-07  Darin Adler  <darin@apple.com>
3063
3064         Another build fix.
3065
3066         * WebCore.NPAPI.exp: Added new functions.
3067
3068 2009-04-07  Anders Carlsson  <andersca@apple.com>
3069
3070         Another build fix.
3071         
3072         * plugins/npfunctions.h:
3073
3074 2009-04-07  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3075
3076         Unreviewed build fix. Fix non-Mac builds.
3077
3078         * bridge/npapi.h:
3079
3080 2009-04-07  Simon Fraser  <simon.fraser@apple.com>
3081
3082         Reviewed by Dan Bernstein
3083
3084         https://bugs.webkit.org/show_bug.cgi?id=25082
3085         
3086         Clean up repaint logic when RenderLayers become and stop being composited.
3087
3088         * rendering/RenderLayer.h:
3089         * rendering/RenderLayer.cpp:
3090         (WebCore::RenderLayer::rendererContentChanged):
3091         (WebCore::RenderLayer::repaintIncludingNonCompositingDescendants):
3092         New compositing-only method that repaints a layer and all its non-composited descendants.
3093         Takes a repaintContainer for performance; all the repaints necessarily share the same
3094         repaintContainer.
3095
3096         * rendering/RenderLayerCompositor.h:
3097         * rendering/RenderLayerCompositor.cpp:
3098         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
3099         Rather than use calculateCompositedBounds() to compute the repaint rect (which gave
3100         the wrong answer when the composited layer tree was in flux), use the new
3101         repaintOnCompositingChange() method.
3102         
3103         (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
3104         Call repaintIncludingNonCompositingDescendants(), and if necessary make sure
3105         that the view/layer drawing synchronization happens.
3106         
3107         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3108         Do a repaintOnCompositingChange() when a layer is going to be composited. This is
3109         a good place because we haven't started to change the compositing tree.
3110         
3111         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3112         After we've finished updating all the descendant layers, we can do a repaint for
3113         layers that ceased compositing.
3114
3115 2009-04-07  Simon Fraser  <simon.fraser@apple.com>
3116
3117         Reviewed by Dave Hyatt
3118         
3119         https://bugs.webkit.org/show_bug.cgi?id=25069
3120         
3121         Clean up the accelerated compositing code that determines the format of
3122         the GraphicsLayer hierarchy, being more explicit about which parts have
3123         to happen before and after descendant layers have been updated. Also remove
3124         some unhelpful caching of state.
3125
3126         * dom/Document.cpp:
3127         (WebCore::Document::recalcStyle):
3128         Only call updateCompositingLayers() if we know we're not going to be
3129         doing a layout soon.
3130         
3131         * platform/graphics/mac/GraphicsLayerCA.mm:
3132         (WebCore::GraphicsLayerCA::setDrawsContent):
3133         Toggling drawsContent from false to true should do a setNeedsDisplay().
3134         
3135         * rendering/RenderLayer.cpp:
3136         (WebCore::RenderLayer::styleChanged):
3137         updateLayerCompositingState() no longer updates the layer geometry, so
3138         do that here if we're not going to rebuild layers anyway.
3139         Also, updateLayerCompositingState() no longer does a setContentsNeedDisplay,
3140         so do that if the style change indicates that a repaint is required.
3141         
3142         * rendering/RenderLayerBacking.h:
3143         * rendering/RenderLayerBacking.cpp:
3144         (WebCore::RenderLayerBacking::RenderLayerBacking):
3145         (WebCore::RenderLayerBacking::updateAfterLayout):
3146         The 'drawing optimizations' logic has been rolled into updateGraphicsLayerConfiguration()
3147         and updateGraphicsLayerGeometry().
3148         
3149         (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
3150         Group that code that decides what GraphicsLayers are needed into this method,
3151         which deals with clipping layers and 'direct compositing': images that can be
3152         rendered via the compositor.
3153         
3154         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3155         Call setDrawsContent() if updateGraphicsLayerConfiguration() didn't already
3156         figure it out for image layers.
3157         
3158         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
3159         Remove the m_simpleCompositingLayerStatusDirty cache indicator, since we just
3160         computed it every time anyway.
3161         
3162         * rendering/RenderLayerCompositor.h:
3163         * rendering/RenderLayerCompositor.cpp:
3164         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
3165         updateGraphicsLayers() was renamed to updateGraphicsLayerConfiguration(),
3166         which calls clippedByAncestor() etc. itself rather than having everything passed in.
3167         Repaints are taken care of by styleChanged() and setDrawsContent().
3168         
3169         (WebCore::RenderLayerCompositor::calculateCompositedBounds):
3170         !layer->isComposited() && layer->transform() is a synonym for paintsWithTransform().
3171         
3172         (WebCore::RenderLayerCompositor::setCompositingParent):
3173         No need to call updateGraphicsLayerGeometry() here, because we're going to
3174         rebuild layers anyway.
3175         
3176         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3177         Add comments, and test layerBacking instead of layer->isComposited().
3178
3179 2009-04-07  Anders Carlsson  <andersca@apple.com>
3180
3181         Fix build.
3182         
3183         * WebCore.base.exp:
3184
3185 2009-04-07  Anders Carlsson  <andersca@apple.com>
3186
3187         Reviewed by Sam Weinig.
3188
3189         <rdar://problem/6667001> NPAPI: need NPN_Get/SetValueForURL() and NPN_GetAuthenticationInfo()
3190         
3191         * WebCore.base.exp:
3192         Add symbols needed by WebKit.
3193         
3194         * WebCore.xcodeproj/project.pbxproj:
3195         Make CookieJar a private header.
3196         
3197         * bridge/npapi.h:
3198         Add function definitions.
3199         
3200         * plugins/npfunctions.h:
3201         Fix the NPN_SetValueForURLProcPtr signature.
3202
3203 2009-04-07  Adam Roben  <aroben@apple.com>
3204
3205         Fix <rdar://6520933> REGRESSION (3.2.1-ToT): Scroll bar disappears in
3206         WebView and Bookmarks view after switching theme or turning on High
3207         Contrast mode
3208
3209         Reviewed by Dave Hyatt.
3210
3211         * platform/win/ScrollbarThemeWin.cpp:
3212         (WebCore::ScrollbarThemeWin::themeChanged): Null out scrollbarTheme
3213         after closing it so that we'll re-open the theme next time we paint.
3214
3215 2009-04-07  Adam Roben  <aroben@apple.com>
3216
3217         Small cleanup/correctness fix in ScrollbarThemeWin
3218
3219         Reviewed by Dave Hyatt.
3220
3221         * platform/win/ScrollbarThemeWin.cpp: Removed the now-unused
3222         haveTheme boolean.
3223         (WebCore::checkAndInitScrollbarTheme): Check IsThemeActive() before
3224         calling OpenThemeData. This seems to be what MSDN recommends.
3225         (WebCore::ScrollbarThemeWin::themeChanged): Null-check scrollbarTheme
3226         before closing it, rather than indirectly null-checking it via
3227         checking haveTheme.
3228
3229 2009-04-07  Dan Bernstein  <mitz@apple.com>
3230
3231         Reviewed by John Sullivan.
3232
3233         - when -webkit-line-break: after-white-space is specified but the text
3234           does not auto-wrap, do not shrink the trailing space to fit in the
3235           available width
3236
3237         Test: fast/text/whitespace/nowrap-line-break-after-white-space.html
3238
3239         - when shrinking such trailing space, do not shrink below zero
3240
3241         Covered by existing tests
3242
3243         * rendering/bidi.cpp:
3244         (WebCore::RenderBlock::computeHorizontalPositionsForLine):
3245         (WebCore::RenderBlock::layoutInlineChildren):
3246
3247 2009-04-07  Eric Seidel  <eric@webkit.org>
3248
3249         Reviewed by Darin Adler.
3250
3251         Move RangeBoundaryPoint off of Position, per Darin's suggestion
3252         https://bugs.webkit.org/show_bug.cgi?id=24966
3253
3254         Rename setToChild to setToBeforeChild (since that's what the method does)
3255
3256         * dom/Position.h:
3257         (WebCore::Position::offsetInContainerNode):
3258         * dom/Range.cpp:
3259         (WebCore::Range::insertNode):
3260         (WebCore::Range::selectNodeContents):
3261         (WebCore::boundaryNodeWillBeRemoved):
3262         * dom/Range.h:
3263         (WebCore::Range::startPosition):
3264         (WebCore::Range::endPosition):
3265         * dom/RangeBoundaryPoint.h:
3266         (WebCore::RangeBoundaryPoint::RangeBoundaryPoint):
3267         (WebCore::RangeBoundaryPoint::container):
3268         (WebCore::RangeBoundaryPoint::childBefore):
3269         (WebCore::RangeBoundaryPoint::position):
3270         (WebCore::RangeBoundaryPoint::offset):
3271         (WebCore::RangeBoundaryPoint::clear):
3272         (WebCore::RangeBoundaryPoint::set):
3273         (WebCore::RangeBoundaryPoint::setOffset):
3274         (WebCore::RangeBoundaryPoint::setToBeforeChild):
3275         (WebCore::RangeBoundaryPoint::setToStartOfNode):
3276         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3277         (WebCore::RangeBoundaryPoint::childBeforeWillBeRemoved):
3278         (WebCore::RangeBoundaryPoint::invalidateOffset):
3279
3280 2009-04-07  Eric Seidel  <eric@webkit.org>
3281
3282         Reviewed by Darin Adler.
3283
3284         Add containerNode(), computeOffsetInContainerNode(),
3285         computeNodeBeforePosition() and computeNodeAfterPosition().
3286         https://bugs.webkit.org/show_bug.cgi?id=24763
3287
3288         These functions will replace uses of rangeCompliantPosition()
3289         in future patches.
3290
3291         No changes in behavior, thus no tests.
3292
3293         * dom/Position.cpp:
3294         (WebCore::Position::containerNode):
3295         (WebCore::Position::computeOffsetInContainerNode):
3296         (WebCore::Position::computeNodeBeforePosition):
3297         (WebCore::Position::computeNodeAfterPosition):
3298         (WebCore::Position::anchorType):
3299         * dom/Position.h:
3300         (WebCore::Position::):
3301
3302 2009-04-06  Sam Weinig  <sam@webkit.org>
3303
3304         Reviewed by Mark Rowe.
3305
3306         Bottleneck dispatching mutation events in a new dispatchMutationEvent
3307         function.
3308
3309         * dom/CharacterData.cpp:
3310         (WebCore::CharacterData::dispatchModifiedEvent):
3311         * dom/ContainerNode.cpp:
3312         (WebCore::dispatchChildInsertionEvents):
3313         (WebCore::dispatchChildRemovalEvents):
3314         * dom/Node.cpp:
3315         (WebCore::Node::dispatchSubtreeModifiedEvent):
3316         (WebCore::Node::dispatchMutationEvent):
3317         * dom/Node.h:
3318
3319 2009-04-06  Dimitri Glazkov  <dglazkov@chromium.org>
3320
3321         Reviewed by Darin Fisher.
3322
3323         https://bugs.webkit.org/show_bug.cgi?id=25059
3324         Remove references to dominantScript, getGenericFontForScript.
3325
3326         * platform/graphics/chromium/FontCacheChromiumWin.cpp: Removed references
3327             to getGenericFontForScript.
3328         (WebCore::FontCache::getLastResortFallbackFont): Removed calls to dominantScript.
3329         * platform/graphics/chromium/FontCacheLinux.cpp: Ditto.
3330         * rendering/RenderThemeChromiumLinux.cpp:
3331         (WebCore::defaultGUIFont): Removed Document* arg.
3332         (WebCore::RenderThemeChromiumLinux::systemFont): Ditto.
3333         * rendering/RenderThemeChromiumLinux.h: Ditto.
3334         * rendering/RenderThemeChromiumMac.h: Ditto.
3335         * rendering/RenderThemeChromiumMac.mm: Ditto.
3336         (WebCore::RenderThemeChromiumMac::systemFont): Ditto.
3337         * rendering/RenderThemeChromiumWin.cpp:
3338         (WebCore::defaultGUIFont): Ditto.
3339         (WebCore::RenderThemeChromiumWin::systemFont): Ditto.
3340         * rendering/RenderThemeChromiumWin.h: Ditto.
3341
3342 2009-04-06  Geoffrey Garen  <ggaren@apple.com>
3343
3344         Reviewed by Darin Adler.
3345         
3346         Fixed https://bugs.webkit.org/show_bug.cgi?id=21260
3347         Unbounded memory growth when churning elements with anonymous event handler functions
3348
3349         The problem was that a protected event listener's scope chain would end
3350         up with a reference to the Node protecting it, causing a cycle. The
3351         solution is to stop protecting event listeners and rely on marking instead.
3352
3353         This patch converts most Node event listeners to use marking instead of
3354         GC protection.
3355
3356         * bindings/js/JSDOMBinding.cpp:
3357         (WebCore::isObservableThroughDOM):
3358         (WebCore::markDOMNodesForDocument): Refactored the test for whether a Node
3359         needs marking, and added a case for marking the node in order to mark its
3360         event listeners.
3361
3362         * bindings/js/JSNodeCustom.cpp:
3363         (WebCore::markEventListeners):
3364         (WebCore::JSNode::addEventListener):
3365         (WebCore::JSNode::removeEventListener):
3366         (WebCore::JSNode::mark): Added code to mark a Node's event listeners when
3367         marking the Node. Changed code using protected event listeners to use event
3368         listeners.
3369
3370         * dom/Node.idl: Changed code using protected event listeners to use event
3371         listeners.
3372
3373 2009-04-06  Sam Weinig  <sam@webkit.org>
3374
3375         Reviewed by Darin Adler.
3376
3377         Remove unchecked bool return values for some dispatch event functions.
3378
3379         * dom/Node.cpp:
3380         (WebCore::Node::dispatchSubtreeModifiedEvent):
3381         (WebCore::Node::dispatchUIEvent):
3382         (WebCore::Node::dispatchWebKitAnimationEvent):
3383         (WebCore::Node::dispatchWebKitTransitionEvent):
3384         (WebCore::Node::dispatchProgressEvent):
3385         * dom/Node.h:
3386
3387 2009-04-06  Darin Fisher  <darin@chromium.org>
3388
3389         Reviewed by Dimitri Glazkov.
3390
3391         https://bugs.webkit.org/show_bug.cgi?id=25058
3392         Fix chromium build bustage caused by r42216
3393
3394         * bindings/scripts/CodeGeneratorJS.pm:
3395         * page/DOMWindow.idl:
3396
3397 2009-04-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3398
3399         Rubber-stamped by Sam Weinig.
3400
3401         https://bugs.webkit.org/show_bug.cgi?id=20575
3402         No localization in WebKitGtk
3403
3404         * platform/gtk/FileChooserGtk.cpp: Remove usage of glib/gi18n.h,
3405         since there are not translatable strings.
3406         * platform/gtk/LocalizedStringsGtk.cpp: Use the glib i18n header
3407         that is specific for libraries.
3408
3409 2009-04-06  Mike Belshe  <mike@belshe.com>
3410
3411         Reviewed by Dimitri Glazkov.
3412
3413         https://bugs.webkit.org/show_bug.cgi?id=24978
3414         Use custom implementations of a few Node methods so that
3415         we don't over-aggressively create JS wrappers here.
3416
3417         * bindings/v8/custom/V8NodeCustom.cpp: Added custom implementations.
3418         * dom/Node.idl: Removed JSC-specifier, making impl custom for V8 as well.
3419
3420 2009-04-06  Dave Moore  <davemoore@google.com>
3421
3422         Reviewed by Dimitri Glazkov.
3423
3424         https://bugs.webkit.org/show_bug.cgi?id=25031
3425         Make the V8 element collections check for named properties *before*
3426         checking if there are any elements with the same name. Otherwise
3427         it is both incorrect and slow.
3428
3429         Test: fast/dom/HTMLSelectElement/length-not-overridden.html
3430
3431         Both of these interceptors were attempting to find an element in the
3432         collection that had a name or id of the property name before checking
3433         for a JS property with that name.
3434         * bindings/v8/V8Collection.h:
3435         (WebCore::collectionNamedPropertyGetter):
3436         (WebCore::nodeCollectionNamedPropertyGetter):
3437
3438 2009-04-06  Simon Fraser  <simon.fraser@apple.com>
3439
3440         Reviewed by Darin Adler
3441
3442         https://bugs.webkit.org/show_bug.cgi?id=25052
3443         
3444         Pull the call to updateGraphicsLayerGeometry() out of updateGraphicsLayers(),
3445         because we need to call it at the end of rebuildCompositingLayerTree() once
3446         we've determined which descendant layers are composited, otherwise
3447         calculateCompositedBounds() can give the wrong answer.
3448         
3449         Now that updateLayerCompositingState() doesn't end up calling updateGraphicsLayerGeometry(),
3450         call that explicitly from styleChanged(), if we know a layer update is not pending,
3451         and similarly from updateAfterLayout().
3452
3453         Test: compositing/overflow/overflow-positioning.html
3454
3455         * rendering/RenderLayer.cpp:
3456         (WebCore::RenderLayer::styleChanged):
3457         * rendering/RenderLayerBacking.cpp:
3458         (WebCore::RenderLayerBacking::updateAfterLayout):
3459         (WebCore::RenderLayerBacking::updateGraphicsLayers):
3460         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3461         * rendering/RenderLayerCompositor.cpp:
3462         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
3463
3464 2009-04-06  Mike Belshe  <mike@belshe.com>
3465
3466         Reviewed by Alexey Proskuryakov.
3467
3468         Add accessors to AtomicString which take String/const char* arguments
3469         so that we don't accidentally thrash the AtomicString table.
3470
3471         https://bugs.webkit.org/show_bug.cgi?id=24979
3472
3473         * platform/text/AtomicString.h:
3474
3475 2009-04-03  Holger Hans Peter Freyther  <zecke@selfish.org>
3476
3477         Reviewed by Simon Hausmann.
3478
3479         Make col and row work in WebCore/manual-tests/cursor.html. The issue
3480         was spotted in the WebKit inspector.
3481
3482         * platform/gtk/CursorGtk.cpp:
3483         (WebCore::columnResizeCursor):
3484         (WebCore::rowResizeCursor):
3485
3486 2009-04-06  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
3487
3488         Reviewed by Simon Hausmann.
3489
3490         [Qt] Don't show and hide the platformPluginWidget, as it's our QWebView
3491
3492         * plugins/mac/PluginViewMac.cpp:
3493         (WebCore::PluginView::show):
3494         (WebCore::PluginView::hide):
3495         (WebCore::PluginView::setParentVisible):
3496
3497 2009-04-06  Simon Hausmann  <simon.hausmann@nokia.com>
3498
3499         Reviewed by Tor Arne Vestbø.
3500
3501         Add new files to the Qt build.
3502         Export helper function from the Qt JSC binding, needed in WebKit/qt.
3503
3504         * WebCore.pro: Add new files.
3505         * bridge/qt/qt_runtime.h: Declare convertQVariantToValue.
3506
3507 2009-04-06  Simon Hausmann  <simon.hausmann@nokia.com>
3508
3509         Reviewed by Tor Arne Vestbø.
3510
3511         Changed ScriptFunctionCall's last argument from a const char* as the function name to a String.
3512
3513         Internally the function name is stored as a WebCore::String and the Qt port wants to use this
3514         constructor programmatically where the function name is also a WebCore::String.
3515
3516         * bindings/js/ScriptFunctionCall.cpp:
3517         (WebCore::ScriptFunctionCall::ScriptFunctionCall):
3518         * bindings/js/ScriptFunctionCall.h:
3519
3520 2009-04-06  Mike Belshe <mike@belshe.com>
3521
3522         Reviewed by Eric Seidel.
3523
3524         HTMLCanvasElement crash when ImageBuffer creation fails.
3525         https://bugs.webkit.org/show_bug.cgi?id=23212
3526
3527         Check for NULL before using the ImageBuffer as we might
3528         be low on memory and creation may have failed.
3529
3530         Test case creation blocked by:
3531         https://bugs.webkit.org/show_bug.cgi?id=25055
3532
3533         * html/HTMLCanvasElement.cpp:
3534         (WebCore::HTMLCanvasElement::createImageBuffer):
3535
3536 2009-04-05  Geoffrey Garen  <ggaren@apple.com>
3537
3538         [Originally] Reviewed by Sam Weinig.
3539
3540         Rolled back in r42214 with crashes fixed.
3541
3542         [Removed irrelevant ExecState* parameter from event handler registration code.]
3543         
3544         [No change in behavior.]
3545
3546         * bindings/js/JSDOMApplicationCacheCustom.cpp:
3547         (WebCore::JSDOMApplicationCache::addEventListener):
3548         (WebCore::JSDOMApplicationCache::removeEventListener):
3549         * bindings/js/JSDOMGlobalObject.cpp:
3550         (WebCore::JSDOMGlobalObject::findOrCreateJSProtectedEventListener):
3551         (WebCore::JSDOMGlobalObject::findJSEventListener):
3552         (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener):
3553         * bindings/js/JSDOMGlobalObject.h:
3554         * bindings/js/JSDOMWindowCustom.cpp:
3555         (WebCore::JSDOMWindow::addEventListener):
3556         * bindings/js/JSMessagePortCustom.cpp:
3557         (WebCore::JSMessagePort::addEventListener):
3558         (WebCore::JSMessagePort::removeEventListener):
3559         * bindings/js/JSNodeCustom.cpp:
3560         (WebCore::JSNode::addEventListener):
3561         * bindings/js/JSSVGElementInstanceCustom.cpp:
3562         (WebCore::JSSVGElementInstance::addEventListener):
3563         * bindings/js/JSWorkerContextCustom.cpp:
3564         (WebCore::JSWorkerContext::addEventListener):
3565         (WebCore::JSWorkerContext::removeEventListener):
3566         * bindings/js/JSWorkerCustom.cpp:
3567         (WebCore::JSWorker::addEventListener):
3568         (WebCore::JSWorker::removeEventListener):
3569         * bindings/js/JSXMLHttpRequestCustom.cpp:
3570         (WebCore::JSXMLHttpRequest::addEventListener):