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