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