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