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