Reviewed by Hyatt.
[WebKit-https.git] / WebCore / ChangeLog
1 2007-07-23  Timothy Hatcher  <timothy@apple.com>
2
3         Reviewed by Hyatt.
4
5         <rdar://problem/5242145> REGRESSION: Clicking on symbol in documentation often doesn't scroll to symbol
6
7         A renderer for the anchor wasn't always available at the time parsing finished. So we need
8         to bail out of gotoAnchor if stylesheets are pending and remember to call gotoAnchor later
9         once all of the pending stylesheets load.
10
11         * dom/Document.cpp:
12         (WebCore::Document::Document): Initialize m_gotoAnchorNeededAfterStylesheetsLoad to false.
13         (WebCore::Document::stylesheetLoaded): If we have no more pending stylesheets, call gotoAnchor if needed.
14         * dom/Document.h:
15         (WebCore::Document::gotoAnchorNeededAfterStylesheetsLoad): New method.
16         (WebCore::Document::setGotoAnchorNeededAfterStylesheetsLoad): Ditto.
17         * loader/FrameLoader.cpp:
18         (WebCore::FrameLoader::gotoAnchor): Bail early if the document still has pending stylesheets.
19         * loader/FrameLoader.h: Make gotoAnchor() public.
20
21 2007-07-23  John Sullivan  <sullivan@apple.com>
22
23         Reviewed by Darin
24         
25         - fixed <rdar://problem/5327887> Printing Mail note (or Safari page) with misspelled word prints red underline
26
27         * rendering/InlineTextBox.cpp:
28         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
29         When printing, bail out without doing any work. Also moved a couple of lines down below another early
30         bailout since they were pointless above it.
31
32 2007-07-23  Oliver Hunt  <oliver@apple.com>
33
34         Reviewed by Darin.
35         
36         <rdar://problem/5353577> WebKit key event behaviour needs to better match other browsers keyevent behaviour
37         <rdar://problem/5352152> REGRESSION (24399-24479): Pressing Enter in a search field at apple.com no longer starts a search with Korean IM
38         <rdar://problem/5352649> WebKit should send keyDown event on autorepeat keyDowns
39         http://bugs.webkit.org/show_bug.cgi?id=14690
40
41         Perform Input Method call first so that our behaviour is determined by whether or not 
42         the input method has actually handle the event, rather than by making guesses based 
43         on the existences of marked text.  This fixes issues with IMs that have side effects
44         even on events they do not handle.
45
46         Refactored the code in order to improve clarity given the hoisting required by performing
47         the IM call earlier.
48
49         * page/EventHandler.cpp:
50         (WebCore::EventHandler::keyEvent):
51
52 2007-07-23  Anders Carlsson  <andersca@apple.com>
53
54         Reviewed by Darin.
55
56         <rdar://problem/5045711> 
57         http://bugs.webkit.org/show_bug.cgi?id=12938
58         Google calendar settings page crashes
59         
60         Move handling of checked radio buttons to a new class, HTMLFormElement::CheckedRadioButtons. 
61         Each <form> element has an instance of this class. For radio buttons without a containing 
62         form, the document has an instance of HTMLFormElement::CheckedRadioButtons where the
63         state of those radio buttons will be stored.
64         be stored.
65         
66         This also fixes another bug where removing a checked radio button that does not have a
67         containing form would not remove the radio button from the checked radio buttons map,
68         which could lead to a crash due to a dangling pointer.
69         
70         * dom/Document.cpp:
71         (WebCore::Document::~Document):
72         * dom/Document.h:
73         (WebCore::Document::checkedRadioButtons):
74         * html/HTMLFormElement.cpp:
75         (WebCore::HTMLFormElement::registerFormElement):
76         (WebCore::HTMLFormElement::removeFormElement):
77         (WebCore::HTMLFormElement::CheckedRadioButtons::didCheckButton):
78         (WebCore::HTMLFormElement::CheckedRadioButtons::checkedButtonForGroup):
79         (WebCore::HTMLFormElement::CheckedRadioButtons::removeButtonIfChecked):
80         * html/HTMLFormElement.h:
81         (WebCore::HTMLFormElement::checkedRadioButtons):
82         * html/HTMLGenericFormElement.cpp:
83         (WebCore::HTMLGenericFormElement::insertedIntoTree):
84         * html/HTMLInputElement.cpp:
85         (WebCore::HTMLInputElement::~HTMLInputElement):
86         (WebCore::checkedRadioButtons):
87         (WebCore::HTMLInputElement::isKeyboardFocusable):
88         (WebCore::HTMLInputElement::setInputType):
89         (WebCore::HTMLInputElement::parseMappedAttribute):
90         (WebCore::HTMLInputElement::setChecked):
91         (WebCore::HTMLInputElement::preDispatchEventHandler):
92         (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
93         * manual-tests/remove-form-node-with-radio-buttons-crash.html: Added.
94
95 2007-07-23  David Hyatt  <hyatt@apple.com>
96
97         Fix for 5350587, hang in iExploder text 8101.  The code that painted outlines for continuations was buggy
98         in that it assumed the chain was always inline-block-inline, but this is only true for the innermost chained
99         continuation.  To make this more robust, we always just use the inline's containing block's containing block,
100         which should be guaranteed to enclose all renderers in the continuation chain.  In addition, there is now a
101         null check (to guarantee no more hangs) and an assert (to check if we hit this situation again where the block
102         used to paint does not properly enclose the continuation chain).
103
104         Reviewed by beth
105
106         fast/inline/outline-continuation.html
107
108         * rendering/RenderBlock.cpp:
109         (WebCore::RenderBlock::paintContinuationOutlines):
110         * rendering/InlineFlowBox.cpp:
111         (WebCore::RenderInline::paint):
112
113 2007-07-22  Holger Hans Peter Freyther  <zecke@selfish.org>
114
115         Reviewed by Adam.
116
117         WARNING: NO TEST CASES ADDED OR CHANGED
118
119         Add the WebKit/Gtk API to the buildsystem, ask qmake to create a
120         pkg-config file and install headers and libraries.
121
122         Start to emit signals from FrameLoaderClientGdk, hide the kit Frame
123         inside the the FrameLoaderClientGdk.
124
125         Move ChromeClientGdk to WebKit/gtk/WebCoreSupport
126
127         * WebCore.pro:
128         * loader/gdk/FrameLoaderClientGdk.cpp:
129         * loader/gdk/FrameLoaderClientGdk.h:
130         * platform/gdk/ChromeClientGdk.h: Removed.
131         * platform/gdk/FrameGdk.cpp: Remove code not belonging here
132         * platform/gdk/FrameGdk.h:
133         * platform/gdk/ScrollViewGdk.cpp: The gdkDrawable won't exist at that time and it is fine
134         * platform/gdk/TemporaryLinkStubs.cpp: Removed ChromeClientGdk stubs
135
136 2007-07-22  Maciej Stachowiak  <mjs@apple.com>
137
138         Reviewed by Adam.
139
140         <rdar://problem/5353174> REGRESSION: 1% JavaScript performance regression fro Window refactoring (14717)
141         http://bugs.webkit.org/show_bug.cgi?id=14717
142         
143         * bindings/js/kjs_window.cpp:
144         * bindings/js/kjs_window.h:
145         (KJS::Window::impl): inlined
146         * page/DOMWindow.cpp:
147         * page/DOMWindow.h:
148         (WebCore::DOMWindow::frame): inlined
149
150 2007-07-22  Darin Adler  <darin@apple.com>
151
152         * platform/ContextMenu.cpp: Added missing include.
153
154 2007-07-22  Sam Weinig  <sam@webkit.org>
155
156         Reviewed by Darin.
157
158         Fix for http://bugs.webkit.org/show_bug.cgi?id=14682
159         REGRESSION(24285-24399): alerts do not appear at W3C RTL test page
160
161         Test: fast/dom/Window/window-function-name-getter-precedence.html
162
163         * bindings/js/JSDOMWindowCustom.cpp:
164         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Make sure to return functions
165         before the custom name getter.
166
167 2007-07-22  Darin Adler  <darin@apple.com>
168
169         Reviewed by Adam.
170
171         - fix <rdar://problem/5353263> ContextMenuItem and ContextMenu objects leaking (seen on buildbot)
172
173         * platform/ContextMenu.cpp:
174         (WebCore::separatorItem): Return an auto_ptr instead of a raw pointer, since this function
175         creates an object that's the caller's responsibility to delete.
176         (WebCore::createAndAppendFontSubMenu): Create the context menu on the stack, not the heap,
177         since setSubMenu does not take ownership, and hence the objects were leaking.
178         (WebCore::createAndAppendSpellingAndGrammarSubMenu): Ditto.
179         (WebCore::createAndAppendSpellingSubMenu): Ditto.
180         (WebCore::createAndAppendSpeechSubMenu): Ditto.
181         (WebCore::createAndAppendWritingDirectionSubMenu): Ditto.
182
183 2007-07-22  Darin Adler  <darin@apple.com>
184
185         Reviewed by Kevin Decker.
186
187         - fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
188           http://bugs.webkit.org/show_bug.cgi?id=13250
189
190         * bindings/objc/WebScriptObject.mm:
191         (_didExecute): Removed unnecessary check for isValid() since the _rootObject method already
192         takes care of that check.
193         (-[WebScriptObject _imp]): Made this return 0 if there is not a valid rootObject.
194         (-[WebScriptObject _isSafeScript]): Made this always return false if there is not a valid
195         rootObject, eliminating the need to check _rootObject for nil if the code is checking _isSafeScript.
196         (-[WebScriptObject callWebScriptMethod:withArguments:]): Removed check of _rootObject, since it's
197         immediately followed by a check of _isSafeScript. Removed awkward conversion of name from NSString *
198         to KJS::Identifier and did it using WebCore::String instead -- makes it clear that there's no
199         arbitrary JavaScript execution after _isSafeScript and before _imp, so we don't need to null-check
200         the _imp pointer. Added a second check of _isSafeScript after calling get to get the function
201         object, since arbitrary changes could occur in there, including navigation to a new frame.
202         This also takes care of null checking the second call to _imp.
203         (-[WebScriptObject evaluateWebScript:]): Removed check of _rootObject, since it's
204         immediately followed by a check of _isSafeScript. Removed awkward conversion of script from NSString *
205         to KJS::Identifier and did it using WebCore::String instead -- makes it clear that there's no
206         arbitrary JavaScript execution after _isSafeScript and before _imp, so we don't need to null-check
207         the _imp pointer.
208         (-[WebScriptObject setValue:forKey:]): Removed check of _rootObject, since it's
209         immediately followed by a check of _isSafeScript. Removed awkward conversion of key from NSString *
210         to KJS::Identifier and did it using WebCore::String instead -- makes it clear that there's no
211         arbitrary JavaScript execution after _isSafeScript and before _imp, so we don't need to null-check
212         the _imp pointer.
213         (-[WebScriptObject valueForKey:]): Ditto.
214         (-[WebScriptObject removeWebScriptKey:]): Ditto.
215         (-[WebScriptObject stringRepresentation]): Removed check of _rootObject, since it's
216         immediately followed by a check of _isSafeScript. Removed unnecessary local variable
217         and const_cast from the call to the _imp method.
218         (-[WebScriptObject webScriptValueAtIndex:]): Removed check of _rootObject, since it's
219         immediately followed by a check of _isSafeScript.
220         (-[WebScriptObject setWebScriptValueAtIndex:value:]): Ditto.
221         (-[WebScriptObject JSObject]): Ditto.
222
223 2007-07-22  Darin Adler  <darin@apple.com>
224
225         Reviewed by Anders Carlsson and John Sullivan.
226
227         - speculative fix for <rdar://problem/5337500> CrashTracer: [USER] 4 crashes in Mail
228           at WebCore::HTMLImageElement::isURLAttribute(WebCore::Attribute*) const
229
230         * editing/markup.cpp: Added AttributeChange class.
231         (WebCore::completeURLs): Changed function so that all the URL completion is done in
232         a separate pass after finding all the URL attributes. This is safer, since actually
233         applying an attribute change could have any arbitrary effect on the document; it's
234         tricky to iterate a document while it's being modified and we don't have the checks
235         here that would be needed to make that work in pathological cases.
236
237 2007-07-18  Darin Adler  <darin@apple.com>
238
239         Reviewed by Adam.
240
241         - fix <rdar://problem/5350604> REGRESSION: Crash in inspector controller code after
242           clicking back button in test application (14337)
243
244         * page/InspectorController.cpp: (WebCore::InspectorController::addScriptResource):
245         Replace an assertion that was firing with some code that at least doesn't immediately crash.
246
247 2007-07-22  Darin Adler  <darin@apple.com>
248
249         Reviewed by Anders.
250
251         - improve the fix for <rdar://problem/5298816> Crash redirecting message,
252           in -[SharedBufferData initWithSharedBuffer:]; fixes a crash seen on the buildbot
253
254         * loader/DocLoader.cpp: (WebCore::DocLoader::~DocLoader): Call setDocLoader(0) on all
255         the resources so they don't try to use a stale DocLoader pointer later.
256
257 2007-07-21  Mitz Pettel  <mitz@webkit.org>
258
259         Reviewed by Sam Weinig.
260
261         - fixed typos and markup in the following manual tests
262
263         * manual-tests/accidental-strict-mode.html:
264         * manual-tests/caretScrolling.html:
265         * manual-tests/close-on-closedWindow.html:
266
267 2007-07-21  Sam Weinig  <sam@webkit.org>
268
269         Reviewed by Mitz.
270
271         Patch for <rdar://problem/5352013>
272         The computed style for background-position is wrong for the initial value
273
274         - Set the initial value for background-position-x and background-position-y (and
275           therefore background-position) to 0% instead of 0px.
276
277         * rendering/RenderStyle.cpp:
278         (WebCore::BackgroundLayer::BackgroundLayer):
279         * rendering/RenderStyle.h:
280         (WebCore::RenderStyle::initialBackgroundXPosition):
281         (WebCore::RenderStyle::initialBackgroundYPosition):
282
283 2007-07-20  Brady Eidson  <beidson@apple.com>
284
285         Reviewed by Adele and Andersca
286
287         <rdar://problem/5336105> - WebBackForwardList created from scratch is unusable (always leads to crash)
288
289         * WebCore.exp: Export the BackForwardList c'tor so WebKit can create one explicitly
290
291 2007-07-20  Sam Weinig  <sam@webkit.org>
292
293         Reviewed by Beth Dakin.
294
295         Fix for <rdar://problem/5351901>
296         Computed value of border-position should return a CSSValueList, not a CSSPrimitiveValue
297
298         - Return a space separated CSSValueList for background-position
299           instead of a CSSPrimitiveValue (string type).
300         - Remove the "else if (renderer)" case as it never returns a different
301           value than just calling length.value().
302         - Make background-position-x and background-position-y behave like
303           background-position.  Fix case of initial value return 'auto' instead
304           of 0.
305
306         Test: fast/css/getComputedStyle-background-position.html
307
308         * css/CSSComputedStyleDeclaration.cpp:
309         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
310
311 2007-07-20  Geoffrey Garen  <ggaren@apple.com>
312
313         Build fix for non-Mac platforms.
314         
315         * bindings/js/GCController.cpp:
316
317 2007-07-20  Anders Carlsson  <andersca@apple.com>
318
319         Reviewed by Darin.
320
321         If the style sheet requested is a user style sheet, don't store it in the DocLoader's resource map;
322         user style sheets can outlive their doc loaders.
323
324         * loader/DocLoader.cpp:
325         (WebCore::DocLoader::requestCSSStyleSheet):
326
327 2007-07-20  Justin Garcia  <justin.garcia@apple.com>
328
329         Reviewed by Darin.
330
331         <rdar://problem/5109817> Ctrl-click on word in non-editable text doesn't select it
332         
333         * bridge/EditorClient.h: Removed a client method for enabling/disabling
334         word selection on right clicks.
335         * editing/Editor.cpp: Ditto.
336         * editing/Editor.h:
337         * page/EventHandler.cpp:
338         (WebCore::EventHandler::sendContextMenuEvent): Select the
339         word underneath the mouse regardless of whether its editable.
340
341 2007-07-20  Ada Chan  <adachan@apple.com>
342
343         Reviewed by Darin and Adam.
344
345         <rdar://problem/5338385> Fixed infinite loop in ScrollView::scrollRectIntoViewRecursively().
346         Also removed an unused local variable.
347
348         * platform/win/ScrollViewWin.cpp:
349         (WebCore::ScrollView::scrollRectIntoViewRecursively):
350
351 2007-07-21  Antti  <antti@apple.com>
352
353         Reviewed by Darin.
354         
355         Fix <rdar://problem/5305788>
356         REGRESSION: Safari sometimes loads IE-specific stylesheet on www.apaema.org
357         
358         Pick the preferred style sheet set based on document order even if the sheet is still loading. Previously 
359         the set was chosen based on which stylesheet happened to arrive first. Just fix the problem at hand 
360         and resist urge to start refactoring this function.
361
362         * dom/Document.cpp:
363         (WebCore::Document::recalcStyleSelector):
364
365 2007-07-20  Sam Weinig  <sam@webkit.org>
366
367         Reviewed by Darin.
368
369         Fix for <rdar://problem/5351252>
370         Computed value for -webkit-background-size and border-spacing
371         should be space separated CSSValueLists.
372
373         * css/CSSComputedStyleDeclaration.cpp:
374         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
375
376 2007-07-20  Geoffrey Garen  <ggaren@apple.com>
377
378         Suggested by Darin Adler.
379         
380         Slight tweak to my last commit: changed gcController() to return a 
381         reference instead of a pointer.
382
383 2007-07-20  Geoffrey Garen  <ggaren@apple.com>
384
385         Reviewed by Darin Adler.
386         
387         Fixed http://bugs.webkit.org/show_bug.cgi?id=12900 Page tear-down 
388         forces garbage collection once per frame
389
390         Also fixed <rdar://problem/5286989> GC on window close does not always 
391         bring the JS object count down to 0
392         
393         Implemented a 0-delay GC timer in WebCore. Instead of forcing GC
394         immediately, code that thinks it has created a lot of garbage starts
395         the timer. This has two advantages: 
396
397         1) Multiple GCs can coalesce. In my pathological test case, this 
398         improves performance by an order of magnitude. 
399         
400         2) Conservative marking is less likely to keep alive important dead
401         objects, like the window object, because the stack is small and free of
402         JS processing when the timer fires.
403
404         Added GCController.h/.cpp, sometimes blindly:
405         * WebCore.pro:
406         * WebCore.vcproj/WebCore.vcproj:
407         * WebCore.xcodeproj/project.pbxproj:
408         * WebCoreSources.bkl:
409
410         Added singleton that implements GC on a 0-delay timer:
411         * bindings/js/GCController.h: Added.
412         * bindings/js/GCController.cpp: Added.
413         
414         Changed Collector::collect() calls below to call to the singleton:
415         * bindings/js/kjs_proxy.cpp:
416         (WebCore::KJSProxy::~KJSProxy):
417         * bindings/js/kjs_window.cpp:
418         (KJS::Window::clear):
419         * history/CachedPage.cpp:
420         (WebCore::CachedPage::clear):
421         
422         * page/Frame.cpp:
423         (WebCore::Frame::~Frame): Removed previous slightly hackish attempt to
424         avoid conservative marking of the window object.
425
426 2007-07-20  Anders Carlsson  <andersca@apple.com>
427     
428         Reviewed by Darin.
429
430         <rdar://problem/5298816> Crash redirecting message, in -[SharedBufferData initWithSharedBuffer:]
431         
432         Have cached resources keep track of what DocLoader they belong to. This is so that they can remove themselves
433         from the DocLoader's resource map when they're destroyed when the cache is disabled.
434         
435         * html/HTMLImageLoader.cpp:
436         (WebCore::HTMLImageLoader::updateFromElement):
437         * loader/Cache.cpp:
438         (WebCore::Cache::requestResource):
439         * loader/CachedResource.cpp:
440         (WebCore::CachedResource::CachedResource):
441         (WebCore::CachedResource::~CachedResource):
442         * loader/CachedResource.h:
443         (WebCore::CachedResource::setDocLoader):
444
445 2007-07-20  Brady Eidson  <beidson@apple.com>
446
447         Reviewed by Darin
448
449         <rdar://problem/5153021> and http://bugs.webkit.org/show_bug.cgi?id=13364
450
451         The issue here was that if a document in a subframe was loaded from a URL, but then a script did 
452         document.open or document.write during parsing, we would overwrite the document's url and baseurl 
453         with the parent frame's url.  WRONG!
454
455         * dom/Document.cpp:
456         (WebCore::Document::open): Only set the url and baseURL in document.open if they are still empty or about:blank
457
458 2007-07-20  Maciej Stachowiak  <mjs@apple.com>
459
460         Reviewed by Oliver.
461
462         <rdar://problem/5326303> REGRESSION: blur event fires upon navigating away from a page with focused element
463
464
465         
466         The proximate cause was the recent change to keep focus on the
467         WebHTMLView when switching views. But the reason this happend was
468         that didCommitLoadForFrame got called at a time when the new view
469         was in place, but the old document was still there. This was a
470         longstanding problem with the delegate, and fixing it cleans it
471         up.
472
473         * loader/FrameLoader.cpp:
474         (WebCore::FrameLoader::begin): Don't send dispatchWindowObjectAvailable if
475         caller asked not to (this is to allow order of delegates to be the same).
476         (WebCore::FrameLoader::transitionToCommitted): Don't emit didCommitLoadForFrame here.
477         (WebCore::FrameLoader::receivedFirstData): Instead do it here, after calling begin(),
478         so the new document is set up.
479         * loader/FrameLoader.h: Add new optional parameter to begin().
480
481 2007-07-20  Sam Weinig  <sam@webkit.org>
482
483         Reviewed by Beth Dakin.
484
485         Update for fix for http://bugs.webkit.org/show_bug.cgi?id=14646
486         <rdar://problem/5340449>
487
488         - Return a CSSValueList instead of CSSValue (with a Pair type) for
489           computed values of border radii.
490         - Add ability to CSSValueList to print out a space separated list
491           instead of a comma.
492         - Add border radii to list of computed styles that we create and can
493           iterate over.
494
495         * css/CSSComputedStyleDeclaration.cpp:
496         (WebCore::):
497         (WebCore::getBorderRadiusCornerValue):
498         * css/CSSValueList.cpp:
499         (WebCore::CSSValueList::CSSValueList):
500         (WebCore::CSSValueList::cssText):
501         * css/CSSValueList.h:
502
503 2007-07-20  Mitz Pettel  <mitz@webkit.org>
504
505         Reviewed by Darin.
506
507         - http://bugs.webkit.org/show_bug.cgi?id=14626
508           Make bidiReorderCharacters independent of RenderBlock
509
510         No layout test possible because there is no change in functionality.
511
512         This patch generalizes RenderBlock's implementation of the Unicode Bidi Algorithm
513         in the form of the BidiResolver class template. An instance of a BidiResolver class
514         can generate a sequence of runs with corresponding level and override attributes,
515         given a range specified by start and end iterators. The iterators can optionally
516         call back to the BidiResolver instance to push or pop explicit embedding levels.
517
518         The patch replaces BidiState with a specialization of BidiResolver that uses
519         BidiIterators and generates BidiRuns. It also eliminates some of the file statics
520         in bidi.cpp, instead relying on BidiResolver data members.
521
522         The patch makes the BidiContext part of BidiStatus, thus making BidiStatus the
523         entire state that needs to be saved and restored in order to restart the bidi
524         algorithm at a given point. Previously, you had to keep and pass around two
525         separate structures, namely the BidiContext and the BidiStatus.
526
527         bidiReorderCharacters is implemented without relying on render objects, using
528         a BidiResolver specialization that uses simple character buffer iterators and
529         simple run structures.
530
531         * WebCore.pro:
532         * WebCore.vcproj/WebCore.vcproj:
533         * WebCore.xcodeproj/project.pbxproj:
534         * WebCoreSources.bkl:
535         * platform/BidiContext.cpp: Added.
536         (WebCore::operator==):
537         * platform/BidiContext.h: Added.
538         (WebCore::BidiContext::BidiContext):
539         (WebCore::BidiContext::ref):
540         (WebCore::BidiContext::deref):
541         (WebCore::BidiContext::parent):
542         (WebCore::BidiContext::level):
543         (WebCore::BidiContext::dir):
544         (WebCore::BidiContext::override):
545         * platform/BidiReorderCharacters.cpp: Added.
546         (WebCore::CharacterBufferIterator::CharacterBufferIterator):
547         (WebCore::CharacterBufferIterator::offset):
548         (WebCore::CharacterBufferIterator::increment):
549         (WebCore::CharacterBufferIterator::atEnd):
550         (WebCore::CharacterBufferIterator::current):
551         (WebCore::CharacterBufferIterator::direction):
552         (WebCore::CharacterBufferIterator::operator==):
553         (WebCore::CharacterBufferIterator::operator!=):
554         (WebCore::::appendRun):
555         (WebCore::bidiReorderCharacters):
556         * platform/BidiReorderCharacters.h: Added.
557         * platform/BidiResolver.h: Added.
558         (WebCore::BidiStatus::BidiStatus):
559         (WebCore::operator==):
560         (WebCore::operator!=):
561         (WebCore::BidiCharacterRun::BidiCharacterRun):
562         (WebCore::BidiCharacterRun::reversed):
563         (WebCore::BidiCharacterRun::dirOverride):
564         (WebCore::BidiCharacterRun::next):
565         (WebCore::BidiResolver::):
566         (WebCore::BidiResolver::context):
567         (WebCore::BidiResolver::setContext):
568         (WebCore::BidiResolver::setLastDir):
569         (WebCore::BidiResolver::setLastStrongDir):
570         (WebCore::BidiResolver::setEorDir):
571         (WebCore::BidiResolver::dir):
572         (WebCore::BidiResolver::setDir):
573         (WebCore::BidiResolver::status):
574         (WebCore::BidiResolver::setStatus):
575         (WebCore::BidiResolver::adjustEmbedding):
576         (WebCore::BidiResolver::setAdjustEmbedding):
577         (WebCore::BidiResolver::firstRun):
578         (WebCore::BidiResolver::lastRun):
579         (WebCore::BidiResolver::runCount):
580         (WebCore::::embed):
581         (WebCore::::deleteRuns):
582         (WebCore::::reverseRuns):
583         (WebCore::::createBidiRunsForLine):
584         * platform/win/PopupMenuWin.cpp:
585         (WebCore::PopupMenu::paint):
586         * rendering/RenderBlock.h:
587         * rendering/RenderFileUploadControl.cpp:
588         (WebCore::RenderFileUploadControl::paintObject):
589         * rendering/RenderListBox.cpp:
590         (WebCore::RenderListBox::paintItemForeground):
591         * rendering/RootInlineBox.cpp:
592         (WebCore::RootInlineBox::childRemoved):
593         (WebCore::RootInlineBox::lineBreakBidiStatus):
594         (WebCore::RootInlineBox::setLineBreakInfo):
595         * rendering/RootInlineBox.h:
596         (WebCore::RootInlineBox::RootInlineBox):
597         * rendering/bidi.cpp:
598         (WebCore::BidiIterator::BidiIterator):
599         (WebCore::BidiState::deleteRuns):
600         (WebCore::operator==):
601         (WebCore::operator!=):
602         (WebCore::bidiNext):
603         (WebCore::bidiFirst):
604         (WebCore::BidiState::addRun):
605         (WebCore::appendRunsForObject):
606         (WebCore::BidiState::appendRun):
607         (WebCore::RenderBlock::constructLine):
608         (WebCore::RenderBlock::computeHorizontalPositionsForLine):
609         (WebCore::RenderBlock::computeVerticalPositionsForLine):
610         (WebCore::RenderBlock::bidiReorderLine):
611         (WebCore::buildCompactRuns):
612         (WebCore::RenderBlock::layoutInlineChildren):
613         (WebCore::RenderBlock::determineStartPosition):
614         (WebCore::RenderBlock::determineEndPosition):
615         (WebCore::RenderBlock::matchedEndLine):
616         (WebCore::RenderBlock::skipWhitespace):
617         * rendering/bidi.h:
618         (WebCore::BidiRun::BidiRun):
619         (WebCore::BidiRun::next):
620
621 2007-07-20  Darin Adler  <darin@apple.com>
622
623         Reviewed by John Sullivan.
624
625         - fix for <rdar://problem/5331723> <rdar://problem/5331723> Safari gives error
626           103 for URLs that Adobe Lightroom's Preview feature produces, with ":1" in the hostname
627
628         Test: fast/loader/file-URL-with-port-number.html
629
630         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
631         Don't do any port blocking for file URLs.
632
633 2007-07-20  Mitz Pettel  <mitz@webkit.org>
634
635         Reviewed by Darin.
636
637         - fix http://bugs.webkit.org/show_bug.cgi?id=14689
638           REGRESSION (3.0.2-TOT): <select> menu items have incorrect background color
639
640         * manual-tests/item-background.html: Added.
641         * platform/PopupMenuClient.h:
642         * platform/graphics/Color.cpp:
643         (WebCore::blendComponent): Renamed the static method blend() to this.
644         (WebCore::Color::blend): Added. Compositing (in "normal" or "source over"
645         blend mode) B.blend(C) over A is equivalent to compositing C over the
646         result of compositing B over A.
647         (WebCore::Color::blendWithWhite): Changed for the above rename.
648         * platform/graphics/Color.h:
649         * platform/win/PopupMenuWin.cpp:
650         (WebCore::PopupMenu::paint): Changed to use itemBackgroundColor().
651         * rendering/RenderMenuList.cpp:
652         (WebCore::RenderMenuList::itemBackgroundColor): Added. Returns the color
653         that would result from overlaying the item's background color over the
654         menu's background color over solid white. Note that clientStyle() cannot
655         be used for the menu's background color, since background color is not
656         inherited by the inner block (the regression resulted from changing
657         clientStyle() to return the inner block's style), and that the color
658         returned from this method is guaranteed to be opaque.
659         * rendering/RenderMenuList.h:
660         * rendering/RenderTextControl.cpp:
661         (WebCore::RenderTextControl::itemBackgroundColor): Added.
662         * rendering/RenderTextControl.h:
663
664 2007-07-20  Rob Buis  <buis@kde.org>
665
666         Reviewed by Darin.
667
668         http://bugs.webkit.org/show_bug.cgi?id=14642
669         REGRESSION(r24064-24096): Reflection type effect in canvas tag broke
670
671         Do not stop the fill/stroke operation when encountering an empty path.
672
673         * html/CanvasRenderingContext2D.cpp:
674         (WebCore::CanvasRenderingContext2D::fill):
675         (WebCore::CanvasRenderingContext2D::stroke):
676
677 2007-07-20  Lars Knoll  <lars@trolltech.com>
678
679         Reviewed by Simon.
680
681         Remove some files that are not used anymore.
682
683         * platform/qt/FontCacheQt.cpp: Removed.
684         * platform/qt/FontDataQt.cpp: Removed.
685         * platform/qt/FontPlatformData.h: Removed.
686         * platform/qt/FontPlatformDataQt.cpp: Removed.
687         * platform/qt/GlyphPageTreeNodeQt.cpp: Removed.
688
689 2007-07-20  Lars Knoll  <lars@trolltech.com>
690
691         Reviewed by Simon.
692
693         use the correct font for spaces.
694
695         * platform/qt/FontQt.cpp:
696         (WebCore::generateComponents):
697
698 2007-07-20  Lars Knoll  <lars@trolltech.com>
699
700         Reviewed by Simon.
701
702         spaces where not correctly taken into account for both offsetForPosition and selectionRectForText. Because of that selections sort of worked in LTR text, but completely failed in RTL.
703
704         * platform/qt/FontQt.cpp:
705         (WebCore::TextRunComponent::isSpace):
706         (WebCore::TextRunComponent::TextRunComponent):
707         (WebCore::generateComponents):
708         (WebCore::Font::drawText):
709         (WebCore::Font::offsetForPosition):
710         (WebCore::Font::selectionRectForText):
711
712 2007-07-20  Lars Knoll  <lars@trolltech.com>
713
714         Reviewed by Simon.
715
716         fix up some smaller issues in selection handling. It's still not perfect and selections in mixed rtl/ltr text are still broken, but it's getting there.
717
718         * platform/qt/FontQt.cpp:
719         (WebCore::Font::offsetForPosition):
720         (WebCore::cursorToX):
721         (WebCore::Font::selectionRectForText):
722
723 2007-07-20  Lars Knoll  <lars@trolltech.com>
724
725         Reviewed by Simon.
726
727         make offsetForPosition and selectionRectForText work correctly with small caps.
728
729         * platform/qt/FontQt.cpp:
730         (WebCore::Font::offsetForPosition):
731         (WebCore::cursorToX):
732         (WebCore::Font::selectionRectForText):
733
734 2007-07-20  Lars Knoll  <lars@trolltech.com>
735
736         Reviewed by Simon.
737
738         clip the drawn text correctly when needed.
739
740         * platform/qt/FontQt.cpp:
741         (WebCore::Font::drawText):
742
743 2007-07-20  Lars Knoll  <lars@trolltech.com>
744
745         Reviewed by Simon.
746
747         Fix offsetForPosition and selectionRectForText methods.
748
749         * platform/qt/FontQt.cpp:
750         (WebCore::Font::offsetForPosition):
751         (WebCore::cursorToX):
752         (WebCore::Font::selectionRectForText):
753
754 2007-07-20  Lars Knoll  <lars@trolltech.com>
755
756         Reviewed by Simon.
757
758         fix BiDi text rendering.
759
760         * platform/qt/FontQt.cpp:
761         (WebCore::TextRunComponent::TextRunComponent):
762         (WebCore::generateComponents):
763         (WebCore::Font::drawText):
764
765 2007-07-20  Mark Rowe  <mrowe@apple.com>
766
767         Reviewed by Maciej.
768
769         Move FTPDirectoryTokenizer::m_templateDocumentData to be a function-scoped static
770         to avoid creating a global initializer.  This fixes the build for x86_64.
771
772         * loader/FTPDirectoryDocument.cpp:
773         (WebCore::FTPDirectoryTokenizer::loadDocumentTemplate):
774
775 2007-07-19  Geoffrey Garen  <ggaren@apple.com>
776
777         Reviewed by Maciej Stachowiak.
778         
779         Fixed <rdar://problem/5347849> Cache eviction of live decoded data is 
780         thrash-y
781         
782         The solution here is to evict live decoded data based on a strict LRU
783         model. This should work well as a "scrolling window."
784
785         With this patch, I see a substantial reduction in CPU while scrolling
786         through a page with large images on a low memory system. Layout tests
787         pass.
788
789         * loader/Cache.h: Changed from a size-based vector of LRU lists to a
790         single LRU list in order to implement strict LRU.
791         
792         * loader/CachedResource.h: Removed tracking of access count, since that
793         was the old cache eviction model.
794
795 2007-07-19  Oliver Hunt  <oliver@apple.com>
796
797         Reviewed by Maciej.
798
799         <rdar://problem/5076807> REGRESSION: Can't undo conversion of inline text (by hitting ESC)
800         <rdar://problem/5346167> DOM key events triggered during IME composition differ in webkit/mac vs all windows browsers
801
802         We now basically match the behaviour of IE/Windows. This means that during composition keydown and autorepeat
803         keys generate keydown events with a keyCode of 229, which correlates to the windows VK_PROCESSKEY message.
804         keyup events are generated with the keyCode of the actual key that was pressed.
805
806         The only difference is on the first keydown of a composition, in which IE will use keyCode == 229, and we will
807         send an event with the keyCode for the actual key that was pressed.
808
809         * page/EventHandler.cpp:
810         (WebCore::EventHandler::keyEvent):
811         * platform/PlatformKeyboardEvent.h:
812         (WebCore::PlatformKeyboardEvent::setWindowsKeyCode):
813
814 2007-07-19  Brady Eidson  <beidson@apple.com>
815
816         Reviewed by Sam
817
818         <rdar://problem/5134929> REGRESSION: Colon detected as delimiting an empty port is stripped
819
820         The fix for this was in KURL::parse() which had a slightly changed rule that would strip the colon if there
821         was no port.
822
823         An additional canonicalization fix was made in window.location.host to match the expected behavior of leaving
824         the colon in place - before this fix, if the colon was there but no port was there, we'd see the port as 0.
825
826         * bindings/js/kjs_window.cpp:
827         (KJS::Location::put): Call setHostAndPort instead of setHost and setPort seperately
828
829         * manual-tests/location-host-canonicalization.html: Added.
830
831         * platform/KURL.cpp:
832         (WebCore::KURL::setHostAndPort): Set the host and port as one string component then reparse the URL
833         (WebCore::KURL::parse): Change one line to consider the empty colon as part of the host name
834         * platform/KURL.h:
835
836 2007-07-19  Anders Carlsson  <andersca@apple.com>
837
838         Reviewed by Adam.
839
840         <rdar://problem/5288617>
841         Crash playing a very large QuickTime movie in Safari
842         
843         <rdar://problem/5271174>
844         http://bugs.webkit.org/show_bug.cgi?id=14148
845         LEAK: Serious memory consumption and leak when loading QT movies.
846         
847         Don't keep plugin stream data in memory since some plugin resources (like QT movies)
848         can be really big. If a plug-in wants data in a file, create a file and write data to it 
849         as it's coming from the wire, instead of using a big buffer.
850         
851         * loader/ResourceLoader.cpp:
852         (WebCore::ResourceLoader::ResourceLoader):
853         (WebCore::ResourceLoader::addData):
854         (WebCore::ResourceLoader::willStopBufferingData):
855         * loader/ResourceLoader.h:
856         (WebCore::ResourceLoader::setShouldBufferData):
857         * plugins/win/PluginStreamWin.cpp:
858         (WebCore::PluginStreamWin::PluginStreamWin):
859         (WebCore::PluginStreamWin::start):
860         (WebCore::PluginStreamWin::startStream):
861         (WebCore::PluginStreamWin::destroyStream):
862         (WebCore::PluginStreamWin::didReceiveData):
863         (WebCore::PluginStreamWin::didFinishLoading):
864         * plugins/win/PluginStreamWin.h:
865
866 2007-07-19  Geoffrey Garen  <ggaren@apple.com>
867
868         Reviewed by Darin Adler.
869         
870         Fixed <rdar://problem/5348384> Restore old return value behavior of 
871         stringByEvaluatingJavaScriptFromString
872         
873         Return an empty string unless you have a string, boolean, or number
874         result.
875
876         * WebCore.xcodeproj/project.pbxproj:
877         * page/mac/WebCoreFrameBridge.mm:
878         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
879
880 2007-07-19  Darin Adler  <darin@apple.com>
881
882         Reviewed by Alexey.
883
884         - fix http://bugs.webkit.org/show_bug.cgi?id=14666
885           remove unused xxx-encodings.txt for all platforms other than Mac
886
887         * platform/gdk/gdk-encodings.txt: Removed.
888         * platform/win/win-encodings.txt: Removed.
889         * platform/wx/wx-encodings.txt: Removed.
890
891         * platform/character-sets.txt: Moved into mac subdirectory since it's only used for Mac; at some
892         point I hope to remove it completely.
893         * platform/make-charset-table.pl: Ditto.
894         * platform/mac/character-sets.txt: Copied from platform/character-sets.txt.
895         * platform/mac/make-charset-table.pl: Copied from platform/make-charset-table.pl.
896
897         * DerivedSources.make: Moved CharsetData.cpp into the MACOS section.
898         Changed the build rule to use Mac-specific paths for everything and got rid of
899         make variables.
900
901         * WebCore.vcproj/build-generated-files.sh: Removed code to set ENCODINGS_FILE and ENCODINGS_PREFIX.
902         * WebCore.xcodeproj/project.pbxproj: Ditto.
903         * make-generated-sources.sh: Ditto.
904
905         * Projects/gdk/webcore-gdk.bkl: Removed code to pass gdk-encodings.txt to make-generated-sources.sh.
906         * Projects/wx/webcore-wx.bkl: Ditto, but for wx-encodings.txt.
907
908 2007-07-19  Antti  <antti@apple.com>
909
910         Reviewed by Darin.
911
912         Fix <rdar://problem/5257371>
913         Dashcode Client crash when clicking on placemarks in Maps widget in WebCore::DeprecatedPtrListImpl::addIterator
914         
915         FlexibleBoxes should never have inline children. Don't move children out from last remaining anonymous block.
916
917         * rendering/RenderBlock.cpp:
918         (WebCore::RenderBlock::removeChild): real fix
919         * rendering/RenderFlexibleBox.cpp:
920         (WebCore::RenderFlexibleBox::layoutVerticalBox): just to be sure, this is checked elsewhere too
921
922 2007-07-19  Anders Carlsson  <andersca@apple.com>
923
924         Reviewed by Darin.
925
926         <rdar://problem/5322268>
927         Safari Crash at http://www.exlibrisgroup.com/sfx_openurl.htm
928         
929         Add a real copy constructor and assignment operator for CollectionInfo
930         so that the vectors in the cache maps will be copied correctly.
931         
932         * html/HTMLCollection.cpp:
933         (WebCore::HTMLCollection::CollectionInfo::CollectionInfo):
934         (WebCore::HTMLCollection::CollectionInfo::swap):
935         * html/HTMLCollection.h:
936         (WebCore::HTMLCollection::CollectionInfo::operator=):
937         (WebCore::HTMLCollection::CollectionInfo::copyCacheMap):
938
939 2007-07-19  David Hyatt  <hyatt@apple.com>
940
941         Fix for 5237574, Colloquy main view does not size correctly.  Make
942         sure to reset the baseilne when calculating a row's height/baseline, so
943         that old values don't stick around.
944
945         Reviewed by Tim Hatcher
946
947         * rendering/RenderTableSection.cpp:
948         (WebCore::RenderTableSection::calcRowHeight):
949
950 2007-07-19  Antti  <antti@apple.com>
951
952         Reviewed by John.
953         
954         Fix <rdar://problem/5346697>
955         REGRESSION(r23773): Visibile children on invisible layer are not painted (fast/layers/layer-visibility.html fails)
956         
957         Test m_hasVisibleContent instead of renderer()->style()->visibility(). 
958         This takes children into account too.
959
960         Regression spotted by Mitz.
961
962         * rendering/RenderLayer.cpp:
963         (WebCore::RenderLayer::paintLayer):
964
965 2007-07-18  Oliver Hunt  <oliver@apple.com>
966
967         Rubber stamped by maciej
968
969         Rollout patch from r24437.
970
971         * page/EventHandler.cpp:
972         (WebCore::EventHandler::keyEvent):
973
974 2007-07-18  Oliver Hunt  <oliver@apple.com>
975
976         Reviewed by Kevin M.
977
978         Fix for <rdar://problem/5346167> DOM key events triggered during
979                 IME composition differ in webkit/mac vs all windows browsers
980
981         We no longer send DOM key events during IME composition.  This behaviour 
982         matches the behaviour of WebKit/Win.
983
984         * page/EventHandler.cpp:
985         (WebCore::EventHandler::keyEvent):
986
987 2007-07-18  Sam Weinig  <sam@webkit.org>
988
989         Reviewed by Oliver.
990
991         Fix for http://bugs.webkit.org/show_bug.cgi?id=14646
992         WebKit border radius properties are unavailable via JavaScript
993
994         Test: fast/dom/getComputedStyle-borderRadius.html
995
996         * css/CSSComputedStyleDeclaration.cpp:
997         (WebCore::getBorderRadiusCornerValue): Helper function that returns a single value if
998         width and the height of the corner radius are equal, and otherwise a pair.
999         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1000
1001 2007-07-18  Anders Carlsson  <andersca@apple.com>
1002
1003         Reviewed by Darin.
1004
1005         <rdar://problem/5262136> Double form repost alert going forward on britishairways.com
1006         
1007         When checking if the request has changed and a new policy callback needs to be sent, 
1008         ignore the request headers. NSURLConnection in Leopard will always call willSendRequest,
1009         with a request that was different from the one passed to -[NSURLConnection connectionWithRequest:]
1010         (a few Accept headers are added).
1011
1012         * loader/FrameLoader.cpp:
1013         (WebCore::FrameLoader::checkNavigationPolicy):
1014         * platform/network/ResourceRequestBase.cpp:
1015         (WebCore::equalIgnoringHeaderFields):
1016         (WebCore::operator==):
1017         * platform/network/ResourceRequestBase.h:
1018
1019 2007-07-18  Anders Carlsson  <andersca@apple.com>
1020
1021         Reviewed by Darin.
1022
1023         <rdar://problem/5340098>
1024         http://bugs.webkit.org/show_bug.cgi?id=13366
1025         REGRESSION (r10935): AOL beta music player doesn't play
1026
1027         The AOL beta music player has a typo, causing it to create an <embed"> element inside of
1028         an <object> element
1029         Because of this, it will not be treated as an embed tag, so its name will not be added
1030         to the document's named item map. Furthermore, since the <object> contains a child that
1031         is not a <param>, the object's name won't be added either.
1032         
1033         The (somewhat ugly) fix is to add <object> to the named map only if it has <param> or
1034         unknown elements as children.
1035         
1036         * html/HTMLObjectElement.cpp:
1037         (WebCore::HTMLObjectElement::updateDocNamedItem):
1038
1039 2007-07-18  Timothy Hatcher  <timothy@apple.com>
1040
1041         Reviewed by Adam.
1042
1043         <rdar://problem/5343767> Should have a way to disable the Web Inspector
1044
1045         This change facilitates the ability to turn the Web Inspector on and off.
1046
1047         Makes the InspectorClient be required to create a new Page. This also means that
1048         InspectorController will never be NULL. Adds a new function on Page to test
1049         if the inspector is enabled.
1050
1051         * WebCore.exp: New symbol for the Page constructor.
1052         * WebCore.pro: Add InspectorClientGdk.cpp.
1053         * WebCoreSources.bkl: ditto.
1054         * html/HTMLDocument.cpp:
1055         (WebCore::HTMLDocument::createTokenizer):
1056         * loader/FrameLoader.cpp:
1057         (WebCore::FrameLoader::detachFromParent): Don't null check the InspectorCOntroller.
1058         (WebCore::FrameLoader::dispatchDidCommitLoad): Ditto.
1059         (WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest): Ditto.
1060         (WebCore::FrameLoader::dispatchWillSendRequest): Ditto.
1061         (WebCore::FrameLoader::dispatchDidReceiveResponse): Ditto.
1062         (WebCore::FrameLoader::dispatchDidReceiveContentLength): Ditto.
1063         (WebCore::FrameLoader::dispatchDidFinishLoading): Ditto.
1064         (WebCore::FrameLoader::dispatchDidLoadResourceFromMemoryCache): Ditto.
1065         * page/ContextMenuController.cpp:
1066         (WebCore::ContextMenuController::handleContextMenuEvent): Ask the InspectorController if it is enabled.
1067         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
1068         * page/InspectorController.cpp:
1069         (WebCore::InspectorController::enabled): Ask the Page's settings if developer extras are enabled.
1070         (WebCore::InspectorController::inspect): Check if the InspectorController is enabled.
1071         (WebCore::InspectorController::focusNode): Ditto.
1072         (WebCore::InspectorController::highlight): Ditto.
1073         (WebCore::InspectorController::hideHighlight): Ditto.
1074         (WebCore::InspectorController::addMessageToConsole): Ditto.
1075         (WebCore::InspectorController::attachWindow): Ditto.
1076         (WebCore::InspectorController::detachWindow): Ditto.
1077         (WebCore::InspectorController::windowScriptObjectAvailable): Ditto.
1078         (WebCore::InspectorController::didCommitLoad): Ditto.
1079         (WebCore::InspectorController::frameDetachedFromParent): Ditto.
1080         (WebCore::InspectorController::didLoadResourceFromMemoryCache): Ditto.
1081         (WebCore::InspectorController::identifierForInitialRequest): Ditto.
1082         (WebCore::InspectorController::willSendRequest): Ditto.
1083         (WebCore::InspectorController::didReceiveResponse): Ditto.
1084         (WebCore::InspectorController::didReceiveContentLength): Ditto.
1085         (WebCore::InspectorController::didFinishLoading): Ditto.
1086         (WebCore::InspectorController::didFailLoading): Ditto.
1087         * page/InspectorController.h:
1088         * page/Page.cpp:
1089         (WebCore::Page::Page): Require an InspectorClient.
1090         (WebCore::Page::~Page): Always call pageDestroyed on the InspectorController.
1091         (WebCore::Page::inspectorEnabled): Check the WebCore settings if the developer extras are enabled.
1092         * page/Page.h:
1093         * page/gdk/InspectorClientGdk.cpp: Added.
1094         (WebCore::InspectorClientGdk::inspectorDestroyed): Empty stub calling notImplemented.
1095         (WebCore::InspectorClientGdk::createPage): Ditto.
1096         (WebCore::InspectorClientGdk::showWindow): Ditto.
1097         (WebCore::InspectorClientGdk::closeWindow): Ditto.
1098         (WebCore::InspectorClientGdk::attachWindow): Ditto.
1099         (WebCore::InspectorClientGdk::detachWindow): Ditto.
1100         (WebCore::InspectorClientGdk::highlight): Ditto.
1101         (WebCore::InspectorClientGdk::hideHighlight): Ditto.
1102         (WebCore::InspectorClientGdk::inspectedURLChanged): Ditto.
1103         * page/gdk/InspectorClientGdk.h: Added.
1104         * platform/graphics/svg/SVGImage.cpp:
1105         (WebCore::SVGImage::dataChanged): Pass in a dummy InspectorClient.
1106         * platform/graphics/svg/SVGImageEmptyClients.h:
1107         (WebCore::SVGEmptyInspectorClient::~SVGEmptyInspectorClient): Empty dummy implementation.
1108         (WebCore::SVGEmptyInspectorClient::inspectorDestroyed): Ditto.
1109         (WebCore::SVGEmptyInspectorClient::createPage): Ditto.
1110         (WebCore::SVGEmptyInspectorClient::showWindow): Ditto.
1111         (WebCore::SVGEmptyInspectorClient::closeWindow): Ditto.
1112         (WebCore::SVGEmptyInspectorClient::attachWindow): Ditto.
1113         (WebCore::SVGEmptyInspectorClient::detachWindow): Ditto.
1114         (WebCore::SVGEmptyInspectorClient::highlight): Ditto.
1115         (WebCore::SVGEmptyInspectorClient::hideHighlight): Ditto.
1116         (WebCore::SVGEmptyInspectorClient::inspectedURLChanged): Ditto.
1117
1118 2007-07-18  Anders Carlsson  <andersca@apple.com>
1119
1120         Make some headers private instead of project.
1121         
1122         * WebCore.xcodeproj/project.pbxproj:
1123
1124 2007-07-18  John Sullivan  <sullivan@apple.com>
1125
1126         Reviewed by Maciej and Kevin Decker
1127
1128         - fixed <rdar://problem/5315926> REGRESSION: ~.4% PLT regression from r23949 (canonicalization change)
1129
1130         * loader/mac/LoaderNSURLExtras.m:
1131         (canonicalURL):
1132         Rolled out the fix for 5249730 that caused this regression. 5249730 is addressed a different way now.
1133
1134 2007-07-18  Sam Weinig  <sam@webkit.org>
1135
1136         Build fix.
1137
1138         * WebCore.xcodeproj/project.pbxproj:
1139         * loader/gdk/FrameLoaderClientGdk.cpp:
1140         (WebCore::FrameLoaderClientGdk::objectContentType):
1141         * platform/graphics/win/ImageWin.cpp:
1142         * platform/network/cf/ResourceResponseCFNet.cpp:
1143         * platform/win/ClipboardWin.cpp:
1144         (WebCore::createGlobalImageFileDescriptor):
1145
1146 2007-07-18  Sam Weinig  <sam@webkit.org>
1147
1148         Rubber-stamped by Adam Roben.
1149
1150         Rename MimeTypeRegistry to MIMETypeRegistry and xmlhttprequest to XMLHttpRequest
1151
1152         * WebCore.exp:
1153         * WebCore.pro:
1154         * WebCore.vcproj/WebCore.vcproj:
1155         * bindings/js/JSXMLHttpRequest.cpp:
1156         * bindings/js/kjs_binding.cpp:
1157         * bindings/js/kjs_dom.cpp:
1158         * dom/Document.cpp:
1159         * html/HTMLFormElement.cpp:
1160         (WebCore::HTMLFormElement::formData):
1161         * html/HTMLObjectElement.cpp:
1162         (WebCore::HTMLObjectElement::containsJavaApplet):
1163         * loader/FrameLoader.cpp:
1164         (WebCore::FrameLoader::requestObject):
1165         * loader/mac/LoaderNSURLExtras.m:
1166         (suggestedFilenameWithMIMEType):
1167         * platform/MIMETypeRegistry.cpp: Copied from platform/MimeTypeRegistry.cpp.
1168         (WebCore::initialiseSupportedImageMIMETypes):
1169         (WebCore::initialiseMIMETypeRegistry):
1170         (WebCore::MIMETypeRegistry::getMIMETypeForPath):
1171         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
1172         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
1173         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
1174         (WebCore::MIMETypeRegistry::isJavaAppletMIMEType):
1175         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
1176         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
1177         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
1178         * platform/MIMETypeRegistry.h: Copied from platform/MimeTypeRegistry.h.
1179         * platform/MimeTypeRegistry.cpp: Removed.
1180         * platform/MimeTypeRegistry.h: Removed.
1181         * platform/gdk/MIMETypeRegistryGdk.cpp: Copied from platform/gdk/MimeTypeRegistryGdk.cpp.
1182         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1183         * platform/gdk/MimeTypeRegistryGdk.cpp: Removed.
1184         * platform/graphics/BitmapImage.cpp:
1185         * platform/graphics/Image.cpp:
1186         (WebCore::Image::supportsType):
1187         * platform/mac/DragDataMac.mm:
1188         * platform/mac/MIMETypeRegistryMac.mm: Copied from platform/mac/MimeTypeRegistryMac.mm.
1189         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1190         (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
1191         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1192         * platform/mac/MimeTypeRegistryMac.mm: Removed.
1193         * platform/mac/PasteboardMac.mm:
1194         (WebCore::Pasteboard::writeImage):
1195         * platform/qt/MIMETypeRegistryQt.cpp: Copied from platform/qt/MimeTypeRegistryQt.cpp.
1196         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1197         * platform/qt/MimeTypeRegistryQt.cpp: Removed.
1198         * platform/win/MIMETypeRegistryWin.cpp: Copied from platform/win/MimeTypeRegistryWin.cpp.
1199         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1200         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1201         * platform/win/MimeTypeRegistryWin.cpp: Removed.
1202         * rendering/RenderPartObject.cpp:
1203         (WebCore::RenderPartObject::updateWidget):
1204         * xml/xmlhttprequest.cpp: Removed.
1205         * xml/xmlhttprequest.h: Removed.
1206         * xml/XMLHttpRequest.cpp: Copied from xml/xmlhttprequest.cpp.
1207         * xml/XMLHttpRequest.h: Copied from xml/xmlhttprequest.h.
1208
1209 2007-07-18  Sam Weinig  <sam@webkit.org>
1210
1211         Rubber-stamped by Adam Roben.
1212
1213         Rename csshelper.h, csshelper.cpp, cssparser.h, cssparser.cpp,
1214         cssstyleselector.h, and cssstyleselector.cpp to be CamelCase.
1215
1216         * WebCore.pro:
1217         * WebCore.vcproj/WebCore.vcproj:
1218         * bindings/objc/DOM.mm:
1219         * bindings/objc/DOMHTML.mm:
1220         * css/CSSGrammar.y:
1221         * css/CSSMediaRule.cpp:
1222         * css/CSSMutableStyleDeclaration.cpp:
1223         * css/CSSPrimitiveValue.cpp:
1224         * css/CSSStyleSheet.cpp:
1225         * css/MediaList.cpp:
1226         * css/MediaQueryExp.cpp:
1227         * css/csshelper.cpp: Removed.
1228         * css/csshelper.h: Removed.
1229         * css/CSSHelper.cpp: Copied from css/csshelper.cpp.
1230         * css/CSSHelper.h: Copied from css/csshelper.h.
1231         * css/cssparser.cpp: Removed.
1232         * css/cssparser.h: Removed.
1233         * css/CSSParser.cpp: Copied from css/cssparser.cpp.
1234         * css/CSSParser.h: Copied from css/cssparser.h.
1235         * css/cssstyleselector.cpp: Removed.
1236         * css/cssstyleselector.h: Removed.
1237         * css/CSSStyleSelector.cpp: Copied from css/cssstyleselector.cpp.
1238         * css/CSSStyleSelector.h: Copied from css/cssstyleselector.h.
1239         * dom/Document.cpp:
1240         * dom/Element.cpp:
1241         * dom/StyledElement.cpp:
1242         * editing/ApplyStyleCommand.cpp:
1243         * editing/markup.cpp:
1244         * html/CanvasGradient.cpp:
1245         * html/CanvasRenderingContext2D.cpp:
1246         * html/CanvasStyle.cpp:
1247         * html/HTMLAnchorElement.cpp:
1248         * html/HTMLBaseElement.cpp:
1249         * html/HTMLBodyElement.cpp:
1250         * html/HTMLDocument.cpp:
1251         * html/HTMLEmbedElement.cpp:
1252         * html/HTMLFormElement.cpp:
1253         * html/HTMLFrameElementBase.cpp:
1254         * html/HTMLImageElement.cpp:
1255         * html/HTMLImageLoader.cpp:
1256         * html/HTMLLinkElement.cpp:
1257         * html/HTMLObjectElement.cpp:
1258         * html/HTMLOptGroupElement.cpp:
1259         * html/HTMLOptionElement.cpp:
1260         * html/HTMLSelectElement.cpp:
1261         * html/HTMLTableElement.cpp:
1262         * html/HTMLTablePartElement.cpp:
1263         * html/HTMLTokenizer.cpp:
1264         * ksvg2/css/SVGCSSParser.cpp:
1265         * ksvg2/css/SVGCSSStyleSelector.cpp:
1266         * ksvg2/svg/SVGAElement.cpp:
1267         * ksvg2/svg/SVGClipPathElement.cpp:
1268         * ksvg2/svg/SVGGradientElement.cpp:
1269         * ksvg2/svg/SVGLength.cpp:
1270         * ksvg2/svg/SVGMaskElement.cpp:
1271         * ksvg2/svg/SVGStyledElement.cpp:
1272         * ksvg2/svg/SVGUseElement.cpp:
1273         * page/DOMWindow.cpp:
1274         * page/mac/FrameMac.mm:
1275         * page/mac/WebCoreFrameBridge.mm:
1276         * rendering/HitTestResult.cpp:
1277         * rendering/RenderObject.cpp:
1278         * rendering/RenderStyle.cpp:
1279         * rendering/RenderThemeMac.mm:
1280
1281 2007-07-18  Brady Eidson  <beidson@apple.com>
1282
1283         Rubberstamped by Adam
1284
1285         * platform/win/SharedBufferWin.cpp:
1286         (WebCore::SharedBuffer::createWithContentsOfFile): Correct license on this newly checked in file from yesterday
1287
1288 2007-07-18  Maciej Stachowiak  <mjs@apple.com>
1289
1290         Reviewed by Oliver.
1291
1292         - fixed <rdar://problem/5340603> REGRESSION: javascript being written to the screen in Safari
1293
1294         Test Case: fast/tokenizer/badscript.html
1295         
1296         * html/HTMLTokenizer.cpp:
1297         (WebCore::HTMLTokenizer::parseTag): Don't apply our self-closing
1298         <script> quirk in cases where the / appears in a mangled attribtue
1299         value.
1300
1301 2007-07-17  Peter Kasting  <zerodpx@gmail.com>
1302
1303         Reviewed by Hyatt.
1304
1305         http://bugs.webkit.org/show_bug.cgi?id=13618
1306         Don't set link targets to "_blank" on middle-click; rely on the policy
1307         delegate to do the right thing.
1308
1309         * html/HTMLAnchorElement.cpp:
1310         (WebCore::HTMLAnchorElement::defaultEventHandler):
1311
1312 2007-07-17  Oliver Hunt  <oliver@apple.com>
1313
1314         Reviewed by Maciej.
1315
1316         Fix for <rdar://problem/4799967> Safari and other WebKit 
1317         apps sometimes crash in WebCore::FontData::platformInit
1318
1319         Always retain/release our font handle, instead of only retaining
1320         in the presence of GC.
1321
1322         * platform/mac/FontPlatformData.h:
1323         (WebCore::FontPlatformData::FontPlatformData):
1324         (WebCore::FontPlatformData::~FontPlatformData):
1325
1326 2007-07-17  Sam Weinig  <sam@webkit.org>
1327
1328         Reviewed by Geoff Garen.
1329
1330         Fix for <rdar://problem/5333957>
1331                 http://bugs.webkit.org/show_bug.cgi?id=14610
1332
1333         Original patch by Feng Qian.
1334
1335         - Clear the selection object when disconnecting a frame.
1336
1337         Test: http/tests/security/cross-frame-access-selection.html
1338
1339         * loader/FrameLoader.cpp:
1340         (WebCore::FrameLoader::clear):
1341         * page/DOMWindow.cpp:
1342         (WebCore::DOMWindow::disconnectFrame):
1343         (WebCore::DOMWindow::clear):
1344         * page/DOMWindow.h:
1345         * page/Frame.cpp:
1346         (WebCore::Frame::clearScriptProxy):
1347         (WebCore::Frame::clearDOMWindow):
1348         * page/Frame.h:
1349
1350 2007-07-17  Oliver Hunt  <oliver@apple.com>
1351
1352         Reviewed by Sam.
1353
1354         Fix for <rdar://problem/5154518> REGRESSION: Hitting return does
1355         nothing in ruby terminal at http://tryruby.hobix.com/
1356
1357         Calling event.preventDefault() during a keydown event should not 
1358         prevent the keypress event from firing.
1359
1360         * WebCore.xcodeproj/project.pbxproj:
1361         * page/EventHandler.cpp:
1362         (WebCore::EventHandler::keyEvent):
1363         (WebCore::EventHandler::defaultKeyboardEventHandler):
1364
1365 2007-07-17  Anders Carlsson  <andersca@apple.com>
1366
1367         Reviewed by Geoff.
1368
1369         <rdar://problem/4993463> 
1370         http://bugs.webkit.org/show_bug.cgi?id=12732
1371         REGRESSION: Comments fields on ircimages not showing up in nightly
1372
1373         Postpone setting the frame name to just right before we request the frame. Otherwise, 
1374         two calls to FrameTree::uniqueChildName will return the same frame name and in that case only
1375         one Frame object will actually be created and multiple iframe elements will refer to it.
1376         
1377         * html/HTMLFrameElementBase.cpp:
1378         (WebCore::HTMLFrameElementBase::openURL):
1379         (WebCore::HTMLFrameElementBase::setNameAndOpenURL):
1380         (WebCore::HTMLFrameElementBase::setNameAndOpenURLCallback):
1381         (WebCore::HTMLFrameElementBase::insertedIntoDocument):
1382         (WebCore::HTMLFrameElementBase::attach):
1383         * html/HTMLFrameElementBase.h:
1384
1385 2007-07-17  Brady Eidson  <beidson@apple.com>
1386
1387         Reviewed by Steve
1388
1389         Required for <rdar://problem/4516185> - FTP Directory Listings
1390
1391         * WebCore.vcproj/WebCore.vcproj: Added SharedBufferWin
1392         
1393         * platform/SharedBuffer.cpp: Windows doesn't get the default empty resource anymore
1394         * platform/win/SharedBufferWin.cpp: Added.
1395         (WebCore::SharedBuffer::createWithContentsOfFile):
1396
1397 2007-07-17  Brady Eidson  <beidson@apple.com>
1398
1399         Reviewed by Tim Hatcher
1400
1401         Tweak the class names we give to the icon table cell to make it easier to style
1402
1403         * loader/FTPDirectoryDocument.cpp:
1404           (WebCore::FTPDirectoryTokenizer::appendEntry): The the table cell a "IconCell" class name and
1405           either a "FileType" or "DirectoryType" class name depending on the type
1406
1407 2007-07-17  Holger Hans Peter Freyther  <zecke@selfish.org>
1408
1409         Reviewed by NOBODY.
1410
1411         Build fix after r24366 add an additional ResourceRequest parameter to
1412         the download method.
1413
1414         * loader/gdk/FrameLoaderClientGdk.cpp:
1415         (WebCore::FrameLoaderClientGdk::download):
1416         * loader/gdk/FrameLoaderClientGdk.h:
1417
1418 2007-07-17  Adam Roben  <aroben@apple.com>
1419
1420         Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item
1421         http://bugs.webkit.org/show_bug.cgi?id=14324
1422
1423         Reviewed by Tim.
1424
1425         No regression test possible.
1426
1427         * page/ContextMenuController.cpp:
1428         (WebCore::ContextMenuController::handleContextMenuEvent): Add the
1429         Inspect Element item to the menu before passing it to the
1430         ContextMenuClient so that the UI delegate has a chance to
1431         modify/remove the item.
1432
1433 2007-07-17  Adam Roben  <aroben@apple.com>
1434
1435         Remove ContextMenuClient::shouldIncludeInspectElementItem
1436
1437         Reviewed by Tim.
1438
1439         No regression test possible.
1440
1441         * page/ContextMenuClient.h:
1442         * page/ContextMenuController.cpp:
1443         (WebCore::ContextMenuController::handleContextMenuEvent): Use Settings
1444         to determine whether to include the Inspect Element item.
1445         * page/gdk/ContextMenuClientGdk.cpp:
1446         * page/gdk/ContextMenuClientGdk.h:
1447         * platform/graphics/svg/SVGImageEmptyClients.h:
1448
1449 2007-07-17  Adam Roben  <aroben@apple.com>
1450
1451         Initialize ContextMenuController::m_page
1452
1453         Somehow this variable had never been initialized before.
1454
1455         Reviewed by Tim.
1456
1457         * page/ContextMenuController.cpp:
1458         (WebCore::ContextMenuController::ContextMenuController):
1459         * page/ContextMenuController.h:
1460         * page/Page.cpp:
1461         (WebCore::Page::Page):
1462
1463 2007-07-17  Adam Roben  <aroben@apple.com>
1464
1465         Add Settings::developerExtrasEnabled
1466
1467         Reviewed by Tim.
1468
1469         * WebCore.exp:
1470         * page/Settings.cpp:
1471         * page/Settings.h:
1472
1473 2007-07-17  Justin Garcia  <justin.garcia@apple.com>
1474
1475         Reviewed by Antti.
1476
1477         <rdar://problem/5206311> 
1478         Whitespace can't be removed when editing text pasted into from web page
1479         
1480         The whitespace comes from table rows that aren't being removed after they are
1481         emptied out during a deletion.
1482
1483         * editing/DeleteSelectionCommand.cpp:
1484         (WebCore::isTableCell):
1485         (WebCore::isTableRow):
1486         (WebCore::isTableCellEmpty):
1487         (WebCore::isTableRowEmpty):
1488         (WebCore::DeleteSelectionCommand::initializePositionData): Remember the table
1489         rows that contained the start and end of the selection.
1490         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
1491         Remove table rows that come before the end of the selection
1492         that was removed (except for the row that contained the start of the selection
1493         and any before that).
1494         Remove table rows that are come after the start of the selection
1495         that was removed (except for the row that contained the end of the selection
1496         and any after that).
1497         (WebCore::DeleteSelectionCommand::doApply): Call the new function.
1498         * editing/DeleteSelectionCommand.h:
1499
1500 2007-07-17  Geoffrey Garen  <ggaren@apple.com>
1501
1502         Reviewed by Kevin Decker.
1503
1504         Removed ASSERT that was breaking the pageout test. It's trivial to
1505         reproduce this ASSERT when navigating between pages that change their
1506         names, but nothing bad seems to happen.
1507
1508         * page/Page.cpp:
1509         (WebCore::Page::goToItem):
1510
1511 2007-07-17  Geoffrey Garen  <ggaren@apple.com>
1512
1513         Build fix.
1514         
1515         * plugins/win/PluginViewWin.cpp: Pass false for lockHistory like we
1516         do elsewhere.
1517
1518 2007-07-17  Holger Hans Peter Freyther  <zecke@selfish.org>
1519
1520         Reviewed by Maciej.
1521
1522         Implement the callback responsible for handling HTTP headers. This
1523         callback gets called for every header.
1524         We will add these headers to our ResourceResponse and on the 'end-of-header'
1525         indicator we will update the ResourceResponse and dispatch it.
1526
1527         This patch adds various set methods to ResourceResponse. This improves
1528         the readability of the headerCallback and avoids storing a CURL handle inside
1529         the ResourceResponse which would be needed to implement ResourceResponse::doUpdateResourceResponse
1530
1531         Add a destructor for ResourceHandleManager which would free the resources and remove
1532         a unused variable.
1533
1534         * platform/network/ResourceHandleInternal.h:
1535         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1536         * platform/network/ResourceResponse.cpp:
1537         (WebCore::ResourceResponse::setUrl):
1538         (WebCore::ResourceResponse::setMimeType):
1539         (WebCore::ResourceResponse::setExpectedContentLength):
1540         (WebCore::ResourceResponse::setTextEncodingName):
1541         (WebCore::ResourceResponse::setSuggestedFilename):
1542         * platform/network/ResourceResponse.h:
1543         * platform/network/curl/ResourceHandleCurl.cpp:
1544         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
1545         * platform/network/curl/ResourceHandleManager.cpp:
1546         (WebCore::ResourceHandleManager::~ResourceHandleManager):
1547         (WebCore::ResourceHandleManager::sharedInstance):
1548         (WebCore::headerCallback):
1549         * platform/network/curl/ResourceHandleManager.h:
1550
1551 2007-07-17  Sam Weinig  <sam@webkit.org>
1552
1553         Reviewed by Adam Roben.
1554
1555         Convert JS undefined to the empty string when calling alert, confirm, and prompt. 
1556
1557         Test: fast/dom/Window/alert-undefined.html
1558
1559         * page/DOMWindow.idl:
1560
1561 2007-07-17  Geoffrey Garen  <ggaren@apple.com>
1562
1563         Reviewed by Kevin McCulough.
1564
1565         Fixed failing layout test.
1566         
1567         Renamed "FrameLoadTypeInternal" to "FrameLoadTypeRedirectWithLockedHistory".
1568         This is almost certainly not a correct name for the original intent
1569         of this load type, but it's a correct name for its current behavior.
1570         
1571         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory):
1572         When history is supposed to be locked, and no current history item
1573         exists, only add a new history item if you're the top-level frame.
1574         
1575         This rule, combined with the rule that setting iframe.src should not
1576         create a history item, is pretty hackish. On the other hand, it
1577         matches WinIE and doesn't cause any test regressions. So I'm OK with
1578         it as a short-term solution until the solution described in 
1579         <rdar://problem/5339292> can be implemented.
1580
1581 2007-07-17  Tristan O'Tierney  <tristan@apple.com>
1582
1583         Reviewed by Maciej Stachowiak.
1584
1585         <rdar://problem/5294691> Source of file is misrepresented if downloaded by typing in URL in Safari address bar
1586
1587         * loader/FrameLoaderClient.h:
1588         * loader/MainResourceLoader.cpp:        
1589         (WebCore::MainResourceLoader::continueAfterContentPolicy):
1590         Added an extra request parameter, initialRequest, to the download() method
1591         by passing up the resource handle's request.
1592         
1593         * platform/graphics/svg/SVGImageEmptyClients.h:
1594         (WebCore::SVGEmptyFrameLoaderClient::download):
1595         Added an extra parameter to the empty SVG download method.
1596         
1597 2007-07-17  Antti  <antti@apple.com>
1598
1599         Reviewed by home-bradee.
1600
1601         <rdar://problem/5336372>
1602         Icon database uses too much memory
1603         
1604         XRaying Safari startup memory consumption revealed that icon database is eating quite
1605         a bit of RAM if Icon.db is large (which it probably is if it has been in use for a while, 
1606         mine used for getting figures below was 2.6MB). 
1607         
1608         Note that the wins are less impressive with smaller Icon.db.
1609         
1610         This patch addresses three separate issues
1611         
1612         - SQLite fails to free the memory used by temporary tables. Icon database uses a temporary table
1613           on startup for pruning unused page urls. This wastes around 1MB. Addressed by rewriting
1614           pruning so it does not need a temporary table. The new method is also quite a bit faster speeding
1615           up Safari launch time by around 100ms
1616         - SQLite has it's own memory cache limited by default to 3MB. Icon database does not really need that much.
1617           Dropped the cache size to 300kB saving ~1MB on startup. 
1618           Smaller cache slows down startup by ~30ms (more than compensated by faster pruning above)
1619         - Don't populate m_pageURLToIconURLMap with all urls from database on startup, instead let it get populated
1620           when urls are accessed (user opens history menu for example). This shouldn't have any real performance impact 
1621           as the accesses are icon loads that need to hit the database anyway. This saves ~700kB.
1622           
1623         All in all with this Icon.db these changes reduce allocated memory by around 2.7MB on startup. Release build
1624         Safari RPRVT (empty start page) goes from 12.4MB to 10.4MB (TCMalloc pooling probably explaining why the win 
1625         looks bit smaller here).
1626
1627         * loader/icon/IconDatabase.cpp:
1628         (WebCore::IconDatabase::IconDatabase):
1629         (WebCore::IconDatabase::open):
1630         (WebCore::IconDatabase::deleteAllPreparedStatements):
1631         (WebCore::IconDatabase::retainIconForPageURL):
1632         (WebCore::IconDatabase::releaseIconForPageURL):
1633         (WebCore::IconDatabase::establishIconIDForIconURL):
1634         (WebCore::IconDatabase::pruneUnretainedIconsOnStartup):
1635         * loader/icon/IconDatabase.h:
1636
1637 2007-07-17  Darin Adler  <darin@apple.com>
1638
1639         Reviewed by Mitz.
1640
1641         - fix http://bugs.webkit.org/show_bug.cgi?id=14569
1642           Repro crash due to saved state not being cleared when select and textarea elements
1643           are adopted by another document
1644
1645         Test: fast/forms/saved-state-adoptNode-crash.html
1646
1647         * dom/Document.h:
1648         (WebCore::Document::registerFormElementWithState): Updated parameter type to be
1649         HTMLFormControlElementWithState.
1650         (WebCore::Document::unregisterFormElementWithState): Ditto.
1651         Also removed isFormElementRegistered function and changed the type of the
1652         m_formElementsWithState ListHashSet.
1653         * dom/Document.cpp: (WebCore::Document::formElementsState): Updated to use new type,
1654         for set contents and to use new saveState() function and only save state for elements
1655         that return true.
1656
1657         * html/HTMLGenericFormElement.h: Added HTMLFormControlElementWithState class,
1658         derived from HTMLGenericFormElement, and moved down all the behavior related to
1659         saving form control element state. Also removed the unnecessary default parameter
1660         to the HTMLGenericFormElement constructor.
1661         * html/HTMLGenericFormElement.cpp:
1662         (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState): Added.
1663         Calls registerFormElementWithState.
1664         (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState): Added.
1665         Calls unregisterFormElementWithState.
1666         (WebCore::HTMLFormControlElementWithState::willMoveToNewOwnerDocument): Added.
1667         Calls unregisterFormElementWithState.
1668         (WebCore::HTMLFormControlElementWithState::didMoveToNewOwnerDocument): Added.
1669         Calls registerFormElementWithState.
1670         (WebCore::HTMLFormControlElementWithState::closeRenderer): Moved to this class from
1671         the base class.
1672
1673         * html/HTMLInputElement.h: Updated the base class name and overrode saveState instead
1674         of stateValue.
1675         * html/HTMLInputElement.cpp: Updated the base class name.
1676         (WebCore::HTMLInputElement::init): Removed the call to registerFormElementWithState.
1677         (WebCore::HTMLInputElement::~HTMLInputElement): Removed the call to
1678         unregisterFormElementWithState. Also changed the code to only call the
1679         unregisterForDidRestoreFromCacheCallback function for type PASSWORD (consistency
1680         and efficiency).
1681         (WebCore::HTMLInputElement::setInputType): Removed calls to registerFormElementWithState
1682         and unregisterFormElementWithState; we now let the element stay registered and simply
1683         don't save or restore state for password fields.
1684         (WebCore::HTMLInputElement::saveState): Updated function name and signature to replace
1685         the old stateValue function. Returns false for password fields.
1686         (WebCore::HTMLInputElement::willMoveToNewOwnerDocument): Removed the call to
1687         unregisterFormElementWithState.
1688         (WebCore::HTMLInputElement::didMoveToNewOwnerDocument): Removed the call to
1689         registerFormElementWithState.
1690
1691         * html/HTMLSelectElement.h: Updated the base class name and overrode saveState instead
1692         of stateValue.
1693         * html/HTMLSelectElement.cpp: Updated the base class name.
1694         (WebCore::HTMLSelectElement::HTMLSelectElement): Removed the call to
1695         registerFormElementWithState.
1696         (WebCore::HTMLSelectElement::~HTMLSelectElement): Removed the call to
1697         unregisterFormElementWithState.
1698         (WebCore::HTMLSelectElement::saveState): Updated function name and signature to
1699         replace the old stateValue function.
1700         (WebCore::HTMLSelectElement::setLength): Updated to use document() instead of
1701         ownerDocument(); the latter is just a slower virtual-function way of doing the
1702         same thing in all cases except for Document and XPathNamespace.
1703
1704         * html/HTMLTextAreaElement.h: Update the base class name, overrode saveState instead
1705         of stateValue, and removed the now-unnecessary explicit destructor.
1706         * html/HTMLTextAreaElement.cpp: Updated the base class name.
1707         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Removed the call to
1708         registerFormElementWithState.
1709         (WebCore::HTMLTextAreaElement::saveState): Updated function name and signature to replace
1710         the old stateValue function.
1711
1712 2007-07-17  Sam Weinig  <sam@webkit.org>
1713
1714         Reviewed by Darin.
1715
1716         - Make HTMLFrameOwnerElement::contentWindow() return a DOMWindow instead of a Frame
1717         - Remove the unnecessary hack in HTMLFrameElement.idl and HTMLIFrameElement.idl that
1718           converted from Frame to Window now that it is not necessary.
1719         - Remove now unused [NullCheck] extended attribute from CodeGeneratorJS.pm.
1720
1721         * bindings/scripts/CodeGeneratorJS.pm:
1722         * html/HTMLDocument.idl:
1723         * html/HTMLFrameElement.idl:
1724         * html/HTMLFrameOwnerElement.cpp:
1725         (WebCore::HTMLFrameOwnerElement::contentWindow):
1726         * html/HTMLFrameOwnerElement.h:
1727         * html/HTMLIFrameElement.idl:
1728
1729 2007-07-16  Sam Weinig  <sam@webkit.org>
1730
1731         Reviewed by Adam Roben.
1732
1733         Move self, opener, parent, top, window, and frames from kjs_window
1734         to DOMWindow and auto-generate the bindings for them.
1735
1736         * bindings/js/kjs_window.cpp:
1737         (KJS::Window::getValueProperty):
1738         * bindings/js/kjs_window.h:
1739         (KJS::Window::):
1740         * page/DOMWindow.cpp:
1741         (WebCore::DOMWindow::self):
1742         (WebCore::DOMWindow::opener):
1743         (WebCore::DOMWindow::parent):
1744         (WebCore::DOMWindow::top):
1745         * page/DOMWindow.h:
1746         (WebCore::DOMWindow::window):
1747         (WebCore::DOMWindow::frames):
1748         * page/DOMWindow.idl:
1749
1750 2007-07-16  Geoffrey Garen  <ggaren@apple.com>
1751
1752         Reviewed by Sam Weinig.
1753         
1754         Fixed <rdar://problem/5334483> REGRESSION: JavaScript-induced 
1755         window.open loads not added to back/forward list
1756         
1757         I did an audit of our history rules in loading and tried to establish
1758         some sane uniformity.
1759         
1760         The uniform rule is:
1761             - HTTP redirects and HTTP redirects simulated by <meta http-equiv>
1762             add a history item if and only if the redirect takes > 1 second.
1763             - Other navigations, including JavaScript navigations, always
1764             add a history item, except for location.replace navigations.
1765
1766         In the future, we'll want to refine the second case to be more like the
1767         first. I've filed <rdar://problem/5339292> about that.
1768
1769         * bindings/js/JSHTMLDocumentCustom.cpp:
1770         (WebCore::JSHTMLDocument::setLocation): Don't pass 'true' for 
1771         userGesture unconditionally. userGesture is used to determine popup 
1772         blocking, not history item creation.
1773
1774         * bindings/js/kjs_window.cpp: Pass 'false' for lockHistory in all loads
1775         except location.replace, which intends to lock history.
1776
1777         * loader/FrameLoader.cpp: Distinguish between lockHistory and 
1778         userGesture. The former determines whether a new history item gets
1779         created. The latter determines whether JavaScript can open popup
1780         windows. Start passing these variables in functions that used to
1781         swallow or conflate them.
1782         
1783         (WebCore::FrameLoader::requestFrame): Pass 'true' for lockHistory here
1784         because that's usually correct when setting the 'src' attribute of a
1785         child frame, and we want to avoid regressing <rdar://problem/4921797>.
1786
1787         (WebCore::FrameLoader::load): Use the lockHistory variable to determine
1788         whether to start a history-creating load. Using userGesture for this
1789         purpose is wrong, as explained above.
1790
1791         * loader/FrameLoader.h: Renamed one variant of scheduleRedirection to
1792         scheduleHTTPRedirection because the behavior there of measuring elapsed
1793         time is specific to the HTTP redirection case.
1794
1795         * page/ContextMenuController.cpp:
1796         (WebCore::ContextMenuController::contextMenuItemSelected): lockHistory
1797         can always be false here because this navigation is never the result of
1798         a redirection.
1799
1800 2007-07-16  Sam Weinig  <sam@webkit.org>
1801
1802         Reviewed by Adam and Maciej.
1803
1804         Move the frameElement attribute from kjs_window to DOMWindow and
1805         auto-generate the bindings for it. 
1806
1807         * bindings/js/kjs_window.cpp:
1808         (KJS::Window::getValueProperty):
1809         * bindings/js/kjs_window.h:
1810         (KJS::Window::):
1811         * bindings/scripts/CodeGeneratorJS.pm:
1812         * page/DOMWindow.cpp:
1813         (WebCore::DOMWindow::frameElement):
1814         (WebCore::DOMWindow::devicePixelRatio):
1815         * page/DOMWindow.h:
1816         * page/DOMWindow.idl:
1817
1818 2007-07-16  Sam Weinig  <sam@webkit.org>
1819
1820         Reviewed by Adam.
1821
1822         Move more functions from kjs_window to DOMWindow and auto-generate
1823         the bindings for them.
1824
1825         * bindings/js/kjs_window.cpp:
1826         (KJS::WindowFunc::callAsFunction):
1827         * bindings/js/kjs_window.h:
1828         (KJS::Window::):
1829         * page/DOMWindow.cpp:
1830         (WebCore::DOMWindow::print):
1831         (WebCore::DOMWindow::stop):
1832         (WebCore::DOMWindow::alert):
1833         (WebCore::DOMWindow::confirm):
1834         (WebCore::DOMWindow::prompt):
1835         (WebCore::DOMWindow::find):
1836         * page/DOMWindow.h:
1837         * page/DOMWindow.idl:
1838
1839 2007-07-17  Mark Rowe  <mrowe@apple.com>
1840
1841         Gdk build fix.
1842
1843         * platform/gdk/ChromeClientGdk.h:
1844
1845 2007-07-16  Brady Eidson  <beidson@apple.com>
1846
1847         Reviewed by Adam
1848
1849         Begin the arduous task of localizing FTP directory listings while removing a global initializer!
1850
1851         * loader/FTPDirectoryDocument.cpp:
1852         (WebCore::processFilesizeString):
1853
1854         * page/mac/WebCoreViewFactory.h:
1855
1856         * platform/LocalizedStrings.h:
1857
1858         * platform/gdk/TemporaryLinkStubs.cpp:
1859         (WebCore::unknownFileSizeText):
1860
1861         * platform/mac/LocalizedStringsMac.mm:
1862         (WebCore::unknownFileSizeText):
1863
1864         * platform/qt/Localizations.cpp:
1865         (WebCore::unknownFileSizeText):
1866
1867 2007-07-16  Sam Weinig  <sam@webkit.org>
1868
1869         Reviewed by Oliver.
1870
1871         Remove more redundant isSafeScript checks.
1872
1873         * bindings/js/kjs_window.cpp:
1874         (KJS::Window::getOwnPropertySlot):
1875
1876 2007-07-16  Sam Weinig  <sam@webkit.org>
1877
1878         Reviewed by Oliver.
1879
1880         Turn off -Wshorten-64-to-32 warning for 64-bit builds.
1881
1882         * Configurations/Base.xcconfig:
1883
1884 2007-07-16  Anders Carlsson  <andersca@apple.com>
1885
1886         Reviewed by Oliver.
1887
1888         <rdar://problem/5336276>
1889         ASSERT(cs->accessCount() > 0) when instantiating widget templates in DashCode
1890
1891         If the cache is disabled, accessCount will always be 0. Account for this in the assert.
1892         
1893         * html/HTMLTokenizer.cpp:
1894         (WebCore::HTMLTokenizer::reset):
1895         (WebCore::HTMLTokenizer::notifyFinished):
1896
1897 2007-07-16  Brady Eidson  <beidson@apple.com>
1898
1899         Reviewed by Darin.
1900
1901         Append FTP row entries to the first TBODY instead of the TABLE element itself, 
1902         as many TABLE elements end up with an implicit TBODY and that's where most people would
1903         expect it to be added.
1904
1905         * html/HTMLTableElement.h:
1906         (WebCore::HTMLTableElement::firstTBody): Added this accessor
1907
1908         * loader/FTPDirectoryDocument.cpp:
1909         (WebCore::FTPDirectoryTokenizer::appendEntry): Add to the first tbody if it exists
1910
1911 2007-07-16  Justin Garcia  <justin.garcia@apple.com>
1912
1913         Reviewed by Adele.
1914
1915         <rdar://problem/5240265> 
1916         REGRESSION: Clicking a <button> clears the selection in contenteditable areas
1917
1918         * page/FocusController.cpp:
1919         (WebCore::clearSelectionIfNeeded): Don't clear the selection if
1920         the mouse press that caused the focus shift occurred in 
1921         a -webkit-user-select: ignore region.
1922
1923 2007-07-16  David Hyatt  <hyatt@apple.com>
1924
1925         Fix for 5335829, avoid creating a pathological # of FontData objects
1926         on Windows.  The MLang service actually caches and reuses HFONTs, which
1927         means it is safe to use our FontPlatformData -> FontData cache.
1928
1929         Reviewed by olliej
1930
1931         * platform/win/FontCacheWin.cpp:
1932         (WebCore::FontCache::getFontDataForCharacters):
1933
1934 2007-07-16  Adam Roben  <aroben@apple.com>
1935
1936         Added a manual test to test calling window.print on a subframe.
1937
1938         Reviewed by Darin.
1939
1940         * manual-tests/resources/print-subframe.html: Added.
1941         * manual-tests/window-print-subframe.html: Added.
1942
1943 2007-07-16  Adam Roben  <aroben@apple.com>
1944
1945         Replace Frame::print with Chrome::print
1946
1947         This also adds a Frame* parameter to Chrome::print and
1948         ChromeClient::print so that it knows which Frame to print.
1949
1950         Reviewed by Darin.
1951
1952         All tests pass.
1953
1954         * bindings/js/kjs_window.cpp:
1955         (KJS::WindowFunc::callAsFunction): Call Chrome::print.
1956         * editing/JSEditor.cpp: Ditto.
1957
1958         * bridge/win/FrameWin.cpp: Removed Frame::print.
1959         * page/Frame.h: Ditto.
1960         * page/mac/FrameMac.mm: Ditto.
1961         * page/qt/FrameQt.cpp: Ditto.
1962         * platform/gdk/FrameGdk.cpp: Ditto.
1963         * page/mac/WebCoreFrameBridge.h: Removed -print.
1964
1965         * page/Chrome.cpp: Added Frame* parameter to Chrome::print and pass it
1966         up to the ChromeClient.
1967         * page/Chrome.h: Ditto.
1968         * page/ChromeClient.h: Ditto.
1969         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
1970         * platform/graphics/svg/SVGImageEmptyClients.h: Ditto.
1971
1972 2007-07-16  Adele Peterson  <adele@apple.com>
1973
1974         Reviewed by Brady.
1975
1976         Fix for <rdar://problem/5321490> REGRESSION: visibility:hidden property doesn't hide parts of file input element and listbox
1977         http://bugs.webkit.org/show_bug.cgi?id=14565
1978
1979         Tests:
1980         fast/forms/hidden-input-file.html
1981         fast/forms/hidden-listbox.html
1982
1983         * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject):
1984         Only paint if the control is supposed to be visible.
1985         * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintObject):
1986         ditto.  We already had checks to prevent drawing the text that considered the option's style too, but if visibility: hidden
1987         was just set on the listbox then a lot of extra work was being done, and the scrollbar was drawing too.  This change fixes that.
1988
1989 2007-07-16  David Hyatt  <hyatt@apple.com>
1990
1991         Fix for Radar 5338081, text-shadow should be reset on form controls so that
1992         it doesn't inherit in when set e.g., on the <body>.
1993
1994         Reviewed by beth
1995
1996         * css/html4.css:
1997
1998 2007-07-16  Holger Hans Peter Freyther  <zecke@selfish.org>
1999
2000         Reviewed by Niko.
2001
2002         FrameView, PlatformScrollbar and changes to the way we draw
2003
2004         Fix the lifetime of PlatformScrollbar, use a default width and
2005         height and fix drawing of the PlatformScrollbar and other widgets
2006         the following way: FrameGdk handles the expose events of the Frame
2007         and will make the frame redraw and now it will draw the childrent of
2008         the FrameView as well. This approach has the issue of honoring the
2009         z-order of elements inside the RenderTree. Honoring the z-order will
2010         be a bit more work
2011
2012         Widget can now handle Widget::setGtkWidget call where the GtkWidget
2013         has not yet a GdkWindow allocated. We will lazily set the GdkDrawable.
2014
2015         In preparation of honoring the z-order of the RenderTree for RenderWidgets
2016         it is started to store native objects inside the GraphicsContext. Doing this
2017         nicely eliminates the need of RenderThemeGdk to do any drawing to a temporary
2018         GdkPixmap. This should fix themes with rounded buttons.
2019
2020         ScrollView implement add- and removeChild to get a working PlatformScrollbar
2021
2022
2023         * platform/Widget.h:
2024         * platform/gdk/FrameGdk.cpp:
2025         (frame_gdk_expose_child): Will send the expose to all children
2026         (WebCore::FrameGdk::handleGdkEvent): Painting changes, move to mouseMoved
2027         * platform/gdk/PlatformScreenGdk.cpp:
2028         (WebCore::screenDepth): gdkDrawable
2029         * platform/gdk/PlatformScrollBarGdk.cpp:
2030         (PlatformScrollbar::PlatformScrollbar): Fix ownership
2031         (PlatformScrollbar::~PlatformScrollbar): Fix ownership
2032         (PlatformScrollbar::paint): Widget::paint will do the right thing soon
2033         * platform/gdk/RenderThemeGdk.cpp: No need for using a GdkPixmap, draw directly
2034         (WebCore::RenderThemeGdk::paintCheckbox): No need for using a GdkPixmap, draw directly
2035         (WebCore::RenderThemeGdk::paintRadio): No need for using a GdkPixmap, draw directly
2036         (WebCore::RenderThemeGdk::paintButton): No need for using a GdkPixmap, draw directly
2037         * platform/gdk/RenderThemeGdk.h: remove the copyContext call
2038         * platform/gdk/ScrollViewGdk.cpp: gdkDrawable
2039         (WebCore::ScrollView::updateView): gdkDrawable
2040         (WebCore::ScrollView::update): clear the area to fix repainting issues
2041         (WebCore::ScrollView::setGtkWidget): gdkDrawable
2042         (WebCore::ScrollView::addChild): implement
2043         (WebCore::ScrollView::removeChild): implement
2044         * platform/gdk/TemporaryLinkStubs.cpp: Not needed header removed
2045         * platform/gdk/WidgetGdk.cpp:
2046         (WebCore::Widget::gdkDrawable): Renamed from drawable
2047         (WebCore::Widget::setGtkWidget): use gdkDrawable
2048         (WebCore::Widget::setCursor): gdkDrawable
2049         (WebCore::Widget::show): gdkDrawable
2050         (WebCore::Widget::hide): gdkDrawable
2051         * platform/graphics/GraphicsContext.h: Allow to set the GdkDrawable, e.g. used inside a expose event
2052         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2053         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
2054         (WebCore::GraphicsContext::setGdkDrawable):
2055         (WebCore::GraphicsContext::gdkDrawable):
2056
2057 2007-07-16  Holger Hans Peter Freyther  <zecke@selfish.org>
2058
2059         Reviewed by Maciej.
2060
2061         Lazily update the scrollbars (e.g. on loading a page) to
2062         generate less expose events, which will lead to laying out less often
2063          and will fix http://bugs.webkit.org/show_bug.cgi?id=14020.
2064
2065         * platform/gdk/ScrollViewGdk.cpp:
2066         (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
2067         (WebCore::ScrollView::update):
2068         (WebCore::ScrollView::resizeContents):
2069         (WebCore::ScrollView::updateScrollbars):
2070
2071 2007-07-16  Rob Buis  <buis@kde.org>
2072
2073         Reviewed by Maciej.
2074
2075         http://bugs.webkit.org/show_bug.cgi?id=14462
2076         non empty <style> element doesn't work
2077
2078         Return an empty sheet for empty <style> elements
2079         instead of a null sheet. Clean up StyleElement a bit.
2080
2081         * dom/StyleElement.cpp:
2082         (WebCore::StyleElement::StyleElement):
2083         (WebCore::StyleElement::sheet):
2084         (WebCore::StyleElement::childrenChanged):
2085         (WebCore::StyleElement::createSheet):
2086         * dom/StyleElement.h:
2087         (WebCore::StyleElement::setLoading):
2088         * html/HTMLStyleElement.cpp:
2089         (WebCore::HTMLStyleElement::HTMLStyleElement):
2090         (WebCore::HTMLStyleElement::sheet):
2091         * html/HTMLStyleElement.h:
2092         (WebCore::HTMLStyleElement::setLoading):
2093         * ksvg2/svg/SVGStyleElement.cpp:
2094         (WebCore::SVGStyleElement::sheet):
2095         (WebCore::SVGStyleElement::sheetLoaded):
2096         * ksvg2/svg/SVGStyleElement.h:
2097
2098 2007-07-15  Oliver Hunt  <oliver@apple.com>
2099
2100         Reviewed by Adam.
2101
2102         Fix for fix for <rdar://problem/5336602> REGRESSION: tab characters
2103                         cannot be entered into text fields
2104                         http://bugs.webkit.org/show_bug.cgi?id=14032
2105
2106         Need to use UChar not char.
2107
2108         * html/HTMLInputElement.cpp:
2109         (WebCore::HTMLInputElement::constrainValue):
2110
2111 2007-07-15  Sam Weinig  <sam@webkit.org>
2112
2113         Reviewed by Geoff Garen.
2114
2115         Remove redundant calls to isSafeScript()
2116
2117         * bindings/js/JSDOMWindowCustom.cpp:
2118         (WebCore::JSDOMWindow::customPut):
2119         * bindings/js/kjs_window.cpp:
2120         (KJS::Window::put):
2121
2122 2007-07-15  Geoffrey Garen  <ggaren@apple.com>
2123
2124         Reviewed by Maciej Stachowiak.
2125         
2126         Removed incorrect error log, seen while running layout tests.
2127         
2128         Perhaps at some point FrameLoadTypeInteral had a specific meaning
2129         that prevented it from being used in non-child frame, non-redirect
2130         situations. However, that meaning has been lost and nobody remembers
2131         how to get it back.
2132         
2133         We currently use FrameLoadTypeInternal for any load that is not
2134         initiated by a user gesture, so it's trivial to produce this error
2135         log, even though nothing has gone wrong.
2136
2137         * loader/FrameLoader.cpp:
2138         (WebCore::FrameLoader::updateHistoryForInternalLoad):
2139
2140 2007-07-15  Oliver Hunt  <oliver@apple.com>
2141
2142         Reviewed by Maciej
2143
2144         Fix for <rdar://problem/5336602> REGRESSION: tab characters cannot be entered into text fields
2145                 http://bugs.webkit.org/show_bug.cgi?id=14032
2146
2147         constrainValue attempted to block control characters from being inserted 
2148         by a simple less than ' ' check, which prevent tab characters from being
2149         inserted.  This patch adds an additional check to allow the tab character 
2150         again
2151
2152         * html/HTMLInputElement.cpp:
2153         (WebCore::HTMLInputElement::constrainValue):
2154
2155 2007-07-14  Brady Eidson  <beidson@apple.com>
2156
2157         Third shot at blind Qt/GDK build fix
2158
2159         * platform/gdk/TemporaryLinkStubs.cpp:
2160         (FTPDirectoryDocument::createTokenizer):
2161         * platform/qt/TemporaryLinkStubs.cpp:
2162         (FTPDirectoryDocument::createTokenizer):
2163
2164 2007-07-14  Brady Eidson  <beidson@apple.com>
2165
2166         Reviewed by Sam
2167
2168         Windows build fix
2169
2170         * WebCore.vcproj/WebCore.vcproj:
2171
2172 2007-07-14  Sam Weinig  <sam@webkit.org>
2173
2174         Fix Tiger build.
2175
2176         * config.h:
2177
2178 2007-07-14  Brady Eidson  <beidson@apple.com>
2179
2180         Blind attempt at (hopefully) fixing the Qt and GDK builds
2181
2182         * platform/gdk/TemporaryLinkStubs.cpp:
2183         (FTPDirectoryDocument::FTPDirectoryDocument):
2184         * platform/qt/TemporaryLinkStubs.cpp:
2185         (FTPDirectoryDocument::FTPDirectoryDocument):
2186
2187 2007-07-14  Brady Eidson  <beidson@apple.com>
2188
2189         Reviewed by Sam Weinig
2190
2191         Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
2192
2193         Development has taken place on both Leopard and Windows (windows enabling patch will follow shortly)
2194         Support will only exist on platforms whose network layers (ie, ResourceHandle) support piping the raw
2195         FTP Directory data into the engine.  
2196
2197         This is known to include Leopard, Windows, and CURL based platforms - probably others
2198         Known incompatible platforms include Tiger.
2199
2200         The FTP listing page is built in HTML.  An external HTML document can be provided as a template for the 
2201         directory listing.  This document is parsed, and expected to have a <table> with a certain class in it.
2202         As FTP directory listings come in, each entry is added to this table as a row.
2203
2204         If no HTML template is provided to work with, a very basic empty document is hard coded that contains only 
2205         this special table.
2206
2207         Upgrades to the look and feel of the directory listings can take place largely in this HTML template which,
2208         admittedly, is conspicuously absent in this initial checkin
2209
2210         * WebCore.exp: New Settings symbols for WebKit
2211         * WebCore.xcodeproj/project.pbxproj:
2212
2213         * config.h: If BUILDING_ON_TIGER, disable FTP directory listing support
2214
2215         * dom/DOMImplementation.cpp:
2216         (WebCore::DOMImplementation::createDocument): Create an FTPDirectoryDocument if the mime type is 
2217           "application/x-ftp-directory"
2218
2219         * loader/FTPDirectoryDocument.cpp: Added.
2220         (WebCore::FTPDirectoryTokenizer::isWaitingForScripts):
2221         (WebCore::FTPDirectoryTokenizer::checkBuffer):
2222         (WebCore::FTPDirectoryTokenizer::FTPDirectoryTokenizer): Building on HTML tokenizer, this facilitates 
2223           parsing FTP Directory listings in the engine
2224         (WebCore::FTPDirectoryTokenizer::appendEntry): Add a table row for a directory listing to the document
2225         (WebCore::FTPDirectoryTokenizer::createTDForFilename): Create the TD for the filename with the anchor in it
2226
2227         (WebCore::processFilesizeString): Prettify the filesize
2228         (WebCore::wasLastDayOfMonth):
2229         (WebCore::processFileDateString): Prettify the date
2230         (WebCore::FTPDirectoryTokenizer::parseAndAppendOneLine):
2231         (WebCore::FTPDirectoryTokenizer::loadDocumentTemplate): Loads the HTML template that FTP directory listings
2232           can build on top of
2233         (WebCore::FTPDirectoryTokenizer::createBasicDocument): Creates a most basic document (body and one table) to
2234           append the rows to in case the document template is not loaded and parsed
2235         (WebCore::FTPDirectoryTokenizer::write): Add the FTP listing to the buffer and parse entries out of it
2236         (WebCore::FTPDirectoryTokenizer::finish): 
2237
2238         (WebCore::FTPDirectoryDocument::FTPDirectoryDocument): Special document-type for FTP directory listings
2239         (WebCore::FTPDirectoryDocument::createTokenizer):
2240         * loader/FTPDirectoryDocument.h: Added.
2241         (WebCore::FTPDirectoryDocument::isImageDocument):
2242         
2243         * loader/FTPDirectoryParser.cpp: Added.
2244         (WebCore::parseOneFTPLine): Adapted from ParseFTPList.cpp from Firefox - parses most known
2245           FTP directory listing styles into discrete FTP directory entries
2246         * loader/FTPDirectoryParser.h: Added.
2247         (WebCore::ListState::ListState): Maintains FTP Parser state
2248         (WebCore::ListResult::ListResult): Represents one FTP directory listing
2249         (WebCore::ListResult::clear):
2250
2251         * loader/FrameLoader.cpp:
2252         (WebCore::FrameLoader::checkContentPolicy): If the Settings say to bypass the policy check for 
2253           "application/x-ftp-directory", skip it.  This will allow people to test this feature even if their 
2254           browser/WebKit app would otherwise not allow it
2255
2256         * page/Settings.cpp:
2257         (WebCore::Settings::Settings):
2258         (WebCore::Settings::setFTPDirectoryTemplatePath): Set the path to the FTP listing document template
2259         (WebCore::Settings::setForceFTPDirectoryListings): Set to bypass the policy delegate check for mime type
2260           "application/x-ftp-directory"
2261         * page/Settings.h:
2262         (WebCore::Settings::ftpDirectoryTemplatePath):
2263         (WebCore::Settings::forceFTPDirectoryListings):
2264
2265         * platform/Logging.cpp: Add an "LogFTP" logging channel
2266         * platform/Logging.h:
2267         * platform/mac/LoggingMac.mm:
2268         (WebCore::InitializeLoggingChannelsIfNecessary):
2269
2270         * platform/MimeTypeRegistry.cpp:
2271         (WebCore::initialiseSupportedNonImageMimeTypes): Add "application/x-ftp-directory"
2272
2273         * platform/SharedBuffer.cpp:
2274         (WebCore::SharedBuffer::createWithContentsOfFile): Stub for now
2275         * platform/SharedBuffer.h:
2276
2277         * platform/mac/SharedBufferMac.mm:
2278         (WebCore::SharedBuffer::createWithContentsOfFile): Load contents of the file into an NSData, then
2279           wrap that NSData
2280
2281 2007-07-14  Alexey Proskuryakov  <ap@webkit.org>
2282
2283         Reviewed by Darin.
2284
2285         http://bugs.webkit.org/show_bug.cgi?id=14618
2286         REGRESSION(13464): drivehq.com login form doesn't work
2287
2288         Test: http/tests/misc/post-submit-button.html
2289
2290         * html/HTMLInputElement.cpp:
2291         (WebCore::HTMLInputElement::appendFormData): Append a submit even if its value is empty.
2292
2293 2007-07-13  Oliver Hunt  <oliver@apple.com>
2294
2295         Reviewed by Sam.
2296
2297         Fix for 
2298             <rdar://problem/5335265> REGRESSION: WebCore::DragController crashes if WebDragSourceActionDHTML cleared
2299             http://bugs.webkit.org/show_bug.cgi?id=13652
2300
2301         Reorder logic for drag initiation: we can always preflight the clipboard, regardless as to whether 
2302         we are performing any dhtml drag handling    
2303
2304         * page/EventHandler.cpp:
2305         (WebCore::EventHandler::handleDrag):
2306
2307 2007-07-13  Matt Lilek  <pewtermoose@gmail.com>
2308
2309         Reviewed by Tim Hatcher.
2310
2311         Bug 14401: Semi-regression: Can no longer copy anything from the inspector
2312         http://bugs.webkit.org/show_bug.cgi?id=14401
2313
2314         * page/inspector/inspector.css:
2315
2316 2007-07-13  Beth Dakin  <bdakin@apple.com>
2317
2318         Reviewed by Hyatt.
2319
2320         Fix for <rdar://problem/5304742> A hang occurs when attempting to 
2321         display web clip banner at http://www.signonsandiego.com/sports/
2322         chargers/index.html
2323
2324         Here is the actual fix. 
2325         * rendering/RenderInline.cpp:
2326         (WebCore::RenderInline::absoluteRects): Set topLevel to 
2327         false when we recurse to get our children's absoluteRects.
2328         * rendering/RenderInline.h: New boolean parameter 
2329         topLevel that defaults to true.
2330         * rendering/RenderObject.cpp:
2331         (WebCore::RenderObject::absoluteRects):
2332         * rendering/RenderObject.h:
2333
2334         And these are just other implementations/declarations of this 
2335         (virtual) function that have to add the parameter. No behavior 
2336         change here.
2337         * rendering/RenderPath.cpp:
2338         (WebCore::RenderPath::absoluteRects):
2339         * rendering/RenderPath.h:
2340         * rendering/RenderSVGContainer.cpp:
2341         (WebCore::RenderSVGContainer::absoluteRects):
2342         * rendering/RenderSVGContainer.h:
2343         * rendering/RenderSVGHiddenContainer.cpp:
2344         (WebCore::RenderSVGHiddenContainer::absoluteRects):
2345         * rendering/RenderSVGHiddenContainer.h:
2346         * rendering/RenderSVGImage.cpp:
2347         (WebCore::RenderSVGImage::absoluteRects):
2348         * rendering/RenderSVGImage.h:
2349         * rendering/RenderSVGInlineText.cpp:
2350         (WebCore::RenderSVGInlineText::absoluteRects):
2351         * rendering/RenderSVGInlineText.h:
2352         * rendering/RenderSVGTSpan.cpp:
2353         (WebCore::RenderSVGTSpan::absoluteRects):
2354         * rendering/RenderSVGTSpan.h:
2355         * rendering/RenderSVGText.cpp:
2356         (WebCore::RenderSVGText::absoluteRects):
2357         * rendering/RenderSVGText.h:
2358         * rendering/RenderText.cpp:
2359         (WebCore::RenderText::absoluteRects):
2360         * rendering/RenderText.h:
2361         * rendering/RenderView.cpp:
2362         (WebCore::RenderView::absoluteRects):
2363         * rendering/RenderView.h:
2364
2365 2007-07-13  Mitz Pettel  <mitz@webkit.org>
2366
2367         Reviewed by Hyatt.
2368
2369         - fix http://bugs.webkit.org/show_bug.cgi?id=13438 <rdar://problem/5153030>
2370               Run rounding makes word-break:break-all/word not functional
2371
2372         Test: fast/text/word-break-run-rounding.html
2373
2374         * rendering/RenderText.cpp:
2375         (WebCore::RenderText::calcPrefWidths): Update the maximum width only on word
2376         boundaries to avoid rounding errors.
2377         * rendering/bidi.cpp:
2378         (WebCore::RenderBlock::findNextLineBreak): Integrated breakAll with the
2379         midWordBreak/wrapW mechanism. Also made the wrapW upper bound more accurate
2380         by resetting it when tmpW is committed.
2381
2382 2007-07-13  Sam Weinig  <sam@webkit.org>
2383
2384         Reviewed by Geoff Garen.
2385
2386         Patch for <rdar://problem/5318394>
2387         http site can read/write content of https site in same domain
2388
2389         Add protocol and port checks in isSafeScript.
2390
2391         * bindings/js/kjs_window.cpp:
2392         (KJS::Window::isSafeScript):
2393
2394 2007-07-13  Anders Carlsson  <andersca@apple.com>
2395
2396         Reviewed by Mitz Pettel.
2397
2398         <rdar://problem/5298870> 
2399         REGRESSION: In Yahoo Mail modal dialog, OK and Cancel buttons do not work, and descriptive text is missing (14327)
2400         
2401         http://bugs.webkit.org/show_bug.cgi?id=14327
2402         REGRESSION (r21367): dialogArguments not set in window generated by showModalDialog
2403
2404         When creating popup windows/dialogs, prevent the window properties from being cleared by the initial frame load.
2405         
2406         * loader/FrameLoader.cpp:
2407         (WebCore::FrameLoader::FrameLoader):
2408         (WebCore::FrameLoader::createWindow):
2409         (WebCore::FrameLoader::clear):
2410         (WebCore::FrameLoader::begin):
2411         (WebCore::FrameLoader::open):
2412         * loader/FrameLoader.h:
2413         (WebCore::FrameLoader::setShouldClearWindowProperties):
2414         * manual-tests/modal-dialog-arguments.html: Added.
2415
2416 2007-07-13  Steve Falkenburg  <sfalken@apple.com>
2417
2418         Update ResourceError related code to account for changes in CF interfaces.
2419
2420         Reviewed by Darin, Ada.
2421
2422         * platform/network/ResourceError.h: Change Mac conditionals to CF to share more code.
2423         * platform/network/cf/ResourceErrorCF.cpp:
2424         (WebCore::ResourceError::ResourceError): Modified based on CFErrorRef changes
2425         (WebCore::ResourceError::unpackPlatformError): Ported from ResourceErrorMac.mm.
2426         (WebCore::ResourceError::operator CFErrorRef): Ported from ResourceErrorMac.mm.
2427         (WebCore::ResourceError::operator CFStreamError): Modified based on CFErrorRef changes.
2428
2429 2007-07-13  Antti Koivisto  <antti@apple.com>
2430
2431         Reviewed by Adele.
2432         
2433         Fix <rdar://problem/5192256>
2434         click() in onchange handler causes another change event (causes hang at http://forums.whirlpool.net.au/)
2435         
2436         Guard against generating a simulated event from within a simulated event in the same node. Try to
2437         match Firefox behavior.
2438
2439         * dom/EventTargetNode.cpp:
2440         (WebCore::EventTargetNode::dispatchSimulatedMouseEvent):
2441         (WebCore::EventTargetNode::dispatchSimulatedClick):
2442         * dom/Node.cpp:
2443         (WebCore::Node::Node):
2444         * dom/Node.h:
2445
2446 2007-07-13  Antti Koivisto  <antti@apple.com>
2447
2448         Reviewed by Darin.
2449         
2450         Fix <rdar://problem/5333387>
2451         Combination of selection and click() on checkbox crashes
2452         
2453         Ensure there is no pending style update before doing synchronous paint. Under certain
2454         circumstances this ends up doing style recalc in middle of paint() which may
2455         for example tear down the rendering tree being painted, with bad results.
2456
2457         * dom/ContainerNode.cpp:
2458         (WebCore::ContainerNode::setActive):
2459
2460 2007-07-13  Antti Koivisto  <antti@apple.com>
2461
2462         Reviewed by Adele.
2463         
2464         Fix <rdar://problem/5333365>
2465         Calling click() is very slow
2466         
2467         There is a 100ms delay in ContainerNode::setActive() to do an activation effect. It is used for
2468         simulated mouse activations (using keyboard for example). However, it shouldn't be done when calling from javascript 
2469         (through click() interface) since it hangs script execution.
2470
2471         * html/HTMLElement.cpp:
2472         (WebCore::HTMLElement::click):
2473
2474 2007-07-13  Mitz Pettel  <mitz@webkit.org>
2475
2476         Reviewed by Dave Hyatt.
2477
2478         - fix http://bugs.webkit.org/show_bug.cgi?id=13873
2479           Incomplete repaint of replaced element's box shadow
2480
2481         Tests: fast/repaint/box-shadow-h.html
2482                fast/repaint/box-shadow-v.html
2483
2484         * rendering/RenderHTMLCanvas.cpp:
2485         (WebCore::RenderHTMLCanvas::layout): Added a call to adjustOverflowForBoxShadow().
2486         * rendering/RenderImage.cpp:
2487         (WebCore::RenderImage::layout): Ditto.
2488         * rendering/RenderPartObject.cpp:
2489         (WebCore::RenderPartObject::layout): Ditto.
2490         * rendering/RenderReplaced.cpp:
2491         (WebCore::RenderReplaced::RenderReplaced): Initialize m_hasOverflow.
2492         (WebCore::RenderReplaced::~RenderReplaced): Added. Removes this object from the
2493         overflow rect map if it has overflow.
2494         (WebCore::RenderReplaced::shouldPaint): Account for overflow.
2495         (WebCore::RenderReplaced::adjustOverflowForBoxShadow): Added. Creates or
2496         removes an entry for this object in the global overflow rect map.
2497         (WebCore::RenderReplaced::overflowHeight): Added.
2498         (WebCore::RenderReplaced::overflowWidth): Added.
2499         (WebCore::RenderReplaced::overflowLeft): Added.
2500         (WebCore::RenderReplaced::overflowTop): Added.
2501         (WebCore::RenderReplaced::overflowRect): Added.
2502         * rendering/RenderReplaced.h:
2503
2504 2007-07-13  Mitz Pettel  <mitz@webkit.org>
2505
2506         Reviewed by Dave Hyatt.
2507
2508         - fix http://bugs.webkit.org/show_bug.cgi?id=14395
2509           When a <p> is inside <li> two <BR>s are rendered
2510
2511         Test: fast/lists/marker-before-empty-inline.html
2512
2513         * rendering/RenderBlock.h:
2514         * rendering/RenderListItem.cpp:
2515         (WebCore::getParentOfFirstLineBox): Changed to skip empty inline flows that
2516         do not actually generate any line boxes. Limited the nested lists quirk to
2517         the case where the list is a child of the list item, to match Firefox.
2518         * rendering/bidi.cpp:
2519         (WebCore::requiresLineBox): Added. Factored out of skipWhitespace.
2520         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Added. Checkes
2521         whether the child or any of its siblings following it will generate a line
2522         box in the flow.
2523         (WebCore::RenderBlock::skipWhitespace):
2524
2525 2007-07-13  Holger Hans Peter Freyther  <zecke@selfish.org>
2526
2527         Reviewed by Alexey.
2528
2529         Move HTTP methods to parse Content-Type from xmlhttprequest.cpp
2530         which is LGPL to HTTPParsers.cpp. As both files were written by the
2531         same author and the advice to move them came from him I think this move
2532         is what is meant to be done.
2533
2534         Move filenameFromHTTPContentDisposition to HTTPParsers as well. This parse
2535         function uses Vector<String>::split and doesn't honor quoting. This needs
2536         to be fixed in later versions.
2537
2538         http://bugs.webkit.org/show_bug.cgi?id=5954 and http://bugs.webkit.org/show_bug.cgi?id=14059
2539         benefit from this change.
2540
2541         * platform/network/HTTPParsers.cpp:
2542         (WebCore::filenameFromHTTPContentDisposition):
2543         (WebCore::extractMIMETypeFromMediaType):
2544         (WebCore::extractCharsetFromMediaType):
2545         * platform/network/HTTPParsers.h:
2546         * platform/network/cf/ResourceResponseCFNet.cpp:
2547         * xml/xmlhttprequest.cpp:
2548         (WebCore::XMLHttpRequest::responseMIMEType):
2549         (WebCore::XMLHttpRequest::didReceiveResponse):
2550
2551 2007-07-13  Mark Rowe  <mrowe@apple.com>
2552
2553         Reviewed by Mitz.
2554
2555         Build fix.  Stub out ChromeClientGdk::print and SVGEmptyChromeClient::print.
2556
2557         * platform/gdk/ChromeClientGdk.h:
2558         * platform/gdk/TemporaryLinkStubs.cpp:
2559         (ChromeClientGdk::print):
2560         * platform/graphics/svg/SVGImageEmptyClients.h:
2561         (WebCore::SVGEmptyChromeClient::print):
2562
2563 2007-07-12  Alice Liu  <alice.liu@apple.com>
2564
2565         Reviewed by Maciej and Steve.
2566
2567         fixed <rdar://4982432> window.print() needs to be implemented
2568
2569         * bridge/win/FrameWin.cpp:
2570         (WebCore::Frame::print):
2571         * page/Chrome.cpp:
2572         (WebCore::Chrome::print):
2573         * page/Chrome.h:
2574         * page/ChromeClient.h:
2575         * platform/win/TemporaryLinkStubs.cpp:
2576
2577 2007-07-11  Justin Garcia  <justin.garcia@apple.com>
2578
2579         Reviewed by Harrison.
2580         
2581         <rdar://problem/5300379> Mail hung on option-delete
2582         
2583         We were starting backward iteration at [container, 0] and
2584         emitting for container over and over.
2585
2586         * editing/TextIterator.cpp:
2587         (WebCore::SimplifiedBackwardsTextIterator::advance): Don't 
2588         emit characters for a node if we're starting iteration at 
2589         [container, 0].  Don't emit characters for exiting containers
2590         if we've already done so.
2591
2592 2007-07-12  Kevin Decker  <kdecker@apple.com>
2593
2594         Reviewed by Mark Rowe.
2595
2596         <rdar://problem/5039463> find a good gray that works well for full frame plug-ins; consistent look for plugins
2597
2598         * loader/PluginDocument.cpp:
2599         (WebCore::PluginTokenizer::createDocumentStructure): Changed values to a darker gray, per request from the HI team.
2600
2601 2007-07-11  Sam Weinig  <sam@webkit.org>
2602
2603         Reviewed by Maciej.
2604
2605         Patch for <rdar://problem/5329841>
2606         Calling window.closed on a closed window causes Safari to crash
2607
2608         - Replaces the Frame member variable in KJS::Window for more appropriate DOMWindow
2609         - Adds additional new null checks as necessary
2610         - Removes bogus toBoolean method
2611         - Removes unused scheduleClose method
2612
2613         Test: fast/dom/Window/window-closed-crash.html
2614
2615         * bindings/js/JSCustomXPathNSResolver.cpp:
2616         (WebCore::JSCustomXPathNSResolver::create):
2617         * bindings/js/JSDOMWindowCustom.cpp:
2618         (WebCore::JSDOMWindow::customGetOwnPropertySlot):
2619         (WebCore::JSDOMWindow::customPut):
2620         * bindings/js/JSXMLHttpRequest.cpp:
2621         (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction):
2622         * bindings/js/kjs_events.cpp:
2623         (WebCore::JSAbstractEventListener::handleEvent):
2624         (WebCore::JSLazyEventListener::parseCode):
2625         * bindings/js/kjs_window.cpp:
2626         (KJS::Window::Window):
2627         (KJS::Window::impl):
2628         (KJS::Window::interpreter):
2629         (KJS::Window::location):
2630         (KJS::Window::find):
2631         (KJS::allowPopUp):
2632         (KJS::createWindow):
2633         (KJS::canShowModalDialog):
2634         (KJS::canShowModalDialogNow):
2635         (KJS::showModalDialog):
2636         (KJS::Window::getValueProperty):
2637         (KJS::Window::childFrameGetter):
2638         (KJS::Window::indexGetter):
2639         (KJS::Window::namedItemGetter):
2640         (KJS::Window::getOwnPropertySlot):
2641         (KJS::Window::put):
2642         (KJS::Window::isSafeScript):
2643         (KJS::Window::setListener):
2644         (KJS::Window::getListener):
2645         (KJS::Window::clear):
2646         (KJS::WindowFunc::callAsFunction):
2647         (KJS::Window::updateLayout):
2648         (KJS::ScheduledAction::execute):
2649         (KJS::Window::disconnectFrame):
2650         (KJS::Location::put):
2651         (KJS::LocationFunc::callAsFunction):
2652         * bindings/js/kjs_window.h:
2653         * page/mac/WebCoreFrameBridge.mm:
2654         (updateRenderingForBindings):
2655
2656 2007-07-12  Mark Rowe  <mrowe@apple.com>
2657
2658         Reviewed by Ada.
2659
2660         <rdar://problem/5329877> REGRESSION: Document::setTransformSource leaks an xmlDocPtr if called more than once per document
2661
2662         * dom/Document.cpp:
2663         (WebCore::Document::setTransformSource): Free any existing m_transformSource before overwriting it, rather than simply leaking it.
2664         * dom/Document.h:
2665
2666 2007-07-12  Holger Hans Peter Freyther  <zecke@selfish.org>
2667
2668         Reviewed by Mark Rowe.
2669
2670         Fix compilation of the CURL backend after the removing of accessors from ResourceHandle in r24202
2671
2672         * platform/network/curl/ResourceHandleManager.cpp:
2673         (WebCore::ResourceHandleManager::setupPOST):
2674         (WebCore::ResourceHandleManager::startJob):
2675
2676 2007-07-12  Mark Rowe  <mrowe@apple.com>
2677
2678         Reviewed by Darin.
2679
2680         <rdar://problem/5327189> Logic error in DeprecatedString::to{,U}Int{,64} can lead to reading past end of buffer
2681
2682         The fix for reading past the end of the buffer is to verify we are not at the end of the string before checking
2683         for a leading '+' character.  Rather than fixing the logic error in four nearly-identical functions I chose to
2684         extract the common functionality into the toIntegralType helper function which the four functions call through to.
2685
2686         * platform/DeprecatedString.cpp:
2687         (WebCore::isCharacterAllowedInBase):
2688         (WebCore::toIntegralType):
2689         (WebCore::DeprecatedString::toInt):
2690         (WebCore::DeprecatedString::toInt64):
2691         (WebCore::DeprecatedString::toUInt):
2692         (WebCore::DeprecatedString::toUInt64):
2693
2694 2007-07-12  George Staikos  <staikos@kde.org>
2695
2696         Reviewed by Alexey.
2697
2698         Remove unused variables and fix rendering of comoboxes.
2699
2700         * platform/graphics/qt/ImageQt.cpp:
2701         (WebCore::BitmapImage::draw):
2702         * platform/qt/RenderThemeQt.cpp:
2703         (WebCore::RenderThemeQt::paintMenuList):
2704
2705 2007-07-11  Oliver Hunt  <oliver@apple.com>
2706
2707         Reviewed by Maciej
2708
2709         Fix for <rdar://problem/5329712> GMail crash when trying to compose new message
2710
2711         * platform/win/FontDataWin.cpp:
2712         (WebCore::FontData::containsCharacters):
2713
2714 2007-07-11  Alexey Proskuryakov  <ap@webkit.org>
2715
2716         Reviewed by Darin.
2717
2718         http://bugs.webkit.org/show_bug.cgi?id=14584
2719         XMLHttpRequest treats null login/password incorrectly
2720
2721         Test: http/tests/xmlhttprequest/null-auth.php
2722
2723         * xml/xmlhttprequest.cpp:
2724         (WebCore::XMLHttpRequest::open):
2725         * xml/xmlhttprequest.h:
2726         Split the open() method into three to distinguish between missing and null credentials.
2727
2728         * bindings/js/JSXMLHttpRequest.cpp:
2729         (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction): Call the appropriate open().
2730
2731 2007-07-11  Oliver Hunt  <oliver@apple.com>
2732
2733         Build fix for windows
2734
2735         * page/Frame.cpp:
2736         (WebCore::Frame::firstRectForRange):
2737
2738 2007-07-11  Oliver Hunt  <oliver@apple.com>
2739
2740         Reviewed by Maciej.
2741
2742         Fix <rdar://problem/5329481> Character range rect code for IME support needs to be crossplatform
2743
2744         Move -[WebCoreFrameBridge firstRectForDOMRange:] to Frame::firstRectForRange
2745
2746         * page/Frame.cpp:
2747         (WebCore::Frame::firstRectForRange):
2748         * page/Frame.h:
2749         * page/mac/WebCoreFrameBridge.mm:
2750         (-[WebCoreFrameBridge firstRectForDOMRange:]):
2751
2752 2007-07-11  Steve Falkenburg  <sfalken@apple.com>
2753
2754         Static analysis build fix.
2755         
2756         Only specify /analyze (PREfast) if it is available.
2757         Prevents entire project from rebuilding each time.        
2758
2759         Reviewed by Hyatt.
2760
2761         * WebCore.vcproj/WebCore.vcproj:
2762
2763 2007-07-11  George Staikos  <staikos@kde.org>
2764
2765         Reviewed by Olliej.
2766
2767         Make comboboxes update when the current item is changed.
2768
2769         * platform/qt/PopupMenuQt.cpp:
2770         (WebCore::PopupMenu::updateFromElement):
2771         * platform/qt/QWebPopup.cpp:
2772         (WebCore::QWebPopup::activeChanged):
2773
2774 2007-07-11  George Staikos  <staikos@kde.org>
2775
2776         Reviewed by Brady.
2777
2778         Add a destructor to cleanup the SQL handle.
2779
2780         * loader/icon/SQLDatabase.h:
2781         (WebCore::SQLDatabase::~SQLDatabase):
2782
2783 2007-07-11  Holger Hans Peter Freyther  <zecke@selfish.org>
2784
2785         Reviewed by Darin.
2786
2787         As of http://bugs.webkit.org/show_bug.cgi?id=14527 move the
2788         WebCore/ForwardingHeader/JavaScriptCore to JavaScriptCore
2789
2790         * ForwardingHeaders/JavaScriptCore: Removed.
2791         * ForwardingHeaders/JavaScriptCore/APICast.h: Removed.
2792         * ForwardingHeaders/JavaScriptCore/JSBase.h: Removed.
2793         * ForwardingHeaders/JavaScriptCore/JSContextRef.h: Removed.
2794         * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
2795         * ForwardingHeaders/JavaScriptCore/JSObjectRef.h: Removed.
2796         * ForwardingHeaders/JavaScriptCore/JSStringRef.h: Removed.
2797         * ForwardingHeaders/JavaScriptCore/JSStringRefCF.h: Removed.
2798         * ForwardingHeaders/JavaScriptCore/JSValueRef.h: Removed.
2799         * ForwardingHeaders/JavaScriptCore/JavaScriptCore.h: Removed.
2800
2801 2007-07-11  Anders Carlsson  <andersca@apple.com>
2802
2803         Fix build.
2804         
2805         * platform/network/cf/ResourceHandleCFNet.cpp:
2806         (WebCore::willSendRequest):
2807         (WebCore::didReceiveResponse):
2808         (WebCore::didReceiveData):
2809         (WebCore::didFinishLoading):
2810         (WebCore::didFail):
2811         (WebCore::didReceiveChallenge):
2812
2813 2007-07-11  George Staikos  <staikos@kde.org>
2814
2815         Repair the build.
2816
2817         * platform/network/qt/ResourceHandleQt.cpp:
2818         (WebCore::ResourceHandle::start):
2819
2820 2007-07-11  Adele Peterson  <adele@apple.com>
2821
2822         Reviewed by Darin.
2823
2824         Fix for <rdar://problem/5230188> REGRESSION: Active/inactive marked text is not distinguished in textfields and textareas
2825
2826         We were previously trying to leave room for 1px of space between the text and the underline.
2827         This change removes that requirement so that if we don't have room for the extra space, we still draw the thick underline
2828         touching the text.
2829
2830         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintMarkedTextUnderline):
2831
2832 2007-07-11  Anders Carlsson  <andersca@apple.com>
2833
2834         Reviewed by Darin and Geoff.
2835
2836         <rdar://problem/5313508>
2837         REGRESSION (Leopard): http/tests/xmlhttprequest/basic-auth.html hangs
2838         
2839         Leopard Foundation now ignores credentials passed in as part of the URL so we need to pass them ourselves.
2840         
2841         For the asynchronous case, we simply keep track of the URL and if it has a user name and password, we
2842         pass those if we're asked to authenticate.
2843                 
2844         For the synchronous case, implement a new connection delegate and run it in a separate mode so 
2845         no other sources will fire.
2846
2847         * platform/network/mac/ResourceHandleMac.mm:
2848         (WebCore::ResourceHandle::loadResourceSynchronously):
2849         (-[WebCoreResourceHandleAsDelegate dealloc]):
2850         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
2851         (-[WebCoreResourceHandleAsDelegate connection:didReceiveAuthenticationChallenge:]):
2852         (-[WebCoreSynchronousLoader _isDone]):
2853         (-[WebCoreSynchronousLoader dealloc]):
2854         (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]):
2855         (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]):
2856         (-[WebCoreSynchronousLoader connection:didReceiveResponse:]):
2857         (-[WebCoreSynchronousLoader connection:didReceiveData:]):
2858         (-[WebCoreSynchronousLoader connectionDidFinishLoading:]):
2859         (-[WebCoreSynchronousLoader connection:didFailWithError:]):
2860         (-[WebCoreSynchronousLoader _data]):
2861         (-[WebCoreSynchronousLoader _response]):
2862         (-[WebCoreSynchronousLoader _error]):
2863         (+[WebCoreSynchronousLoader loadRequest:returningResponse:error:]):
2864
2865 2007-07-11  Darin Adler  <darin@apple.com>
2866
2867         Reviewed by Sam Weinig.
2868
2869         - fix <rdar://problem/5315265> REGRESSION: Leopard launch time -
2870           there are about 190 stats of icudt36b files during launch
2871
2872         * platform/TextEncodingRegistry.cpp: (WebCore::atomicCanonicalTextEncodingName):
2873         Add a special case for the empty string so we don't load the extended text
2874         encodings just so we can return 0 for that case.
2875
2876 2007-07-11  Anders Carlsson  <andersca@apple.com>
2877
2878         Reviewed by Darin.
2879
2880         Remove a bunch of unneeded accessors from ResourceHandle.
2881         
2882         * loader/icon/IconLoader.cpp:
2883         (WebCore::IconLoader::didReceiveResponse):
2884         (WebCore::IconLoader::didFail):
2885         (WebCore::IconLoader::didFinishLoading):
2886         * platform/network/ResourceHandle.cpp:
2887         * platform/network/ResourceHandle.h:
2888
2889 2007-07-09  Justin Garcia  <justin.garcia@apple.com>
2890
2891         Reviewed by Darin.
2892         
2893         <rdar://problem/5234383> REGRESSION: Sentence breaker method returning entire document length
2894         
2895         The functions for moving the caret to the next/previous sentence boundary
2896         were in many cases moving to the beginning/end of the document.  The functions that 
2897         should move the caret to an equivalent position in the next/previous sentence behaved
2898         like the aforementioned functions ought to.  Put the code from the second two functions
2899         in the first and made sure that the second two are properly FIXMEd.  They're rarely 
2900         used (filed 5323691).
2901         
2902         * editing/SelectionController.cpp:
2903         (WebCore::SelectionController::modify): Added an option for sentenceBoundary granularity,
2904         so that we can test the functions that were broken from JS.
2905         * editing/visible_units.cpp:
2906         (WebCore::startOfSentence): Removed the FIXME about 5234383.
2907         (WebCore::endSentenceBoundary): Make this function do what nextSentencePositionBoundary
2908         current does.
2909         (WebCore::endOfSentence): Removed the FIXME about 5234383.
2910         (WebCore::previousSentencePosition): Removed an incorrect FIXME.
2911         (WebCore::nextSentencePositionBoundary): Tweaked FIXME.  This function is
2912         identical, not close to endSentenceBoundary.
2913         (WebCore::nextSentencePosition): Removed an incorrect FIXME.
2914
2915 2007-07-11  Rob Buis  <buis@kde.org>
2916
2917         Reviewed by Darin.
2918
2919         http://bugs.webkit.org/show_bug.cgi?id=14453
2920         REGRESSION: www.nzherald.co.nz almost all the formating is gone
2921  
2922         Be less strict for the hex color definition.
2923
2924         * css/CSSGrammar.y:
2925         * css/cssparser.cpp:
2926         (WebCore::CSSParser::lex):
2927         (WebCore::CSSParser::text):
2928         * css/tokenizer.flex:
2929
2930 2007-07-11  Rob Buis  <buis@kde.org>
2931
2932         Reviewed by Oliver.
2933
2934         Forgot to commit this as part of commit r24146. Now we are sure
2935         createElement creates elements in the xhtml namespace only.
2936
2937         * ksvg2/svg/SVGDocument.cpp:
2938         * ksvg2/svg/SVGDocument.h:
2939
2940 2007-07-10  Sam Weinig  <sam@webkit.org>
2941
2942         Reviewed by Oliver.
2943
2944         Move more attributes from the pure JS bindings in KJS::Window
2945         to the implementation in DOMWindow and autogenerate the new bindings
2946
2947         Test: fast/dom/Window/get-set-properties.html
2948
2949         * bindings/js/JSDOMWindowCustom.cpp:
2950         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Change to use propHashTable in
2951         JSDOMWindow instead of KJS::Window
2952         * bindings/js/kjs_window.cpp:
2953         (KJS::Window::getValueProperty):
2954         (KJS::Window::put):
2955         * bindings/js/kjs_window.h:
2956         (KJS::Window::):
2957         * bindings/scripts/CodeGeneratorJS.pm: Cleanup getValueProperty and put generation
2958         to reduce code duplication. 
2959         * page/DOMWindow.cpp:
2960         (WebCore::DOMWindow::closed):
2961         (WebCore::DOMWindow::length):
2962         (WebCore::DOMWindow::name):
2963         (WebCore::DOMWindow::setName):
2964         (WebCore::DOMWindow::status):
2965         (WebCore::DOMWindow::setStatus):
2966         (WebCore::DOMWindow::defaultStatus):
2967         (WebCore::DOMWindow::setDefaultStatus):
2968         * page/DOMWindow.h:
2969         (WebCore::DOMWindow::defaultstatus):
2970         (WebCore::DOMWindow::setDefaultstatus):
2971         * page/DOMWindow.idl:
2972
2973 2007-07-10  Sam Weinig  <sam@webkit.org>
2974
2975         Reviewed by Geoff.
2976
2977         Fix for <rdar://problem/5326791> XSS vulnerability: ability to set window.defaultStatus,
2978         window.defaultstatus and window.status cross domains
2979
2980         Test: http/tests/security/cross-frame-access-put.html
2981
2982         * bindings/js/kjs_window.cpp:
2983         (KJS::Window::put): Adds isSafeScript check for defaultStatus,
2984         defaultstatus and status cases.
2985
2986 2007-07-10  Sam Weinig  <sam@webkit.org>
2987
2988         Fix build for BuildBot.
2989
2990         * page/DOMWindow.cpp:
2991         (WebCore::DOMWindow::outerHeight):
2992         (WebCore::DOMWindow::outerWidth):
2993         (WebCore::DOMWindow::screenX):
2994         (WebCore::DOMWindow::screenY):
2995
2996 2007-07-10  Brady Eidson  <beidson@apple.com>
2997
2998         Reviewed by Sam
2999
3000         <rdar://problem/5326653> - REGRESSION: [WebBackForwardList forwardListCount] might return incorrect result
3001
3002         No layout test because this is an API issue that can't be tested in DRT or the browser
3003
3004         * history/BackForwardList.cpp:
3005         (WebCore::BackForwardList::forwardListCount): If the index is NoCurrentItemIndex, return 0
3006
3007 2007-07-10  Sam Weinig  <sam@webkit.org>
3008
3009         Reviewed by Darin.
3010
3011         Move more readonly attributes from pure JS bindings in KJS::Window
3012         to the implementation in DOMWindow and autogenerate the new bindings.
3013
3014         * bindings/js/kjs_window.cpp:
3015         (KJS::Window::getValueProperty):  Sort the hashmap comment into categories
3016         to make further migration easier.
3017         * bindings/js/kjs_window.h: Sort the enum into categories to make further
3018         migration easier.
3019         (KJS::Window::):
3020         * page/DOMWindow.cpp: Add new methods.
3021         (WebCore::DOMWindow::focus):
3022         (WebCore::DOMWindow::blur):
3023         (WebCore::DOMWindow::offscreenBuffering):
3024         (WebCore::DOMWindow::outerHeight):
3025         (WebCore::DOMWindow::outerWidth):
3026         (WebCore::DOMWindow::innerHeight):
3027         (WebCore::DOMWindow::innerWidth):
3028         (WebCore::DOMWindow::screenX):
3029         (WebCore::DOMWindow::screenY):
3030         (WebCore::DOMWindow::scrollX):
3031         (WebCore::DOMWindow::scrollY):
3032         (WebCore::DOMWindow::getComputedStyle):
3033         (WebCore::DOMWindow::getMatchedCSSRules): Add null Document assertion.
3034         (WebCore::DOMWindow::devicePixelRatio): Add null Frame and Page checks.
3035         * page/DOMWindow.h:
3036         (WebCore::DOMWindow::screenLeft):
3037         (WebCore::DOMWindow::screenTop):
3038         (WebCore::DOMWindow::pageXOffset):
3039         (WebCore::DOMWindow::pageYOffset):
3040         * page/DOMWindow.idl:
3041
3042 2007-07-10  Oliver Hunt  <oliver@apple.com>
3043
3044         Reviewed by Maciej.
3045
3046         Fix for <rdar://problem/5326417> Editor::unmarkText needs to be crossplatform
3047
3048         Missed this in earlier patch to make text marking platform independent.
3049
3050         * editing/Editor.cpp:
3051         (WebCore::Editor::unmarkText):
3052            Add platform independent impl
3053         * editing/mac/EditorMac.mm:
3054            Remove the old mac path.
3055
3056 2007-07-10  Geoffrey Garen  <ggaren@apple.com>
3057
3058         Reviewed by Tim Hatcher.
3059
3060         Added a Page counter. This helped me while investigating 
3061         <rdar://problem/5314463> 40MB of WebKit memory still allocated after 
3062         closing large email in Mail
3063
3064         * WebCore.xcodeproj/project.pbxproj:
3065         * page/Page.cpp:
3066         (WebCore::):
3067         (WebCore::PageCounter::~PageCounter):
3068         (WebCore::Page::Page):
3069         (WebCore::Page::~Page):
3070
3071 2007-07-10  Timothy Hatcher  <timothy@apple.com>
3072
3073         Reviewed by Geoff.
3074
3075         <rdar://problem/5326126> InspectorResource holds onto more data than it needs
3076
3077         Reduces the fixed size of InspectorResource from 630 bytes to 224 bytes. Now
3078         selectively pick out parts of the ResourceRequest and ResourceResponse objects
3079         for the info needed and store that directly in InspectorResource.
3080
3081         The ResourceRequest and ResourceResponse objects hold a reference to the original
3082         NSURL object, so almost double the data was being kept around. So the struct size
3083         reduction is just the tip of the ice burg on what this really saves.
3084
3085         In a test of 100,000 XMLHTTPRequests using a 85 byte long data URL, I see ~21 MB less
3086         RSIZE compared to Safari running without this change.
3087
3088         * page/InspectorController.cpp:
3089         (WebCore::InspectorResource::InspectorResource):
3090         (WebCore::InspectorResource::type):
3091         (WebCore::addSourceToFrame):
3092         (WebCore::scriptObjectForRequest):
3093         (WebCore::scriptObjectForResponse):
3094         (WebCore::InspectorController::addScriptResource):
3095         (WebCore::InspectorController::addAndUpdateScriptResource):
3096         (WebCore::updateResourceRequest):
3097         (WebCore::updateResourceResponse):
3098         (WebCore::InspectorController::updateScriptResourceRequest):
3099         (WebCore::InspectorController::updateScriptResourceResponse):
3100         (WebCore::InspectorController::didLoadResourceFromMemoryCache):
3101         (WebCore::InspectorController::identifierForInitialRequest):
3102         (WebCore::InspectorController::willSendRequest):
3103         (WebCore::InspectorController::didReceiveResponse):
3104         (WebCore::InspectorController::didFailLoading):
3105         * page/InspectorController.h:
3106
3107 2007-07-10  Darin Adler  <darin@apple.com>
3108
3109         Reviewed by Brady.
3110
3111         - fix crash introduced by my patch for 5318732, only seen in release builds
3112
3113         * page/Page.cpp: (WebCore::Page::~Page): Added a missing null check.
3114
3115 2007-07-10  Andrea Cavalli  <amc82@cam.ac.uk>
3116
3117         Reviewed by George Staikos.
3118
3119         Fixed render theme for text field.
3120
3121         * platform/qt/RenderThemeQt.cpp:
3122         (WebCore::RenderThemeQt::paintTextField):
3123
3124 2007-07-10  Qing Zhao  <qing@staikos.net>
3125
3126         Reviewed by George Staikos.
3127
3128         Draw focus rings for nodes that are not rendered by QStyle.
3129
3130         * platform/graphics/qt/GraphicsContextQt.cpp:
3131         (WebCore::focusRingColor):
3132         (WebCore::GraphicsContext::drawFocusRing):
3133         * platform/qt/RenderThemeQt.cpp:
3134         (WebCore::RenderThemeQt::supportsFocusRing):
3135         (WebCore::RenderThemeQt::supportsFocus):
3136
3137 2007-07-10  Nikolas Zimmermann  <zimmermann@kde.org>
3138
3139         Reviewed by Geoff.
3140
3141         Fix 'unsigned int' overflow in CodeGeneratorJS.pm.
3142         This fixes hashing of "SVG_FEBLEND_MODE_NORMAL". Its hashvalue exceeded 2^32, which
3143         is no problem in perl but in the cpp code. Emulate C/C++ behaviour by using "% 2^32" in
3144         the perl code. Testcase available in feature-branch soon (js-svg-constructors.svg).
3145
3146         * bindings/scripts/CodeGeneratorJS.pm:
3147
3148 2007-07-10  Geoffrey Garen  <ggaren@apple.com>
3149
3150         Reviewed by Maciej Stachowiak.
3151
3152         Disabled Arena recycling in RenderArena. PLT shows no regression 
3153         (possibly a small speedup), and this can reduce allocated memory in 
3154         WebKit clients by about 120K (4K per Arena * 30 Arenas).
3155         
3156         I happened upon this optimization while investigating 
3157         <rdar://problem/5314463> WebKit hangs on to 40MB RAM after closing 
3158         large email in Mail (appears to be render tree arena allocator), 
3159         although I don't think it will come close to fixing that bug 
3160         completely.
3161
3162         * rendering/RenderArena.cpp:
3163         (WebCore::RenderArena::~RenderArena): Use FinishArenaPool, which frees
3164         the ArenaPool's Arenas immediately.
3165
3166 2007-07-10  Mitz Pettel  <mitz@webkit.org>
3167
3168         Reviewed by Hyatt.
3169
3170         - fix http://bugs.webkit.org/show_bug.cgi?id=14449
3171           REGRESSION (r14345-r14375): Absolutely positioned image does not scale to containing element's height
3172
3173         Test: fast/replaced/absolute-position-percentage-height.html
3174
3175         * rendering/RenderBox.cpp:
3176         (WebCore::RenderBox::calcReplacedHeightUsing): For positioned elements, evaluate
3177         the percentage with respect to the container's final height.
3178
3179 2007-07-10  Brady Eidson  <beidson@apple.com>
3180
3181         Reviewed by Mark Rowe
3182
3183         Add 64-bit integer converters to our string classes for future work
3184
3185         * platform/DeprecatedString.cpp:
3186         (WebCore::DeprecatedString::toInt64):
3187         (WebCore::DeprecatedString::toUInt64):
3188         * platform/DeprecatedString.h:
3189
3190         * platform/PlatformString.h:
3191         * platform/String.cpp:
3192         (WebCore::String::toInt64):
3193         (WebCore::String::toUInt64):
3194
3195         * platform/StringImpl.cpp:
3196         (WebCore::StringImpl::toInt64):
3197         (WebCore::StringImpl::toUInt64):
3198         * platform/StringImpl.h:
3199
3200 2007-07-10  Darin Adler  <darin@apple.com>
3201
3202         Reviewed by Anders.
3203
3204         - fix <rdar://problem/5318732> REGRESSION: In Mail, a crash occurs when attempting to send
3205           a HTML based message (nytimes.com, washingtonpost.com, latimes.com)
3206
3207         Did an audit of calls to get the inspector and most other uses of Page* and added null
3208         checks since Frame* can outlast its Page*.
3209
3210         * loader/FrameLoader.cpp:
3211         (WebCore::FrameLoader::createWindow): Added null check.
3212         (WebCore::FrameLoader::loadSubframe): Ditto.
3213         (WebCore::FrameLoader::load): Ditto.
3214         (WebCore::FrameLoader::transitionToCommitted): Ditto.
3215         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Ditto.
3216         (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): Ditto.
3217         (WebCore::FrameLoader::addExtraFieldsToRequest): Ditto.
3218         (WebCore::FrameLoader::loadResourceSynchronously): Ditto.
3219         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
3220         (WebCore::FrameLoader::requestFromDelegate): Ditto.
3221         (WebCore::FrameLoader::canGoBackOrForward): Ditto.
3222         (WebCore::FrameLoader::getHistoryLength): Ditto.
3223         (WebCore::FrameLoader::historyURL): Ditto.
3224         (WebCore::FrameLoader::cachePageForHistoryItem): Ditto.
3225         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget): Ditto.
3226         (WebCore::FrameLoader::goToItem): Ditto.
3227         (WebCore::FrameLoader::dispatchWindowObjectAvailable): Ditto.
3228         (WebCore::FrameLoader::dispatchDidCommitLoad): Ditto.
3229         (WebCore::FrameLoader::dispatchAssignIdentifierToInitialRequest): Ditto.
3230         (WebCore::FrameLoader::dispatchWillSendRequest): Ditto.
3231         (WebCore::FrameLoader::dispatchDidReceiveResponse): Ditto.
3232         (WebCore::FrameLoader::dispatchDidReceiveContentLength): Ditto.
3233         (WebCore::FrameLoader::dispatchDidFinishLoading): Ditto.
3234         (WebCore::FrameLoader::dispatchDidLoadResourceFromMemoryCache): Ditto.
3235
3236         * page/ContextMenuController.h:
3237         * page/ContextMenuController.cpp:
3238         (WebCore::ContextMenuController::ContextMenuController): Removed unneeded and
3239         unused Page* parameter.
3240         (WebCore::openNewWindow): Added null check.
3241         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
3242
3243         * page/InspectorController.h:
3244         (WebCore::InspectorController::pageDestroyed): Added. Since this object is
3245         owned by the Page and has a back-pointer to it, it needs an explicit disconnect.
3246         There's already a higher-level one, but this is more reliable than that.
3247         * page/InspectorController.cpp:
3248         (WebCore::InspectorController::windowScriptObjectAvailable): Added null check.
3249         (WebCore::InspectorController::windowUnloading): Ditto.
3250
3251         * page/Page.cpp:
3252         (WebCore::Page::Page): Updated for change in parameters of ContextMenuController 
3253         constructor.
3254         (WebCore::Page::~Page): Added call to InspectorController pageDestroyed().
3255
3256         * page/Chrome.cpp: Updated includes.
3257         * page/DragController.cpp: Ditto.
3258
3259 2007-07-10  Adam Treat  <adam@staikos.net>
3260
3261         Reviewed by George Staikos.
3262
3263         Bring scroll wheel out of Ludicrous Speed.
3264
3265         * platform/qt/WheelEventQt.cpp:
3266         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
3267
3268 2007-07-09  Geoffrey Garen  <ggaren@apple.com>
3269
3270         Reviewed by Maciej Stachowiak.
3271
3272         Fixed http://bugs.webkit.org/show_bug.cgi?id=13241 | <rdar://problem/5126396>
3273         onload fires before content is finished loading (woot.com)
3274         
3275         * dom/Document.cpp:
3276         (WebCore::Document::close): Try to go through the normal "Am I done loading?"
3277         machinery before dispatching the load event. As the comment indicates, 
3278         we can't do this in all cases, so the fix isn't perfect. However, a perfect 
3279         solution would require much riskier sweeping changes to the loader, which 
3280         are best left for later, I think.
3281
3282         * xml/XSLTProcessor.cpp:
3283         (WebCore::XSLTProcessor::createDocumentFromSource): Removed a slightly
3284         worse solution to the same problem.
3285
3286 2007-07-10  Rob Buis  <buis@kde.org>
3287
3288         Reviewed by Maciej.
3289
3290         http://bugs.webkit.org/show_bug.cgi?id=8007
3291         createElement() and XHTML (A dynamically created table not rendered as such)
3292
3293         Follow the HTML5 rules of making the name lowercase and then
3294         creating the element in the xhtml namespace.
3295
3296         * dom/Document.cpp:
3297         (WebCore::Document::createElement):
3298         * dom/Document.h:
3299         * html/HTMLDocument.cpp:
3300         * html/HTMLDocument.h:
3301
3302 2007-07-09  Qing Zhao  <qing@staikos.net>
3303
3304         Reviewed by George Staikos.
3305
3306         Add qt context menu support.
3307
3308         * WebCore.pro:
3309         * platform/ContextMenu.h:
3310         * platform/ContextMenuItem.h:
3311         (WebCore::PlatformMenuItemDescriptionType::PlatformMenuItemDescriptionType):
3312         * platform/qt/ContextMenuItemQt.cpp:
3313         (WebCore::ContextMenuItem::ContextMenuItem):
3314         (WebCore::ContextMenuItem::~ContextMenuItem):
3315         (WebCore::ContextMenuItem::releasePlatformDescription):
3316         (WebCore::ContextMenuItem::type):
3317         (WebCore::ContextMenuItem::setType):
3318         (WebCore::ContextMenuItem::action):
3319         (WebCore::ContextMenuItem::setAction):
3320         (WebCore::ContextMenuItem::title):
3321         (WebCore::ContextMenuItem::setTitle):
3322         (WebCore::ContextMenuItem::platformSubMenu):
3323         (WebCore::ContextMenuItem::setSubMenu):
3324         (WebCore::ContextMenuItem::setChecked):
3325         (WebCore::ContextMenuItem::setEnabled):
3326         (WebCore::ContextMenuItem::enabled):
3327         * platform/qt/ContextMenuQt.cpp:
3328         (WebCore::ContextMenu::ContextMenu):
3329         (WebCore::ContextMenu::~ContextMenu):
3330         (WebCore::ContextMenu::appendItem):
3331         (WebCore::ContextMenu::itemCount):
3332         (WebCore::ContextMenu::insertItem):
3333         (WebCore::ContextMenu::setPlatformDescription):
3334         (WebCore::ContextMenu::platformDescription):
3335
3336 2007-07-09  Anders Carlsson  <andersca@apple.com>
3337
3338         Build fix.
3339         
3340         * plugins/win/PluginViewWin.cpp:
3341         (WebCore::PluginViewWin::performRequest):
3342
3343 2007-07-09  Anders Carlsson  <andersca@apple.com>
3344
3345         Reviewed by Geoff.
3346
3347         Get rid of the node argument in our various script execution functions.
3348         
3349         * bindings/js/kjs_proxy.cpp:
3350         (WebCore::KJSProxy::evaluate):
3351         * bindings/js/kjs_proxy.h:
3352         * bindings/js/kjs_window.cpp:
3353         (KJS::ScheduledAction::execute):
3354         * dom/XMLTokenizer.cpp:
3355         (WebCore::XMLTokenizer::endElementNs):
3356         (WebCore::XMLTokenizer::notifyFinished):
3357         * html/HTMLScriptElement.cpp:
3358         (WebCore::HTMLScriptElement::evaluateScript):
3359         * html/HTMLTokenizer.cpp:
3360         (WebCore::HTMLTokenizer::scriptExecution):
3361         * loader/FrameLoader.cpp:
3362         (WebCore::FrameLoader::changeLocation):
3363         (WebCore::FrameLoader::urlSelected):
3364         (WebCore::FrameLoader::submitForm):
3365         (WebCore::FrameLoader::replaceContentsWithScriptResult):
3366         (WebCore::FrameLoader::executeScript):
3367         * loader/FrameLoader.h:
3368         * page/mac/WebCoreFrameBridge.mm:
3369         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
3370         (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]):
3371
3372 2007-07-09  Justin Garcia  <justin.garcia@apple.com>
3373
3374         Rolling the fix for 5290534 back in now that 5310404 has been fixed in Mail.
3375
3376         * editing/DeleteSelectionCommand.cpp:
3377         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
3378
3379 2007-07-09  Geoffrey Garen  <ggaren@apple.com>
3380
3381         Reviewed by Anders Carlsson.
3382
3383         A little more FrameLoader cleanup while working on <rdar://problem/5126396>.
3384         
3385         Rename: "checkEmitLoadEvent" => "checkCallImplicitClose" because the function
3386         doesn't emit the load event; it just calls implicitClose.
3387         
3388         Rename: "m_wasLoadEventEmitted" => "m_didCallImplicitClose" because the variable
3389         tracks whether implicitClose was called.
3390
3391         * dom/Document.cpp:
3392         (WebCore::Document::implicitClose): Turned 12 lines of code into 6, adding ASSERT.
3393         * loader/FrameLoader.h: Removed bogus declaration of non-existent emitLoadEvent().
3394
3395 2007-07-09  Justin Garcia  <justin.garcia@apple.com>
3396
3397         Reviewed by John.
3398         
3399         REGRESSION: Crash when deleting table content in Leopard Mail
3400
3401         * editing/DeleteSelectionCommand.cpp:
3402         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Use a RefPtr
3403         for the next node to delete, in case it is destroyed when the
3404         current node is deleted.  In the crash reported in the radar, we
3405         crash because the next node is the div that holds the delete button
3406         and it's destroyed when the node that contains the selection is removed.
3407
3408 2007-07-09  Adam Treat  <adam@staikos.net>
3409
3410         Reviewed by George Staikos.
3411
3412         Convert QWebFrame from a QFrame to a pure QObject to eliminate all
3413         traces of widgets.
3414
3415         * page/qt/EventHandlerQt.cpp:
3416         (WebCore::EventHandler::passSubframeEventToSubframe):
3417         * platform/ScrollView.h:
3418         * platform/Widget.h:
3419         * platform/qt/PlatformScrollBarQt.cpp:
3420         (WebCore::PlatformScrollbar::handleMouseMoveEvent):
3421         (WebCore::PlatformScrollbar::handleMousePressEvent):
3422         (WebCore::PlatformScrollbar::handleMouseReleaseEvent):
3423         * platform/qt/PopupMenuQt.cpp:
3424         (WebCore::PopupMenu::show):
3425         * platform/qt/ScrollViewQt.cpp:
3426         (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate):
3427         (WebCore::ScrollView::ScrollViewPrivate::scrollBackingStore):
3428         (WebCore::ScrollView::ScrollViewPrivate::windowClipRect):
3429         (WebCore::ScrollView::updateContents):
3430         (WebCore::ScrollView::update):
3431         (WebCore::ScrollView::geometryChanged):
3432         (WebCore::ScrollView::windowToContents):
3433         (WebCore::ScrollView::contentsToWindow):
3434         (WebCore::ScrollView::convertChildToSelf):
3435         (WebCore::ScrollView::convertSelfToChild):
3436         (WebCore::ScrollView::scrollbarUnderMouse):
3437         (WebCore::ScrollView::addChild):
3438         (WebCore::ScrollView::paint):
3439         * platform/qt/WidgetQt.cpp:
3440         (WebCore::WidgetPrivate::WidgetPrivate):
3441         (WebCore::WidgetPrivate::~WidgetPrivate):
3442         (WebCore::WidgetPrivate::setGeometry):
3443         (WebCore::WidgetPrivate::geometry):
3444         (WebCore::Widget::frameGeometry):
3445         (WebCore::Widget::setFocus):
3446         (WebCore::Widget::setCursor):
3447         (WebCore::Widget::show):
3448         (WebCore::Widget::hide):
3449         (WebCore::Widget::qwebframe):
3450         (WebCore::Widget::setQWebFrame):
3451         (WebCore::Widget::qwidget):
3452         (WebCore::Widget::setQWidget):
3453         (WebCore::Widget::setFrameGeometry):
3454         (WebCore::Widget::isEnabled):
3455         (WebCore::Widget::setEnabled):
3456         (WebCore::Widget::setIsSelected):
3457         (WebCore::Widget::invalidate):
3458         (WebCore::Widget::invalidateRect):
3459         (WebCore::Widget::removeFromParent):
3460         (WebCore::Widget::geometryChanged):
3461         (WebCore::Widget::convertToContainingWindow):
3462         (WebCore::Widget::convertFromContainingWindow):
3463         (WebCore::Widget::convertChildToSelf):
3464         (WebCore::Widget::convertSelfToChild):
3465         (WebCore::Widget::containingWindow):
3466
3467 2007-07-09  Anders Carlsson  <andersca@apple.com>
3468
3469         Reviewed by Oliver.
3470
3471         Add DocumentLoader::isLoadingMainResource.
3472
3473         * WebCore.exp:
3474
3475 2007-07-09  John Sullivan  <sullivan@apple.com>
3476
3477         Reviewed by Darin
3478
3479         * WebCore.exp:
3480         * WebCore.xcodeproj/project.pbxproj:
3481         exported String::createCFString, needed for <rdar://problem/5320208>
3482
3483 2007-07-09  Mitz Pettel  <mitz@webkit.org>
3484
3485         Reviewed by Maciej.
3486
3487         Test case for the bug below, which is http://bugs.webkit.org/show_bug.cgi?id=14207
3488
3489         * manual-tests/flash-unload-tab.html: Added.
3490
3491 2007-07-09  Maciej Stachowiak  <mjs@apple.com>
3492
3493         Reviewed by Oliver.
3494
3495         <rdar://problem/5295734> Repro crash closing tab/window @ maps.google.com in
3496         WTF::HashSet<KJS::RuntimeObjectImp*, WTF::PtrHash<KJS::RuntimeObjectImp*>,
3497         WTF::HashTraits<KJS::RuntimeObjectImp*> >::add + 11
3498         
3499         Automated test case is not possible. Did not bother with manual test this time.
3500
3501         * bindings/js/kjs_dom.cpp:
3502         (WebCore::getRuntimeObject): Check that runtime root isn't null, as well as instance;
3503         this should cover the case where the plugin is already shut down and onunload time.
3504
3505 2007-07-08  Maciej Stachowiak  <mjs@apple.com>
3506
3507         Reviewed by Sam.
3508
3509         - fixed <rdar://problem/5220706> REGRESSION (TOT): repro crash in -[WebView(WebViewInternal) _addObject:forIdentifier:] [14425]
3510         http://bugs.webkit.org/show_bug.cgi?id=14425
3511
3512         * bindings/js/kjs_window.cpp:
3513         (KJS::createWindow): No longer take an immediate argument - always do immediate loads
3514         on a newly created Window. Also, do a load of "" to make sure that the right info makes
3515         it to the app.
3516         (KJS::showModalDialog): Updated for above.
3517         (KJS::WindowFunc::callAsFunction): Updated for above.
3518         * dom/Document.cpp:
3519         (WebCore::Document::shouldBeAllowedToLoadLocalResources): If our URL is about:blank,
3520         we're allowed if our opener is (since the opener must have written the contents).
3521         * loader/FrameLoader.cpp:
3522         (WebCore::FrameLoader::changeLocation): Add a variant which takes a KURL, which it
3523         expects to be pre-completed. This is to avoid completing "" to the opener URL.
3524         (WebCore::FrameLoader::urlSelected): Allow loading empty URLs.
3525         * loader/FrameLoader.h:
3526         
3527         Test case is manual only, since it takes particular app behavior to reproduce:
3528         
3529         * manual-tests/new-window-subresource-crash.html: Added.
3530
3531 2007-07-08  Mitz Pettel  <mitz@webkit.org>
3532
3533         Reviewed by Maciej.
3534
3535         - fix leaks introduced in r24099
3536
3537         * dom/Element.cpp:
3538         (WebCore::Element::~Element): Do not delete the cached computed style here.
3539         (WebCore::Element::detach): Delete the computed style here instead.
3540         (WebCore::Element::computedStyle): Removed a redundant ref() which was
3541         causing the leak. Changed to return 0 if the element is not attached,
3542         because in that case there is currently no way to tell when to delete the computed
3543         style.
3544
3545 2007-07-08  Mitz Pettel  <mitz@webkit.org>
3546
3547         Reviewed by Darin.
3548
3549         - fix http://bugs.webkit.org/show_bug.cgi?id=12384
3550           getComputedStyle with td.style.display='none' reports '' for all properties except display
3551
3552         Test: fast/css/computed-style-without-renderer.html
3553
3554         Implement rich computed style for elements that do not have a renderer.
3555
3556         * css/CSSComputedStyleDeclaration.cpp:
3557         (WebCore::getPositionOffsetValue): Changed to take a RenderStyle instead of
3558         a RenderObject.
3559         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Changed to
3560         use the computed style returned by the node instead of going through the
3561         renderer. Changed properties that compute by measuring the renderer to
3562         fall back on return