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