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