WebCore:
[WebKit-https.git] / WebCore / ChangeLog
1 2007-09-18  David Harrison  <harrison@apple.com>
2
3         Reviewed by Darin.
4
5         <rdar://problem/5486974> REGRESSION(r25373): 1/4 second to doubleclick word in GMail when using Kotoeri IM, also slow in other IMs (15163)
6
7         Updated tests:
8         * fast/dom/Window/window-xy-properties-expected.txt:
9         * fast/dom/plugin-attributes-enumeration-expected.txt:
10         * fast/events/onerror-bubbling-expected.txt:
11         * fast/events/related-target-expected.txt:
12         * fast/forms/select-namedItem-expected.txt:
13         * fast/table/incomplete-table-in-fragment-2-expected.txt:
14         * fast/table/incomplete-table-in-fragment-hang-expected.txt:
15         * fast/table/large-rowspan-crash-expected.txt:
16         * plugins/embed-attributes-setting-expected.txt:
17
18         * editing/TextIterator.cpp:
19         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
20         Avoid VisiblePosition check if the current node is a descendant
21         of the start container and the start offset was 0. In that case
22         we already had enough context to correctly decide whether to emit
23         a newline after a preceding block. We chose not to emit
24         (m_haveEmitted is false), so don't second guess that.
25             
26         (WebCore::TextIterator::exitNode):
27         Changed some comments.
28
29 2007-09-17  Geoffrey Garen  <ggaren@apple.com>
30
31         Reviewed by Darin Adler.
32
33         Speculative fix for <rdar://problem/5479443> REGRESSION: Hang due to 
34         infinite JS recursion on close @ engadget.com (onunload-based ad)
35         
36         If page is NULL, shouldInterruptScript now returns true, so you can't 
37         get stuck in a state in which a script executes forever without putting 
38         up a UI to ask if it should stop.
39
40         * bindings/js/kjs_binding.cpp:
41         (KJS::ScriptInterpreter::shouldInterruptScript):
42
43 2007-09-17  Dave Hyatt  <hyatt@apple.com>
44
45         Fix for bug 14743, missing glyphs on many international sites because of MLang's tiny cache.
46         
47         Bypass Mlang's cache entirely.  Get the mapped font from MLang, obtain the font name, and then feed
48         the name back into our own system so that it gets created and cached again without MLang being involved.
49         Then free up the font obtained from MLang immediately so that its cache just remains empty.
50            
51         Reviewed by aroben
52
53         * platform/FontData.h:
54         (WebCore::FontData::isSystemFont):
55         * platform/win/FontCacheWin.cpp:
56         (WebCore::FontCache::getFontDataForCharacters):
57         * platform/win/FontDataWin.cpp:
58         (WebCore::FontData::platformInit):
59         (WebCore::FontData::platformDestroy):
60         * platform/win/UniscribeController.cpp:
61         (WebCore::UniscribeController::shapeAndPlaceItem):
62         
63 2007-09-17  Adam Roben  <aroben@apple.com>
64
65         Fix <rdar://5423441> Should get focus ring color from SafariTheme
66
67         Reviewed by Hyatt.
68
69         No regression test possible.
70
71         * WebCore.vcproj/WebCore.vcproj: Added ColorSafari.cpp.
72         * platform/graphics/win/ColorSafari.cpp: Added.
73         (WebCore::makeRGBAFromCGColor): Added.
74         (WebCore::focusRingColor): Added. Gets the focus ring color from
75         SafariTheme if SafariTheme has support for it.
76         (WebCore::setFocusRingColorChangeFunction): Added.
77         * platform/win/TemporaryLinkStubs.cpp: Removed focus ring color
78         functions.
79
80 2007-09-17  Anders Carlsson  <andersca@apple.com>
81
82         Fix Windows build.
83
84         * WebCore.vcproj/WebCore.vcproj:
85         * loader/NetscapePlugInStreamLoader.h:
86
87 2007-09-17  Anders Carlsson  <andersca@apple.com>
88
89         Fix Mac build.
90         
91         * loader/NetscapePlugInStreamLoader.cpp:
92         * loader/NetscapePlugInStreamLoader.h:
93         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Copied from loader/NetscapePlugInStreamLoader.cpp.
94
95 2007-09-17  Anders Carlsson  <andersca@apple.com>
96
97         Reviewed by Adam.
98
99         <rdar://problem/5483346>
100         crash at vw.com WebCore::PluginViewWin::disconnectStream.
101         
102         The following events would lead to this crash:
103         
104         1. a plug-in stream finishes loading and calls NPP_DestroyStream.
105         2. the DestroyStream handler calls NPN_Evaluate, submitting a form through JavaScript.
106         3. A new page is going to be loaded and DocumentLoader::stopLoading is called.
107         4. DocumentLoader::stopLoading will stop all loader, including the one that is done loading!
108         
109         The fix is to port NetscapePluginStreamLoader over from the Mac code and use it instead. This fixes the crash
110         because it disassociates the stream loader with the document loader _before_ calling NPP_DestroyStream, whereas
111         SubresourceLoader does this _after_ calling NPP_DestroyStream. 
112         
113         * loader/NetscapePlugInStreamLoader.cpp:
114         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
115         (WebCore::NetscapePlugInStreamLoader::~NetscapePlugInStreamLoader):
116         (WebCore::NetscapePlugInStreamLoader::create):
117         (WebCore::NetscapePlugInStreamLoader::isDone):
118         (WebCore::NetscapePlugInStreamLoader::releaseResources):
119         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
120         (WebCore::NetscapePlugInStreamLoader::didReceiveData):
121         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
122         (WebCore::NetscapePlugInStreamLoader::didFail):
123         (WebCore::NetscapePlugInStreamLoader::didCancel):
124         * loader/NetscapePlugInStreamLoader.h:
125         (WebCore::NetscapePlugInStreamLoaderClient::didFinishLoading):
126         * plugins/win/PluginStreamWin.cpp:
127         (WebCore::PluginStreamWin::start):
128         (WebCore::PluginStreamWin::didReceiveResponse):
129         (WebCore::PluginStreamWin::didReceiveData):
130         (WebCore::PluginStreamWin::didFail):
131         (WebCore::PluginStreamWin::didFinishLoading):
132         * plugins/win/PluginStreamWin.h:
133         * plugins/win/PluginViewWin.cpp:
134         (WebCore::PluginViewWin::load):
135
136 2007-09-17  Anders Carlsson  <andersca@apple.com>
137
138         Reviewed by Adam.
139
140         <rdar://problem/5483839>
141         Crash loading http://www.microsoft.com if Silverlight 1.0 is installed.
142         
143         Work around a problem in our NPRuntime implementation by never unloading the silverlight plug-in dll.
144         
145         * plugins/win/PluginViewWin.cpp:
146         (WebCore::PluginViewWin::~PluginViewWin):
147         (WebCore::PluginViewWin::determineQuirks):
148         * plugins/win/PluginViewWin.h:
149         (WebCore::):
150
151 2007-09-17  Brady Eidson  <beidson@apple.com>
152
153         Reviewed by John Sullivan
154
155         Fix for http://bugs.webkit.org/show_bug.cgi?id=15178
156         and
157         <rdar://problem/5474001>
158
159         The stress test proves that this was an overzealous ASSERT.  It is very possible to mark an icon
160         for addition to the on-disk database and then mark it for removal before it is ever written out.  
161         This is not an error and was already handled gracefully
162
163         * loader/icon/IconDatabase.cpp:
164         (WebCore::IconDatabase::removeIconFromSQLDatabase): Don't ASSERT of log if the icon wasn't on disk
165
166 2007-09-17  Brady Eidson  <beidson@apple.com>
167
168         Reviewed by Oliver
169
170         <rdar://problem/5487048> - ASSERT in stress test in IconDatabase
171
172         If a PageURLRecord went away, it never clears its URL from the IconRecord it retained.
173
174         * loader/icon/PageURLRecord.cpp:
175         (WebCore::PageURLRecord::~PageURLRecord): Set the icon record to 0, clearing the page url
176         * loader/icon/PageURLRecord.h: Add the destructor
177
178 2007-09-17  Antti Koivisto  <antti@apple.com>
179
180         Reviewed by Darin.
181         
182         Fix <rdar://problem/5480050>
183         Leopard9A551 with Dashcode 112: Dashcode crash when dragging image into canvas.
184         
185         If @import stylesheet was modified through CSS DOM style selector would not get updated. This
186         could lead to crashes.
187
188         Test: fast/css/import-style-update.html
189
190         * css/CSSStyleSheet.cpp:
191         (WebCore::CSSStyleSheet::styleSheetChanged):
192
193 2007-09-17  Anders Carlsson  <andersca@apple.com>
194
195         Reviewed by Adam.
196
197         <rdar://problem/5421997>
198         http://bugs.webkit.org/show_bug.cgi?id=14247
199         Display problem with Flash - image does not stop changing
200         
201         Port the manual load code over from the Mac version.
202
203         * plugins/win/PluginDatabaseWin.cpp:
204         (WebCore::PluginDatabaseWin::createPluginView):
205         * plugins/win/PluginDatabaseWin.h:
206         Add load manually parameter.
207         
208         * plugins/win/PluginStreamWin.cpp:
209         (WebCore::PluginStreamWin::stop):
210         If we're loading manually, cancel the main resource load.
211          
212         (WebCore::PluginStreamWin::destroyStream):
213         Don't disconnect the stream if we're loading manually.
214         
215         * plugins/win/PluginViewWin.cpp:
216         (WebCore::PluginViewWin::setFrameGeometry):
217         Always call updateWindow()
218         
219         (WebCore::PluginViewWin::PluginViewWin):
220         Initialize loadManually.
221         
222         (WebCore::PluginViewWin::init):
223         Don't set the width and height of the window here since it will make the plug-in HWND show briefly
224         before it's been positioned.
225         
226         (WebCore::PluginViewWin::didReceiveResponse):
227         Create the manual stream.
228         
229         (WebCore::PluginViewWin::didReceiveData):
230         (WebCore::PluginViewWin::didFinishLoading):
231         (WebCore::PluginViewWin::didFail):
232         Call through to the manual stream.
233         
234         * plugins/win/PluginViewWin.h:
235
236 2007-09-16  Sam Weinig  <sam@webkit.org>
237
238         Reviewed by Maciej.
239
240         Fix for http://bugs.webkit.org/show_bug.cgi?id=14693
241         document.width/height doesn't force layout
242
243         Test: fast/dom/document-width-height-force-layout.html
244
245         * html/HTMLDocument.cpp:
246         (WebCore::HTMLDocument::width): Force layout.
247         (WebCore::HTMLDocument::height): ditto.
248         * html/HTMLDocument.h:
249
250 2007-09-15  Holger Hans Peter Freyther  <zecke@selfish.org>
251
252         Reviewed by Mark.
253
254         Convert the filenames from WebCore::String to the filesystem encoding
255         and vice versa using g_filename_{from,to}_utf8 functions. Also add the needed NULL
256         checks for the return values where glib and gtk+ can return NULL.
257
258         * platform/gdk/FileChooserGdk.cpp:
259         (WebCore::convertToStringByAdoptingTheFilesystemRepresentation):
260         (WebCore::FileChooser::openFileChooser):
261         (WebCore::FileChooser::basenameForWidth):
262
263 2007-09-15  Holger Hans Peter Freyther  <zecke@selfish.org>
264
265         Reviewed by Mark.
266
267         Use the new WebCore::String::fromUTF8 function to create
268         the labels.
269
270         * platform/gdk/LocalizedStringsGdk.cpp:
271         (WebCore::submitButtonDefaultLabel):
272         (WebCore::inputElementAltText):
273         (WebCore::resetButtonDefaultLabel):
274         (WebCore::searchableIndexIntroduction):
275         (WebCore::fileButtonChooseFileLabel):
276         (WebCore::fileButtonNoFileSelectedLabel):
277         (WebCore::contextMenuItemTagOpenLinkInNewWindow):
278         (WebCore::contextMenuItemTagDownloadLinkToDisk):
279         (WebCore::contextMenuItemTagCopyLinkToClipboard):
280         (WebCore::contextMenuItemTagOpenImageInNewWindow):
281         (WebCore::contextMenuItemTagDownloadImageToDisk):
282         (WebCore::contextMenuItemTagCopyImageToClipboard):
283         (WebCore::contextMenuItemTagOpenFrameInNewWindow):
284         (WebCore::contextMenuItemTagCopy):
285         (WebCore::contextMenuItemTagGoBack):
286         (WebCore::contextMenuItemTagGoForward):
287         (WebCore::contextMenuItemTagStop):
288         (WebCore::contextMenuItemTagReload):
289         (WebCore::contextMenuItemTagCut):
290         (WebCore::contextMenuItemTagPaste):
291         (WebCore::contextMenuItemTagNoGuessesFound):
292         (WebCore::contextMenuItemTagIgnoreSpelling):
293         (WebCore::contextMenuItemTagLearnSpelling):
294         (WebCore::contextMenuItemTagSearchWeb):
295         (WebCore::contextMenuItemTagLookUpInDictionary):
296         (WebCore::contextMenuItemTagOpenLink):
297         (WebCore::contextMenuItemTagIgnoreGrammar):
298         (WebCore::contextMenuItemTagSpellingMenu):
299         (WebCore::contextMenuItemTagShowSpellingPanel):
300         (WebCore::contextMenuItemTagCheckSpelling):
301         (WebCore::contextMenuItemTagCheckSpellingWhileTyping):
302         (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
303         (WebCore::contextMenuItemTagFontMenu):
304         (WebCore::contextMenuItemTagBold):
305         (WebCore::contextMenuItemTagItalic):
306         (WebCore::contextMenuItemTagUnderline):
307         (WebCore::contextMenuItemTagOutline):
308         (WebCore::contextMenuItemTagWritingDirectionMenu):
309         (WebCore::contextMenuItemTagDefaultDirection):
310         (WebCore::contextMenuItemTagLeftToRight):
311         (WebCore::contextMenuItemTagRightToLeft):
312         (WebCore::contextMenuItemTagInspectElement):
313         (WebCore::searchMenuNoRecentSearchesText):
314         (WebCore::searchMenuRecentSearchesText):
315         (WebCore::searchMenuClearRecentSearchesText):
316
317 2007-09-15  Holger Hans Peter Freyther  <zecke@selfish.org>
318
319         Reviewed by Mark.
320
321         Add WebCore::String::fromUTF8 to convert from UTF-8
322         to a WebCore::String. This is meant to be used by
323         the Gtk+ port and the signature and implementation
324         is similiar to the one of DeprecatedString.
325
326         * platform/PlatformString.h:
327         * platform/String.cpp:
328         (WebCore::String::fromUTF8):
329
330 2007-09-13  Holger Hans Peter Freyther  <zecke@selfish.org>
331
332         Reviewed by Anders.
333
334         Implement the fileExists and deleteFile functions
335         using glib.
336
337         * WebCore.pro:
338         * platform/gdk/FileSystemGdk.cpp: Added.
339         (WebCore::fileExists):
340         * platform/gdk/TemporaryLinkStubs.cpp:
341
342 2007-09-16  David Harrison  <harrison@apple.com>
343
344         Reviewed by Darin.
345
346         <rdar://problem/5472125> REGRESSION (9A535-9A548): No VO cursor shown when navigating in a mail message body
347
348         The problem was that the visible units code was mishandling non-editable content, generating null
349         VisiblePositions instead of the actual boundary VisiblePositions.
350         
351         Updated tests:
352         * fast/dom/Window/window-xy-properties-expected.txt:
353         * fast/dom/plugin-attributes-enumeration-expected.txt:
354         * fast/events/onerror-bubbling-expected.txt:
355         * fast/events/related-target-expected.txt:
356         * fast/forms/select-namedItem-expected.txt:
357         * fast/table/incomplete-table-in-fragment-2-expected.txt:
358         * fast/table/incomplete-table-in-fragment-hang-expected.txt:
359         * fast/table/large-rowspan-crash-expected.txt:
360         * plugins/embed-attributes-setting-expected.txt:
361        
362         Source Changes:
363         * editing/VisiblePosition.cpp:
364         (WebCore::VisiblePosition::next):
365         (WebCore::VisiblePosition::previous):
366         (WebCore::VisiblePosition::honorEditableBoundaryAtOrBefore):
367         (WebCore::VisiblePosition::honorEditableBoundaryAtOrAfter):
368         Rename firstEditablePositionAtOrAfter to honorEditableBoundaryAtOrAfter.
369         Rename firstEditablePositionAtOrBefore to honorEditableBoundaryAtOrBefore.
370         Changed these two functions to handle non-editable positions.
371         
372         * editing/VisiblePosition.h:
373         * editing/visible_units.cpp:
374         (WebCore::previousWordPosition):
375         (WebCore::nextWordPosition):
376         (WebCore::positionAvoidingFirstPositionInTable):
377         (WebCore::startPositionForLine):
378         (WebCore::startOfLine):
379         (WebCore::endOfLine):
380         (WebCore::previousSentencePosition):
381         (WebCore::nextSentencePosition):
382         Rename firstEditablePositionAtOrAfter to honorEditableBoundaryAtOrAfter.
383         Rename firstEditablePositionAtOrBefore to honorEditableBoundaryAtOrBefore.
384         Also, startOfLine() now calls positionAvoidingFirstPositionInTable() in the empty block early return case.
385         positionAvoidingFirstPositionInTable() was the logic startOfLine() used in the normal case. Now in a reusable function.
386
387 2007-09-14  Oliver Hunt  <oliver@apple.com>
388
389         Reviewed by Adam.
390
391         Mac doesn't have any kind of not implemented macro, so we'll actually implement
392         fileSize.
393
394         * platform/mac/FileSystemMac.mm:
395         (WebCore::fileSize):
396
397 2007-09-14  Timothy Hatcher  <timothy@apple.com>
398
399         Initialize m_dialogArguments to 0. Fixes the newly crashing layout tests.
400
401         * bindings/js/kjs_window.cpp:
402         (KJS::WindowPrivate::WindowPrivate):
403
404 2007-09-14  Oliver Hunt  <oliver@apple.com>
405
406         Reviewed by Brady, John H.
407
408         <rdar://problem/5483632> File system operation wrappers are unimplemented on windows
409         
410         Implement Windows versions of fileExists and deleteFile. 
411         Also corrects fileSize to use a 64-bit version of stat.
412
413         * platform/win/FileSystemWin.cpp:
414         (WebCore::fileSize):  
415           Renamed argument to be more consistent with others.
416           And converted to _stat32i64 to allow 64-bit filesizes
417         (WebCore::fileExists):
418         (WebCore::deleteFile):
419         * platform/win/TemporaryLinkStubs.cpp:
420
421 2007-09-14  Oliver Hunt  <oliver@apple.com>
422
423         Reviewed by Sam and Geoff.
424
425         <rdar://problem/5333272> Cannot upload files when path contains 
426         non-ascii/multibyte characters
427
428         We can't use _stat to determine file size on Windows as it may not 
429         correctly handle multibyte characters, so we have to use _wstat.
430         
431         In deference to the fact that we may one day use the FormDataStreamCFNet.cpp
432         on Mac i've wrapped the call to _wstat with a generic fileSize
433         method in FileSystem.h
434
435         * WebCore.vcproj/WebCore.vcproj:
436         * platform/FileSystem.h:
437         * platform/network/cf/FormDataStreamCFNet.cpp:
438         * platform/win/FileSystemWin.cpp: Added.
439         (WebCore::setHTTPBody):
440         * platform/gdk/TemporaryLinkStubs.cpp:
441         * platform/mac/FileSystemMac.mm:
442         (WebCore::fileSize):
443         * platform/qt/TemporaryLinkStubs.cpp:
444
445 2007-09-14  Timothy Hatcher  <timothy@apple.com>
446
447         Reviewed by Sam.
448
449         <rdar://problem/5472970> REGRESSION (r24276): TinyMCE popups show an empty window with no content
450
451         Accessing the document of a window before the load finished would cause the window
452         object to hold onto the initial empty document, and never switch over to the real document
453         once the load finished. This regression was caused by r24276 which added a check to prevent
454         clearing the window object when the load finished. The absence of this clear allowed the
455         dialogArguments set with showModalDialog to persist on the window after the load. However,
456         not clearing the window would keep other properties (and the empty document object) around.
457
458         So the fix is to store away the dialog arguments that were passed to showModalDialog and
459         put them back on the window object in the dialogArguments property each time
460         the window is cleared.
461
462         * bindings/js/kjs_window.cpp:
463         (KJS::createWindow): No longer put dialogArguments on the window here.
464         (KJS::showModalDialog): Put dialogArguments on the window and call
465         setDialogArgumentsAndReturnValueSlot to remember the arguments.
466         (KJS::Window::clear): Put m_dialogArguments back on the window as dialogArguments.
467         (KJS::WindowFunc::callAsFunction): Call the new setDialogArgumentsAndReturnValue.
468         (KJS::Window::setDialogArgumentsAndReturnValue): Store the arguments in m_dialogArguments.
469         * bindings/js/kjs_window.h: Rename setReturnValueSlot to setDialogArgumentsAndReturnValueSlot.
470         * manual-tests/modal-dialog-arguments.html: Confirmed that this test still passes.
471
472         Reverted r24276 which was all the changes in FrameLoader.cpp and FrameLoader.h.
473
474         * loader/FrameLoader.cpp:
475         (WebCore::FrameLoader::FrameLoader): Remove m_shouldClearWindowProperties.
476         (WebCore::FrameLoader::createWindow): Remove the call to setShouldClearWindowProperties.
477         (WebCore::FrameLoader::clear): No longer check m_shouldClearWindowProperties, clear the
478         window whenever clearWindowProperties is set.
479         (WebCore::FrameLoader::begin): Remove m_shouldClearWindowProperties.
480         (WebCore::FrameLoader::open): Ditto.
481         * loader/FrameLoader.h: Remove m_shouldClearWindowProperties.
482
483 2007-09-14  Brady Eidson  <beidson@apple.com>
484
485         How about a build fix that works on *all* platforms?
486
487         * platform/Threading.h:
488         (WebCore::initializeThreading):
489
490 2007-09-14  Brady Eidson  <beidson@apple.com>
491
492         Roll out my previous build fix and just make the stupid thing inline
493         (I knew there was something easier but oh boy, no coffee yet... weinig?)
494
495 2007-09-14  Brady Eidson  <beidson@apple.com>
496
497         Rubberstamped by Mark Rowe
498
499         Add the logging channel I just created to the initialize list on Mac
500
501         * platform/mac/LoggingMac.mm:
502         (WebCore::InitializeLoggingChannelsIfNecessary):
503
504 2007-09-14  Brady Eidson  <beidson@apple.com>
505
506         Build fix
507
508         That method can't go in the header, apparently
509
510         * platform/Threading.h:
511         * platform/gdk/TemporaryLinkStubs.cpp:
512         (WebCore::initializeThreading):
513         * platform/mac/Threading.mm:
514         (WebCore::initializeThreading):
515         * platform/qt/TemporaryLinkStubs.cpp:
516         (WebCore::initializeThreading):
517
518 2007-09-14  Brady Eidson  <beidson@apple.com>
519
520         Reviewed by Darin
521
522         -Add callOnMainThread() implementation to Windows
523
524         * WebCore.vcproj/WebCore.vcproj:
525         
526         * loader/icon/IconDatabase.cpp:
527         (WebCore::IconDatabase::open): Call initializeThreading() from the main thread before kicking off the secondary thread
528         
529         * platform/Logging.cpp: Added Threading logging channel
530         (WebCore::):
531         * platform/Logging.h: Ditto
532         
533         * platform/Threading.h:
534         (WebCore::initializeThreading): Added - only needs Windows impl for now
535         * platform/win/ThreadingWin.cpp: Added.
536         (WebCore::callFunctionsOnMainThread): Calls each function currently in the main-thread queue
537         (WebCore::ThreadingWindowWndProc):
538         (WebCore::initializeThreading): Creates a message-only window to use for callOnMainThread()
539         (WebCore::callOnMainThread): Queues the function to be called and posts a message to the threading
540           window such that the function-call-queue can be addressed
541         
542         * platform/win/TemporaryLinkStubs.cpp:
543         (WebCore::signedPublicKeyAndChallengeString):
544         
545 2007-09-14  Anders Carlsson  <andersca@apple.com>
546
547         Reviewed by Adam.
548
549         <rdar://problem/5316743>
550         Safari does not handle filename parameter of content-disposition
551         
552         Use CFURLResponseCopySuggestedFilename instead of our own hand-rolled implementation. 
553         
554         While we do return the correct filename in all cases I've tried, using CFNetwork is better because
555         it might handle corner cases that we don't.
556         
557         * platform/network/cf/ResourceResponseCFNet.cpp:
558         (WebCore::ResourceResponse::doUpdateResourceResponse):
559         
560 2007-09-14  Geoffrey Garen  <ggaren@apple.com>
561
562         Reviewed by Adam Roben.
563
564         Fixed http://bugs.webkit.org/show_bug.cgi?id=15209
565         Sometimes removing an iframe from the DOM does not remove its frame 
566         from the page
567
568         * loader/FrameLoader.cpp:
569         (WebCore::FrameLoader::requestFrame): Use the contentFrame pointer
570         directly instead of searching for a frame by the frame element's name, 
571         because the frame element's name may have changed. (Another reason to do
572         this is that it's just plain more straight-forward and efficient.)
573
574 2007-09-14  Darin Adler  <darin@apple.com>
575
576         Reviewed by Mitz and Kevin Decker.
577
578         - fix http://bugs.webkit.org/show_bug.cgi?id=15197
579           <rdar://problem/5478271> REGRESSION: Some Yahoo text entry fields
580           render as lines rather than text entry boxes
581
582         Test: fast/forms/textarea-rows-cols.html
583
584         * html/HTMLTextAreaElement.cpp:
585         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Use constants for the default number
586         of rows and columns.
587         (WebCore::HTMLTextAreaElement::parseMappedAttribute): If rows/cols attribute has a value
588         that's missing, non-numeric, or zero, then use the default value. Also check for the
589         case where the effective value of the attribute isn't changing.
590
591 2007-09-14  Sven Herzberg  <sven@imendio.com>
592
593         Reviewed by George.
594
595         Don't maintain obsolete code, fixes:
596         http://bugs.webkit.org/show_bug.cgi?id=15215
597
598         * platform/gdk/FontPlatformData.cpp: remove static
599         FontPlatformData::list() (isn't used at any place)
600
601 2007-09-14  Sven Herzberg  <sven@imendio.com>
602
603         Reviewed by Adam Roben.
604
605         Don't use fontconfig types if necessary, fixes:
606         http://bugs.webkit.org/show_bug.cgi?id=15203
607
608         * platform/gdk/FontPlatformData.cpp: don't use an FcBool to store the
609         initialized state, use a plain c++ bool instead
610
611 2007-09-13  Brady Eidson  <beidson@apple.com>
612
613         Reviewed by Maciej
614
615         <rdar://problem/5480437> - No site icon at launch and related error messages
616
617         The error message was actually indicative of a larger bug that might've resulted in icons getting
618         improperly pruned because they were never added to the set of retained page URLs.
619
620         To solve the no-icon-at-launch problem, we send the "didReceiveIcon:" delegate call for every page 
621         load that has an icon, whether the icon comes in from network, from disk, or was already in ram
622
623         * loader/FrameLoader.cpp:
624         (WebCore::FrameLoader::startIconLoader): Always send the didReceiveIcon delegate call when an icon's 
625           image data is known
626
627         * loader/icon/IconDatabase.cpp:
628         (WebCore::IconDatabase::retainIconForPageURL): Much more accurately track the set of retained pages by
629           adding them when their retain count moves from 0 to 1
630
631         * loader/icon/PageURLRecord.h:
632         (WebCore::PageURLRecord::retain): Correctly distinguish the "retain count just went from 0 to 1" case
633           in the return value
634
635 2007-09-13  Brady Eidson  <beidson@apple.com>
636
637         Rubberstamped by Geoff and Maciej
638
639         Fix MSVC build warning due to out of range data in a char array
640
641         * loader/icon/IconDatabase.cpp:
642         (WebCore::IconDatabase::defaultIcon): The buffer is now unsigned data
643
644         * platform/SharedBuffer.cpp:
645         (WebCore::SharedBuffer::SharedBuffer): Add the "unsigned char*" c'tor
646         * platform/SharedBuffer.h:
647
648 2007-09-13  Darin Adler  <darin@apple.com>
649
650         Reviewed by Oliver.
651
652         - fix <rdar://problem/5470457> REGRESSION: Input method inline hole is mishandled in text
653           <input> elements with maxlength limit
654
655         * editing/Editor.h: Moved MarkedTextUnderline here and renamed it CompositionUnderline.
656         Moved the rest of the marked text API here and used the term that will be more familiar
657         to those on platforms other than Macintosh, "composition". This helps prevent confusion
658         with the other kinds of mark -- the emacs "mark" and spelling/grammar marks. Also
659         cleaned up the conditionals a bit for the Macintosh-specific parts of this header.
660
661         * editing/Editor.cpp:
662         (WebCore::Editor::Editor): Updated for name change.
663         (WebCore::Editor::clear): Added. To be called by FrameLoader::clear().
664         (WebCore::Editor::insertTextWithoutSendingTextEvent): Removed code to make inserted
665         text replace the marked text range -- we now deal with this explicitly by not
666         calling this function to replace marked text. Also removed unneeded code that was
667         specific to the use of this to replace the marked text.
668         (WebCore::Editor::selectComposition): Renamed from selectMarkedText. Updated since
669         the composition range is not stored as a Range.
670         (WebCore::Editor::confirmComposition): Added. To be called when changing a composition
671         into actual text. Unlike the old code path, deletes the composition first, then inserts
672         the text, triggering the normal insertion code path and events. This is helpful because
673         it means the inserted text will be truncated by the <input> element, for example.
674         (WebCore::Editor::confirmCompositionWithoutDisturbingSelection): Added.
675         (WebCore::Editor::setComposition): Added. To be called when changing the composition.
676         Takes parameters for the underlines and selection. Unlike the old code path, this passes
677         a flag down that indicates the inserted text is part of a composition. This is helpful
678         because we don't send the event that will cause the <input> element to do truncation.
679         It's also a better API for future improvements to our input method handling.
680         (WebCore::Editor::revealSelectionAfterEditingOperation): Updated for name change.
681         (WebCore::Editor::setIgnoreCompositionSelectionChange): Ditto.
682         (WebCore::Editor::compositionRange): Added. Needed now that the composition is not
683         stored as a Range.
684         (WebCore::Editor::getCompositionSelection): Added.
685
686         * editing/TypingCommand.h:
687         * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertText):
688         Added an insertedTextIsComposition parameter, and don't send the BeforeTextInsertedEvent
689         if it's true.
690
691         * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): Replaced the Macintosh-specific
692         call to setMarkedTextRange with a call to the new Editor::clear().
693
694         * page/Frame.h:
695         * page/Frame.cpp:
696         * page/FramePrivate.h:
697         * page/mac/FrameMac.mm:
698         Removed the marked text code. It was streamlined and moved to Editor, except for the
699         Mac-specific code, which was moved into WebKit.
700
701         * page/mac/WebCoreFrameBridge.h:
702         * page/mac/WebCoreFrameBridge.mm: Removed some now-unneeded marked text code.
703         (-[WebCoreFrameBridge markedTextNSRange]): Updated for name/API change.
704
705         * rendering/InlineTextBox.h:
706         * rendering/InlineTextBox.cpp:
707         (WebCore::InlineTextBox::paint): Updated marked text code for name changes, and also
708         streamlined the code a bit for the case where there is no composition.
709         (WebCore::InlineTextBox::paintCompositionBackground): Name change.
710         (WebCore::InlineTextBox::paintCompositionUnderline): Ditto.
711
712         * rendering/RenderTextControl.h:
713         * rendering/RenderTextControl.cpp:
714         (WebCore::RenderTextControl::finishText): Added. Helper function shared by the
715         (WebCore::RenderTextControl::text):
716         (WebCore::getNextSoftBreak):
717         (WebCore::RenderTextControl::textWithHardLineBreaks):
718
719         * platform/CharacterNames.h: Added newlineCharacter.
720
721         * dom/Range.h: Remove the now-unneeded version of toString that converts <br>
722         elements into newlines.
723         * dom/Range.cpp:
724         (WebCore::Range::toString): Changed this to use a Vector<UChar> instead of
725         a String so it will not have pathological reallocation performance, and removed
726         the <br> feature.
727         (WebCore::Range::pastEndNode): Made this return 0 when there is no start node.
728         This bit of extra robustness guarantees you can't do a null dereference if the
729         start node is 0 and the end node is not. Not sure this case really exists.
730
731         * page/ContextMenuController.cpp: (ContextMenuController::contextMenuItemSelected):
732         Removed a semi-bogus use of Range::toString(true). The right function to use here
733         is plainText().
734
735         * bridge/EditorClient.h: Removed obsolete markedTextAbandoned function.
736
737         * WebCore.exp: Updated for above changes. 
738
739 2007-09-13  Anders Carlsson  <andersca@apple.com>
740
741         Reviewed by Adam and Geoff.
742
743         <rdar://problem/5304000>
744         Windows Safari doesn't always call NPP_SetWindow() for NPAPI plugins.
745         
746         This does two things:
747         
748         1. Makes sure that the plug-in get the correct initial size.
749         
750         2. Always updates the size of the HWND, even if the widget size didn't change. This is because
751         the widget size can be different before the HWND has been created.
752         
753         * plugins/win/PluginDatabaseWin.cpp:
754         (WebCore::PluginDatabaseWin::createPluginView):
755         * plugins/win/PluginDatabaseWin.h:
756         * plugins/win/PluginViewWin.cpp:
757         (WebCore::PluginViewWin::setFrameGeometry):
758         (WebCore::PluginViewWin::PluginViewWin):
759         * plugins/win/PluginViewWin.h:
760
761 2007-09-13  Kevin McCullough  <kmccullough@apple.com>
762
763         Reviewed by Geof, Sam, Adam, Hyatt, Darin.
764
765         - <rdar://problem/5480234> JS setTimeout function requires a second argument
766         - Removed check for number of arguments in setTimeout to behave like other browsers.
767         - Added layoutTest setTimeout-no-arguments.html
768
769         * bindings/js/kjs_window.cpp:
770         (KJS::WindowFunc::callAsFunction):
771
772 2007-09-13   Dave Hyatt  <hyatt@apple.com>
773
774         Some minor Windows font improvements before I make the larger changes.
775         
776         Reviewed by aroben, weinig
777
778         * platform/win/FontCacheWin.cpp:
779         (WebCore::FontCache::getFontDataForCharacters):
780         Don't use the currently selected font in the HDC when passing priority code pages to MLANG.  Make
781         sure to use ACP code pages instead so that there won't be any confusion regarding traditional vs.
782         simplified chinese, etc.
783
784         * platform/win/FontDataWin.cpp:
785         (WebCore::FontData::containsCharacters):
786         Rewrite containsCharacters so that it isn't glyph-dependent (since CG doesn't shape, this call is
787         rejecting fonts that it shouldn't).  Re-implement this method in terms of MLang and use code page
788         testing.
789         
790         * platform/win/UniscribeController.cpp:
791         (WebCore::UniscribeController::itemizeShapeAndPlace):
792         Add some comments to explain the additional item in the items array.
793        
794         (WebCore::UniscribeController::shape):
795         Fix up the missing glyph check when doing uniscribe shaping.  Only wgDefault matters as far as doing
796         font fallback.
797         
798 2007-09-13  kuchhal  <kuchhal@yahoo.com>
799
800         Reviewed, tweaked and landed by Anders.
801
802         <rdar://problem/5461153> 
803         http://bugs.webkit.org/show_bug.cgi?id=15143
804         Crash seen on Windows
805         
806         Null check frame before calling Frame::settings.
807         
808         * loader/PluginDocument.cpp:
809         (WebCore::PluginTokenizer::writeRawData):
810
811 2007-09-12  Holger Hans Peter Freyther  <zecke@selfish.org>
812
813         Reviewed by Mark.
814
815         Implement the FileChooser for the WebKit/Gtk+ port by using
816         the GtkFileChooserDialog and g_path_get_basename to get the
817         basename for the current filename.
818
819
820         * WebCore.pro:
821         * platform/gdk/FileChooserGdk.cpp: Added.
822         (WebCore::FileChooser::FileChooser):
823         (WebCore::FileChooser::~FileChooser):
824         (WebCore::FileChooser::openFileChooser):
825         (WebCore::FileChooser::basenameForWidth):
826         * platform/gdk/TemporaryLinkStubs.cpp:
827
828 2007-09-12  Holger Hans Peter Freyther  <zecke@selfish.org>
829
830         Reviewed by Mark.
831
832         Move the "string" functions from the TemporaryLinkStubs.cpp
833         to LocalizedStringsGdk.cpp and implement them using the text
834         from the win port and glib-i18n (gettext).
835
836         * platform/gdk/LocalizedStringsGdk.cpp: Added.
837         (WebCore::submitButtonDefaultLabel):
838         (WebCore::inputElementAltText):
839         (WebCore::resetButtonDefaultLabel):
840         (WebCore::searchableIndexIntroduction):
841         (WebCore::fileButtonChooseFileLabel):
842         (WebCore::fileButtonNoFileSelectedLabel):
843         (WebCore::contextMenuItemTagOpenLinkInNewWindow):
844         (WebCore::contextMenuItemTagDownloadLinkToDisk):
845         (WebCore::contextMenuItemTagCopyLinkToClipboard):
846         (WebCore::contextMenuItemTagOpenImageInNewWindow):
847         (WebCore::contextMenuItemTagDownloadImageToDisk):
848         (WebCore::contextMenuItemTagCopyImageToClipboard):
849         (WebCore::contextMenuItemTagOpenFrameInNewWindow):
850         (WebCore::contextMenuItemTagCopy):
851         (WebCore::contextMenuItemTagGoBack):
852         (WebCore::contextMenuItemTagGoForward):
853         (WebCore::contextMenuItemTagStop):
854         (WebCore::contextMenuItemTagReload):
855         (WebCore::contextMenuItemTagCut):
856         (WebCore::contextMenuItemTagPaste):
857         (WebCore::contextMenuItemTagNoGuessesFound):
858         (WebCore::contextMenuItemTagIgnoreSpelling):
859         (WebCore::contextMenuItemTagLearnSpelling):
860         (WebCore::contextMenuItemTagSearchWeb):
861         (WebCore::contextMenuItemTagLookUpInDictionary):
862         (WebCore::contextMenuItemTagOpenLink):
863         (WebCore::contextMenuItemTagIgnoreGrammar):
864         (WebCore::contextMenuItemTagSpellingMenu):
865         (WebCore::contextMenuItemTagShowSpellingPanel):
866         (WebCore::contextMenuItemTagCheckSpelling):
867         (WebCore::contextMenuItemTagCheckSpellingWhileTyping):
868         (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
869         (WebCore::contextMenuItemTagFontMenu):
870         (WebCore::contextMenuItemTagBold):
871         (WebCore::contextMenuItemTagItalic):
872         (WebCore::contextMenuItemTagUnderline):
873         (WebCore::contextMenuItemTagOutline):
874         (WebCore::contextMenuItemTagWritingDirectionMenu):
875         (WebCore::contextMenuItemTagDefaultDirection):
876         (WebCore::contextMenuItemTagLeftToRight):
877         (WebCore::contextMenuItemTagRightToLeft):
878         (WebCore::contextMenuItemTagInspectElement):
879         (WebCore::searchMenuNoRecentSearchesText):
880         (WebCore::searchMenuRecentSearchesText):
881         (WebCore::searchMenuClearRecentSearchesText):
882         (WebCore::unknownFileSizeText):
883         * platform/gdk/TemporaryLinkStubs.cpp:
884
885 2007-09-10  Holger Hans Peter Freyther  <zecke@selfish.org>
886
887         Reviewed by Mark.
888
889         EventHandlerGdk::createDraggingClipboard must succeed otherwise an
890         ASSERT is hit. Add Clipboard stubs for the Gdk/Gtk+ port and
891         instantiate ClipboardGdk from the EventHandlerGdk to make the ASSERT
892         go away. In contrast to the Windows and Mac port this clipboard is not
893         inheriting CachedResourceClient. This was proposed by Oliver.
894
895         * WebCore.pro:
896         * page/gdk/EventHandlerGdk.cpp:
897         * platform/gdk/ClipboardGdk.cpp: Added.
898         (WebCore::ClipboardGdk::ClipboardGdk):
899         (WebCore::ClipboardGdk::~ClipboardGdk):
900         (WebCore::ClipboardGdk::clearData):
901         (WebCore::ClipboardGdk::clearAllData):
902         (WebCore::ClipboardGdk::getData):
903         (WebCore::ClipboardGdk::setData):
904         (WebCore::ClipboardGdk::types):
905         (WebCore::ClipboardGdk::dragLocation):
906         (WebCore::ClipboardGdk::dragImage):
907         (WebCore::ClipboardGdk::setDragImage):
908         (WebCore::ClipboardGdk::dragImageElement):
909         (WebCore::ClipboardGdk::setDragImageElement):
910         (WebCore::ClipboardGdk::createDragImage):
911         (WebCore::ClipboardGdk::declareAndWriteDragImage):
912         (WebCore::ClipboardGdk::writeURL):
913         (WebCore::ClipboardGdk::writeRange):
914         (WebCore::ClipboardGdk::hasData):
915         * platform/gdk/ClipboardGdk.h: Added.
916
917 2007-09-12  Oliver Hunt  <oliver@apple.com>
918
919         Reviewed by Adam.
920
921         Corrections missed in previous revision
922
923         * platform/Cursor.h:
924         * platform/win/CursorWin.cpp:
925         (WebCore::loadCursorByName):
926
927 2007-09-12  Oliver Hunt  <oliver@apple.com>
928
929         Reviewed by Adam.
930
931         Fixing 
932             <rdar://problem/5018591> Windows doesn't have a standard vertical text cursor
933             <rdar://problem/5224996> Add zoom in and zoom out cursors
934
935         Added SharedCursor for CursorWin so we can correctly track lifetime of custom/image
936         based cursors, such as the vertical text and zooming cursors.
937
938         * platform/Cursor.h:
939         (WebCore::SharedCursor::SharedCursor):
940         (WebCore::SharedCursor::~SharedCursor):
941         (WebCore::SharedCursor::nativeCursor):
942         * platform/win/CursorWin.cpp:
943         (WebCore::Cursor::Cursor):
944         (WebCore::loadCursorByName):
945         (WebCore::loadSharedCursor):
946         (WebCore::pointerCursor):
947         (WebCore::crossCursor):
948         (WebCore::handCursor):
949         (WebCore::iBeamCursor):
950         (WebCore::waitCursor):
951         (WebCore::helpCursor):
952         (WebCore::eastResizeCursor):
953         (WebCore::northResizeCursor):
954         (WebCore::northEastResizeCursor):
955         (WebCore::northWestResizeCursor):
956         (WebCore::southResizeCursor):
957         (WebCore::southEastResizeCursor):
958         (WebCore::southWestResizeCursor):
959         (WebCore::westResizeCursor):
960         (WebCore::northSouthResizeCursor):
961         (WebCore::eastWestResizeCursor):
962         (WebCore::northEastSouthWestResizeCursor):
963         (WebCore::northWestSouthEastResizeCursor):
964         (WebCore::columnResizeCursor):
965         (WebCore::rowResizeCursor):
966         (WebCore::moveCursor):
967         (WebCore::verticalTextCursor):
968         (WebCore::progressCursor):
969         (WebCore::notAllowedCursor):
970         (WebCore::zoomInCursor):
971         (WebCore::zoomOutCursor):
972         * platform/win/WidgetWin.cpp:
973         (WebCore::Widget::setCursor):
974
975 2007-09-12  Brady Eidson  <beidson@apple.com>
976
977         Reviewed by Geoff Garen
978
979         <rdar://problem/5478577> - Further improve cold launch time with Icon Database changes
980
981         * loader/icon/IconDatabase.cpp:
982         (WebCore::IconDatabase::open): Store the directory and full path for later usage and access in the API, respectively
983           Move the makeAllDirectories() call to the background thread.
984         (WebCore::IconDatabase::IconDatabase): Don't set up the timer here...
985         (WebCore::IconDatabase::scheduleOrDeferSyncTimer): Create the timer on demand
986         (WebCore::IconDatabase::iconDatabaseSyncThread): makeAllDirectories() here where it's not as expensive
987         (WebCore::IconDatabase::cleanupSyncThread): Cleanup the directory as well as full path
988
989         * loader/icon/IconDatabase.h: m_syncTimer becomes an OwnPtr, and we add the database directory
990           as a member to set it on the main thread and act with it on the background thread
991
992 2007-09-12  Justin Garcia  <justin.garcia@apple.com>
993
994         Reviewed by Tristan.
995
996         <rdar://problem/5469868> 
997         GoogleDocs: A hang occurs when applying list styling to a selection in a <table>
998         
999         When list insertion moves selected paragraphs into list items, it relies on 
1000         the selection preservation code inside moveParagraphs to iterate over the 
1001         selected paragraphs.  If a selection is ever restored incorrectly (before
1002         the original, or inside the original) list insertion will go into an infinite loop.
1003         
1004         In this hang, a table was selected and the selection preservation code incorrectly
1005         restored a selection, placing it inside the table.
1006         
1007         The bug was that a TextIterator, when being used for selection preservation, must
1008         emit a character between every VisiblePosition in the Range used to create the
1009         iterator.
1010         
1011         * editing/TextIterator.cpp:
1012         (WebCore::TextIterator::TextIterator): Renamed the boolean that we use for 
1013         selection preservation.  It used to be m_emitForReplacedElements because
1014         we believed that replaced elements were the only case where TextIterators
1015         should have emitted differently when used for selection preservation.
1016         (WebCore::TextIterator::handleReplacedElement): Ditto.
1017         (WebCore::TextIterator::shouldRepresentNodeOffsetZero): Represent the 
1018         position before block tables, but only if we are emitting for selection 
1019         preservation.
1020         (WebCore::TextIterator::shouldEmitSpaceBeforeAndAfterNode): We should emit 
1021         a space before and after block tables if we are emitting for selection 
1022         preservation (because we have VisiblePositions before and after them).
1023         (WebCore::TextIterator::handleNonTextNode): Use a renamed variable.
1024         * editing/TextIterator.h: Made shouldEmitSpaceBeforeAndAfterNode a member
1025         function, because whether or not we emit spaces before and after a block
1026         table depends we're emitting for selection preservation.
1027
1028 2007-09-12  Beth Dakin  <bdakin@apple.com>
1029
1030         Reviewed by Hyatt.
1031
1032         Fix for <rdar://problem/5464998> REGRESSION (9A543): Using Sort 
1033         options takes you back to search screen on zappos.com
1034
1035         The current mechanism for preserving form elements across removes 
1036         did not work in the case where the input was moved by the parser to 
1037         be out of scope of the form. This fixes that problem by having the 
1038         parser keep track of the preserve boolean rather than the current 
1039         form element.
1040
1041         * dom/Tokenizer.h:
1042         (WebCore::Tokenizer::isHTMLTokenizer): New function.
1043         * html/HTMLFormElement.cpp:
1044         (WebCore::HTMLFormElement::HTMLFormElement): Get rid of 
1045         m_preserveAcrossRemove.
1046         * html/HTMLFormElement.h:
1047         (WebCore::HTMLFormElement::isMalformed): Get rid of 
1048         m_preserveAcrossRemove.
1049         * html/HTMLGenericFormElement.cpp:
1050         (WebCore::HTMLGenericFormElement::removedFromTree): Ask the parser 
1051         if it is currently handling residual style rather than asking the 
1052         form if it wants to preserveAcrossRemove.
1053         * html/HTMLParser.cpp:
1054         (WebCore::HTMLParser::HTMLParser): New boolean to initialize.
1055         (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): Set 
1056         m_handlingResidualStyleAcrossBlocks to true at the beginning and 
1057         false at the end.
1058         * html/HTMLParser.h:
1059         (WebCore::HTMLParser::isHandlingResidualStyleAcrossBlocks):
1060         * html/HTMLTokenizer.h:
1061         (WebCore::HTMLTokenizer::isHTMLTokenizer):
1062         (WebCore::HTMLTokenizer::htmlParser):
1063
1064 2007-09-12  George Staikos  <staikos@kde.org>
1065
1066         Fix compilation in some configurations for patch I reviewed and missed
1067         this option on.
1068
1069         * platform/qt/CursorQt.cpp:
1070         (WebCore::Cursor::Cursor):
1071
1072 2007-09-12  Brady Eidson  <beidson@apple.com>
1073
1074         Reviewed by Tim Hatcher and Kevin Decker
1075
1076         <rdar://problem/5367045> - Launch time regression due to accessing resource from a different bundle
1077
1078         When the default icon was moved from WebKit to WebCore, we had to access an entirely new bundle on launch which
1079         measurably increased time during launch accessing the disk.
1080
1081         Instead of moving it back to the WebKit bundle, lets make launch time even faster by compiling in the icon.
1082
1083         * Resources/urlIcon.tiff: Removed.
1084
1085         * WebCore.xcodeproj/project.pbxproj: Removed urlIcon.tiff
1086
1087         * loader/icon/IconDatabase.cpp:
1088         (WebCore::IconDatabase::defaultIcon): Compile in the icon data here.
1089
1090 2007-09-12  Adam Roben  <aroben@apple.com>
1091
1092         Always specify that slider thumbs are small when painting with SafariTheme
1093
1094         This is the only size we support.
1095
1096         Reviewed by Sam.
1097
1098         * rendering/RenderThemeSafari.cpp:
1099         (WebCore::RenderThemeSafari::paintSliderThumb):
1100
1101 2007-09-12  Brady Eidson  <beidson@apple.com>
1102
1103         Reviewed by Darin
1104
1105         <rdar://problem/5474753> - ASSERT in IconDatabase ReadySQLStatement
1106
1107         * loader/icon/IconDatabase.cpp:
1108         (WebCore::readySQLStatement): This is a LOG_ERROR situation, not really an ASSERT situation
1109
1110 2007-09-12  Adam Roben  <aroben@apple.com>
1111
1112         Don't ask SafariTheme to draw focus rings around text controls
1113
1114         We do this ourselves.
1115
1116         Reviewed by Oliver.
1117
1118         * rendering/RenderThemeSafari.cpp:
1119
1120 2007-09-11  Brady Eidson  <beidson@apple.com>
1121
1122         Reviewed by Darin
1123
1124         <rdar://problem/5475639> and http://bugs.webkit.org/show_bug.cgi?id=15185 -
1125         Prevent two WebKits from fighting over the database schema in the future in case it ever changes again
1126
1127         By telling the "older schema" WebKit to simply close itself and not bother to do any icon related stuff
1128         if the database schema is newer, we prevent the possibility of an older webkit run side-by-side with a newer
1129         WebKit causing icon database issues.
1130
1131         * loader/icon/IconDatabase.cpp:
1132         (WebCore::IconDatabase::defaultDatabaseFilename): Rev the icon database filename to be "WebpageIcons.db"  The name is
1133           more appropriate for what is actually stored in the file, and since we're already not converting v5 to v6 icons, 
1134           making this leap now makes sense and gives us a good "future-proof" baseline
1135         (WebCore::isValidDatabase): Change the validity check to be "less then" instead of "not equal to" - the
1136           "greater than" case is now handled in performOpenInitialization()
1137         (WebCore::IconDatabase::performOpenInitialization): If the schema version is greater than the current, then
1138           close the database as to not conflict with the newer version.  Also noted that the integrity check failure 
1139           should actually close the sql database, not the icondatabase
1140         (WebCore::IconDatabase::syncThreadMainLoop): If termination has already been requested, skip straight to cleanup
1141         (WebCore::IconDatabase::cleanupSyncThread): More correctly set the "sync thread running" flag to false here,
1142           as the thread can now decide to exit on its own
1143
1144 2007-09-12  Mike Fenton <mike@staikos.net>
1145
1146         Reviewed by George Staikos.
1147
1148         Patch from Mike Fenton to allow custom cursors.
1149
1150         * platform/qt/CursorQt.cpp:
1151
1152 2007-09-11  Kevin Decker <kdecker@apple.com>
1153
1154         Reviewed by Oliver Hunt.
1155
1156         Fixed: <rdar://problem/5472402> crash due to infinite recursion in expandUseElementsInShadowTree on SVG from wikipedia
1157
1158         * ksvg2/svg/SVGUseElement.cpp: Added SVG_EXPERIMENTAL #ifdef for expandUseElementsInShadowTree().
1159         (WebCore::SVGUseElement::buildPendingResource): Ditto.
1160         (WebCore::SVGUseElement::associateInstancesWithShadowTreeElements): Tweaked an ASSERT to not fire on non-experimental builds.
1161         * ksvg2/svg/SVGUseElement.h: Added SVG_EXPERIMENTAL #ifdef for expandUseElementsInShadowTree().
1162
1163 2007-09-11  Brady Eidson  <beidson@apple.com>
1164
1165         Reviewed by Maciej
1166
1167         Fix for <rdar://problem/5473046> - Crash when resetting all icons
1168
1169         Originally I'd written the "reset all icons" to be synchronous on the main thread, but it
1170         was decided that it should be async since it involved I/O.  Turns out it needs to be... both!
1171         Synchronous removal of all in-memory records of icons, and then continue and clean up the 
1172         on-disk database on the background thread.
1173
1174         Also, it turns out that resetting all the page url retain counts should *not* be part of 
1175         "reset all icons" because it breaks various contracts the API makes about maintaining retain counts.
1176
1177         The problem that occured here was removing all the icons, then all the history items that were 
1178         removed as part of "Reset Safari..." would try to release their icon, but their icon doesn't exist
1179         anymore.
1180
1181         We get around this by simply leaving the in-memory page url records and retain counts alone - they
1182         are still wiped from disk.
1183
1184         * loader/icon/IconDatabase.cpp:
1185         (WebCore::IconDatabase::removeAllIcons): Clear in-memory records of all icons then tell the thread to
1186           wipe the on-disk tables
1187         (WebCore::IconDatabase::removeAllIconsOnThread): Only do the disk cleanup - in-memory maintenance is
1188           handled on the main thread
1189         (WebCore::IconDatabase::cleanupSyncThread): Now that it's possible for new "icons to be written to disk"
1190           to appear while on-disk deleting is occuring, let the cleanup procedure perform 1 final write *after*
1191           it does the remove all icons
1192         * loader/icon/IconDatabase.h: Removed unused lock and condition
1193
1194         * loader/icon/PageURLRecord.cpp:
1195         (WebCore::PageURLRecord::setIconRecord): Allow setting a NULL icon record, so a PageURLRecord can be
1196           cleared as part of removeAllIcons()
1197
1198 2007-09-11  Tristan O'Tierney  <tristan@apple.com>
1199
1200         Reviewed by David Harrison.
1201         
1202         <rdar://problem/5467203> CrashTracer: [USER] 1 crash in Mail at <unknown binary>: WebCore::Range::startContainer const
1203
1204         * editing/SelectionController.cpp:
1205         (WebCore::SelectionController::addRange):
1206         (WebCore::SelectionController::setSelectedRange):
1207         Added a check to make sure the passed in Range* value is not null
1208         before performing operations on it.
1209
1210 2007-09-11  Justin Garcia  <justin.garcia@apple.com>
1211
1212         Reviewed by Maciej.
1213         
1214         <rdar://problem/5458246> 
1215         GoogleDocs: A hang occurs when applying list styling to selection that contains a <HR>
1216         
1217         List insertion moves selected paragraphs into list items, and relies on the selection
1218         preservation code inside moveParagraphs to iterate over the selected paragraphs.
1219         When list insertion would try to listify a paragraph that came after a list item 
1220         containing an <hr>, the selection preservation code would set an incorrect ending 
1221         selection because of a TextIterator bug, and we would try to listify the same 
1222         paragraph over and over.
1223         
1224         * editing/CompositeEditCommand.cpp:
1225         (WebCore::CompositeEditCommand::moveParagraphs): Pass range compliant equivalents to
1226         the Range constructor here.  The position [hr, 0] is not a valid DOM Range endpoint 
1227         for example.
1228         * editing/TextIterator.cpp:
1229         (WebCore::shouldEmitSpaceForNode): Added.
1230         (WebCore::TextIterator::handleNonTextNode): Emit a space to represent a horizontal rule,
1231         since it has VisiblePositions before and after it, but only for TextIterators used for
1232         selection preservation, so innerText will be unaffected.
1233
1234 2007-09-11  Ada Chan  <adachan@apple.com>
1235
1236         <rdar://problem/5472130> Support NTLM authentication via CFNetwork.
1237
1238         Reviewed by Darin.
1239
1240         * platform/network/ProtectionSpace.h:
1241         (WebCore::):
1242         * platform/network/cf/AuthenticationCF.cpp:
1243         (WebCore::createCF):
1244         (WebCore::core):
1245
1246 2007-09-11  Darin Adler  <darin@apple.com>
1247
1248         Rubber-stamped by Dave Harrison.
1249
1250         - fixed pasteboard types here to match WebKit and use constants instead of
1251           WebKitSystemInterface
1252
1253         * platform/mac/PasteboardMac.mm: Use constants for all pasteboard type strings.
1254
1255         * platform/mac/WebCoreSystemInterface.h: Removed wkCreateURLPasteboardFlavorTypeName
1256         and wkCreateURLNPasteboardFlavorTypeName.
1257
1258 2007-09-11  Sven Herzberg  <sven@imendio.com>
1259
1260         Reviewed by Mark.
1261
1262         Remove unnecessary fields in FontPlatformData
1263         http://bugs.webkit.org/show_bug.cgi?id=15177
1264
1265         * platform/gdk/FontDataGdk.cpp: removed the destroy code of the fields
1266         that have been removed
1267         * platform/gdk/FontPlatformData.h: removed m_fontFace, m_fontMatrix
1268         and m_options; hask on m_scaledFont
1269         * platform/gdk/FontPlatformDataGdk.cpp: simplified setFont() by using
1270         m_scaledFont only; turned the former struct members into local
1271         variables
1272
1273 2007-09-11  George Staikos  <staikos@kde.org>
1274
1275         Reviewed by Anders.
1276
1277         Work around gcc bug with some old gcc versions.
1278
1279         * platform/qt/WidgetQt.cpp:
1280         (WebCore::Widget::convertToContainingWindow):
1281         (WebCore::Widget::convertFromContainingWindow):
1282
1283 2007-09-10  Mitz Pettel  <mitz@webkit.org>
1284
1285         Reviewed by Maciej Stachowiak.
1286
1287         - fix http://bugs.webkit.org/show_bug.cgi?id=15157
1288           Image defined in background-position: top center gets unexpectedly truncated
1289           <rdar://problem/5469095>
1290
1291         Test: fast/repaint/body-background-image.html
1292
1293         * rendering/RenderBox.cpp:
1294         (WebCore::RenderBox::imageChanged): Refined the logic for when the root takes
1295         over painting the background, to match paintBoxDecorations(). In particular,
1296         if the root has defined a background, the body should paint its own background.
1297
1298 2007-09-10  David Harrison  <harrison@apple.com>
1299
1300         Reviewed by Kevin and Tristan.
1301
1302         Tests added:
1303         * editing/pasteboard/paste-into-anchor-text.html: Added.
1304         * editing/pasteboard/paste-table-cells.html: Added.
1305
1306         Source changes:
1307         * editing/CompositeEditCommand.cpp:
1308         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
1309         Nil check enclosingAnchor.
1310         
1311         * editing/ReplaceSelectionCommand.cpp:
1312         (WebCore::ReplaceSelectionCommand::removeNodeAndPruneAncestors):
1313         New. Keeps m_firstNodeInserted and m_lastLeafInserted updated.
1314         
1315         (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
1316         Added a comment.
1317         
1318         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
1319         Let ReplaceSelectionCommand::removeNodeAndPruneAncestors() update the nodes.
1320          
1321         (WebCore::ReplaceSelectionCommand::doApply):
1322         Pass originalVisPosBeforeEndBR to shouldRemoveEndBR()
1323         
1324         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR):
1325         Don't remove the br if nothing was inserted.
1326         
1327         * editing/ReplaceSelectionCommand.h:
1328         Add VisiblePosition parameter to shouldRemoveEndBR()
1329         
1330         * editing/markup.cpp:
1331         (WebCore::createMarkup):
1332         Wrap orphan tr element with a table element, just like we were doing
1333         for tobody elements.
1334
1335 2007-09-10  David Kilzer  <ddkilzer@apple.com>
1336
1337         Rubberstamped by Kevin Decker.
1338
1339         No test required since there is no change in functionality.
1340
1341         * history/BackForwardList.cpp:
1342         (WebCore::BackForwardList::BackForwardList): Fix misspelling of DefaultCapacitiy to DefaultCapacity.
1343
1344 2007-09-10  Mitz Pettel  <mitz@webkit.org>
1345
1346         Reviewed by Adele Peterson.
1347
1348         - fix http://bugs.webkit.org/show_bug.cgi?id=15156
1349           REGRESSION (r24594-r24668): The bottom of styled <select> button text is clipped out
1350           <rdar://problem/5464301>
1351
1352         Test: fast/forms/menulist-clip.html
1353
1354         * rendering/RenderMenuList.cpp:
1355         (WebCore::RenderMenuList::controlClipRect): Use correct coordinates for
1356         the inner block's content rect.
1357
1358 2007-09-10  Brady Eidson  <beidson@apple.com>
1359
1360         Reviewed by Darin, Sam, Oliver, Geoff, probably others - what a fun one to review!
1361
1362         <rdar://problem/5471641> - URLs get the wrong icon
1363
1364         Turns out sqlite3_reset() doesn't clear bindings, so previously bound icons were being
1365         written out for pages without icons.  Easy fix!
1366
1367         * loader/icon/IconDatabase.cpp:
1368         (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase): For null icons, manually
1369           bind NULL - otherwise, the previously bound icon will be written out to disk
1370
1371         * loader/icon/SQLStatement.cpp:
1372         (WebCore::SQLStatement::bindNull): Access to sqlite3_bind_null
1373         * loader/icon/SQLStatement.h:
1374
1375 2007-09-10  Anders Carlsson  <andersca@apple.com>
1376
1377         Reviewed by Oliver and Darin.
1378
1379         <rdar://problem/5468613>
1380         Using shockwave pages first time after plugin install crashed safari in PluginPing.
1381         
1382         Only restore the window proc if the plugin didn't override it.
1383         
1384         * plugins/win/PluginViewWin.cpp:
1385         (WebCore::PluginViewWin::stop):
1386
1387 2007-09-10  Justin Garcia  <justin.garcia@apple.com>
1388
1389         Reviewed by Darin.
1390
1391         <rdar://problem/5467405> 
1392         Revert back behavior of -webkit-user-select to fix widget selection problems
1393         
1394         Rolled out r25086 and r25057.  I will be re-opening:
1395         <rdar://problem/5333725> -webkit-user-select: none makes selection difficult
1396         Which we will either to defer or fix by introducing a new value of -webkit-user-select.
1397         <rdar://problem/5370059> REGRESSION: Cannot type into edit fields on a form (sccsheriff.org)
1398         Which we will either defer or fix with Adele's patch that doesn't involve making 
1399         -webkit-user-select inherited.
1400
1401         * css/CSSComputedStyleDeclaration.cpp:
1402         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1403         * css/CSSStyleSelector.cpp:
1404         (WebCore::CSSStyleSelector::adjustRenderStyle):
1405         (WebCore::CSSStyleSelector::applyProperty):
1406         * editing/SelectionController.cpp:
1407         (WebCore::SelectionController::selectAll):
1408         * page/EventHandler.cpp:
1409         (WebCore::EventHandler::selectClosestWordFromMouseEvent):
1410         (WebCore::EventHandler::handleMousePressEventTripleClick):
1411         (WebCore::EventHandler::handleMousePressEventSingleClick):
1412         (WebCore::EventHandler::updateSelectionForMouseDrag):
1413         (WebCore::EventHandler::selectCursor):
1414         (WebCore::EventHandler::canMouseDownStartSelect):
1415         * page/EventHandler.h:
1416         * rendering/RenderObject.cpp:
1417         (WebCore::selectStartNode):
1418         (WebCore::RenderObject::canSelect):
1419         (WebCore::RenderObject::shouldSelect):
1420         (WebCore::RenderObject::draggableNode):
1421         * rendering/RenderObject.h:
1422         * rendering/RenderStyle.cpp:
1423         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1424         (WebCore::StyleRareNonInheritedData::operator==):
1425         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1426         (WebCore::StyleRareInheritedData::operator==):
1427         (WebCore::RenderStyle::diff):
1428         * rendering/RenderStyle.h:
1429         (WebCore::):
1430         (WebCore::RenderStyle::userSelect):
1431         (WebCore::RenderStyle::setUserSelect):
1432         (WebCore::RenderStyle::initialUserSelect):
1433
1434 2007-09-10  Antti Koivisto  <antti@apple.com>
1435
1436         Reviewed by Kevin.
1437
1438         Fix <rdar://problem/5444866>
1439         REGRESSION: missing text in Acrobat "Getting Started" screen due to change in load ordering of large resources
1440         
1441         Make external scripts loaded using file: wait until all style sheet loads have completed before executing. 
1442         Fixes a class of problems where there is a dependency between script and stylesheet and results would effectively 
1443         get randomized based on which order the resources arrived. In Tiger file loads were effectively serialized by
1444         lower level components, which is why this regressed. 
1445
1446         Test: http/tests/local/stylesheet-and-script-load-order.html
1447
1448         * dom/Document.cpp:
1449         (WebCore::Document::removePendingSheet):
1450         * dom/Tokenizer.h:
1451         (WebCore::Tokenizer::executeScriptsWaitingForStylesheets):
1452         * html/HTMLTokenizer.cpp:
1453         (WebCore::HTMLTokenizer::HTMLTokenizer):
1454         (WebCore::HTMLTokenizer::begin):
1455         (WebCore::HTMLTokenizer::executeScriptsWaitingForStylesheets):
1456         (WebCore::HTMLTokenizer::notifyFinished):
1457         * html/HTMLTokenizer.h:
1458
1459 2007-09-08  David Smith  <catfish.man@gmail.com>
1460
1461         Reviewed by Maciej Stachowiak.
1462         
1463         http://bugs.webkit.org/show_bug.cgi?id=15148
1464         Bug 15148: Poor performance on crazy DOM raytracer
1465         
1466         Switch data structures to avoid quadratic behavior.
1467
1468         * rendering/RenderBlock.cpp:
1469         (WebCore::RenderBlock::layoutPositionedObjects): Update for ListHashSet
1470         (WebCore::RenderBlock::markPositionedObjectsForLayout): Update for ListHashSet
1471         (WebCore::RenderBlock::insertPositionedObject): Use ListHashSet to avoid expensive uniqueing
1472         (WebCore::RenderBlock::removePositionedObject): Update for ListHashSet
1473         (WebCore::RenderBlock::removePositionedObjects): Update for ListHashSet
1474         (WebCore::RenderBlock::lowestPosition): Update for ListHashSet
1475         (WebCore::RenderBlock::rightmostPosition): Update for ListHashSet
1476         (WebCore::RenderBlock::leftmostPosition): Update for ListHashSet
1477         (WebCore::RenderBlock::rightBottom): Update for ListHashSet
1478         * rendering/RenderBlock.h: Change m_positionedObjects from DeprecatedPtrList to ListHashSet
1479
1480 2007-09-09  Brady Eidson <beidson@apple.com>
1481
1482         Rubberstamped by Darin
1483
1484         pthread_main_np() is a Darwin thing, not a Mac thing
1485
1486         * loader/icon/IconDatabase.cpp:
1487         (WebCore::IconDatabase::IconDatabase):
1488
1489 2007-09-09  Holger Hans Peter Freyther  <zecke@selfish.org>
1490
1491         Build fix for Gtk+ by adding WebCore::callOnMainThread to the TemporaryLinkStubs.
1492
1493         * platform/gdk/TemporaryLinkStubs.cpp:
1494         (WebCore::callOnMainThread):
1495
1496 2007-09-08  George Staikos  <staikos@kde.org>
1497
1498         Reviewed by Olliej.
1499
1500         Separate out and implement FileSystem functions,  and stub out the
1501         icondatabase function for future implementation.
1502
1503         * WebCore.pro:
1504         * platform/qt/FileSystemQt.cpp: Added.
1505         (WebCore::fileExists):
1506         (WebCore::deleteFile):
1507         * platform/qt/TemporaryLinkStubs.cpp:
1508         * platform/qt/ThreadingQt.cpp: Added.
1509         (WebCore::callOnMainThread):
1510
1511 2007-09-08  Mark Rowe  <mrowe@apple.com>
1512
1513         Build fix for when ENABLE(ICONDATABASE) is not set.
1514
1515         * loader/icon/IconDatabaseNone.cpp:
1516         (WebCore::IconDatabase::~IconDatabase):
1517
1518 2007-09-08  Mark Rowe  <mrowe@apple.com>
1519
1520         More fixes for the Qt and Gtk builds.
1521
1522         * WebCore.pro: Update for file changes.
1523         * loader/icon/IconDatabase.cpp: Include errno.h for EDEADLK.
1524         * loader/icon/PageURLRecord.h:
1525
1526 2007-09-08  Justin Garcia  <justin.garcia@apple.com>
1527
1528         Backing my change back in without the changes to VisiblePosition::next 
1529         and previous that weren't necessary to fix the bug and were causing some
1530         layout test failures.  Most of the failures appeared to be fixes but I
1531         want more time to investigate and have to move to on to another task.
1532
1533         * editing/Selection.cpp:
1534         (WebCore::Selection::validate):
1535         * editing/visible_units.cpp:
1536         (WebCore::endOfWord):
1537
1538 2007-09-08  Brady Eidson  <beidson@apple.com>
1539
1540         Reviewed by Mark Rowe
1541
1542         Fix the _NSAutoreleaseNoPool() errors on launch - We were using NSFileManager on the secondary
1543         thread with no NSAutoreleasePool in place
1544
1545         * loader/icon/IconDatabase.cpp:
1546         (WebCore::IconDatabase::iconDatabaseSyncThread):
1547
1548 2007-09-08  Sam Weinig  <sam@webkit.org>
1549
1550         Add fix to the correct file.
1551
1552         * loader/icon/SQLDatabase.h:
1553         * loader/icon/SQLStatement.h:
1554
1555 2007-09-08  Sam Weinig  <sam@webkit.org>
1556
1557         Fix Windows build.
1558
1559         * loader/icon/SQLStatement.h: Disable boolean conversion warning.
1560
1561 2007-09-08  Brady Eidson  <beidson@apple.com>
1562
1563         Build fix for non-Mac platforms that use Icon Database
1564
1565         * loader/icon/IconDatabase.cpp:
1566         (WebCore::IconDatabase::IconDatabase): Apparently only Mac has the beauty that is pthread_main_np()
1567
1568 2007-09-08  Mark Rowe  <mrowe@apple.com>
1569
1570         Build fix.
1571
1572         * WebCore.xcodeproj/project.pbxproj: Headers used up in WebKit need to be be "private" rather than "project".
1573
1574 2007-09-08  Brady Eidson  <beidson@apple.com>
1575
1576         Reviewed by Darin
1577
1578         <rdar://problem/5434431> - Asynchronous Icon Database
1579
1580         The IconDatabase API was originally designed to be fully asynchronous - if an icon wasn't read in from disk
1581         when you asked for it, you would be notified when it was.
1582
1583         Safari 2 did writes on a background thread, but reads blocked the main thread.
1584
1585         The current WebCore implementation using SQLite attempted to get rid of the background thread by defering expensive 
1586         writes via timers, but falls short in moderate to extreme usage cases
1587
1588         Time to make the IconDatabase live up to it's fully asynchronous destiny.
1589
1590         This should -
1591         - Make the browser instantly usable while converting Safari 2 icons in the background occurs
1592         - Remedy any UI slowness/blocking when on slow network home directories
1593         - Remedy random UI slowness, pauses, and stutters do to random I/O occurring at the exact wrong time or under heavy
1594           disk usage from swapping or other apps on the system
1595         - Allow certain long-running procedures to be interruptible (Safari 2 import, reading icons in from disk when trying to quit, etc)
1596
1597         This will have a noticeable effect on current Safari 2 and Safari 3 beta browsers, including icons not appearing in bookmarks, history,
1598         or the location field the first time they're asked for, as current released Safari's don't properly listen for these async notifations.  
1599         The second time such a menu or view is brought up, the icon should be there.
1600
1601         Additionally this includes a SQLite schema change which will be a lot more efficient but will result in the loss of current SQLite icons.
1602         Converting from Safari 2 style icons will still work.
1603
1604         WebCore, welcome to multi-threadedness
1605
1606         * WebCore.exp:
1607         * WebCore.xcodeproj/project.pbxproj:
1608         * WebCore.vcproj/WebCore.vcproj:
1609
1610         * loader/DocumentLoader.cpp:
1611         (WebCore::DocumentLoader::iconLoadDecisionAvailable): Called when an Icon becomes available that was requested by this 
1612           DocumentLoader (to support the webView:didReceiveIcon: delegate call in WebKit)
1613         * loader/DocumentLoader.h:
1614
1615         * loader/FrameLoader.cpp:
1616         (WebCore::FrameLoader::iconLoadDecisionAvailable): Called from the DocumentLoaders who get notified - if the FrameLoader 
1617           ends up not caring because the WebView has transitioned to a new page, nothing occurs.  Otherwise, the FrameLoader possibly
1618           starts it Icon Loader and possibly sends the webView:didReceiveIcon: delegate call
1619         (WebCore::FrameLoader::startIconLoader): Instead of "Yes, load the icon now" or "No, don't load it" there is a third possibility -
1620           "You might be asked to load your icon later."  Add supporting logic for receiving this state, and being called a second time
1621           when the load decision is finally available.
1622         * loader/FrameLoader.h:
1623
1624         * loader/FrameLoaderClient.h: Added "registerForIconNotification" which is a way to tell WebViews "The icon you are interested in might
1625           become available via the generic WebIconDatabaseDidAddIconNotification instead of a targeted delegate call"
1626           A WebView can then receive the generic notification and pass on it's own targeted delegate call.
1627
1628         * loader/icon/IconDataCache.cpp: Removed.
1629         * loader/icon/IconDataCache.h: Removed.
1630
1631         * loader/icon/IconDatabase.cpp:
1632         (WebCore::urlForLogging): Cut a URL down in length for sane logging and debugging
1633         (WebCore::defaultClient): Return the default, empty IconDatabaseClient incase the API doesn't set one.
1634
1635         Following block of methods are for the Main thread's usage -
1636         (WebCore::IconDatabase::setClient):
1637         (WebCore::makeAllDirectories): Small optimization that checks to see if the entire path exists already, and doesn't try to loop
1638           through each patch component if the full path is already present
1639         (WebCore::IconDatabase::open): Makes all directories to the target path and kicks off the background thread - nothing more.
1640         (WebCore::IconDatabase::close): Signals the thread to quit and waits for it to do so
1641         (WebCore::IconDatabase::removeAllIcons): Purge the icon database
1642         (WebCore::IconDatabase::iconForPageURL):
1643         (WebCore::IconDatabase::readIconForPageURLFromDisk):
1644         (WebCore::IconDatabase::iconURLForPageURL):
1645         (WebCore::IconDatabase::defaultIcon):
1646         (WebCore::IconDatabase::retainIconForPageURL):
1647         (WebCore::IconDatabase::releaseIconForPageURL):
1648         (WebCore::IconDatabase::setIconDataForIconURL):
1649         (WebCore::IconDatabase::setIconURLForPageURL):
1650         (WebCore::IconDatabase::loadDecisionForIconURL): Determine if an icon loader should load now.  If the decision is "maybe later", then
1651           mark the DocumentLoader to be notified later when the final decision is available.
1652         (WebCore::IconDatabase::iconDataKnownForIconURL): Determine if the actual image data has been read from disk (or set from the loader) for 
1653           icon URL in question
1654         (WebCore::IconDatabase::setEnabled):
1655         (WebCore::IconDatabase::isEnabled):
1656         (WebCore::IconDatabase::setPrivateBrowsingEnabled):
1657         (WebCore::IconDatabase::isPrivateBrowsingEnabled):
1658         (WebCore::IconDatabase::delayDatabaseCleanup): Restore this method from a year ago, as asynchronous pruning of icons can now occur on a 
1659           background thread.
1660         (WebCore::IconDatabase::allowDatabaseCleanup):
1661         (WebCore::IconDatabase::checkIntegrityBeforeOpening):
1662         (WebCore::IconDatabase::pageURLMappingCount):
1663         (WebCore::IconDatabase::retainedPageURLCount):
1664         (WebCore::IconDatabase::iconRecordCount):
1665         (WebCore::IconDatabase::iconRecordCountWithData):
1666         (WebCore::IconDatabase::IconDatabase):
1667         (WebCore::IconDatabase::~IconDatabase):
1668         (WebCore::IconDatabase::notifyPendingLoadDecisions): Tell all the registered DocumentLoaders "Hey, we've read in all URL mappings from disk,
1669           so check to see if you are interested in any of them"
1670         (WebCore::IconDatabase::notifyPendingLoadDecisionsInternal):
1671         (WebCore::IconDatabase::wakeSyncThread): Wake the sync thread, if it is idle
1672         (WebCore::IconDatabase::scheduleOrDeferSyncTimer): Even though we're on a background thread, we still defer writing out to disk during
1673           periods of high activity
1674         (WebCore::IconDatabase::syncTimerFired): Call wakeSyncThread()
1675
1676         Following block of methods may be used by either thread -
1677         (WebCore::IconDatabase::isOpen):
1678         (WebCore::IconDatabase::databasePath):
1679         (WebCore::IconDatabase::defaultDatabaseFilename):
1680         (WebCore::IconDatabase::getOrCreateIconRecord):
1681         (WebCore::IconDatabase::getOrCreatePageURLRecord):
1682
1683         Following block of methods are used by the secondary thread only -
1684         (WebCore::IconDatabase::importIconURLForPageURL): For the Safari 2 import procedure - write a URL mapping directly out to disk
1685         (WebCore::IconDatabase::importIconDataForIconURL): For the Safari 2 import procedure - write an Icon directly out to disk
1686         (WebCore::IconDatabase::shouldStopThreadActivity): To check and see if the thread should stop what it is doing now to do something
1687           more important (such as quit, or delete all icons)
1688         (WebCore::IconDatabase::iconDatabaseSyncThreadStart):
1689         (WebCore::IconDatabase::iconDatabaseSyncThread): Entry point for the background thread
1690         (WebCore::databaseVersionNumber):
1691         (WebCore::isValidDatabase):
1692         (WebCore::createDatabaseTables):
1693         (WebCore::IconDatabase::performOpenInitialization): Open and validate the SQLite database, making sure it's schema jives with what
1694           is expected
1695         (WebCore::IconDatabase::checkIntegrity):
1696         (WebCore::IconDatabase::performURLImport): Import all the Page URL -> Icon URL mappings from the database.  Done "1st thing" on startup,
1697           this is necessary to be able to give the loader decisions about whether or not it should load icons from the network
1698         (WebCore::IconDatabase::syncThreadMainLoop): Main loop - sleeps until woken up, then does a read cycle and a write cycle until both cycles
1699           do no work - then it goes back to sleep.
1700         (WebCore::IconDatabase::readFromDatabase): Reads icons from the database that clients are waiting on
1701         (WebCore::IconDatabase::writeToDatabase): Writes any changes page -> icon url mappings to disk, as well as any new image data that has 
1702           been received from the loader
1703         (WebCore::IconDatabase::pruneUnretainedIcons): Done only once, and only after the first write to the database, this procedure removes all
1704           icons and page URLs from disk that haven't been retained by any client.  Note that the prune can be delayed by utilizing delayDatabaseCleanup()
1705         (WebCore::IconDatabase::checkForDanglingPageURLs): Usually part of the prune procedure, prunes any pages who point to icons that no longer exist 
1706           in the database
1707         (WebCore::IconDatabase::removeAllIconsOnThread): Completely purge both the on-disk and in memory records of all icons
1708         (WebCore::IconDatabase::deleteAllPreparedStatements): Part of removeAllIcons and the thread cleanup procedure
1709         (WebCore::IconDatabase::cleanupSyncThread): Write out any last remaining writes to disk, close the database, and then end the thread
1710         (WebCore::IconDatabase::imported): Checks the DB to see if the Safari 2 import has occured
1711         (WebCore::IconDatabase::setImported): Sets the "Safari 2 imported" flag
1712         (WebCore::readySQLStatement):
1713         (WebCore::IconDatabase::setIconURLForPageURLInSQLDatabase): This and the following "SQLDatabase" suffixed methods are pretty self explanatory
1714         (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
1715         (WebCore::IconDatabase::removePageURLFromSQLDatabase):
1716         (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
1717         (WebCore::IconDatabase::addIconURLToSQLDatabase):
1718         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
1719         (WebCore::IconDatabase::removeIconFromSQLDatabase):
1720         (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
1721         * loader/icon/IconDatabase.h:
1722
1723         * loader/icon/IconDatabaseClient.h: Added.
1724         (WebCore::IconDatabaseClient::~IconDatabaseClient):
1725         (WebCore::IconDatabaseClient::performImport): Perform the Safari 2 import, implemented by WebKit
1726         (WebCore::IconDatabaseClient::dispatchDidRemoveAllIcons): Send the API notification
1727         (WebCore::IconDatabaseClient::dispatchDidAddIconForPageURL): Ditto
1728
1729         * loader/icon/IconDatabaseNone.cpp: Best attempt to keep non icon-DB platforms building
1730         (WebCore::IconDatabase::defaultDatabaseFilename):
1731         (WebCore::IconDatabase::readIconForPageURLFromDisk):
1732         (WebCore::IconDatabase::loadDecisionForIconURL):
1733         (WebCore::IconDatabase::iconDataKnownForIconURL):
1734         (WebCore::IconDatabase::setIconURLForPageURL):
1735         (WebCore::IconDatabase::isEnabled):
1736         (WebCore::IconDatabase::delayDatabaseCleanup):
1737         (WebCore::IconDatabase::allowDatabaseCleanup):
1738         (WebCore::IconDatabase::setClient):
1739
1740         * loader/icon/IconRecord.cpp: Added.
1741         (WebCore::IconRecord::IconRecord): IconRecord used to be "IconDataCache" - it is merely a container for the url, timestamp, and image for a site icon.
1742           It is Shared, and therefore ref counted - PageURLRecords are the owning containers.  This is a tricky way to track how many page urls are retaining 
1743           an IconRecord and therefore tracking when we should try to get rid of one.
1744         (WebCore::IconRecord::~IconRecord):
1745         (WebCore::IconRecord::image):
1746         (WebCore::IconRecord::setImageData):
1747         (WebCore::IconRecord::loadImageFromResource):
1748         (WebCore::IconRecord::imageDataStatus): Return whether the image data hasn't been read yet, exists in memory, or is absent (site with no icon)
1749         (WebCore::IconRecord::snapshot): Returns a snapshot of the icon's data - url, timestamp, and image data - to be written to disk
1750         * loader/icon/IconRecord.h: Added.
1751         (WebCore::IconSnapshot::IconSnapshot):
1752         (WebCore::IconRecord::getTimestamp):
1753         (WebCore::IconRecord::setTimestamp):
1754         (WebCore::IconRecord::iconURL):
1755         (WebCore::IconRecord::retainingPageURLs):
1756
1757         * loader/icon/PageURLRecord.cpp: Added.
1758         (WebCore::PageURLRecord::PageURLRecord): PageURLRecord is fundamentally a pairing of a Page URL to an Icon.  It has manual ref counting for the sake
1759           of "retainIconForPageURL" and "releaseIconForPageURL", and can provide a quick snapshot of it's Page URL -> Icon URL mapping for writing to
1760           the database
1761         (WebCore::PageURLRecord::setIconRecord):
1762         (WebCore::PageURLRecord::snapshot):
1763         * loader/icon/PageURLRecord.h: Added.
1764         (WebCore::PageURLSnapshot::PageURLSnapshot):
1765         (WebCore::PageURLRecord::url):
1766         (WebCore::PageURLRecord::PageURLRecord::iconRecord):
1767         (WebCore::PageURLRecord::retain):
1768         (WebCore::PageURLRecord::release):
1769         (WebCore::PageURLRecord::retainCount):
1770
1771         * platform/SharedBuffer.cpp:
1772         (WebCore::SharedBuffer::copy): Added a deep copy method for the purposes of handing icon data across the thread boundary into the icon database
1773         * platform/SharedBuffer.h:
1774
1775         * platform/graphics/svg/SVGImageEmptyClients.h:
1776         (WebCore::SVGEmptyFrameLoaderClient::registerForIconNotification):
1777
1778         * platform/win/TemporaryLinkStubs.cpp:
1779         (WebCore::callOnMainThread): Only other IconDatabase utilizing platform - keep their build going
1780
1781 2007-09-07  David Kilzer  <ddkilzer@apple.com>
1782
1783         Reviewed by Timothy Hatcher.
1784
1785         Housekeeping.  No test required.
1786
1787         * bindings/objc/WebScriptObjectInternal.h: Removed unused file.
1788         * bindings/objc/WebScriptObjectPrivate.h: Updated copyright statement.
1789
1790 2007-09-07  Justin Garcia  <justin.garcia@apple.com>
1791         
1792         Rolling out my changes from r25421 while I investigate the layout test failures
1793         they caused.
1794         
1795         * editing/Selection.cpp:
1796         (WebCore::Selection::validate):
1797         * editing/VisiblePosition.cpp:
1798         (WebCore::VisiblePosition::next):
1799         (WebCore::VisiblePosition::previous):
1800         (WebCore::VisiblePosition::lastEditablePositionAtOrBefore):
1801         (WebCore::VisiblePosition::firstEditablePositionAtOrAfter):
1802         * editing/VisiblePosition.h:
1803         * editing/visible_units.cpp:
1804         (WebCore::endOfWord):
1805         (WebCore::previousWordPosition):
1806         (WebCore::nextWordPosition):
1807         (WebCore::startOfLine):
1808         (WebCore::endOfLine):
1809         (WebCore::previousSentencePosition):
1810         (WebCore::nextSentencePosition):
1811
1812 2007-09-05  Geoffrey Garen  <ggaren@apple.com>
1813
1814         Reviewed by Darin Adler, Maciej Stachowiak, Mark Rowe, Tim Hatcher.
1815         
1816         Fixed <rdar://problem/5326009> Make non-browser WebKit clients have no 
1817         memory cache, or a very tiny one
1818
1819         Added a client callback to notify WebKit when the first navigation has
1820         taken place. "Navigation" here means a transition from one page to 
1821         another that ends up in the back/forward list.
1822         
1823         WebKit Mac uses this notification to grow its cache model under certain
1824         circumstances.
1825         
1826         * loader/FrameLoader.cpp:
1827         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget):
1828         * loader/FrameLoaderClient.h:
1829
1830         * platform/graphics/svg/SVGImageEmptyClients.h:
1831         (WebCore::SVGEmptyFrameLoaderClient::didPerformFirstNavigation): Ah, 
1832         SVGEmptyFrameLoaderClient, my old friend. 
1833
1834 2007-09-07  Adele Peterson  <adele@apple.com>
1835
1836         Reviewed by Dave Harrison.
1837
1838         Fix for <rdar://problem/5428427> Wrong characters are re-converted after doing reconversion with Kotoeri
1839
1840         Revert change for<rdar://problem/5279521> and add nil checks for the result of TextIterator::rangeFromLocationAndLength
1841         TextIterator::exitNode shouldn't require the m_lastTextNode to be true, but we can't change that without making the logic in _web_attributedStringFromRange match.
1842         We'll get that for free when we switch to use TextIterator in _web_attributedStringFromRange.
1843
1844         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyBlockStyle): Added nil checks.
1845         * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::indentRegion): ditto.
1846         * editing/TextIterator.cpp: (WebCore::TextIterator::exitNode): Re-added check for m_lastTextNode before emitting newline.
1847
1848 2007-09-07  Ada Chan  <adachan@apple.com>
1849
1850         <rdar://problem/5395928> Need to be able to handle context menu item selection by index
1851         
1852         Reviewed by Beth.
1853
1854         * platform/ContextMenu.h: Added method to retrieve context menu item by index
1855         * platform/win/ContextMenuWin.cpp:
1856         (WebCore::ContextMenu::ContextMenu): call setPlatformDescription() since that will handle
1857         adding the MNS_NOTIFYBYPOS style to the context menu.
1858         (WebCore::contextMenuItemByIdOrPosition): helper method so we don't have to duplicate code
1859         between itemWithAction() and itemAtIndex().
1860         (WebCore::ContextMenu::itemWithAction):
1861         (WebCore::ContextMenu::itemAtIndex):
1862         (WebCore::ContextMenu::setPlatformDescription): add MNS_NOTIFYBYPOS style to the context menu
1863         so we will get notified by menu position through WM_MENUCOMMAND when the item is selected.
1864
1865 2007-09-07  Justin Garcia  <justin.garcia@apple.com>
1866
1867         Reviewed by Darin.
1868         
1869         <rdar://problem/5057506> Double-clicking after ToDo content doesn't select the paragraph break
1870         
1871         * editing/Selection.cpp:
1872         (WebCore::Selection::validate):
1873         Moved the code that moves across a paragraph boundary
1874         when expanding selections by word granularity from
1875         endOfWord to here.
1876         In the word and paragraph granularity cases, if the 
1877         end of the selection is at the end of the last paragraph 
1878         in the last cell of a block table, expand it so that 
1879         it ends at the start of the paragraph after the table, 
1880         instead of just after the table, so that ToDo content 
1881         gets the same double/tripled click behavior that normal 
1882         paragraphs get (added two testcases).
1883         When expanding the selection to include paragraph
1884         breaks, pass VisiblePosition::next true so that it
1885         doesn't change editability.
1886         * editing/VisiblePosition.cpp:
1887         (WebCore::VisiblePosition::next): Renamed the bool because it's now also
1888         used to keep non-editable positions non-editable.
1889         (WebCore::VisiblePosition::previous): Ditto.
1890         (WebCore::VisiblePosition::lastPositionWithSameEditabilityAtOrBefore):
1891         Renamed this function and made it also work with non-editable positions.
1892         (WebCore::VisiblePosition::firstPositionWithSameEditabilityAtOrAfter):
1893         Ditto.
1894         * editing/VisiblePosition.h:
1895         * editing/visible_units.cpp:
1896         (WebCore::endOfWord): Called the renamed function.
1897         (WebCore::previousWordPosition): Ditto.
1898         (WebCore::nextWordPosition): Ditto.
1899         (WebCore::startOfLine): Ditto.
1900         (WebCore::endOfLine): Ditto.
1901         (WebCore::previousSentencePosition): Ditto.
1902         (WebCore::nextSentencePosition): Ditto.
1903
1904 2007-09-07  Brady Eidson  <beidson@apple.com>
1905
1906         Reviewed by Sam
1907
1908         <rdar://problem/5089241> - ASSERT and other funky effects in IconLoader with large 404 pages
1909
1910         There were two problems:
1911         1 - I originally didn't expect SubresourceLoader to keep pulling in data after it received a 404 response,
1912             but if the server sends back a complex 404 page, the loader did just that.  That could result in the 
1913             IconLoader "finishing" twice
1914         2 - In this case, the long messy 404 page would be committed to the database as image data.  This would 
1915             result in wasted space on disk, wasted space in RAM, and wasting processor time trying to parse 50k+
1916             of HTML as image data
1917
1918         Fix is two parts - 1, monitor the "m_loadIsInProgress" flag and 2, make ::finishLoading() take an actual 
1919         SharedBuffer argument that is what should be committed to the database so the ResourceHandle is unnecessary
1920
1921         * loader/icon/IconLoader.cpp:
1922         (WebCore::IconLoader::didReceiveResponse): If the response is not valid, commit null data 
1923         (WebCore::IconLoader::didFail): If we've already finished loading once (the 404 response), don't
1924           finish again!
1925         (WebCore::IconLoader::didFinishLoading): Ditto
1926         (WebCore::IconLoader::finishLoading): Take a SharedBuffer argumnt as the actual data to commit
1927         * loader/icon/IconLoader.h: Add a SharedBuffer arg to ::finishLoading()
1928
1929 2007-09-07  Brady Eidson  <beidson@apple.com>
1930
1931         Reviewed by Darin
1932
1933         Inline the in-header definitions for non-Mac platforms
1934
1935         * platform/AutodrainedPool.h:
1936         (WebCore::AutodrainedPool::AutodrainedPool):
1937         (WebCore::AutodrainedPool::~AutodrainedPool):
1938         (WebCore::AutodrainedPool::cycle):
1939
1940 2007-09-07  Brady Eidson  <beidson@apple.com>
1941
1942         Reviewed by Darin
1943
1944         Add some AutoreleasePool and Threading utilities in preparation for the multi-threaded
1945         fix for <rdar://problem/5434431>
1946
1947         AutodrainedPool wraps an NSAutoreleasePool and tracks a "cycle" count.  This allows clients
1948         in WebCore to simply call ::cycle() and after a preset number of iterations the pool will drain
1949         and recreate the underlying NSAutoreleasePool
1950    
1951         Threading utilities include C++ wrappers for pthread mutexes and conditions, as well as a generic
1952         "callOnMainThread()" function for any non-main thread to use.
1953
1954         * platform/AutodrainedPool.h: Added.  
1955         (WebCore::AutodrainedPool::AutodrainedPool): Empty implementations for all non-mac platforms
1956         (WebCore::AutodrainedPool::~AutodrainedPool): ditto
1957         (WebCore::AutodrainedPool::cycle): ditto
1958         * platform/mac/AutodrainedPool.mm: Added.
1959         (WebCore::AutodrainedPool::AutodrainedPool): 
1960         (WebCore::AutodrainedPool::~AutodrainedPool):
1961         (WebCore::AutodrainedPool::cycle): Keep track of number of cycles, and drain/recreate the pool if the
1962           cycle limit is hit
1963
1964         * platform/Threading.h: Added.
1965         (WebCore::Mutex::Mutex): C++ wrapper for pthread_mutex
1966         (WebCore::Mutex::~Mutex):
1967         (WebCore::Mutex::lock):
1968         (WebCore::Mutex::tryLock):
1969         (WebCore::Mutex::unlock):
1970         (WebCore::MutexLocker::MutexLocker): Handles automatically locking/unlocking a Mutex (for early returns
1971           from a function, for example)
1972         (WebCore::MutexLocker::~MutexLocker):
1973         (WebCore::ThreadCondition::ThreadCondition): C++ wrapper for pthread_condition
1974         (WebCore::ThreadCondition::~ThreadCondition):
1975         (WebCore::ThreadCondition::wait):
1976         (WebCore::ThreadCondition::signal):
1977         (WebCore::ThreadCondition::broadcast):
1978         * platform/mac/Threading.mm: Added.
1979         (-[WebCoreFunctionWrapper initWithFunction:]): Obj-C implementation of "callOnMainThread"
1980         (-[WebCoreFunctionWrapper _call]):
1981         (WebCore::callOnMainThread):
1982
1983 2007-09-07  George Staikos  <staikos@kde.org>
1984
1985         Fix typo.
1986
1987         * loader/ProgressTracker.h:
1988         (WebCore::ProgressTracker::totalPageAndResourceBytesToLoad):
1989
1990 2007-09-07  Qing Zhao  <qing@staikos.net>
1991
1992         Reviewed by Anders and George.
1993
1994         Add accessors for these two variables.
1995
1996         * loader/ProgressTracker.h:
1997         (WebCore::ProgressTracker::totalPageAndResourseBytesToLoad):
1998         (WebCore::ProgressTracker::totalBytesReceived):
1999
2000 2007-09-06  Tristan O'Tierney  <tristan@apple.com>
2001
2002         Reviewed by Maciej Stachowiak.
2003         
2004         <rdar://problem/5333496> Back button stopped working on sfgate.com (14957)
2005         
2006         This fix is specifically targted to address sfgate.com and reuters.com with minimal
2007         impact to other areas of the frameloader.  It does not cause any regression tests to fail.
2008         I've added two layout tests: One to detect this particular bug, and one to address
2009         a secondary issue: if an iframe navigation occurs during onload by a timeout an
2010         additional history item is added, similarly to firefox.  We tried to match firefox
2011         more than IE with this fix but did gain a little bit of IE compatability.
2012
2013         Tests: http/tests/navigation/onload-navigation-iframe-timeout.html
2014                http/tests/navigation/onload-navigation-iframe.html
2015
2016         * dom/Document.h:
2017         (WebCore::Document::processingLoadEvent):
2018         Return the m_processingLoadEvent boolean so FrameLoader knows
2019         that the document is in the middle of calling <body onload>
2020         
2021         * html/HTMLFrameOwnerElement.cpp:
2022         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
2023         * html/HTMLFrameOwnerElement.h:
2024         (WebCore::HTMLFrameOwnerElement::createdByParser):
2025         (WebCore::HTMLFrameOwnerElement::setCreatedByParser):
2026         Added support for a new member variable of frame elements: m_createdByParser.
2027         This lets us specifically target the fix to only iframes created via JS
2028         and not in-document.
2029         
2030         * loader/FrameLoader.cpp:
2031         (WebCore::FrameLoader::FrameLoader):
2032         Initialize m_navigationDuringLoad to false
2033         
2034         (WebCore::FrameLoader::provisionalLoadStarted):
2035         Determine if the load we're about to start is occuring during
2036         an onload.
2037         
2038         (WebCore::FrameLoader::updateHistoryForStandardLoad):
2039         If the current frameloader is for a child frame, and the navigation is occuring
2040         during an onload update the current history item rather than adding a new one.
2041         
2042         * loader/FrameLoader.h:
2043         Added a new member variable, m_navigationDuringLoad to track
2044         the navigation status during the on load, rather than trying to determine
2045         the status after (which is nearly impossible due to a new runloop spin).
2046
2047 2007-09-06  David Kilzer  <ddkilzer@apple.com>
2048
2049         Reviewed by Darin.
2050
2051         The implementation of BackForwardList::clearPageCache() was removed in r21793.
2052         It's now safe to remove it from the header.
2053
2054         * history/BackForwardList.h: Removed clearPageCache().
2055
2056 2007-09-06  Anders Carlsson  <andersca@apple.com>
2057
2058         Reviewed by Ada.
2059
2060         <rdar://problem/5457844>
2061         Crash when using mouse wheel with plug-ins disabled.
2062
2063         Null check the widget.
2064
2065         * page/EventHandler.cpp:
2066         (WebCore::EventHandler::handleWheelEvent):
2067
2068 2007-09-06  Anders Carlsson  <andersca@apple.com>
2069
2070         Reviewed by Mitz.
2071
2072         Small tweak.
2073         
2074         * plugins/win/PluginStreamWin.cpp:
2075         (WebCore::PluginStreamWin::startStream):
2076
2077 2007-09-06  Anders Carlsson  <andersca@apple.com>
2078
2079         Reviewed by Adam and Steve.
2080
2081         <rdar://problem/5459321>
2082         ADOBE: Safari 3 on Windows is passing bogus values in stream->headers in NPP_NewStream, causing Flash Player to crash.
2083         
2084         Serialize the headers into a stream and pass it to NPP_NewStream in stream->headers.
2085         
2086         * plugins/win/PluginStreamWin.cpp:
2087         (WebCore::PluginStreamWin::startStream):
2088         * plugins/win/PluginStreamWin.h:
2089
2090 2007-09-06  Darin Adler  <darin@apple.com>
2091
2092         Reviewed by Hyatt.
2093
2094         - fix http://bugs.webkit.org/show_bug.cgi?id=15153
2095           REGRESSION: Assertion failure in FrameView::scheduleRelayout() (m_frame->view() == this)
2096
2097         Back out the willRemove() part of the previous patch.
2098         It was incorrect and not needed to fix the bug anyway.
2099
2100         * dom/Document.cpp: (WebCore::Document::detach): Remove willRemove().
2101
2102         * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): Put the willRemove() call
2103         back here where it was originally before the previous fix.
2104
2105         * history/CachedPage.cpp: (WebCore::CachedPage::clear):
2106         * page/Frame.cpp:
2107         (WebCore::Frame::setView):
2108         (WebCore::Frame::setDocument):
2109         Added FIXMEs about the fact that we call detach() on the document but not willRemove().
2110
2111 2007-09-05  Timothy Hatcher  <timothy@apple.com>
2112
2113         Reviewed by Darin.
2114
2115         Changed the blocked exception log message to match AppKit's blocked exception message.
2116
2117         * platform/mac/BlockExceptions.mm:
2118         (ReportBlockedObjCException):
2119
2120 2007-09-06  Darin Adler  <darin@apple.com>
2121
2122         Reviewed by Hyatt.
2123
2124         - <rdar://problem/5457865> REGRESSION (9A527): Safari crashes when opening a page
2125           that immediately redirects to a PDF
2126
2127         I don't know how to make an automated test that trips over this.
2128
2129         The immediate cause of this regression was making a back/forward list entry in
2130         this case. Earlier, the quick redirect would not results in a separate entry.
2131         That's possibly a bug too, but it's better to fix the crash first.
2132
2133         The page cache was putting the document into a strange state: Still attached but
2134         with the renderer set to 0. There was no good reason to do this, so got rid of it.
2135         Moved the responsibility to the caller of not calling detach() when moving into
2136         the page cache. This is more of a frame loader thing than a document thing.
2137
2138         * dom/Document.cpp: (WebCore::Document::detach): Added assertions that this is
2139         only called on a document that's attached and not in the page cache. Also moved
2140         the call to willRemove in here, so that callers can't make the mistake of not
2141         calling that function. Removed the incorrectly-positioned code that made this
2142         function do less if it was called on a document in the page cache.
2143
2144         * history/CachedPage.cpp: (WebCore::CachedPage::clear): Removed the code to handle
2145         a document with a renderer of 0. There was no need to put the document into this
2146         state. Any document in the page cache will always be "attached".
2147
2148         * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): Added a check to prevent
2149         from calling an unnecessary cancelParsing() on a document that's in the page cache
2150         and guard the call to detach() with a check of attached(), like all other calls to
2151         detach() on DOM objects.
2152
2153         * page/Frame.cpp:
2154         (WebCore::Frame::setView): Added a missing check of attached(), like all other
2155         calls to detach() on DOM objects. Also added code to not call detach() on the
2156         document when it's in the page cache.
2157         (WebCore::Frame::setDocument): This call site already had the attached() check,
2158         but was missing the page cache check.
2159
2160 2007-09-05  David Harrison  <harrison@apple.com>
2161
2162         Reviewed by Darin.
2163
2164         Follow up on my fix for <rdar://problem/5306171>.
2165         My first patch (r25373) broke svg/custom/stroke-width-click.svg.
2166
2167         * editing/TextIterator.cpp:
2168         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2169         Add currPos.isNotNull() check because positions in non-html content (like svg)
2170         do not have visible positions, and we don't want to emit for them either.
2171
2172 2007-09-06  Mitz Pettel  <mitz@webkit.org>
2173
2174         Reviewed by Adam Roben.
2175
2176         - fix http://bugs.webkit.org/show_bug.cgi?id=14685
2177           <rdar://problem/5349755> text-align affects <select> button but not its drop-down menu
2178
2179         * platform/PlatformString.h:
2180         (WebCore::String::defaultWritingDirection):
2181         * platform/StringImpl.cpp:
2182         (WebCore::StringImpl::defaultWritingDirection): Moved textDirectionForParagraph()
2183         from RenderMenuList.cpp here.
2184         * platform/StringImpl.h:
2185         * platform/win/PopupMenuWin.cpp:
2186         (WebCore::PopupMenu::itemWritingDirectionIsNatural): Changed to return 'true'.
2187         (WebCore::PopupMenu::paint): Changed to use natural directionality for menu
2188         items.
2189         * rendering/RenderMenuList.cpp:
2190         (WebCore::RenderMenuList::adjustInnerStyle): Use defaultWritingDirection.
2191
2192 2007-09-06  Maciej Stachowiak  <mjs@apple.com>
2193
2194         Reviewed by Oliver Hunt.
2195
2196         - fixed <rdar://problem/5455457> REGRESSION (9A527-9A535): Colloquy crash on launch in WebCoreScriptDebugger initWithDelegate (with announce.js plug-in installed)
2197
2198         * page/mac/FrameMac.mm:
2199         (WebCore::Frame::windowScriptObject): Ensure that -[WebView
2200         windowScriptObject] and -[WebFrame windowObject] return null until
2201         the windowScriptObjectAvailable: delegate method is sent.
2202
2203 2007-09-05  David Harrison  <harrison@apple.com>
2204
2205         Reviewed by Kevin Decker.
2206
2207         <rdar://problem/5306171> Mail: The first return after an attachment in multipart/mixed message is lost
2208
2209         Test added: editing/selection/toString-1.html
2210         
2211         Source changes:
2212         * editing/TextIterator.cpp:
2213         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2214         - Remove outdated and erroneous check for m_lastTextNode.
2215         - Fix VisiblePosition check to look for line diff. Simple position diff gives the
2216         wrong answer when the start is table/0 and the current is the first position
2217         inside the content of the table.
2218
2219 2007-09-04  Marvin Decker  <marv.decker@gmail.com>
2220
2221         Reviewed by Maciej Stachowiak.
2222
2223         http://bugs.webkit.org/show_bug.cgi?id=15072
2224         Bug 15072: Fix ImageDecoder.cpp to not copy incoming data
2225
2226         Change ImageDecoder::setData to take a SharedBuffer*.
2227
2228         * platform/graphics/cairo/ImageSourceCairo.cpp:
2229         (WebCore::ImageSource::setData):
2230         * platform/image-decoders/ImageDecoder.h:
2231         (WebCore::RGBA32Buffer::bytes):
2232         (WebCore::RGBA32Buffer::height):
2233         (WebCore::ImageDecoder::setData):
2234         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2235         (WebCore::GIFImageDecoder::setData):
2236         (WebCore::GIFImageDecoder::frameCount):
2237         (WebCore::GIFImageDecoder::decode):
2238         (WebCore::GIFImageDecoder::decodingHalted):
2239         (WebCore::GIFImageDecoder::initFrameBuffer):
2240         * platform/image-decoders/gif/GIFImageDecoder.h:
2241         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2242         (WebCore::JPEGImageDecoder::setData):
2243         (WebCore::JPEGImageDecoder::decode):
2244         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2245         * platform/image-decoders/png/PNGImageDecoder.cpp:
2246         (WebCore::PNGImageDecoder::setData):
2247         (WebCore::PNGImageDecoder::decode):
2248         (WebCore::PNGImageDecoder::headerAvailable):
2249         (WebCore::PNGImageDecoder::rowAvailable):
2250         * platform/image-decoders/png/PNGImageDecoder.h:
2251
2252 2007-09-04  David Hyatt  <hyatt@apple.com>
2253
2254         Fix for <rdar://problem/5271213>, resizing iChat window is slower than in
2255         Tiger. This patch implements a fast scaling mode that can be used by
2256         WebViews, e.g., during window resizing.
2257
2258         Reviewed by John Sullivan
2259
2260         * WebCore.exp:
2261         * WebCore.xcodeproj/project.pbxproj:
2262         * page/Frame.cpp:
2263         (WebCore::FramePrivate::FramePrivate):
2264         * page/Page.cpp:
2265         (WebCore::Page::Page):
2266         (WebCore::Page::inLowQualityImageInterpolationMode):
2267         (WebCore::Page::setInLowQualityImageInterpolationMode):
2268         * page/Page.h:
2269         * platform/graphics/GraphicsContext.cpp:
2270         (WebCore::GraphicsContext::drawImage):
2271         * platform/graphics/GraphicsContext.h:
2272         (WebCore::GraphicsContext::setUseLowQualityImageInterpolation):
2273         (WebCore::GraphicsContext::useLowQualityImageInterpolation):
2274         * platform/graphics/cg/GraphicsContextCG.cpp:
2275         (WebCore::GraphicsContext::setUseLowQualityImageInterpolation):
2276         (WebCore::GraphicsContext::useLowQualityImageInterpolation):
2277         * rendering/RenderImage.cpp:
2278         (WebCore::RenderImage::paint):
2279
2280 2007-09-04  Brady Eidson  <beidson@apple.com>
2281
2282         Reviewed by Adam
2283
2284         Some SQLite tweaks for debugging
2285         -In debug builds, track the thread that opened the database and enforce that any statements
2286          that operate on the SQLDatabase do so from the thread that opened it
2287         -Track whether or not a transaction is in progress for the SQLDatabase to find cases where
2288          someone opens a new transaction while there is still one outstanding (a SQLite logic error)
2289
2290         * loader/icon/SQLDatabase.cpp:
2291         (WebCore::SQLDatabase::SQLDatabase): 
2292         (WebCore::SQLDatabase::open): Track the opening thread.  Also, return false if the DB failed to
2293           open instead of trying to run a PRAGMA on it!
2294         (WebCore::SQLDatabase::close): Reset the opening thread
2295         * loader/icon/SQLDatabase.h:
2296         (WebCore::SQLDatabase::transactionInProgress): 
2297         (WebCore::SQLDatabase::sqlite3Handle): For access to the raw sqlite3* handle to do a thread
2298           safety check
2299
2300         * loader/icon/SQLStatement.cpp:
2301         (WebCore::SQLStatement::prepare): Use the new sqlite3Handle accessor
2302         (WebCore::SQLStatement::step): Ditto
2303
2304         * loader/icon/SQLTransaction.cpp:
2305         (WebCore::SQLTransaction::SQLTransaction): Removed the c'tor form that could automatically
2306           begin the transaction - never used and shouldn't be in practice!
2307         (WebCore::SQLTransaction::begin): Maintain the transaction-in-progress flag on the DB
2308         (WebCore::SQLTransaction::commit): Ditto
2309         (WebCore::SQLTransaction::rollback): Ditto
2310         * loader/icon/SQLTransaction.h:
2311
2312 2007-09-04  David Harrison  <harrison@apple.com>
2313
2314         Reviewed by Maciej and John.
2315
2316         <rdar://problem/5452675> CrashTracer: [USER] 10 crashes in Mail at com.apple.WebCore: WebCore::Node::nodeIndex const + 6
2317
2318         * editing/InsertParagraphSeparatorCommand.cpp:
2319         (WebCore::InsertParagraphSeparatorCommand::doApply):
2320         Adjust pos to pos.downstream() after the refNode is calculated, but before the insertion. Doing it earlier
2321         undid the logic of positionAvoidingSpecialElementBoundary(). The downstream is still needed just to set the
2322         ending selection.
2323
2324 2007-09-04  Antti Koivisto  <antti@apple.com>
2325
2326         Reviewed by Maciej.
2327         
2328         Fix <rdar://problem/5452112>
2329         REGRESSION: Initially focused textfield on www.mac.com login page has no insertion point, and doesn't accept typed characters
2330         
2331         Use updateLayoutIgnorePendingStylesheets() instead of updateLayout(). We need to have rendering to set input focus.
2332
2333         Test: fast/forms/focus-style-pending.html
2334
2335         * dom/Element.cpp:
2336         (WebCore::Element::focus):
2337
2338 2007-09-04  Girish Ramakrishnan  <girish@trolltech.com>
2339
2340         Reviewed by Simon.
2341
2342         Fixed Qt build on Windows
2343
2344         * html/HTMLFormElement.cpp:
2345         (WebCore::pathGetFilename):
2346
2347 2007-09-03  David Harrison  <harrison@apple.com>
2348
2349         Reviewed by Kevin Decker.
2350
2351         <rdar://problem/5456785> REGRESSION (r15963-r15970): Heading text not placed in VoiceOver Item Chooser (15132)
2352
2353         * bridge/mac/WebCoreAXObject.mm:
2354         (-[WebCoreAXObject title]):
2355         For headings, return the text under the element instead of nil.
2356
2357 2007-08-20  Oleg Sukhodolsky <son.two@gmail.com>
2358
2359         Reviewed by Mark.
2360
2361         WebKitQt/WebCoreSupport should not be added to INCLUDEPATH for gdk-port
2362
2363         * WebCore.pro:
2364
2365 2007-09-03  Mark Rowe  <mrowe@apple.com>
2366
2367         Reviewed by Tim Hatcher.
2368
2369         <rdar://problem/5452164> Production build with in symbols directory has no debug info
2370
2371         Enable debug symbol generation on all build configurations.  Production builds are stripped
2372         of symbols by Xcode during deployment post-processing.
2373
2374         * Configurations/Base.xcconfig:
2375         * WebCore.xcodeproj/project.pbxproj:
2376
2377 2007-09-02  Brady Eidson  <beidson@apple.com>
2378
2379         Reviewed by John Sullivan and Mark Rowe
2380
2381         Groundwork for support for monitoring IconDatabase in-memory statistics
2382
2383         * WebCore.exp:
2384         * loader/icon/IconDatabase.cpp:
2385         (WebCore::IconDatabase::pageURLMappingCount): Stub for now
2386         (WebCore::IconDatabase::retainedPageURLCount): Ditto
2387         (WebCore::IconDatabase::iconRecordCount): Ditto
2388         (WebCore::IconDatabase::iconRecordCountWithData): Ditto
2389         * loader/icon/IconDatabase.h:
2390
2391 2007-09-02  Mark Rowe  <mrowe@apple.com>
2392
2393         Reviewed by Antti.
2394
2395         <rdar://problem/5454704> WebKit seems to get too-narrow widths for "Monotype Corsiva", so lays out incorrectly
2396
2397         * platform/mac/FontDataMac.mm:
2398         (WebCore::FontData::determinePitch): Work around NSFont incorrectly reporting Monotype Corsiva as fixed pitch.
2399
2400 2007-09-01  Darin Adler  <darin@apple.com>
2401
2402         - rolled out fix for bug 12988 because it broke getElementById in a layout test
2403           I'm working on a new fix.
2404
2405         * dom/Document.cpp: Rolled out.
2406
2407 2007-09-01  Oliver Hunt  <oliver@apple.com>
2408
2409         Reviewed by Sam.
2410
2411         <rdar://problem/5344848> IME is incorrectly used for key events when on non-editable regions
2412
2413         Adding a new EditorClient method so it is possible to inform WebKit of focus changes.
2414         Also added new virtual method Node::shouldUseInputMethod to allow us to trivially check
2415         whether an input method should be used when processing input for the currently focused
2416         Node.
2417
2418         * bridge/EditorClient.h:
2419         * dom/Node.cpp:
2420         (WebCore::Node::shouldUseInputMethod):
2421         * dom/Node.h:
2422         * html/HTMLInputElement.cpp:
2423         (WebCore::HTMLInputElement::shouldUseInputMethod):
2424         * html/HTMLInputElement.h:
2425         * html/HTMLTextAreaElement.cpp:
2426         (WebCore::HTMLTextAreaElement::shouldUseInputMethod):
2427         * html/HTMLTextAreaElement.h:
2428         * page/FocusController.cpp:
2429         (WebCore::FocusController::setFocusedNode):
2430         * platform/graphics/svg/SVGImageEmptyClients.h:
2431         (WebCore::SVGEmptyEditorClient::setInputMethodState):
2432
2433 2007-09-01  Rob Buis  <buis@kde.org>
2434
2435         Reviewed by Darin.
2436
2437         http://bugs.webkit.org/show_bug.cgi?id=12988
2438         First element (in document order) is not returned when other duplicate ID-ed elements were created first
2439
2440         Reset the element id cache when id's are added or removed and there
2441         are duplicates for that id.
2442
2443         Tests: fast/dom/duplicate-ids-document-order.html
2444
2445         * dom/Document.cpp:
2446         (WebCore::Document::getElementById):
2447         (WebCore::Document::addElementById):
2448         (WebCore::Document::removeElementById):
2449
2450 2007-09-01  Rob Buis  <buis@kde.org>
2451
2452         Reviewed by Darin.
2453
2454         http://bugs.webkit.org/show_bug.cgi?id=15083
2455         Some symbols in WebKit do not need to be exported
2456
2457         Do not export these symbols.
2458
2459         * dom/QualifiedName.cpp:
2460         (WebCore::hashComponents):
2461         * dom/XMLTokenizer.cpp:
2462         (WebCore::toString):
2463         (WebCore::getTokenizer):
2464         * history/HistoryItem.cpp:
2465         (WebCore::defaultNotifyHistoryItemChanged):
2466         * platform/Arena.cpp:
2467         (WebCore::CeilingLog2):
2468         * platform/graphics/Color.cpp:
2469         (WebCore::calcHue):
2470         * platform/graphics/Path.cpp:
2471         (WebCore::pathLengthApplierFunction):
2472         * platform/graphics/cg/PathCG.cpp:
2473         (WebCore::CGPathToCFStringApplierFunction):
2474         (WebCore::CFStringFromCGPath):
2475         * rendering/RenderText.cpp:
2476         (WebCore::isSpaceAccordingToStyle):
2477
2478 2007-08-31  Alice Liu  <alice.liu@apple.com>
2479
2480         Reviewed by Tim Hatcher.
2481
2482         Fixed <rdar://problem/5420682> Mail crashes at WebCore::InsertLineBreakCommand::doApply() after dropping a selected image over container's close box
2483
2484         * editing/DeleteButtonController.cpp:
2485         (WebCore::DeleteButtonController::show):
2486         Factored out the code in ::show() that created and styled the elements of the Deletion UI
2487
2488         (WebCore::DeleteButtonController::createDeletionUI):
2489         Neglecting to move the append of the deletionUI elements into the same clause that handles the creation
2490         of them ended up creating multiple elements at were repeatedly appended to the target, resulting in a 
2491         bloated table deletion UI which was slow to show and hide. 
2492
2493         * editing/DeleteButtonController.h:
2494         (WebCore::DeleteButtonController::enabled):
2495         Restore this function to how it used to be pre-r25305, sans asserts
2496
2497         * editing/EditCommand.cpp:
2498         Add disable/enable sandwich when undoing/redoing commands too
2499         (WebCore::EditCommand::unapply):
2500         (WebCore::EditCommand::reapply):
2501
2502 2007-08-31  Antti Koivisto  <antti@apple.com>
2503
2504         Reviewed by Anders.
2505
2506         Fix <rdar://problem/5452943>
2507         REGRESSION (r25283): Reproducible crash in HTMLObjectElement::getInstance under guard malloc
2508         
2509         Calling updateLayoutIgnorePendingStylesheets() may do arbitrary things to render tree so
2510         no RenderObjects can be cached over it.
2511
2512         * html/HTMLEmbedElement.cpp:
2513         (WebCore::findWidgetRenderer):
2514         (WebCore::HTMLEmbedElement::getInstance):
2515         * html/HTMLObjectElement.cpp:
2516         (WebCore::HTMLObjectElement::getInstance):
2517
2518 2007-08-31  Anders Carlsson  <andersca@apple.com>
2519
2520         Reviewed by Mitz.
2521
2522         <rdar://problem/5443936>
2523         Crash after QT movie completes playback at apple.com/imac
2524         
2525         If the plug-in or one of its children have focus, set it to NULL to prevent the web view window from getting the focus, 
2526         which can cause a layout to happen while in HTMLObjectElement::detach. (This is what we do on the Mac).
2527         
2528         * plugins/win/PluginViewWin.cpp:
2529         (WebCore::PluginViewWin::setParent):
2530
2531 2007-08-30  Adele Peterson  <adele@apple.com>
2532
2533         Reviewed by Justin.
2534
2535         Fix for <rdar://problem/5450600> REGRESSION: can't paste in textfield if its in a body that has user-select:none set (affects widgets)
2536
2537         Test: editing/pasteboard/paste-plaintext-user-select-none.html
2538
2539         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::insertFragmentForTestRendering):
2540           Copy the user-select style from the current selection node and apply it so it is considered during the test rendering.
2541           This is important since we recently changed user-select to be inherited.  When we consider valid VisiblePositions for the test rendering,
2542           we need to have the correct user-select value that will actually be used for the real insertion.
2543
2544 2007-08-31  Anders Carlsson  <andersca@apple.com>
2545
2546         Reviewed by Oliver.
2547
2548         <rdar://problem/5423939>
2549         http://bugs.webkit.org/show_bug.cgi?id=15013
2550         ASSERTION FAILED !m_inDestructor in WebCore::Shared<WebCore::PluginStreamWin>::ref() on Windows
2551         
2552         Protect the stream in case it's destroyed by the plug-in.
2553         
2554         * plugins/win/PluginStreamWin.cpp:
2555         (WebCore::PluginStreamWin::didReceiveData):
2556
2557 a2007-08-31  Darin Adler  <darin@apple.com>
2558
2559         Reviewed by Anders.
2560
2561         - http://bugs.webkit.org/show_bug.cgi?id=15122
2562
2563         * editing/htmlediting.cpp: (WebCore::avoidIntersectionWithNode):
2564         Change assertion so that it only fires when actually modifying the selection.
2565         This isn't nearly as helpful, because the old assertion could catch potential
2566         problems in more cases, but it's not obvious how to do better.
2567
2568 2007-08-30  Oliver Hunt  <oliver@apple.com>
2569
2570         Reviewed by Adam.
2571         
2572         <rdar://problem/5430772> REGRESSION(303-310A5) list items do not show with mouse over on istweb.apple.com/quack.apple.com
2573         
2574         VC++ treats bitfields as signed members, so Node::m_styleChange would be
2575         sign extended if it was assigned the value FullStyleChange.  This caused
2576         style recalculation to stop propagating.  
2577         
2578         We work around this VC++ oddity by storing the enum as an unsigned, and
2579         casting back to StyleChangeType in the getter.
2580                 
2581         Test: fast/css/hover-affects-child.html
2582
2583         * dom/Node.h:
2584         (WebCore::Node::styleChangeType):
2585
2586 2007-08-29  Justin Garcia  <justin.garcia@apple.com>
2587
2588         Reviewed by Darin.
2589
2590         <rdar://problem/5368833> 
2591         REGRESSION: Pasting a triple-clicked line of quoted text at the top of a message adds an extra, quoted line
2592
2593         * editing/CompositeEditCommand.cpp:
2594         (WebCore::CompositeEditCommand::insertParagraphSeparator): Added an option for
2595         using a plain div to hold the new paragraph, instead of a clone of the previous
2596         block.
2597         * editing/CompositeEditCommand.h:
2598         * editing/InsertParagraphSeparatorCommand.cpp: Ditto.
2599         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Ditto.
2600         (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
2601         * editing/InsertParagraphSeparatorCommand.h:
2602         * editing/ReplaceSelectionCommand.cpp:
2603         (WebCore::ReplaceSelectionCommand::doApply): Use a default block element when creating
2604         new paragraphs, so that empty paragraphs don't contain the block style of the previous
2605         one.
2606         Don't expand collapsed brs at the end of inserted content, this was the root of the bug.
2607         We'd copy <blockquote>hello<br></blockquote><br class="Apple-interchange-newline">
2608         and get an extra paragraph.  The removed code used to make sure that if the copied 
2609         selection ends with a paragraph break that is represented in the copied markup by a 
2610         regular br (not an interchange newline br), that that paragraph break appears in the 
2611         pasted content, but shouldMergeEnd, which was introduced after this code was written, 
2612         now takes care of that.
2613         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Inserted content should always
2614         displace placeholder brs, even if that inserted content ends with a br.
2615         * editing/markup.cpp:
2616         (WebCore::needInterchangeNewlineAfter): This code failed to add an interchange newline
2617         if the user copied <div>hello</div><br>, only don't add an interchange newline when
2618         copying ^hello<br>^<br>, because then the copied paragraph break will already be 
2619         represented in the copied markup by a br.
2620         (WebCore::createMarkup):
2621
2622 2007-08-30  David Harrison  <harrison@apple.com>
2623
2624         Reviewed by Darin.
2625
2626         <rdar://problem/5423900> Seed: safari crashes on submit feedback page in -[WebCoreAXObject isAttachment]
2627
2628         * bridge/mac/WebCoreAXObject.mm:
2629         (-[WebCoreAXObject isAttachment]):
2630         Add nil check since element could be detached.
2631
2632 2007-08-30  Mitz Pettel  <mitz@webkit.org>
2633
2634         Reviewed by Dave Hyatt.
2635
2636         - fix http://bugs.webkit.org/show_bug.cgi?id=13282
2637           <rdar://problem/5126392> REGRESSION (NativePopUp): Rightmost character cut off in pop-up menu
2638
2639         * rendering/RenderMenuList.cpp:
2640         (WebCore::RenderMenuList::updateOptionsWidth): When measuring option text, use
2641         the same WebCore run rounding behavior that is used to draw it in the popup button.
2642
2643 2007-08-30  Riku Voipio  <riku.voipio@iki.fi>
2644
2645         Reviewed by Dave Kilzer.
2646
2647         Better ARM defines.
2648
2649         * platform/DeprecatedString.h: Update comments to reflect the
2650         change and update test to fit changes to Platform.h.
2651
2652 2007-08-30  Darin Adler  <darin@apple.com>
2653
2654         Reviewed by Tim Hatcher.
2655
2656         - fix http://bugs.webkig.org/show_bug.cgi?id=14981
2657           DEBUG builds of WebKit hang videwing Yahoo! Mail messages
2658           with ~5 MB text attachment
2659
2660         * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::checkConsistency):
2661         * rendering/RenderFlow.cpp: (WebCore::RenderFlow::checkConsistency):
2662         * rendering/RenderText.cpp: (WebCore::RenderText::checkConsistency):
2663         Put the actual consistency check inside an ifdef. If you need it you can
2664         turn it on. There's still some function call overhead in builds that don't
2665         have NDEBUG defined, but that's worth it so we can turn this on and off
2666         without recompiling the world.
2667
2668         - small code style improvement to recently changed function
2669
2670         * editing/TextIterator.cpp: (WebCore::plainTextToMallocAllocatedBuffer):
2671         Use a typedef and make_pair to make the code dealing with the pair simpler to read.
2672
2673 2007-08-30  Simon Hausmann  <hausmann@kde.org>
2674
2675         Reviewed by Zack.
2676
2677         Fix Qt/Gdk build. gcc on Linux at least doesn't like initializing
2678         variables between jumps with goto ("jump to label foo crosses
2679         initialization of bar").
2680
2681         * editing/TextIterator.cpp:
2682         (WebCore::plainTextToMallocAllocatedBuffer):
2683
2684 2007-08-30  Darin Adler  <darin@apple.com>
2685
2686         Reviewed by Antti.
2687  
2688         - fix <rdar://problem/5423270> CrashTracer: [USER] 1 crash in Safari at com.apple.WebCore:
2689           WebCore::plainTextToMallocAllocatedBuffer + 762
2690
2691         * editing/TextIterator.cpp: (WebCore::plainTextToMallocAllocatedBuffer):
2692         Check for a malloc failure and exit the function if it failed.
2693
2694 2007-08-29  Anders Carlsson  <andersca@apple.com>
2695
2696         Reviewed by Oliver.
2697
2698         <rdar://problem/5404329>
2699         Plugin content starves WM_TIMER events on UI thread (affects idle behavior of app) on http://www.vincent-vella.com/, http://www.sagmeister.com/
2700         
2701         Add a tiny delay to invalidation timer to prevent it from starving other timers.
2702         
2703         * plugins/win/PluginViewWin.cpp:
2704         (WebCore::PluginViewWin::invalidateRect):
2705
2706 2007-08-29  Darin Adler  <darin@apple.com>
2707
2708         Reviewed by Adele.
2709
2710         * editing/htmlediting.cpp: (WebCore::avoidIntersectionWithNode):
2711         Fix an assert that was firing for me all the time when doing editing operations.
2712
2713 2007-08-29  Anders Carlsson <andersca@apple.com>
2714
2715         Reviewed by Adam.
2716
2717         <rdar://problem/5386098>
2718         Repro hang with some Flash plugin content (http://dougmccune.com/blog/2007/07/25/coming-to-flexcamp-at-adobe/)
2719         
2720         In some cases, Flash ends up starving the main loop by sending a lot of WM_USER + 1 messages. Throttle these
2721         messages so they won't end up hanging the web browser.
2722         
2723         * plugins/win/PluginViewWin.cpp:
2724         (WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin):
2725         (WebCore::PluginMessageThrottlerWin::~PluginMessageThrottlerWin):
2726         (WebCore::PluginMessageThrottlerWin::appendMessage):
2727         (WebCore::PluginMessageThrottlerWin::messageThrottleTimerFired):
2728         (WebCore::PluginMessageThrottlerWin::allocateMessage):
2729         (WebCore::PluginMessageThrottlerWin::isInlineMessage):
2730         (WebCore::PluginMessageThrottlerWin::freeMessage):
2731         (WebCore::PluginViewWndProc):
2732         (WebCore::PluginViewWin::wndProc):
2733         (WebCore::PluginViewWin::determineQuirks):
2734         * plugins/win/PluginViewWin.h:
2735         (WebCore::):
2736         (WebCore::PluginViewWin::pluginWndProc):
2737
2738 2007-08-29  Beth Dakin  <bdakin@apple.com>
2739
2740         Reviewed by Hyatt.
2741
2742         Fix for <rdar://problem/5436800> REGRESSION: PLT is 1.5% slower due 
2743         to r24593 and r25098
2744
2745         In r25098, we only called setCreatedByParser for XML! This patch 
2746         calls it for HTML too, and takes care of the performance 
2747         regression.
2748
2749         * html/HTMLElementFactory.cpp:
2750         (WebCore::styleConstructor):
2751
2752 2007-08-29  Antti Koivisto  <antti@apple.com>
2753
2754         Reviewed by Mitz.
2755         
2756         Fix <rdar://problem/5425951>
2757         REGRESSION: change to updateLayoutIgnorePendingStylesheets causes SAP Portal page to render wrong
2758         
2759         If new nodes have been added or style recalc has been done with style sheets still pending, some nodes 
2760         may not have had their real style calculated yet. Normally this state gets cleaned when style sheets arrive 
2761         but in updateLayoutIgnorePendingStylesheets() we need to do full style recalc to get up-to-date style immediatly.
2762         
2763         Added a document flag to track if there are any nodes that did not have their real style calculated due to
2764         pending stylesheets.
2765
2766         Test: fast/dynamic/style-access-late-stylesheet-load.html
2767
2768         * css/CSSStyleSelector.cpp:
2769         (WebCore::CSSStyleSelector::styleForElement):
2770         * dom/Document.cpp:
2771         (WebCore::Document::Document):
2772         (WebCore::Document::recalcStyle):
2773         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2774         * dom/Document.h:
2775         (WebCore::Document::setHasNodesWithPlaceholderStyle):
2776
2777 2007-08-29  Alice Liu  <alice.liu@apple.com>
2778
2779         Reviewed by Maciej.
2780
2781         We disable the DeleteButton UI before applying any editing commands.
2782         This patch simply moves those disable/enable calls to a more correct place, closer to the actual application of the editing command. 
2783
2784         * editing/EditCommand.cpp:
2785         (WebCore::EditCommand::apply):
2786         (WebCore::applyCommand):
2787
2788 2007-08-28  Alice Liu  <alice.liu@apple.com>
2789
2790         fixed <rdar://problem/5420682> Mail crashes at WebCore::InsertLineBreakCommand::doApply() 
2791                                        after dropping a selected image over container's close box
2792
2793         Reviewed by Darin and Maciej.
2794
2795         * editing/DeleteButtonController.cpp:
2796         (WebCore::DeleteButtonController::show):
2797         (WebCore::DeleteButtonController::hide):
2798         * editing/DeleteButtonController.h:
2799         (WebCore::DeleteButtonController::enabled):
2800         General changes made to DeleteButtonController: when hiding, it's not necessary to clear out 
2801         the m_containerElement and m_target, especially since to fix this bug we need to keep 
2802         their values around.  It's sufficient to just detach the container from target.
2803
2804         * editing/EditCommand.cpp:
2805         (WebCore::EditCommand::EditCommand):
2806         Move the selection out of the deletion UI since we don't want to expose the deletion UI to any editing.
2807
2808         * editing/Editor.cpp:
2809         (WebCore::Editor::rangeForPoint):
2810         Move the range out of the deletion UI since we don't want to expose the deletion UI to any editing.
2811
2812         * editing/htmlediting.cpp:
2813         * editing/htmlediting.h:
2814         (WebCore::avoidIntersectionWithNode):
2815         Moved function that operates on Range from markup.cpp to here
2816         Added new implementation for function that operates on Selection
2817
2818         * editing/markup.cpp:
2819         (WebCore::createMarkup):
2820         Moved function out of this file to htmlediting.cpp, and renamed to avoidIntersectionWithNode
2821
2822 2007-08-29  David Hyatt  <hyatt@apple.com>
2823
2824         Fix for 5441281, remove our dependency on cursor rects and drag margins
2825         in AppKit for a large performance boost on the PLT and iBench.
2826
2827         Reviewed by darin
2828
2829         * platform/mac/WidgetMac.mm:
2830         (WebCore::safeRemoveFromSuperview):
2831         (WebCore::Widget::addToSuperview):
2832         Suppress the resetting of drag margins when views are added and removed.
2833
2834         (WebCore::Widget::setCursor):
2835         Just use NSCursor's set method to immediately set the cursor.  We no longer
2836         rely on NSScrollView/NSClipView setDocumentCursor, since that is implemented
2837         using cursor rects.
2838
2839 2007-08-29  Rick  <rick@writhe.org.uk>
2840
2841         Reviewed by Tim Hatcher.
2842
2843         Fix http://bugs.webkit.org/show_bug.cgi?id=14853
2844         Bug 14853: Incorrect implementation of ArrayImpl's equality operator
2845
2846         * platform/ArrayImpl.cpp:
2847         (WebCore::ArrayImpl::operator==):
2848         Fixed typo so that correct variable is used in equality comparison.
2849
2850 2007-08-29  Peter Kasting  <zerodpx@gmail.com>
2851
2852         Reviewed by Maciej.
2853
2854         - fix http://bugs.webkit.org/show_bug.cgi?id=15096
2855         Move the GIF frame duration minimum check into the various
2856         ImageSource*.cpp backends and use the same values as
2857         ImageSourceCG.cpp.
2858
2859         * platform/graphics/cairo/ImageSourceCairo.cpp:
2860         (WebCore::ImageSource::frameDurationAtIndex):
2861         * platform/graphics/qt/ImageSourceQt.cpp:
2862         (WebCore::ImageSource::frameDurationAtIndex):
2863         * platform/image-decoders/gif/GIFImageReader.cpp:
2864         (GIFImageReader::read):
2865
2866 2007-08-29  Peter Kasting  <zerodpx@gmail.com>
2867
2868         Reviewed by Maciej.
2869
2870         - fix http://bugs.webkit.org/show_bug.cgi?id=15097
2871         Make PNGImageDecoder.cpp size its frame buffer vector in its
2872         constructor, so it never throws decoded image data away no matter
2873         what order its functions are called in.
2874
2875         * platform/image-decoders/png/PNGImageDecoder.cpp:
2876         (WebCore::PNGImageDecoder::PNGImageDecoder):
2877         (WebCore::PNGImageDecoder::frameBufferAtIndex):
2878         (WebCore::PNGImageDecoder::decode):
2879         (WebCore::PNGImageDecoder::rowAvailable):
2880         (WebCore::PNGImageDecoder::pngComplete):
2881
2882 2007-08-29  Peter Kasting  <zerodpx@gmail.com>
2883
2884         Reviewed by Maciej.
2885
2886         - fix http://bugs.webkit.org/show_bug.cgi?id=15104
2887         Don't double-compensate for sizeof(unsigned) when making a buffer
2888         overflow check in the GIF decoder.  Now interlaced GIFs don't
2889         sometimes get nothing/garbage in some of the bottom rows.
2890
2891         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2892         (WebCore::GIFImageDecoder::haveDecodedRow):
2893
2894 2007-08-28  Sam Weinig  <sam@webkit.org>
2895
2896         Reviewed by Darin.
2897
2898         Update fix landed in r25249 to account for XMLHttpRequest, which can also be EventTargets.
2899
2900         Tests: http/tests/security/listener/xss-XMLHttpRequest-addEventListener.html
2901                http/tests/security/listener/xss-XMLHttpRequest-shortcut.html
2902
2903         * bindings/js/JSXMLHttpRequest.cpp:
2904         (KJS::JSXMLHttpRequest::putValueProperty): Use the Window object associated with document's frame, not the active Window.
2905         (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction): ditto
2906         * xml/XMLHttpRequest.h:
2907         (WebCore::XMLHttpRequest::document): Expose Document member so bindings can access the correct frame.
2908
2909 2007-08-28  Anders Carlsson  <andersca@apple.com>
2910
2911         Reviewed by Darin.
2912
2913         <rdar://problem/5424866> Bottom portion of any Web Clip widget appears transparent
2914
2915         Restore the previous behavior, creating plug-ins on attach, for WebKit plug-ins. Netscape plug-ins
2916         are still created during the first layout.
2917         
2918         * html/HTMLEmbedElement.cpp:
2919         (WebCore::HTMLEmbedElement::getInstance):
2920         Only call layout if the renderer doesn't have a widget.
2921         
2922         * html/HTMLObjectElement.cpp:
2923         (WebCore::HTMLObjectElement::getInstance):
2924         Likewise.
2925         
2926         * loader/FrameLoader.cpp:
2927         (WebCore::FrameLoader::shouldUsePlugin):
2928         Update for enum change.
2929         
2930         * loader/FrameLoaderTypes.h:
2931         Add ObjectContentNetscapePlugin and ObjectContentOtherPlugin.
2932         
2933         * page/mac/WebCoreFrameBridge.h:
2934         Get rid of the enum here, we can use the one in FrameLoaderTypes.h
2935         
2936         * rendering/RenderPartObject.cpp:
2937         (WebCore::RenderPartObject::updateWidget):
2938         Only create the plug-in if it's not a Netscape plug-in.
2939         
2940         (WebCore::RenderPartObject::layout):
2941         Fix indentation.
2942         
2943 2007-08-28  David Harrison  <harrison@apple.com>
2944
2945         Reviewed by Darin.
2946
2947         <rdar://problem/5415006> Command Left in a To Do causes caret to disappear
2948
2949         The selection was ending up inside non-editable content at the To Do Options
2950         arrow image, rather then at the editable position just to the left of that image.
2951         The problem was that startPositionForLine looked only at line boxes, and there
2952         is no linebox for the editable position at the far left of a To Do, which is
2953         a table. Addressed by having startPositionForLine use table offset 0 instead
2954         of the first VisiblePosition inside the table.
2955         
2956         Found and fixed the similar case with option-left (move by word position).
2957         
2958         Test cases:
2959         * editing/selection/mixed-editability-8.html: Added.
2960         * editing/selection/mixed-editability-9.html: Added.
2961
2962         Source changes:
2963         * editing/SelectionController.cpp:
2964         (WebCore::SelectionController::modifyMovingLeftBackward):
2965         
2966         * editing/VisiblePosition.cpp:
2967         (WebCore::VisiblePosition::next):
2968         (WebCore::VisiblePosition::previous):
2969         (WebCore::VisiblePosition::stayInEditableContentLeft):
2970         (WebCore::VisiblePosition::stayInEditableContentRight):
2971         Factored stayInEditableContentLeft() and stayInEditableContentRight()
2972         out of previous() and next().
2973         
2974         * editing/VisiblePosition.h:
2975         Declare stayInEditableContentLeft() and stayInEditableContentRight().
2976
2977         * editing/visible_units.cpp:
2978         (WebCore::previousWordPosition):
2979         (WebCore::nextWordPosition):
2980         (WebCore::startOfLine):
2981         (WebCore::endOfLine):
2982         (WebCore::previousSentencePosition):
2983         (WebCore::nextSentencePosition):
2984         Call stayInEditableContentLeft() or stayInEditableContentRight(), as 
2985         appropriate, so prevent crossing from editable content into
2986         uneditable content.
2987         
2988         (WebCore::startPositionForLine):
2989         Use table offset 0 instead of the first VisiblePosition in the table.
2990         
2991 2007-08-28  Mark Rowe  <mrowe@apple.com>
2992
2993         Reviewed by Darin Adler.
2994
2995         <rdar://problem/5443453> Decreasing history expiration time from 1 year to 1 week can lead to long hang while icon database syncs
2996
2997         Perform the sync inside a SQLite transaction.  This drops the time taken for the sync from over 90s to under half a second in the
2998         extreme case of over 90,000 URLs being pruned.
2999
3000         * loader/icon/IconDatabase.cpp:
3001         (WebCore::IconDatabase::syncDatabase):
3002
3003 2007-08-28  Mark Rowe  <mrowe@apple.com>
3004
3005         Reviewed by Darin Adler.
3006
3007         <rdar://problem/5437983> Loading history containing 100,000 entries adds 20s to Safari's startup
3008
3009         Add a new constructor for HistoryItem that initializes the alternate title.  This prevents WebHistoryItem
3010         in WebKit from having explicitly set the display title, which triggers a history item changed notification
3011         to be posted, for each history item loaded.
3012
3013         * WebCore.exp:
3014         * history/HistoryItem.cpp:
3015         (WebCore::HistoryItem::HistoryItem):
3016         * history/HistoryItem.h:
3017
3018 2007-08-28  Anders Carlsson  <andersca@apple.com>
3019
3020         Reviewed by Darin.
3021
3022         <rdar://problem/5298296> XMLHttpRequest readyState 3 & responseText buffer issues
3023         
3024         Add a shouldContentSniff flag to ResourceLoader and ResourceHandle and have XMLHttpRequest 
3025         pass in false when creating its subresource loader.
3026         
3027         * WebCore.exp:
3028         * loader/MainResourceLoader.cpp:
3029         (WebCore::MainResourceLoader::MainResourceLoader):
3030         (WebCore::MainResourceLoader::loadNow):
3031         * loader/ResourceLoader.cpp:
3032         (WebCore::ResourceLoader::ResourceLoader):
3033         (WebCore::ResourceLoader::load):
3034         * loader/ResourceLoader.h:
3035         * loader/SubresourceLoader.cpp:
3036         (WebCore::SubresourceLoader::SubresourceLoader):
3037         (WebCore::SubresourceLoader::create):
3038         * loader/SubresourceLoader.h:
3039         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
3040         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
3041         * platform/mac/WebCoreSystemInterface.h:
3042         * platform/mac/WebCoreSystemInterface.mm:
3043         * platform/network/ResourceHandle.cpp:
3044         (WebCore::ResourceHandle::ResourceHandle):
3045         (WebCore::ResourceHandle::create):
3046         * platform/network/ResourceHandle.h:
3047         * platform/network/ResourceHandleInternal.h:
3048         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3049         * platform/network/mac/ResourceHandleMac.mm:
3050         (WebCore::ResourceHandle::start):
3051         * xml/XMLHttpRequest.cpp:
3052         (WebCore::XMLHttpRequest::send):
3053
3054 2007-08-27  Steve Falkenburg  <sfalken@apple.com>
3055
3056         Added getter for committedFirstRealDocumentLoad.
3057         
3058         Reviewed by Maciej.
3059
3060         * loader/FrameLoader.h: Added committedFirstRealDocumentLoad.
3061         (WebCore::FrameLoader::committedFirstRealDocumentLoad): Added.
3062
3063 2007-08-27  Antti Koivisto  <antti@apple.com>
3064
3065         Reviewed by Maciej.
3066         
3067         Fix <rdar://problem/5433144>
3068         REGRESSION: Unable to click "Select" link at Expedia for car rentals
3069         
3070         javascript: URLs need special handling when serializing. Escaping them like
3071         normal attribute values can do bad things. Try hard to not escape anything,
3072         escape quote characters only if really necessary. Try to match Firefox.
3073
3074         Test: fast/innerHTML/javascript-url.html
3075
3076         * editing/markup.cpp:
3077         (WebCore::urlAttributeToQuotedString):
3078         (WebCore::startMarkup):
3079
3080 2007-08-27  David Hyatt  <hyatt@apple.com>
3081
3082         Fix for 5441224, micro-optimizations to improve the PLT by 1%.
3083
3084         Reviewed by Darin
3085
3086         * css/CSSStyleSelector.cpp:
3087         (WebCore::CSSStyleSelector::canShareStyleWithElement):
3088         * platform/mac/FontMac.mm:
3089         (WebCore::Font::drawGlyphs):
3090         * rendering/RenderInline.cpp:
3091         (WebCore::RenderInline::requiresLayer):
3092         * rendering/RenderObject.cpp:
3093         (WebCore::RenderObject::isBody):
3094         * rendering/RenderObject.h:
3095         (WebCore::RenderObject::renderArena):
3096         (WebCore::RenderObject::isRoot):
3097
3098 2007-08-27  Mitz Pettel  <mitz@webkit.org>
3099
3100         Reviewed by Darin.
3101
3102         - fix http://bugs.webkit.org/show_bug.cgi?id=15091
3103           Crash in RenderBlock::skipWhitespace during layout <rdar://problem/5439631> 
3104
3105         Test: fast/replaced/applet-disabled-positioned.html
3106
3107         * html/HTMLAppletElement.cpp:
3108         (WebCore::HTMLAppletElement::createRenderer): Changed to call
3109         RenderObject::createObject(), which accounts for style.
3110
3111 2007-08-26  Antti Koivisto  <antti@apple.com>
3112
3113         Reviewed by Darin.
3114         
3115         Fix for <rdar://problem/5433726>
3116         Mail crash at WebCore::Frame::styleForSelectionStart() when deleting a selection in a HTML message (http://www.yahoo.com/)
3117
3118         Test: editing/style/temporary-span-crash.html
3119
3120         * page/Frame.cpp:
3121         (WebCore::Frame::styleForSelectionStart):
3122         Temporary span created here might not have renderer if document has style sheet that makes it display:none.
3123         Set display:inline explicitly in spans style attribute. This temporary span does not need to get its display 
3124         value from actual document style sheets. Null check the renderer too to be sure.
3125
3126
3127 2007-08-24  Sam Weinig  <sam@webkit.org>
3128
3129         Reviewed by Adele.
3130
3131         Fix for <rdar://problem/5426142>
3132
3133         Use the EventTarget's frame when creating the EventListener.
3134
3135         Tests: http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener.html
3136                http/tests/security/listener/xss-JSTargetNode-onclick-shortcut.html
3137                http/tests/security/listener/xss-window-onclick-addEventListener.html
3138                http/tests/security/listener/xss-window-onclick-shortcut.html
3139
3140         * bindings/js/JSEventTargetNode.cpp:
3141         (WebCore::JSEventTargetNode::setListener):
3142         (WebCore::JSEventTargetNodePrototypeFunction::callAsFunction):
3143         * bindings/js/kjs_window.cpp:
3144         (KJS::WindowFunc::callAsFunction):
3145
3146 2007-08-25  Mitz Pettel  <mitz@webkit.org>
3147
3148         Reviewed by Sam Weinig.
3149
3150         - fix http://bugs.webkit.org/show_bug.cgi?id=15077
3151           REGRESSION: Cannot drag selected text out of a background window
3152
3153         * manual-tests/drag-out-of-background-window.html: Added.
3154         * page/EventHandler.cpp:
3155         (WebCore::EventHandler::eventMayStartDrag): Added missing coordinate
3156         conversion.
3157
3158 2007-08-25  Rob Buis  <buis@kde.org>
3159
3160         Reviewed by Darin.
3161
3162         http://bugs.webkit.org/show_bug.cgi?id=14848
3163         DOM table rules are not updated when changed
3164
3165         On a dynamic rules attr change, mark the table cells and
3166         their ancestors (up to and including the table tag) as
3167         changed.
3168
3169         Tests: fast/table/rules-attr-dynchange1.html
3170                fast/table/rules-attr-dynchange2.html
3171
3172         * html/HTMLTableElement.cpp:
3173         (WebCore::isTableCellAncestor):
3174         (WebCore::setTableCellsChanged):
3175         (WebCore::HTMLTableElement::parseMappedAttribute):
3176
3177 2007-08-25  Adele Peterson  <adele@apple.com>
3178
3179         Reviewed by Mitz.
3180
3181         Fix for http://bugs.webkit.org/show_bug.cgi?id=15073
3182         <rdar://problem/5426557> REGRESSION: Can no longer drag text from textareas
3183         
3184         Test: fast/forms/drag-out-of-textarea.html
3185
3186         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
3187           Only restricts hit testing if the placeholder text is visible.
3188         * rendering/RenderTextControl.h: (WebCore::RenderTextControl::placeholderIsVisible): Added. 
3189
3190 2007-08-25  Peter Kasting <zerodpx@gmail.org>
3191
3192         Reviewed by Sam Weinig.
3193
3194         Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
3195         Eliminate all remaining implicit conversions of wtf::Vector<T> to T*.  Where code was
3196         previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
3197         instead.
3198
3199         * bindings/js/kjs_navigator.cpp:
3200         (KJS::PluginBase::cachePluginDataIfNecessary):
3201         * loader/mac/LoaderNSURLExtras.m:
3202         (suggestedFilenameWithMIMEType):
3203         * page/FrameView.cpp:
3204         (WebCore::FrameView::~FrameView):
3205         (WebCore::FrameView::pauseScheduledEvents):
3206         (WebCore::FrameView::resumeScheduledEvents):
3207         (WebCore::FrameView::dispatchScheduledEvents):
3208         * platform/mac/PlugInInfoStoreMac.mm:
3209         (WebCore::PlugInInfoStore::createPluginInfoForPluginAtIndex):
3210
3211 2007-08-25  Mitz Pettel  <mitz@webkit.org>
3212
3213         Rubber-stamped by Adam Roben
3214
3215         - remove unused file
3216
3217         * platform/win/MouseEventWin.cpp: Removed.
3218
3219 2007-08-25  Jasper Bryant-Greene  <m@ni.ac.nz>
3220
3221         Reviewed by Oliver Hunt.
3222
3223         Set paintingDisabled to true in Cairo's GraphicsContext constructor
3224         when passed a null PlatformGraphicsContext.
3225
3226         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3227         (WebCore::GraphicsContext::GraphicsContext):
3228
3229 2007-08-25  Mitz Pettel  <mitz@webkit.org>
3230
3231         Reviewed by Dave Hyatt.
3232
3233         - fix http://bugs.webkit.org/show_bug.cgi?id=15056
3234           REGRESSION (r21472): Digg Podcasts Episodes Render "Digg" counter incorrectly
3235
3236         Covered by fast/parser/residual-style-close-across-n-blocks.html
3237
3238         * html/HTMLParser.cpp:
3239         (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): If the
3240         residual style was closed before anything else in the block (so it does
3241         not apply to anything inside the block) avoid creating an empty element for
3242         it inside the block.
3243
3244 2007-08-25  Mitz Pettel  <mitz@webkit.org>
3245
3246         Reviewed by Dave Hyatt.
3247
3248         - fix http://bugs.webkit.org/show_bug.cgi?id=14972
3249           Moving cursor down in contentEditable section fails if styled line-height:1em
3250
3251         Test: editing/selection/move-by-line-003.html
3252
3253         * rendering/RenderText.cpp:
3254         (WebCore::RenderText::positionForCoordinates): Changed hit testing so that each
3255         line is tested for hits between its overflow top and the next line's overflow top.
3256         This matches RenderBlock::positionForCoordinates.
3257
3258 2007-08-25  Mitz Pettel  <mitz@webkit.org>
3259
3260         Reviewed by Justin.
3261
3262         - fix http://bugs.webkit.org/show_bug.cgi?id=14792
3263           <rdar://problem/5367763> REGRESSION: Copy inserts carriage return in middle of selection
3264
3265         Test: editing/pasteboard/newlines-around-floating-or-positioned.html
3266
3267         * editing/TextIterator.cpp:
3268         (WebCore::shouldEmitNewlinesBeforeAndAfterNode): Do not emit newlines around
3269         floating or positioned blocks. This behavior seems to match WinIE's.
3270
3271 2007-08-23  Justin Garcia  <justin.garcia@apple.com>
3272
3273         Reviewed by Darin.
3274         
3275         <rdar://problem/5432254> GoogleDocs: A hang occurs when applying list style to selected table
3276         
3277         * editing/DeleteSelectionCommand.cpp:
3278         (WebCore::DeleteSelectionCommand::handleGeneralDelete): If the position
3279         that marked the start of the range to delete has been removed from the
3280         document, and it was inside the node that holds the position that marks
3281         the end of the range to delete, don't remove any children of that node,
3282         because we don't know how many to remove.  For example, if the end is
3283         [a, 5] and the start was in some descendant of a and was removed, don't
3284         remove any of the children of a.  We will now refuse to remove some content
3285         incorrectly, but that's less dangerous than removing content incorrectly.
3286         Long term we need to update these positions as we remove content from the 
3287         document, but that seems like a more risky change.  Added a testcase.
3288         * editing/InsertListCommand.cpp:
3289         (WebCore::InsertListCommand::modifyRange): If the end of the selection to 
3290         modify is just after a table, and if the start of the selection is inside 
3291         that table, the last paragraph that we'll want modify is the last one inside 
3292         the table, not the paragraph that contains the table itself. Adjust 
3293         startOfLastParagraph here to avoid infinite recursion.
3294
3295 2007-08-24  Anders Carlsson  <andersca@apple.com>
3296
3297         Reviewed by Geoff.
3298
3299         <rdar://problem/5430165>
3300         REGRESSION: Dynamically loaded images fail to load
3301
3302         * html/HTMLImageLoader.cpp:
3303         (WebCore::HTMLImageLoader::HTMLImageLoader):
3304         Initialize the m_elementIsProtected member.
3305
3306         (WebCore::HTMLImageLoader::~HTMLImageLoader):
3307         Assert that the element is not protected.
3308         
3309         (WebCore::HTMLImageLoader::setLoadingImage):
3310         If the image is not null, protect the element. Otherwise, unprotect it.
3311         
3312         (WebCore::HTMLImageLoader::dispatchLoadEvent):
3313         Unprotect the element here.
3314
3315         (WebCore::HTMLImageLoader::protectElement):
3316         (WebCore::HTMLImageLoader::unprotectElement):
3317         New methods which protect and unprotect the element.
3318         
3319         * html/HTMLImageLoader.h:
3320
3321 2007-08-24  Kevin McCullough  <kmccullough@apple.com>
3322
3323         - Updated ChangeLog
3324
3325 2007-08-24  Beth Dakin  <bdakin@apple.com>
3326
3327         Reviewed by Hyatt and Adele.
3328
3329         Fix for <rdar://problem/5417203> Google Gmail 1.0 widget - unread 
3330         count is missing
3331
3332         * rendering/FixedTableLayout.cpp:
3333         (WebCore::FixedTableLayout::calcWidthArray): Calc pref widths for 
3334         our cells, if needed.
3335
3336 2007-08-24  Kevin McCullough  <kmccullough@apple.com>
3337
3338         Reviewed by Darin.
3339
3340         <rdar://problem/5437038> 1 credential object leaked for each call to credentialWithUser:password:persistence
3341         - Use initWithUser instead of credentialWithUser because credentialWithUser leaks.
3342
3343         * platform/network/mac/AuthenticationMac.mm:
3344         (WebCore::mac):
3345         * platform/network/mac/ResourceHandleMac.mm:
3346         (-[WebCoreResourceHandleAsDelegate connection:didReceiveAuthenticationChallenge:]):
3347         (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]):
3348
3349 2007-08-24  Jon Honeycutt  <jhoneycutt@apple.com>
3350
3351         Reviewed by Darin.
3352
3353         <rdar://problem/5433236> Print preview of empty txt file crashes Safari
3354         Fix: Adjust computePageRectsForFrame to always return at least one 
3355         page rect, even if document height is zero.
3356
3357         * WebCore.vcproj/WebCore.vcproj:
3358         * bridge/win/FrameWin.h: Added Vector& parameter to 
3359         computePagesRectsForFrame; changed its return type to void.
3360         * bridge/win/FrameWin.cpp:
3361         (WebCore::computePageRectsForFrame): Reordered the loop that inserts
3362         rects into the vector.
3363
3364 2007-08-24  Antti Koivisto  <antti@apple.com>
3365
3366         Reviewed by Oliver
3367
3368         Fix <rdar://problem/5393758>
3369         Crash in WebCore::FontData::platformInit
3370         
3371         Null check glyph page. 
3372         
3373         If font has somehow failed to initialize it is possible to have null glyph page. Based on
3374         crash dumps this seems to occasionally happen when running Mail under guard malloc. 
3375         
3376         No test case, I don't know how to get to this state.
3377
3378         * platform/FontData.cpp:
3379         (WebCore::FontData::FontData):
3380         * platform/mac/FontDataMac.mm:
3381         (WebCore::FontData::platformInit):
3382
3383 2007-08-24  George Wright  <george.wright@collabora.co.uk>
3384
3385         Reviewed by Oliver.
3386
3387         http://bugs.webkit.org/show_bug.cgi?id=15071
3388         [cairo] SVG skews are incorrect
3389
3390         Fix Cairo implementation of AffineTransform::shear so that shearing is
3391         done in the correct direction.
3392
3393         * platform/graphics/cairo/AffineTransformCairo.cpp:
3394         (WebCore::AffineTransform::shear):
3395
3396 2007-08-23  Anders Carlsson  <andersca@apple.com>
3397
3398         Reviewed by Steve.
3399
3400         If necessary, re-set the window proc after each call to NPP_SetWindow. This is to ensure that
3401         our window proc is always run even if a plug-in subclasses the window and replaces the window proc.
3402         
3403         Also, make sure that the default window proc is of type ASCII so we can eliminate the 
3404         * plugins/win/PluginViewWin.cpp:
3405         (WebCore::registerPluginView):
3406         (WebCore::PluginViewWndProc):
3407         (WebCore::PluginViewWin::setNPWindowRect):
3408         (WebCore::PluginViewWin::stop):
3409         (WebCore::PluginViewWin::determineQuirks):
3410         (WebCore::PluginViewWin::PluginViewWin):
3411         (WebCore::PluginViewWin::init):
3412         * plugins/win/PluginViewWin.h:
3413         (WebCore::):
3414         (WebCore::PluginViewWin::pluginWndProc):
3415
3416 2007-08-23  Justin Garcia  <justin.garcia@apple.com>
3417
3418         Reviewed by Adele.
3419
3420         <rdar://problem/5156801> REGRESSION: Crash at DeleteSelectionCommand::doApply() when deleting table content
3421
3422         * editing/DeleteSelectionCommand.cpp:
3423         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Use a RefPtr
3424         for node.  If the node to be removed contains the selection, and if
3425         the next node to be removed (nextNode) is inside the deletion UI,
3426         removing node will remove nextNode from the document.  nextNode is
3427         a RefPtr, but node isn't and when nextNode falls out of scope the node
3428         that node points to will be destroyed and we'll end up using a stale pointer.
3429         Long term we should probably just disable the deletion UI before editing 
3430         operations because the undo of the removal of node in the situation 
3431         described above relies on the presence of the deletion UI, but it isn't 
3432         present because its added and removed in a non-undoable way.
3433
3434 2007-08-23  Mitz Pettel  <mitz@webkit.org>
3435
3436         Reviewed by Darin.
3437
3438         - fix http://bugs.webkit.org/show_bug.cgi?id=14899
3439           !d->m_view->needsLayout() in Frame::paint() (Causes assert)
3440
3441         WebKit copies the width and height attributes of an <embed> to its
3442         nearest <object> ancestor. This used to be done in updateWidget(), but
3443         that could lead to the document being dirty right after layout and
3444         before painting. The patch moves the copying of the attributes to when
3445         the <embed> is inserted into the document or its attributes change.
3446
3447         * html/HTMLEmbedElement.cpp:
3448         (WebCore::HTMLEmbedElement::insertedIntoDocument):
3449         (WebCore::HTMLEmbedElement::attributeChanged):
3450         * html/HTMLEmbedElement.h:
3451         * manual-tests/bugzilla-14899.html: Added.
3452         * rendering/RenderPartObject.cpp:
3453         (WebCore::RenderPartObject::updateWidget):
3454
3455 2007-08-22  Anders Carlsson  <andersca@apple.com>
3456
3457         Reviewed by Darin and Oliver.
3458
3459         <rdar://problem/5422410>
3460         http://bugs.webkit.org/show_bug.cgi?id=15019
3461         REGRESSION (r25124-r25140): New posts and hot topics won't show at mobile01.com
3462
3463         Remove the call to checkCallImplicitClose(). Calling it in loadPlugin is bad for two reasons:
3464         
3465         1. It could cause onload to be dispatched even when the page has subresources that are still
3466         loading, such as images.
3467         
3468         2. Now that loadPlugin is called during layout, it could cause onload to be dispatched during
3469         layout, which can execute javascript and do pretty much anything while the render tree is in an
3470         inconsistent state.
3471         
3472         * loader/FrameLoader.cpp:
3473         (WebCore::FrameLoader::loadPlugin):
3474
3475 2007-08-22  Anders Carlsson  <andersca@apple.com>
3476
3477         Reviewed by Adam.
3478
3479         <rdar://problem/5430584>
3480         http://bugs.webkit.org/show_bug.cgi?id=15053        
3481         WebKit does not check Windows Registry HKEY_CURRENT_USER for NPAPI plugin locations
3482         
3483         * plugins/win/PluginDatabaseWin.cpp:
3484         (WebCore::addPluginsFromRegistry):
3485         (WebCore::PluginDatabaseWin::getPluginsInPaths):
3486
3487 2007-08-22  Justin Garcia  <justin.garcia@apple.com>
3488
3489         Reviewed by Adam.
3490         
3491         <rdar://problem/5418891> CrashTracer: [USER] 1 crash in Mail at -[WebViewEditor webView:shouldInsertText:replacingDOMRange:givenAction:]
3492
3493         * editing/BreakBlockquoteCommand.cpp:
3494         (WebCore::BreakBlockquoteCommand::doApply): We're reusing the topBlockquote
3495         variable.  Null it out first.  If there is no new topBlockquote and we don't null
3496         it out first, we'll assume that there was a new one and crash.
3497
3498 2007-08-22  Kevin McCullough  <kmccullough@apple.com>
3499
3500         Reviewed by Adele.
3501
3502       &nbs