compile fix for qt
[WebKit-https.git] / WebCore / ChangeLog
1 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
2
3         Compile fix.
4
5         * platform/qt/ScrollViewQt.cpp:
6         (WebCore::ScrollView::update):
7
8 2007-03-19  Adam Roben  <aroben@apple.com>
9
10         Reviewed by Hyatt and Maciej.
11
12         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
13         part of <rdar://problem/5071653>.
14
15         All layout tests pass.
16
17         * WebCore.exp: Updated.
18         * WebCore.xcodeproj/project.pbxproj: Updated.
19         * bridge/JavaScriptStatistics.cpp: Moved from
20         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
21         (WebCore::collect):
22         (WebCore::JavaScriptStatistics::objectCount):
23         (WebCore::JavaScriptStatistics::interpreterCount):
24         (WebCore::JavaScriptStatistics::protectedObjectCount):
25         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
26         (WebCore::JavaScriptStatistics::garbageCollect):
27         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
28         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
29         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
30         * bridge/JavaScriptStatistics.h: Added.
31         * bridge/mac/WebCoreJavaScript.h: Removed.
32         * bridge/mac/WebCoreJavaScript.mm: Removed.
33
34 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
35
36         Reviewed by Mark.
37
38         - avoid static construction (and global variable access) in a smarter, more portable way,
39         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
40         
41         * bindings/js/JSCustomXPathNSResolver.cpp:
42         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
43         * bindings/js/JSHTMLInputElementBase.cpp:
44         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
45         * bindings/js/JSHTMLOptionElementConstructor.cpp:
46         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
47         * bindings/js/JSXMLHttpRequest.cpp:
48         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
49         * bindings/js/JSXSLTProcessor.cpp:
50         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
51         * bindings/js/kjs_dom.cpp:
52         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
53         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
54         * bindings/js/kjs_events.cpp:
55         (KJS::JSAbstractEventListener::handleEvent):
56         * bindings/js/kjs_html.cpp:
57         (KJS::HTMLElementFunction::HTMLElementFunction):
58         (KJS::JSHTMLCollection::getOwnPropertySlot):
59         * bindings/js/kjs_window.cpp:
60         (KJS::ScheduledAction::execute):
61         * bindings/objc/WebScriptObject.mm:
62         * bindings/scripts/CodeGeneratorJS.pm:
63
64 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
65
66         Reviewed by Mark Rowe
67
68         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
69
70         * WebCore.xcodeproj/project.pbxproj:
71
72 2007-03-18  David Hyatt  <hyatt@apple.com>
73
74         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
75         and resizing to be more like other browsers.
76
77         Reviewed by ggaren
78
79         fast/frames/no-frame-borders.html
80
81         * html/HTMLFrameElement.cpp:
82         (WebCore::HTMLFrameElement::HTMLFrameElement):
83         (WebCore::HTMLFrameElement::attach):
84         (WebCore::HTMLFrameElement::parseMappedAttribute):
85         * html/HTMLFrameElement.h:
86         (WebCore::HTMLFrameElement::hasFrameBorder):
87         * html/HTMLFrameElementBase.cpp:
88         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
89         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
90         * html/HTMLFrameElementBase.h:
91         * html/HTMLFrameSetElement.cpp:
92         (WebCore::HTMLFrameSetElement::attach):
93         * html/HTMLFrameSetElement.h:
94         (WebCore::HTMLFrameSetElement::hasFrameBorder):
95         * html/HTMLIFrameElement.cpp:
96         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
97         * rendering/RenderFrame.cpp:
98         (WebCore::RenderFrame::edgeInfo):
99         * rendering/RenderFrame.h:
100         * rendering/RenderFrameSet.cpp:
101         (WebCore::RenderFrameSet::paint):
102         (WebCore::RenderFrameSet::GridAxis::resize):
103         (WebCore::RenderFrameSet::fillFromEdgeInfo):
104         (WebCore::RenderFrameSet::computeEdgeInfo):
105         (WebCore::RenderFrameSet::edgeInfo):
106         (WebCore::RenderFrameSet::layout):
107         (WebCore::RenderFrameSet::startResizing):
108         (WebCore::RenderFrameSet::continueResizing):
109         (WebCore::RenderFrameSet::canResizeRow):
110         (WebCore::RenderFrameSet::canResizeColumn):
111         (WebCore::RenderFrameSet::splitPosition):
112         (WebCore::RenderFrameSet::hitTestSplit):
113         (WebCore::RenderFrameSet::dump):
114         * rendering/RenderFrameSet.h:
115         (WebCore::):
116         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
117         (WebCore::FrameEdgeInfo::preventResize):
118         (WebCore::FrameEdgeInfo::allowBorder):
119         (WebCore::FrameEdgeInfo::setPreventResize):
120         (WebCore::FrameEdgeInfo::setAllowBorder):
121
122 2007-03-19  Mark Rowe  <mrowe@apple.com>
123
124         Rubber-stamped by Brady.
125
126         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
127
128         * ChangeLog:
129         * WebCore.vcproj/WebCore/build-generated-files.sh:
130         * manual-tests/ATSU-bad-layout.html:
131         * manual-tests/accidental-strict-mode.html:
132         * manual-tests/applet-param-no-name.html:
133         * manual-tests/bidi-parens.html:
134         * manual-tests/bugzilla-3855.html:
135         * manual-tests/bugzilla-4840.html:
136         * manual-tests/bugzilla-6821.html:
137         * manual-tests/containing-block-position-chage.html:
138         * manual-tests/contenteditable-link.html:
139         * manual-tests/css3-cursor-fallback-quirks.html:
140         * manual-tests/css3-cursor-fallback-strict.html:
141         * manual-tests/custom-cursors.html:
142         * manual-tests/dictionary-scrolled-iframe.html:
143         * manual-tests/dom-manipulation-on-resize.html:
144         * manual-tests/drag-image-to-address-bar.html:
145         * manual-tests/empty-link-target.html:
146         * manual-tests/empty-title-popup.html:
147         * manual-tests/first-line-style-crash.html:
148         * manual-tests/invalid-mouse-event.html:
149         * manual-tests/left-overflow-repaint.html:
150         * manual-tests/linkjump-3.html:
151         * manual-tests/log-keypress-events.html:
152         * manual-tests/named-window-blank-target.html:
153         * manual-tests/plain-text-paste.html:
154         * manual-tests/plugin-controller-datasource.html:
155         * manual-tests/pre-tab-selection-rect.html:
156         * manual-tests/redirection-target.html:
157         * manual-tests/redraw-page-cache-visited-links.html:
158         * manual-tests/reset-initiatedDrag.html:
159         * manual-tests/resources/named-window-blank-target-step2.html:
160         * manual-tests/resources/named-window-blank-target-step3.html:
161         * manual-tests/resources/named-window-blank-target-step4.html:
162         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
163         * manual-tests/scrollbar-hittest.html:
164         * manual-tests/scrollbar-hittest2.html:
165         * manual-tests/subview-click-assertion.html:
166         * manual-tests/tabbing-input-google.html:
167         * manual-tests/text-field-autoscroll.html:
168         * manual-tests/textarea-after-stylesheet-link.html:
169         * manual-tests/textarea-focus.html:
170         * manual-tests/whitespace-pre-affinity.html:
171
172 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
173
174         Not reviewed - gdk build fix.
175
176         * platform/gdk/ScrollViewGdk.cpp:
177         (WebCore::ScrollView::update): add a stub
178
179 2007-03-18  Brady Eidson  <beidson@apple.com>
180
181         Reviewed by Hyatt
182
183         http://bugs.webkit.org/show_bug.cgi?id=13111
184         When stopped a load before it completes, partial images become the 
185         broken image icon
186
187         * loader/loader.cpp:
188         (WebCore::Loader::didFail): Split off into a method that knows the 
189           difference between failed and cancelled.  If a load is cancelled,
190           don't call error() on the object - only remove it from the cache
191         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
192         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
193
194 2007-03-18  Mitz Pettel  <mitz@webkit.org>
195
196         Reviewed by Adele.
197
198         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
199           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
200
201         Test: fast/forms/input-text-word-wrap.html
202
203         * rendering/RenderTextControl.cpp:
204         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
205         'word-wrap:normal'.
206
207 2007-03-18  Dan Waylonis  <waylonis@mac.com>
208
209         Reviewed by Tim Hatcher.
210
211         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
212         Bug 13005: WebScriptObject +throwException needs NULL check.
213
214         Add checking for NULL interpreter before throwing exception.
215
216         * bindings/objc/WebScriptObject.mm:
217         (+[WebScriptObject throwException:]):
218
219 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
220
221         Reviewed by Oliver Hunt.
222         
223         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
224         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
225         (Style Change Through JavaScript Blanks Content)
226         
227         When indexing into collections, treat the empty string as an invalid argument,
228         instead of the number 0.
229
230         * bindings/js/kjs_html.cpp:
231         (KJS::JSHTMLCollection::getOwnPropertySlot):
232         (KJS::JSHTMLCollection::callAsFunction):
233         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
234
235 2007-03-18  David Hyatt  <hyatt@apple.com>
236
237         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
238
239         Reviewed by aroben
240
241         * platform/graphics/IntRect.h:
242         * rendering/RenderFrameSet.cpp:
243         (WebCore::RenderFrameSet::paintColumnBorder):
244         (WebCore::RenderFrameSet::paintRowBorder):
245
246 2007-03-18  David Hyatt  <hyatt@apple.com>
247
248         Change the frameborder color to be light gray for framesets.
249
250         Reviewed by aroben
251
252         * rendering/RenderFrameSet.cpp:
253         (WebCore::borderFillColor):
254         (WebCore::RenderFrameSet::paintColumnBorder):
255         (WebCore::RenderFrameSet::paintRowBorder):
256
257 2007-03-18  David Hyatt  <hyatt@apple.com>
258
259         Make iframes work properly with frameborder="0".
260
261         Reviewed by aroben
262
263         * html/HTMLIFrameElement.cpp:
264         (WebCore::HTMLIFrameElement::mapToEntry):
265         (WebCore::HTMLIFrameElement::parseMappedAttribute):
266
267 2007-03-18  David Hyatt  <hyatt@apple.com>
268
269         Add a 2px border by default to <iframe>s for compatibility with other browsers.
270
271         Reviewed by aroben
272
273         * css/html4.css:
274
275 2007-03-18  David Hyatt  <hyatt@apple.com>
276
277         Move frame borders out of WebKit and into WebCore.
278
279         Reviewed by aroben, olliej
280
281         * bridge/mac/FrameViewMac.mm:
282         * css/html4.css:
283         * html/HTMLFrameSetElement.cpp:
284         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
285         (WebCore::HTMLFrameSetElement::mapToEntry):
286         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
287         (WebCore::HTMLFrameSetElement::attach):
288         * html/HTMLFrameSetElement.h:
289         (WebCore::HTMLFrameSetElement::hasBorderColor):
290         * page/FrameView.cpp:
291         (WebCore::FrameViewPrivate::FrameViewPrivate):
292         * page/FrameView.h:
293         * page/mac/WebCoreFrameBridge.h:
294         * platform/graphics/IntRect.h:
295         (WebCore::IntRect::topLeft):
296         (WebCore::IntRect::topRight):
297         (WebCore::IntRect::bottomLeft):
298         (WebCore::IntRect::bottomRight):
299         * rendering/RenderFrame.cpp:
300         (WebCore::RenderFrame::viewCleared):
301         * rendering/RenderFrameSet.cpp:
302         (WebCore::borderStartEdgeColor):
303         (WebCore::borderEndEdgeColor):
304         (WebCore::RenderFrameSet::paintColumnBorder):
305         (WebCore::RenderFrameSet::paintRowBorder):
306         (WebCore::RenderFrameSet::paint):
307         * rendering/RenderFrameSet.h:
308         * rendering/RenderPartObject.cpp:
309         (WebCore::RenderPartObject::viewCleared):
310         * rendering/RenderView.cpp:
311         (WebCore::RenderView::repaintViewRectangle):
312
313 2007-03-17  David Hyatt  <hyatt@apple.com>
314
315         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
316         happens before any timers set by the onload can fire).
317
318         Reviewed by aroben
319
320         * dom/Document.cpp:
321         (WebCore::Document::implicitClose):
322         * platform/ScrollView.h:
323         * platform/mac/ScrollViewMac.mm:
324         (WebCore::ScrollView::update):
325
326 2007-03-17  Dave Hyatt  <hyatt@apple.com>
327
328         Prevent starvation of user input and painting when processing timers.
329         If we are already in the processing of a custom timer message, don't allow that
330         processing to do another PostMessage.  Force SetTimer to be used instead.
331       
332         Reviewed by ggaren
333
334        * platform/win/SharedTimerWin.cpp:
335         (WebCore::TimerWindowWndProc):
336         (WebCore::setSharedTimerFireTime):
337
338 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
339
340         Reviewed by Beth Dakin.
341
342         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
343         closing View Source window
344         
345         I award myself 0 points, and may God have mercy on my soul.
346
347         * bindings/js/kjs_proxy.cpp:
348         (WebCore::KJSProxy::~KJSProxy):
349
350 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
351
352         Not reviewed - gdk build fix.
353
354         * platform/gdk/TemporaryLinkStubs.cpp:
355         (Pasteboard::writeURL):
356
357 2007-03-17  David Hyatt  <hyatt@apple.com>
358
359         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
360         unless we actually have a border/background.
361
362         Reviewed by Brady
363
364         * rendering/RenderImage.cpp:
365         (WebCore::RenderImage::imageChanged):
366
367 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
368
369         Reviewed by Sam Weinig.
370
371         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
372         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
373         Added test: svg/custom/use-css-events.svg
374
375         In general this fixes the peepo.co.uk website.
376
377         Forgot to pass the actual StyleChange to the recalcStyle() function,
378         when calling it on the shadow tree root element.
379
380         * ksvg2/svg/SVGUseElement.cpp:
381         (WebCore::SVGUseElement::recalcStyle):
382
383 2007-03-17  Timothy Hatcher  <timothy@apple.com>
384
385         Reviewed by Mark Rowe.
386
387         Made Version.xcconfig smarter when building for different configurations.
388         Now uses the 522+ OpenSource version for Debug and Release, while using the
389         full 522.4 version for Production builds. The system prefix is also computed
390         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
391
392         * Configurations/Version.xcconfig:
393         * Configurations/WebCore.xcconfig:
394
395 2007-03-17  Antti Koivisto  <antti@apple.com>
396
397         Reviewed by Adele.
398
399         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
400         REGRESSION: Can't add item to cart at lnt.com (JS type error)
401         <rdar://problem/4722863>
402         
403         Emulate Firefox behavior where form elements accessed by a name
404         can be accessed with that name later even if the name changes or
405         even if element is removed from the document.
406         
407         This is loosely based on Darin's earlier patch for the same problem but
408         is much less expansive. It takes somewhat different approach to more closely
409         mimic Firefox behavior. Includes expanded test case.
410
411         * bindings/js/JSHTMLFormElementCustom.cpp:
412         (WebCore::JSHTMLFormElement::canGetItemsForName):
413             Use new the HTMLFormElement::getNamedElements() method
414         (WebCore::JSHTMLFormElement::nameGetter):
415             Use new the HTMLFormElement::getNamedElements() method
416         * html/HTMLFormElement.cpp:
417         (WebCore::HTMLFormElement::HTMLFormElement):
418         (WebCore::HTMLFormElement::~HTMLFormElement):
419         (WebCore::HTMLFormElement::elementForAlias):
420         (WebCore::HTMLFormElement::addElementAlias):
421             Maintain a map of known element aliases
422         (WebCore::HTMLFormElement::getNamedElements):
423             Get a list of elements matching the name, based both their
424             current names and known aliases (earlier names).
425             Keep the alias list in sync.
426         * html/HTMLFormElement.h:
427
428 2007-03-17  Adele Peterson  <adele@apple.com>
429
430         Reviewed by Hyatt.
431
432         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
433         http://bugs.webkit.org/show_bug.cgi?id=12725
434
435         Test: updated fast/forms/listbox-onchange.html
436
437         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
438         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
439         they just have to be up-to-date before we execute an action that may trigger onChange.
440
441         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
442           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
443           that notifyOptionSelected won't get called when the call originates from the select element.
444         * html/HTMLOptionElement.h:
445
446         * html/HTMLSelectElement.cpp:
447         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
448         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
449          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
450          the HTMLSelectElement.
451         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
452         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
453         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
454         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
455          since it will get saved before we call onChange.
456         (WebCore::HTMLSelectElement::reset): ditto.
457         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
458          on blur.
459         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
460         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
461         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
462          onchange during mouseup, or after autoscroll).
463         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
464
465         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
466         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
467         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
468         * html/HTMLSelectElement.h:
469         * platform/PopupMenu.h:
470
471 2007-03-16  Oliver Hunt  <oliver@apple.com>
472
473         Reviewed by Hyatt.
474
475         The old canSaveAsWebArchive call was necessary as stand alone
476         images used to be rendered by ImageDocument.
477
478         Fixes rdar://problem/5061252
479
480         * dom/Clipboard.cpp:
481         * dom/Clipboard.h:
482         (WebCore::Clipboard::setDragHasStarted):
483         * page/DragClient.h:
484         (WebCore::DragClient::declareAndWriteDragImage):
485         * platform/mac/ClipboardMac.mm:
486         (WebCore::ClipboardMac::declareAndWriteDragImage):
487
488 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
489
490         Reviewed by Maciej.
491
492         <rdar://problem/4869095>
493         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
494         
495         * xml/xmlhttprequest.cpp:
496         (WebCore::XMLHttpRequest::send):
497
498 2007-03-16  Brady Eidson  <beidson@apple.com>
499
500         Rubberstamped by Tim Hatcher
501
502         Update the hash table header for Window object properties
503
504         * bindings/js/kjs_window.cpp:
505
506 2007-03-16  Brady Eidson  <beidson@apple.com>
507
508         Reviewed by Anders
509
510         <rdar://problem/5061826> and
511         http://bugs.webkit.org/show_bug.cgi?id=12863
512         Implement window.stop()
513
514         * bindings/js/kjs_window.cpp:
515         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
516         * bindings/js/kjs_window.h:
517         (KJS::Window::): Add "Stop"
518
519 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
520
521         Reviewed by Brady Eidson.
522
523         Fixed dir creation to account for already existing dirs and missing leading
524         dirs in path.
525         
526         * loader/icon/IconDatabase.cpp:
527         (WebCore::makeAllDirectories):
528
529 2007-03-16  David Hyatt  <hyatt@apple.com>
530
531         Fix for 13084, assertion failure in the Cache.  Convert the client list
532         to a HashCountedSet so that multiple refs and derefs are allowed.
533
534         Fix RenderImage so that if it has the same image used as a background/border
535         and as the foreground that it will repaint properly (can be tested using
536         border-image and a foreground image).
537
538         Optimize list marker so that it doesn't waste time in the base class method,
539         since list markers don't support background or border images.
540
541         Reviewed by andersca
542
543         * ChangeLog:
544         * loader/CachedResource.cpp:
545         (WebCore::CachedResource::ref):
546         * loader/CachedResource.h:
547         * loader/CachedResourceClientWalker.cpp:
548         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
549         * loader/CachedResourceClientWalker.h:
550         * rendering/RenderImage.cpp:
551         (WebCore::RenderImage::imageChanged):
552         * rendering/RenderListMarker.cpp:
553         (WebCore::RenderListMarker::imageChanged):
554
555 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
556
557         Reviewed by Anders Carlsson.
558         
559         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
560         seen on buildbot
561
562         The problem was that we were initializing the same WebScriptObject twice.
563         This caused it to leak its original set of ivars.
564         
565         I think some refactoring could prevent this situation from arising in the
566         first place, but I'm just adding a check at the call site for now, to do 
567         the simplest thing.
568
569         * bindings/objc/WebScriptObject.mm:
570         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
571         against multiple calls.
572
573         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
574         to setImp because "init" vs "initialize" was a too subtle indication that
575         one was a Cocoa initializer and one was not.
576
577 2007-03-16  Lars Knoll <lars@trolltech.com>
578
579         don't use #import in .cpp files.
580
581         * editing/qt/EditorQt.cpp:
582
583 2007-03-16  Lars Knoll <lars@trolltech.com>
584
585         Fix the Qt build once again.
586
587         * platform/qt/PasteboardQt.cpp:
588         (WebCore::Pasteboard::Pasteboard):
589         (WebCore::Pasteboard::writeSelection):
590         (WebCore::Pasteboard::plainText):
591         (WebCore::Pasteboard::documentFragment):
592         (WebCore::Pasteboard::writeURL):
593         (WebCore::Pasteboard::writeImage):
594         (WebCore::Pasteboard::clear):
595
596 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
597
598         Gdk build fix.
599
600         * loader/gdk/FrameLoaderClientGdk.cpp:
601         (WebCore::FrameLoaderClientGdk::blockedError):
602         * loader/gdk/FrameLoaderClientGdk.h:
603
604 2007-03-15  Beth Dakin  <bdakin@apple.com>
605
606         Reviewed by Geoff.
607
608         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
609         (r19761-19779): Copy image no longer includes image address 
610         (rdar://5067927)
611
612         writeURL() does not need an isImage parameter. Now that it accepts 
613         the types as a parameter, we can just declare the appropriate image 
614         types within writeImage and send them to writeURL(). Also, 
615         declaring the types twice is what broke this.
616
617         * platform/Pasteboard.h:
618         * platform/mac/PasteboardMac.mm:
619         (WebCore::Pasteboard::writeURL):
620         (WebCore::Pasteboard::writeImage):
621
622 2007-03-15  Adele Peterson  <adele@apple.com>
623
624         Reviewed by Kevin Decker.
625
626         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
627
628         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
629           Only setTextFromOption if the menu isn't visible.
630
631 2007-03-15  Brady Eidson  <beidson@apple.com>
632
633         Reviewed by Oliver
634
635         A few platform specific tweaks
636
637         * platform/cf/RetainPtr.h:
638         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
639         
640         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
641
642 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
643
644         Reviewed by Geoff and Steve.
645
646         * config.h: Remove unneeded hack.
647
648 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
649
650         Reviewed by john
651         
652         <rdar://problem/5062376> 
653         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
654         
655         Bring back the remove step in applyBlockStyle.  It's 
656         necessary because addBlockStyleIfNeeded assumes that 
657         the properties it adds aren't already on the block that 
658         it adds them to.
659
660         * editing/ApplyStyleCommand.cpp:
661         (WebCore::ApplyStyleCommand::applyBlockStyle): 
662         Bring back the remove step (added a testcase).
663         Don't do the add step if m_removeOnly is true (no testcase
664         because there aren't any clients using removeOnly functionality
665         to remove styles yet, only styled elemets).
666         Moved the code for creating new blocks up one level
667         to this function so that we can pass blocks to removeCSSStyle.
668         When converting VisiblePositions to indices and vice versa,
669         use the highest node in the shadow tree if we're in one as
670         the scope (working on a testcase).
671         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
672         applyBlockStyle.
673         * editing/ApplyStyleCommand.h: 
674
675 2007-03-15  Brady Eidson  <beidson@apple.com>
676
677         Reviewed by Maciej
678
679         <rdar://problem/4429701>
680         Implements a port blocking black list that matches Firefox's
681
682         * loader/FrameLoader.cpp:
683         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
684         * loader/FrameLoader.h:
685
686         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
687
688         * loader/ResourceLoader.cpp:
689         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
690         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
691           error to fail with for the didFail() call
692         * loader/ResourceLoader.h:
693
694         * platform/graphics/svg/SVGImageEmptyClients.h:
695         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
696
697         * platform/network/ResourceHandle.cpp:
698         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
699           deferred failure on a timer
700         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
701         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
702         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
703         * platform/network/ResourceHandle.h:
704         * platform/network/ResourceHandleClient.h:
705         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
706
707 2007-03-15  Beth Dakin  <bdakin@apple.com>
708
709         Reviewed by Hyatt.
710
711         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
712         RenderBlock::layoutInlineChildren seen on buildbot
713
714         This leak appeared after http://trac.webkit.org/projects/webkit/
715         changeset/20188. This change shifted line boxes around in 
716         removeChild(). But since removeChild() calls 
717         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
718         removed once we actually lay out anyway. So this patch fixes the 
719         leak by deleting the line boxes instead of shifting them around. 
720
721         * editing/IndentOutdentCommand.cpp:
722         (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
723         updateLayout(). This fixes an assertion I got in editing/
724         execCommand/4976800.html This is very similar to the line box fix I 
725         made recently (http://trac.webkit.org/projects/webkit/changeset/
726         20177). We need to update layout before relying on VisiblePositions 
727         after removing a node.
728         * rendering/RenderBlock.cpp:
729         (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
730         since this functionality is needed in three places now.
731         (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
732         deleteLinesForBlock().
733         (WebCore::RenderBlock::removeChild): Same.
734         * rendering/RenderBlock.h:
735
736 2007-03-15  Timothy Hatcher  <timothy@apple.com>
737
738         Reviewed by John.
739
740         * Factored out most of our common build settings into .xcconfig files. Anything that was common in
741           each build configuration was factored out into the shared .xcconfig file.
742         * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
743         * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
744         * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
745
746         * Configurations/Base.xcconfig: Added.
747         * Configurations/DebugRelease.xcconfig: Added.
748         * Configurations/Version.xcconfig: Added.
749         * Configurations/WebCore.xcconfig: Added.
750         * Info.plist:
751         * WebCore.xcodeproj/project.pbxproj:
752
753 2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
754
755         Not reviewed - gdk build fixes.
756
757         * platform/gdk/EditorClientGdk.cpp:
758         (WebCore::EditorClientGdk::handleKeypress):
759         * platform/graphics/cairo/ImageSourceCairo.cpp:
760         (WebCore::ImageSource::setData):
761         * platform/graphics/gdk/ImageGdk.cpp:
762         (WebCore::Image::loadPlatformResource):
763
764 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
765
766         Reviewed by john
767         
768         ~2x speed up of 5k rich text paste:
769         http://shakespeare.mit.edu/hamlet/full.html        
770
771         * editing/ReplaceSelectionCommand.cpp:
772         (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
773         level style span if its unnecessary before inserting
774         into the document, its faster than doing it after.
775         * editing/ReplaceSelectionCommand.h: Exposed 
776         ReplacementFragment::removeNodePreservingChildren so that
777         the style span can be removed using non-undoable removes,
778         like the rest of the removes done on the ReplacementFragment.
779         * editing/markup.cpp:
780         (WebCore::createMarkup): Make the style span the top level
781         element, otherwise it's useless.  This also facilitates the
782         optimization mentioned above.
783         When including markup for a fully selected root, include markup
784         for all the nodes beneath that fully selected root, to preserve 
785         the structure and appearance of the copied markup.  Did this
786         by merging with the code for adding markup for descendants of
787         special commonAncestorBlocks.
788
789 2007-03-15  Beth Dakin  <bdakin@apple.com>
790
791         Rubber-stamped by Adele.
792
793         Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
794         (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
795         and rdar://4722863) because it causes a horrible memory-trasher. 
796
797         * bindings/js/JSHTMLFormElementCustom.cpp:
798         (WebCore::JSHTMLFormElement::canGetItemsForName):
799         (WebCore::JSHTMLFormElement::nameGetter):
800         * bindings/js/kjs_dom.cpp:
801         (KJS::):
802         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
803         (KJS::DOMNamedNodesCollection::lengthGetter):
804         (KJS::DOMNamedNodesCollection::indexGetter):
805         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
806         * bindings/js/kjs_dom.h:
807         (KJS::DOMNamedNodesCollection::classInfo):
808         * bindings/js/kjs_html.cpp:
809         (KJS::JSHTMLCollection::getNamedItems):
810         * dom/ChildNodeList.cpp:
811         (WebCore::ChildNodeList::ChildNodeList):
812         (WebCore::ChildNodeList::length):
813         (WebCore::ChildNodeList::item):
814         (WebCore::ChildNodeList::nodeMatches):
815         * dom/ChildNodeList.h:
816         * dom/NameNodeList.cpp:
817         (WebCore::NameNodeList::NameNodeList):
818         (WebCore::NameNodeList::item):
819         (WebCore::NameNodeList::nodeMatches):
820         * dom/NameNodeList.h:
821         (WebCore::NameNodeList::rootNodeAttributeChanged):
822         * dom/Node.cpp:
823         (WebCore::TagNodeList::TagNodeList):
824         (WebCore::TagNodeList::nodeMatches):
825         (WebCore::Node::registerNodeList):
826         (WebCore::Node::unregisterNodeList):
827         * dom/Node.h:
828         * dom/NodeList.cpp:
829         (WebCore::NodeList::NodeList):
830         (WebCore::NodeList::~NodeList):
831         (WebCore::NodeList::recursiveLength):
832         (WebCore::NodeList::itemForwardsFromCurrent):
833         (WebCore::NodeList::itemBackwardsFromCurrent):
834         (WebCore::NodeList::recursiveItem):
835         (WebCore::NodeList::itemWithName):
836         (WebCore::NodeList::rootNodeChildrenChanged):
837         * dom/NodeList.h:
838         (WebCore::NodeList::rootNodeAttributeChanged):
839         * html/HTMLFormElement.cpp:
840         (WebCore::HTMLFormElement::HTMLFormElement):
841         (WebCore::HTMLFormElement::~HTMLFormElement):
842         (WebCore::HTMLFormElement::formData):
843         (WebCore::HTMLFormElement::parseMappedAttribute):
844         (WebCore::HTMLFormElement::removeFormElement):
845         * html/HTMLFormElement.h:
846         * html/HTMLGenericFormElement.cpp:
847         (WebCore::HTMLGenericFormElement::parseMappedAttribute):
848         (WebCore::HTMLGenericFormElement::insertedIntoTree):
849         * html/HTMLGenericFormElement.h:
850         * html/HTMLInputElement.cpp:
851         (WebCore::HTMLInputElement::parseMappedAttribute):
852
853 2007-03-15  Geoffrey Garen  <ggaren@apple.com>
854
855         Added an assert to help catch a bug. Hopefully someone will hit it!
856         
857         * bindings/js/kjs_proxy.cpp:
858         (WebCore::KJSProxy::~KJSProxy):
859
860 2007-03-14  Oliver Hunt  <oliver@apple.com>
861
862         Reviewed by Adele.
863
864         Fix for rdar://problem/5061737.
865         
866         This was a regression from the original Objective-C -> C++ conversion
867         for the drag logic.  We don't need to call Range::startNode as we just
868         need the document that contains the range.   
869
870         * page/DragController.cpp:
871         (WebCore::documentFragmentFromDragData):
872
873 2007-03-14  Mitz Pettel  <mitz@webkit.org>
874
875         Reviewed by Hyatt.
876
877         - http://bugs.webkit.org/show_bug.cgi?id=13071
878           REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
879
880         Test: fast/loader/text-document-wrapping.html
881
882         * loader/TextDocument.cpp:
883         (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
884
885 2007-03-14  Mitz Pettel  <mitz@webkit.org>
886
887         Reviewed by Hyatt.
888
889         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
890           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
891
892         Test: fast/text/whitespace/pre-wrap-last-char.html
893
894         * rendering/bidi.cpp:
895         (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.
896
897 2007-03-14  David Hyatt  <hyatt@apple.com>
898
899         Add asserts to help catch double refs and double derefs of CachedResources.
900
901         Reviewed by mjs
902
903         * loader/CachedResource.cpp:
904         (WebCore::CachedResource::ref):
905         (WebCore::CachedResource::deref):
906
907 2007-03-14  Alice Liu  <alice.liu@apple.com>
908
909         Rubber-stamped by Hyatt.
910
911         Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
912
913         * loader/icon/IconDataCache.cpp:
914         (WebCore::IconDataCache::writeToDatabase):
915
916 === Safari-5522.4 ===
917
918 2007-03-14  Adele Peterson  <adele@apple.com>
919
920         Reviewed by Adam.
921
922         Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up
923
924         When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.
925
926         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):
927
928 2007-03-14  Steve Falkenburg  <sfalken@apple.com>
929
930         Reviewed by Adam.
931
932         Added missing null check in case this is called on a subframe
933         that hasn't started loading.
934
935         * page/Frame.cpp:
936         (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.
937
938 2007-03-14  Antti Koivisto  <antti@apple.com>
939
940         Reviewed by Geoff.
941
942         Fix http://bugs.webkit.org/show_bug.cgi?id=13060
943         REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
944         <rdar://5060208>
945         
946         Script evaluation may have dereffed the CachedScript object already, causing double deref and
947         eventually m_liveResourcesSize underflow.
948
949         * html/HTMLScriptElement.cpp:
950         (WebCore::HTMLScriptElement::notifyFinished):
951
952 2007-03-14  Adele Peterson  <adele@apple.com>
953
954         Reviewed by Darin.
955
956         Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
957         Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
958         the event is only used by the newly added commands.  But in the future, many (and possibly all) of
959         these editing commands will need to consider the event so they are applied to the correct selection.
960
961         * WebCore.exp:
962         * editing/Editor.cpp:
963         (WebCore::execCopy):
964         (WebCore::execCut):
965         (WebCore::execDelete):
966         (WebCore::execBackwardDelete):
967         (WebCore::execForwardDelete):
968         (WebCore::execMoveBackward):
969         (WebCore::execMoveBackwardAndModifySelection):
970         (WebCore::execMoveUpByPageAndModifyCaret):
971         (WebCore::execMoveDown):
972         (WebCore::execMoveDownAndModifySelection):
973         (WebCore::execMoveForward):
974         (WebCore::execMoveForwardAndModifySelection):
975         (WebCore::execMoveDownByPageAndModifyCaret):
976         (WebCore::execMoveLeft):
977         (WebCore::execMoveLeftAndModifySelection):
978         (WebCore::execMoveRight):
979         (WebCore::execMoveRightAndModifySelection):
980         (WebCore::execMoveToBeginningOfDocument):
981         (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
982         (WebCore::execMoveToBeginningOfSentence):
983         (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
984         (WebCore::execMoveToBeginningOfLine):
985         (WebCore::execMoveToBeginningOfLineAndModifySelection):
986         (WebCore::execMoveToBeginningOfParagraph):
987         (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
988         (WebCore::execMoveToEndOfDocument):
989         (WebCore::execMoveToEndOfDocumentAndModifySelection):
990         (WebCore::execMoveToEndOfSentence):
991         (WebCore::execMoveToEndOfSentenceAndModifySelection):
992         (WebCore::execMoveToEndOfLine):
993         (WebCore::execMoveToEndOfLineAndModifySelection):
994         (WebCore::execMoveToEndOfParagraph):
995         (WebCore::execMoveToEndOfParagraphAndModifySelection):
996         (WebCore::execMoveParagraphBackwardAndModifySelection):
997         (WebCore::execMoveParagraphForwardAndModifySelection):
998         (WebCore::execMoveUp):
999         (WebCore::execMoveUpAndModifySelection):
1000         (WebCore::execMoveWordBackward):
1001         (WebCore::execMoveWordBackwardAndModifySelection):
1002         (WebCore::execMoveWordForward):
1003         (WebCore::execMoveWordForwardAndModifySelection):
1004         (WebCore::execMoveWordLeft):
1005         (WebCore::execMoveWordLeftAndModifySelection):
1006         (WebCore::execMoveWordRight):
1007         (WebCore::execMoveWordRightAndModifySelection):
1008         (WebCore::execPaste):
1009         (WebCore::execSelectAll):
1010         (WebCore::execToggleBold):
1011         (WebCore::execToggleItalic):
1012         (WebCore::execRedo):
1013         (WebCore::execUndo):
1014         (WebCore::execInsertTab):
1015         (WebCore::execInsertBacktab):
1016         (WebCore::execInsertNewline):
1017         (WebCore::execInsertLineBreak):
1018         (WebCore::enabled):
1019         (WebCore::canPaste):
1020         (WebCore::hasEditableSelection):
1021         (WebCore::hasEditableRangeSelection):
1022         (WebCore::hasRangeSelection):
1023         (WebCore::hasRichlyEditableSelection):
1024         (WebCore::canRedo):
1025         (WebCore::canUndo):
1026         (WebCore::CommandEntry::):
1027         (WebCore::Editor::toggleBold):
1028
1029         (WebCore::Editor::execCommand): Added optional event parameter.
1030         (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
1031         (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
1032          Performs the actual insertion without dispatching any event.
1033         * editing/Editor.h:
1034         * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
1035           Call insertTextWithoutSendingTextEvent.
1036
1037 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
1038
1039         Reviewed by darin
1040         
1041         ~3x speedup pasting 5k lines of rich text:
1042         http://shakespeare.mit.edu/hamlet/full.html
1043         ~2x speedup pasting 10k lines of plain text
1044         
1045         * css/CSSComputedStyleDeclaration.cpp:
1046         (WebCore::computedStyle): Added for convenience.
1047         * css/CSSComputedStyleDeclaration.h:
1048         * editing/ReplaceSelectionCommand.cpp:
1049         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
1050         The code that pushed down the top level style span had
1051         a bug in it that made it do unnecessary work.  Instead of
1052         fixing the bug I removed the code because it was used to 
1053         help see more redundancies in second level style spans, but 
1054         createMarkup now *only* creates a top level style span.
1055         Only remove redundant styles from style spans and only remove
1056         unstyled elements if they are style spans.  FF doesn't
1057         remove redundant styles from elements, or remove redundant 
1058         font tags on copy/paste.  We could offer this functionality 
1059         through a separate "cleanup" command.
1060         * editing/markup.cpp:
1061         (WebCore::createMarkup): Only add markup for ancestors of 
1062         lastClosed if we're including markup for acommonAncestorBlock 
1063         (we do this for commonAncestorBlocks like tables and lists),
1064         otherwise it's unnecessary/redundant.
1065
1066 2007-03-14  Anders Carlsson  <acarlsson@apple.com>
1067
1068         Reviewed by Ada.
1069
1070         Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
1071         data, since SubresourceLoaderClients now make use of that buffer.
1072         
1073         * loader/SubresourceLoader.cpp:
1074         (WebCore::SubresourceLoader::didReceiveData):
1075
1076 2007-03-14  Administrator  <acarlsson@apple.com>
1077
1078         Get the size from the shared buffer.
1079         
1080         * platform/graphics/cg/ImageSourceCG.cpp:
1081         (WebCore::ImageSource::setData):
1082         * platform/graphics/cg/PDFDocumentImage.cpp:
1083         (WebCore::PDFDocumentImage::dataChanged):
1084
1085 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1086
1087         Reviewed by Hyatt, thumbs up by Darin.
1088
1089         - fix http://bugs.webkit.org/show_bug.cgi?id=12782
1090           Reproducible crash in BidiContext::deref
1091
1092         Test: fast/dynamic/anonymous-block-orphaned-lines.html
1093
1094         * rendering/InlineBox.cpp:
1095         (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
1096         * rendering/RenderBlock.cpp:
1097         (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
1098         anonymous blocks being destroyed instead of leaving them orphaned, which
1099         is what caused this crash. The boxes will be deleted on the next layout, but
1100         this ensures consistency in the mean time.
1101
1102 2007-03-14  Lars Knoll <lars@trolltech.com>
1103
1104         Reviewed by Antti.
1105
1106         Fix the Qt build.
1107         Add a getter to SharedBuffer that returns a reference to the internal
1108         Vector to avoid an extra copy of the data.
1109
1110         * platform/SharedBuffer.h:
1111         (WebCore::SharedBuffer::buffer):
1112         * platform/graphics/qt/ImageQt.cpp:
1113         (WebCore::Image::loadPlatformResource):
1114         * platform/graphics/qt/ImageSourceQt.cpp:
1115         (WebCore::detectImageFormat):
1116         (WebCore::createDecoder):
1117         (WebCore::ImageSource::setData):
1118
1119 2007-03-14  Antti Koivisto  <antti@apple.com>
1120
1121         Reviewed by Mitz.
1122         
1123         Fix <rdar://problem/5058774>
1124         REGRESSION: In Mail, caret appears oversized when typing in a To Do note
1125         
1126         Horizontal and vertical were switched. Was regression from
1127         http://trac.webkit.org/projects/webkit/changeset/20103
1128
1129         * rendering/RootInlineBox.cpp:
1130         (WebCore::RootInlineBox::addHighlightOverflow):
1131
1132 2007-03-14  David Hyatt  <hyatt@apple.com>
1133
1134         Tweak the data() functions of stylesheets and scripts to be internally consistent.
1135
1136         * loader/CachedCSSStyleSheet.cpp:
1137         (WebCore::CachedCSSStyleSheet::data):
1138         * loader/CachedScript.cpp:
1139         (WebCore::CachedScript::data):
1140         * loader/CachedXSLStyleSheet.cpp:
1141         (WebCore::CachedXSLStyleSheet::data):
1142
1143 2007-03-14  David Hyatt  <hyatt@apple.com>
1144
1145         Fix Radar 5050688.  
1146
1147         For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
1148         the memory consumption down while giant images are animating.
1149
1150         Reviewed by andersca
1151
1152         * platform/graphics/BitmapImage.cpp:
1153         (WebCore::BitmapImage::BitmapImage):
1154         (WebCore::BitmapImage::destroyDecodedData):
1155         (WebCore::BitmapImage::dataChanged):
1156         (WebCore::BitmapImage::advanceAnimation):
1157         * platform/graphics/BitmapImage.h:
1158
1159 2007-03-14  David Hyatt  <hyatt@apple.com>
1160
1161         Make sure to use CFDataCreateWithBytesNoCopy where we can.
1162
1163         Reviewed by andersca
1164
1165         * platform/graphics/cg/ImageSourceCG.cpp:
1166         (WebCore::ImageSource::setData):
1167         * platform/graphics/cg/PDFDocumentImage.cpp:
1168         (WebCore::PDFDocumentImage::dataChanged):
1169
1170 2007-03-13  David Hyatt  <hyatt@apple.com>
1171
1172         Fix for bugzilla bug 13050 and also radar p1 5050645.
1173
1174         This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
1175         images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
1176         database.
1177
1178         There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
1179         making their own.  Even ImageIO uses the SharedBuffer while decoding.
1180
1181         The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
1182         of 100mb.
1183
1184         Reviewed by olliej, mjs
1185
1186         * WebCore.exp:
1187         * loader/CachedCSSStyleSheet.cpp:
1188         (WebCore::CachedCSSStyleSheet::data):
1189         * loader/CachedCSSStyleSheet.h:
1190         * loader/CachedImage.cpp:
1191         (WebCore::CachedImage::data):
1192         * loader/CachedImage.h:
1193         * loader/CachedResource.cpp:
1194         (WebCore::CachedResource::CachedResource):
1195         (WebCore::CachedResource::~CachedResource):
1196         * loader/CachedResource.h:
1197         (WebCore::CachedResource::data):
1198         * loader/CachedScript.cpp:
1199         (WebCore::CachedScript::data):
1200         * loader/CachedScript.h:
1201         * loader/CachedXSLStyleSheet.cpp:
1202         (WebCore::CachedXSLStyleSheet::data):
1203         * loader/CachedXSLStyleSheet.h:
1204         * loader/DocLoader.cpp:
1205         (WebCore::DocLoader::checkCacheObjectStatus):
1206         * loader/ImageDocument.cpp:
1207         (WebCore::ImageTokenizer::writeRawData):
1208         (WebCore::ImageTokenizer::finish):
1209         * loader/icon/IconDataCache.cpp:
1210         (WebCore::IconDataCache::setImageData):
1211         (WebCore::IconDataCache::writeToDatabase):
1212         * loader/icon/IconDataCache.h:
1213         * loader/icon/IconDatabase.cpp:
1214         (WebCore::IconDatabase::imageDataForIconURL):
1215         (WebCore::IconDatabase::iconForPageURL):
1216         (WebCore::IconDatabase::setIconDataForIconURL):
1217         (WebCore::IconDatabase::setHaveNoIconForIconURL):
1218         (WebCore::IconDatabase::imageDataForIconURLQuery):
1219         * loader/icon/IconDatabase.h:
1220         * loader/icon/IconLoader.cpp:
1221         (WebCore::IconLoader::startLoading):
1222         (WebCore::IconLoader::didReceiveResponse):
1223         (WebCore::IconLoader::didReceiveData):
1224         (WebCore::IconLoader::didFail):
1225         (WebCore::IconLoader::finishLoading):
1226         (WebCore::IconLoader::clearLoadingState):
1227         * loader/icon/IconLoader.h:
1228         * loader/icon/SQLStatement.cpp:
1229         (WebCore::SQLStatement::getColumnBlobAsVector):
1230         (WebCore::SQLStatement::isExpired):
1231         * loader/icon/SQLStatement.h:
1232         * loader/loader.cpp:
1233         (WebCore::Loader::didFinishLoading):
1234         (WebCore::Loader::didReceiveData):
1235         * page/mac/WebCoreFrameBridge.mm:
1236         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
1237         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
1238         * platform/SharedBuffer.h:
1239         (WebCore::SharedBuffer::isEmpty):
1240         * platform/graphics/BitmapImage.cpp:
1241         (WebCore::BitmapImage::destroyDecodedData):
1242         (WebCore::BitmapImage::dataChanged):
1243         * platform/graphics/BitmapImage.h:
1244         * platform/graphics/Image.cpp:
1245         (WebCore::Image::setData):
1246         * platform/graphics/Image.h:
1247         (WebCore::Image::dataChanged):
1248         (WebCore::Image::data):
1249         * platform/graphics/ImageSource.h:
1250         * platform/graphics/cg/ImageSourceCG.cpp:
1251         (WebCore::ImageSource::setData):
1252         * platform/graphics/cg/PDFDocumentImage.cpp:
1253         (WebCore::PDFDocumentImage::dataChanged):
1254         * platform/graphics/cg/PDFDocumentImage.h:
1255         * platform/graphics/mac/ImageMac.mm:
1256         (WebCore::Image::loadPlatformResource):
1257         * platform/graphics/svg/SVGImage.cpp:
1258         (WebCore::SVGImage::setData):
1259         * platform/mac/PasteboardMac.mm:
1260         (WebCore::fileWrapperForImage):
1261
1262 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
1263
1264         Reviewed by darin
1265         
1266         <rdar://problem/5046875> 
1267         Gmail Editor: Applying alignment to selected text in message also applies alignment to signature
1268
1269         * editing/ApplyStyleCommand.cpp:
1270         (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
1271         there is a block style to apply.
1272         (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
1273         It was unnecessary and removed properties from blocks that could contain 
1274         content outside the range being operated on (added a testcase).
1275         (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
1276         instead of if-nesting.
1277         * editing/ApplyStyleCommand.h:
1278         * editing/CompositeEditCommand.cpp:
1279         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1280         Return the new block, if one was created.  Use moveParagraphs to move
1281         paragraphs into the new block, instead of moving nodes.  The old code moved
1282         too much (added a testcase).
1283         * editing/CompositeEditCommand.h:
1284
1285 2007-03-13  Oliver Hunt  <oliver@apple.com>
1286
1287         Reviewed by Brady.
1288
1289         To fix <rdar://problem/5044366> we now pass a NSString
1290         representation of the URL extracted with _web_originalDataAsString
1291         instead of relying on [NSURL absoluteString] in the bridge
1292
1293         * page/mac/WebCoreFrameBridge.h:
1294         * page/mac/WebCoreFrameBridge.mm:
1295         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
1296
1297 2007-03-13  Brady Eidson  <beidson@apple.com>
1298
1299         Reviewed by Anders
1300
1301         <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache
1302
1303         Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
1304         didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
1305         out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
1306         resources being cached.
1307         
1308         Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
1309         didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
1310         
1311         In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
1312         I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
1313         completely load.
1314
1315         Note that the layout test for this - if possible - will require other enhancements including possibly adding
1316         support for window.stop().  That task is documented in <rdar://problem/5061826>
1317
1318         * loader/FrameLoader.cpp:
1319         (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
1320           more perfectly restore the original behavior - including only caching HTML documents via the 
1321           m_client->canCachePage() call
1322         (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
1323           purpose
1324           - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
1325           cachability of a page
1326
1327         * loader/loader.cpp:
1328         (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
1329           loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.
1330
1331 2007-03-13  Beth Dakin  <bdakin@apple.com>
1332
1333         Rendering part reviewed by Hyatt. Editing part consulted with and 
1334         rubber stamped by Justin and Harrison.
1335
1336         Fix for <rdar://problem/5025925> A hang occurs in Safari when 
1337         attempting to print page at http://www.pcadvisor.co.uk
1338
1339         * rendering/RenderBlock.cpp:
1340         (WebCore::RenderBlock::makeChildrenNonInline): 
1341         RenderBlock::makeChildrenNonInline() takes a block's inline 
1342         children and turns them into block children. If the children had 
1343         line boxes, those boxes were being leaked. In the layout test I 
1344         added with the change (and at pcadvisor.co.uk during printing) 
1345         children were being made non-inline, and then they were being made 
1346         inline again. This meant that some of the children ended up 
1347         pointing to totally stale line boxes that are normally just leaked. 
1348         This caused an infinite loop in RenderFlow::destroy(). This patch 
1349         simply deletes everyone's line boxes in 
1350         RenderBlock::makeChildrenNonInline()
1351
1352         * editing/InsertParagraphSeparatorCommand.cpp:
1353         (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
1354         of this fix is that I added a call to updateLayout in 
1355         InsertParagraphSeparatorCommand::doApply(). One layout test 
1356         (editing/spelling/spelling.html) was changed by my patch to 
1357         RenderBlock. doApply() inserts a node into the render tree. In at 
1358         least one case in spelling.html, that caused some line boxes to be 
1359         deleted. Back in doApply() this meant that the RenderTree was out-
1360         of-date, and we mistakenly thought we were at the end of the 
1361         paragraph. This caused us to insert a RenderBR() at the end of the 
1362         tree instead of an empty RenderText(). No one seems to know exactly 
1363         why we insert either, or if the change is necessarily a problem. It 
1364         is clear, though, that the RenderTree in doApply() is out-of-date 
1365         after inserting the node and deleting some line boxes, so it seems 
1366         prudent to call into updateLayout().
1367
1368 2007-03-13  Adam Roben  <aroben@apple.com>
1369
1370         Reviewed by Anders.
1371
1372         * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.
1373
1374 2007-03-13  Beth Dakin  <bdakin@apple.com>
1375
1376         Reviewed by Maciej.
1377
1378         Export DocumentLoader::setFrame(). Part of fix for <rdar://
1379         problem/4277074> 8F32: Help Viewer crashed on clicking link - 
1380         KHTMLView::viewportMouseReleaseEvent (12647)
1381
1382         * WebCore.exp:
1383
1384 2007-03-13  Darin Adler  <darin@apple.com>
1385
1386         Reviewed by Maciej.
1387
1388         - fix http://bugs.webkit.org/show_bug.cgi?id=12794
1389           <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
1390           finishes loading due to unclosed canvas tag (12794)
1391
1392         Change <canvas> elements so that their contents are parsed normally,
1393         but not rendered. This change fixes the bug, because normal parsing
1394         rules close the <canvas> element in that case. The special parser
1395         stuff was just getting in the way.
1396
1397         Also do some basic cleanup to the HTML parser. This was motivated by
1398         an earlier version of this patch that made even more changes to the
1399         parser, but the cleanup is still worth landing.
1400
1401         Test: fast/canvas/canvas-hides-fallback.html
1402         Test: fast/canvas/script-inside-canvas-fallback.html
1403         Test: fast/canvas/unclosed-canvas-1.html
1404         Test: fast/canvas/unclosed-canvas-2.html
1405         Test: fast/canvas/unclosed-canvas-3.html
1406         Test: fast/canvas/unclosed-canvas-4.html
1407
1408         * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
1409         renderer is a RenderHTMLCanvas or not.
1410         * html/HTMLCanvasElement.cpp:
1411         (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
1412         a RenderHTMLCanvas. If it's not, let the default code create the default type
1413         of renderer, which will result in fallback content being visible. The
1414         RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
1415         boolean accordingly. Since the actual storage for the canvas is allocated lazily
1416         when you actually get a drawing context, we don't need to do anything special
1417         to prevent it when JavaScript is disabled; the relevant functions won't be called.
1418         (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
1419         RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
1420         the DOM element that relies on the renderer type.
1421
1422         * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
1423         Noncopyable. Changed the Document parameter to the constructor to instead
1424         be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
1425         Removed unused noSpaces function and unneeded public doc() function.
1426         Moved data members all down to the end so you can see them together in order.
1427         Renamed map to m_currentMapElement and isindex to m_isindexElement.
1428         Removed unused end and headLoaded data members.  Renamed m_fragment to
1429         m_isParsingFragment to make it clearer that it's a boolean, not a fragment.
1430
1431         * html/HTMLParser.cpp:
1432         (WebCore::HTMLParser::HTMLParser): Changed to use member construction
1433         syntax instead of calling reset(). This is especially helpful in the
1434         fragment case, where calling reset() later on is illegal, so not using
1435         it in the constructor lets us assert.
1436         (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
1437         calling setCurrent for its side effect.
1438         (WebCore::HTMLParser::reset): Updated for member name changes and removal
1439         and to use document instead of doc().
1440         (WebCore::HTMLParser::setCurrent): Use document instead of doc().
1441         (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
1442         m_inCanvasBeforeFirstOpenTag data member to false.
1443         (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
1444         top of the function, and added a FIXME about the strange case there where
1445         we don't skip yet stay in skip mode. Updated for renaming and doc().
1446         (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
1447         (WebCore::HTMLParser::handleError): Ditto.
1448         (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
1449         (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
1450         (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
1451         (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
1452         (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
1453         Canvas fallback is now handled in the DOM, not the parser. Updated for
1454         renaming and doc().
1455         (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
1456         constant.
1457         (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
1458         (WebCore::HTMLParser::isInline): Ditto.
1459         (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
1460         (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
1461         the local variable Elem to elem.
1462         (WebCore::HTMLParser::createHead): Ditto.
1463         (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
1464         (WebCore::HTMLParser::startBody): Updated for renaming and doc().
1465         (WebCore::HTMLParser::finished): Ditto.
1466
1467 2007-03-13  David Hyatt  <hyatt@apple.com>
1468
1469         Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
1470         clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
1471         data.  Since we're about to be destroyed this is just wasteful.
1472
1473         When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
1474         since we've established that ImageIO can actually crash if you yank the rug out from under it like that.
1475
1476         Reviewed by ggaren
1477
1478         * loader/Cache.cpp:
1479         (WebCore::Cache::prune):
1480         * platform/graphics/BitmapImage.cpp:
1481         (WebCore::BitmapImage::~BitmapImage):
1482
1483 2007-03-13  Anders Carlsson  <acarlsson@apple.com>
1484
1485         Try fixing the Qt build.
1486         
1487         * editing/Editor.h:
1488         (WebCore::Editor::setStartNewKillRingSequence):
1489
1490 2007-03-13  David Harrison  <harrison@apple.com>
1491
1492         Reviewed by Justin.
1493
1494         <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
1495         <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content
1496
1497         For rdar://5031181, properly extend the selection before the killring handling, and
1498         make sure plainText of that selection returns a linefeed.
1499         
1500         For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
1501         even though the range deletion implicitly stopped it via changing the selection.
1502         
1503         A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
1504         only difference between the two was whether to emit a newline when the range started
1505         with a blockflow element. No callers actually need that any more.
1506
1507         Tests added:
1508         * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
1509         * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
1510         * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
1511         * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.
1512
1513         * editing/Editor.cpp:
1514         (WebCore::Editor::deleteRange):
1515         Clear the "start new kill ring sequence" setting, because it was set to true
1516         when the selection was updated by deleting the range.
1517         
1518         (WebCore::Editor::deleteWithDirection):
1519         If extending the selection to the end of paragraph resulted in a caret selection,
1520         extend by character, to handle the case when the selection started as a caret at
1521         the end of paragraph.
1522         
1523         * editing/TextIterator.cpp:
1524         (WebCore::TextIterator::TextIterator):
1525         Initialize new member variables for tracking handling of the beginning of the range.
1526         
1527         (WebCore::TextIterator::advance):
1528         Call representNodeOffsetZero on the m_endContainer.
1529         Move visibility checks into handleTextNode and handleReplacedElement.
1530         
1531         (WebCore::TextIterator::handleTextNode):
1532         (WebCore::TextIterator::handleTextBox):
1533         Call emitText.
1534         
1535         (WebCore::TextIterator::handleReplacedElement):
1536         Moved visibility check into here.
1537         
1538         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
1539         
1540         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
1541         (WebCore::TextIterator::representNodeOffsetZero):
1542         New. Emits proper sequence when encountering offset 0 of a node, including the
1543         m_endContainer. Started with code from handleNonTextNode.
1544         
1545         (WebCore::TextIterator::handleNonTextNode):
1546         Call representNodeOffsetZero.
1547         
1548         (WebCore::TextIterator::exitNode):
1549         Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
1550         was collapsed, and before any other emitted content.
1551         
1552         (WebCore::TextIterator::emitCharacter):
1553         
1554         (WebCore::TextIterator::emitText):
1555         New. Consolidates code used by handleText and handleTextBox.
1556         
1557         (WebCore::CharacterIterator::CharacterIterator):
1558         Removed RUNFINDER.
1559
1560         (WebCore::WordAwareIterator::WordAwareIterator):
1561         Removed RUNFINDER.
1562         
1563         (WebCore::WordAwareIterator::advance):
1564         Formatting.
1565
1566         (WebCore::TextIterator::rangeLength):
1567         Formatting.
1568         
1569         * editing/TextIterator.h:
1570         Added member variables for tracking handling of the beginning of the range.
1571         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
1572         
1573         * editing/visible_units.cpp:
1574         (WebCore::nextBoundary):
1575         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
1576
1577 2007-03-13  David Hyatt  <hyatt@apple.com>
1578
1579         Clean up the null image case in CachedImage::data to make sure the size totals will stay accurate.
1580         I'm not convinced this case can even be hit, but I'm cleaning it up just in case.
1581
1582         * loader/CachedImage.cpp:
1583         (WebCore::CachedImage::data):
1584
1585 2007-03-13  David Hyatt  <hyatt@apple.com>
1586
1587         Reorder the call to allReferencesRemoved, since otherwise the live object size will become
1588         incorrect.
1589
1590         * loader/CachedResource.cpp:
1591         (WebCore::CachedResource::deref):
1592
1593 2007-03-13  Antti Koivisto  <antti@apple.com>
1594
1595         Reviewed by Darin.
1596         
1597         Fix http://bugs.webkit.org/show_bug.cgi?id=11083
1598         REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
1599         <rdar://problem/4757650>
1600         
1601         Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
1602
1603         * page/EventHandler.cpp:
1604         (WebCore::EventHandler::defaultTabEventHandler):
1605
1606 2007-03-13  David Hyatt  <hyatt@apple.com>
1607
1608         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
1609         destroy decoded data when clearing out a partially loaded image that had an error, since the destructor
1610         (although it does destroy the data) disconnects the observer so that the notification doesn't happen.
1611
1612         Some CachedImages aren't in the cache (like image documents).  When the decoded size of such an image
1613         changes we should not notify the cache, since - newsflash - we aren't actually in it.
1614
1615         Reviewed by ggaren
1616
1617         * loader/CachedImage.cpp:
1618         (WebCore::CachedImage::clear):
1619         (WebCore::CachedImage::decodedSizeChanged):
1620
1621 2007-03-13  Darin Adler  <darin@apple.com>
1622
1623         Reviewed by Tim Hatcher and John Sullivan.
1624
1625         - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at
1626           com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502
1627
1628         * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect):
1629         This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count:
1630         method was never really safe to call unless it was AppKit that called your
1631         drawRect: method. Changed it to call drawSingleRect: instead. A little ugly,
1632         but seems to work and will almost certainly fix the bug.
1633
1634 2007-03-13  Nikolas Zimmermann  <zimmermann@kde.org>
1635
1636         Reviewed by Maciej.
1637
1638         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12974
1639
1640         Call forgetGenericContext in JSSVGPathSeg destructor, otherwhise
1641         we'll hit an ASSERT in a debug build, when running svg/custom/js-update-path-changes.svg
1642         a few dozen times in a single WebKit instance. The ASSERT is good and just warns that
1643         there was already a generic context pointer registered, and the new "to be registered"
1644         object already exists, but pointing to a different object. That's because garbage collection
1645         calls the JSSVGPathSeg destructor, but that didn't cleanup the generic context map.
1646
1647         Only JSSVGPathSeg is hit by this problem, as it's the only non SVGAnimated* type
1648         using the generic context system while using a custom JSSVGPathSegList implementation.
1649
1650         Also cleanup JSSVGPathSegListCustom code to call the static forgetGenericContext
1651         method instead of doing the same using custom code.
1652
1653         * bindings/js/JSSVGPathSegListCustom.cpp:
1654         (WebCore::removeFromPathSegContextMap):
1655         (WebCore::JSSVGPathSegList::clear):
1656         (WebCore::JSSVGPathSegList::removeItem):
1657         * bindings/scripts/CodeGeneratorJS.pm:
1658
1659 2007-03-13  Darin Adler  <darin@apple.com>
1660
1661         Reviewed by Adele.
1662
1663         - fix http://bugs.webkit.org/show_bug.cgi?id=12595
1664           <rdar://problem/4722863> REGRESSION: Can't add item to cart at lnt.com
1665           (JS type error) (12595)
1666
1667         Test: fast/forms/old-names.html
1668
1669         * bindings/js/JSHTMLFormElementCustom.cpp:
1670         (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has
1671         nothing for a given name, try the form's oldNamedElement function.
1672         (WebCore::JSHTMLFormElement::nameGetter): Ditto.
1673
1674         * bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use
1675         a class derived from NodeList.
1676         * bindings/js/kjs_dom.cpp: Ditto.
1677
1678         * bindings/js/kjs_html.cpp:
1679         (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived
1680         from NodeList to be used for the named items result from a collection -- uses a
1681         vector of node pointers.
1682         (KJS::VectorNodeList::length): Added.
1683         (KJS::VectorNodeList::item): Added.
1684         (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper
1685         for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
1686
1687         * dom/ChildNodeList.h:
1688         * dom/ChildNodeList.cpp:
1689         (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList,
1690         since NodeList is now a simpler class.
1691         (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
1692
1693         * dom/NameNodeList.h:
1694         * dom/NameNodeList.cpp:
1695         (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList,
1696         since NodeList is now a simpler class.
1697         (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and
1698         parameter change.
1699
1700         * dom/Node.h: Change register/unregister functions to take TreeNodeList.
1701         * dom/Node.cpp:
1702         (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList,
1703         since NodeList is now a simpler abstract class.
1704         (WebCore::TagNodeList::elementMatches): Updated for name and parameter change.
1705         (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList.
1706         (WebCore::Node::unregisterNodeList): Ditto.
1707
1708         * dom/NodeList.h: Broke NodeList into a simpler base class and a derived class
1709         with the machinery for iterating a tree, called TreeNodeList.
1710         * dom/NodeList.cpp:
1711         (WebCore::NodeList::~NodeList): Added.
1712         (WebCore::NodeList::itemWithName): Factored out of the old itemWithName.
1713         (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList.
1714         (WebCore::TreeNodeList::~TreeNodeList): Ditto.
1715         (WebCore::TreeNodeList::recursiveLength): Ditto.
1716         (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto.
1717         (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto.
1718         (WebCore::TreeNodeList::recursiveItem): Ditto.
1719         (WebCore::TreeNodeList::itemWithName): Factored half of this into this function,
1720         the other half in NodeList::itemWithName.
1721         (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline.
1722         (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
1723
1724         * html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement
1725         fucntions, and a map called m_oldNames. Also removed m_boundary, which I
1726         thought I had already done.
1727         * html/HTMLFormElement.cpp:
1728         (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0.
1729         Switched the rest of the members to initialization syntax.
1730         (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames.
1731         (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference
1732         to one element under each of its old names.
1733         (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element
1734         that once had a given name.
1735
1736         * html/HTMLGenericFormElement.h:
1737         * html/HTMLGenericFormElement.cpp:
1738         (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name
1739         attribute changes, tell the form about the old name.
1740         (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form
1741         about an element, also store away the old name so that we can use it
1742         when the name changes later.
1743
1744         * html/HTMLInputElement.cpp:
1745         (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the
1746         base class in the nameAttr case, so the code in HTMLGenericFormElement
1747         above will get called in the input element case.
1748
1749 2007-03-13  Antti Koivisto  <antti@apple.com>
1750
1751         Reviewed by Alexey.
1752
1753         Alexey spotted a DOS by using string of 64k unbreakable character in
1754         fix for http://bugs.webkit.org/show_bug.cgi?id=12833
1755
1756         * dom/Text.cpp:
1757         (WebCore::Text::createWithLengthLimit):
1758
1759 2007-03-13  Lars Knoll <lars@trolltech.com>
1760
1761         Fix the Qt build
1762
1763         * WebCore.pro:
1764
1765 2007-03-13  Rob Buis  <buis@kde.org>
1766
1767         Reviewed by Darin.
1768
1769         http://bugs.webkit.org/show_bug.cgi?id=12576
1770         WebKit does not support xlink:show attributes
1771
1772         Make an exception for non-empty targets, these should be opened
1773         in a new window, unless the value is _self.
1774
1775         * ksvg2/svg/SVGAElement.cpp:
1776         (WebCore::SVGAElement::defaultEventHandler):
1777
1778 2007-03-13  David Hyatt  <hyatt@apple.com>
1779
1780         - fix cache issues seen in http://bugs.webkit.org/show_bug.cgi?id=13050
1781           6 objects and ~200MB leaked after opening then closing tab
1782           <rdar://problem/5058714>
1783
1784         Double the encoded size of images for now.  We do this to account for a bug in ImageIO where they hold
1785         a separate copy of image data.  See <rdar://problem/5050645>.
1786
1787         Reviewed by aroben.
1788
1789         * loader/CachedImage.cpp:
1790         (WebCore::CachedImage::data):
1791
1792 2007-03-12  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1793
1794         Not reviewed - gdk build fix.
1795
1796         * platform/gdk/TemporaryLinkStubs.cpp:
1797         (SearchPopupMenu::enabled): add missing stub.
1798
1799 2007-03-12  David Kilzer  <ddkilzer@kilzer.net>
1800
1801         Reviewed by Darin.
1802
1803         - fix http://bugs.webkit.org/show_bug.cgi?id=13045
1804           REGRESSION: Blackboard CourseWare Error with Nightlies after Mar 8
1805
1806         * html/HTMLFormElement.cpp:
1807         (WebCore::getUniqueBoundaryString): Speculative fix: remove dashes from
1808         the boundary prefix that appear after non-dash characters.
1809
1810 2007-03-12  Mitz Pettel  <mitz@webkit.org>
1811
1812         Reviewed by Anders.
1813
1814         - fix http://bugs.webkit.org/show_bug.cgi?id=13015
1815           REGRESSION (r17233-r17241): Repro crash when leaving a page whose unload handler submits a form
1816
1817         Test: fast/loader/onunload-form-submit-crash-2.html
1818
1819         * loader/DocumentLoader.cpp:
1820         (WebCore::DocumentLoader::finishedLoading): Added null check.
1821
1822 2007-03-12  Anders Carlsson  <acarlsson@apple.com>
1823
1824         Reviewed by Darin.
1825
1826         <rdar://problem/4900071>
1827         http://bugs.webkit.org/show_bug.cgi?id=6454
1828         ASSERTION: Navigating 'back' in frameset: !_private->previousItem (6454)
1829
1830         Change back the behavior of checkLoadComplete to traverse the entire frame tree instead of
1831         just the parent frames of the current frame. This is needed in order to reset the previous history item
1832         for all frames when doing a frame navigation. (This was changed in revision 11819)
1833         
1834         * loader/FrameLoader.cpp:
1835         (WebCore::FrameLoader::recursiveCheckLoadComplete):
1836         (WebCore::FrameLoader::checkLoadComplete):
1837         * loader/FrameLoader.h:
1838
1839 2007-03-12  Justin Garcia  <justin.garcia@apple.com>
1840
1841         Reviewed by darin
1842         
1843         <rdar://problem/5056619> 
1844         REGRESSION: Gmail Editor: Dragging text into Reply (textarea) field results in a crash at WebCore::InsertNodeBeforeCommand::doApply()
1845         
1846         * editing/SelectionController.cpp:
1847         (WebCore::removingNodeRemovesPosition): Added.
1848         (WebCore::SelectionController::nodeWillBeRemoved): Clear the
1849         selection if it's inside a shadow tree.
1850         * page/DragController.cpp:
1851         (WebCore::setSelectionToDragCaret): Return false to signal to
1852         clients that a drop shouldn't be performed if the second attempt
1853         to set a selection ends up in non-editable content.
1854
1855 2007-03-12  Darin Adler  <darin@apple.com>
1856
1857         Reviewed by Tim Hatcher.
1858
1859         - fixed JavaScript wrapper classes to be correct for a variety of cases
1860           that a new test uncovered: was broken for at least 5 classes
1861
1862         - fixed Objective-C wrapper classes to be correct for a variety of cases
1863           that a test case uncovered: was broken for ast least 50 classes
1864
1865         - added missing DOM API for creating OverflowEvent and WheelEvent instances
1866
1867         Test: fast/dom/wrapper-classes.html
1868
1869         * DerivedSources.make: Added missing bindings: HTMLCanvasElement for ObjC,
1870         CDATASection, Comment, and EntityReference for JavaScript.
1871         * WebCore.xcodeproj/project.pbxproj: Added those new generated files.
1872
1873         * bindings/js/JSHTMLElementWrapperFactory.cpp:
1874         (WebCore::createJSHTMLWrapper): Corrected the wrapper classes for <keygen>,
1875         which needs an HTMLSelectElement wrapper, and <xmp>, which needs an
1876         HTMLPreElement wrapper.
1877
1878         * bindings/objc/DOMInternal.h: Updated for new naming scheme.
1879         Also moved createDOMWrapper from the KJS namespace to the WebCore namespace.
1880         * bindings/objc/DOMUtility.mm:
1881         (KJS::createDOMWrapper): Broke the core function into a separate one, and
1882         left it in the KJS namespace because Objective-C++ rules make it impossible
1883         for it to work in the WebCore namespace. Used a macro-based implementation
1884         to cut down on repeated code, and added missing cases for Counter,
1885         HTMLOptionsCollection, Range, XPathExpression, XPathResult, Event, RGBColor,
1886         Rect, Window, DOMImplementation, NodeIterator, TreeWalker, and HTMLCollection.
1887         (WebCore::createDOMWrapper): The other half of the function.
1888
1889         * bindings/objc/DOM.mm:
1890         (WebCore::createElementClassMap): Corrected the wrapper classes for
1891         <canvas>, which needs a DOMHTMLCanvasElement wrapper, <del>, which needs
1892         a DOMHTMLModElement wrapper, <embed>, which needs a DOMHTMLEmbedElement
1893         wrapper, <ins>, which needs a DOMHTMLModElement wrapper, <th>, which needs
1894         a DOMHTMLTableCellElement wrapper, and <xmp>, which needs an
1895         DOMHTMLPreElement wrapper.
1896         (+[DOMNode _wrapNode:]): Updated for new naming scheme.
1897         (+[DOMNode _wrapEventTarget:]): Ditto.
1898         (+[DOMNodeFilter _wrapNodeFilter:]): Ditto.
1899         (ObjCNodeFilterCondition::acceptNode): Ditto.
1900         (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): Ditto.
1901         (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]): Ditto.
1902         (WebCore::ObjCEventListener::handleEvent): Ditto.
1903
1904         * dom/Document.cpp: (WebCore::Document::createEvent):
1905         Added cases for OverflowEvent and WheelEvent.
1906
1907         * dom/OverflowEvent.h: Added empty constructor and initOverflowEvent.
1908         * dom/OverflowEvent.cpp:
1909         (WebCore::OverflowEvent::OverflowEvent): Added.
1910         (WebCore::OverflowEvent::initOverflowEvent): Added.
1911         * dom/OverflowEvent.idl: Added initOverflowEvent.
1912
1913         * bindings/objc/PublicDOMInterfaces.h: Added initOverflowEvent.
1914
1915         * bindings/objc/DOMCSS.mm:
1916         (+[DOMStyleSheet _wrapStyleSheet:]): Updated for new naming scheme.
1917         (+[DOMCSSRule _wrapCSSRule:]): Corrected wrapper for CSSUnknownRule.
1918         (+[DOMCSSValue _wrapCSSValue:]): Updated for new naming scheme.
1919
1920         * bindings/js/kjs_css.h:
1921         (KJS::DOMRGBColor::impl): Added. Used when making an ObjC wrapper.
1922         (KJS::DOMRect::impl): Ditto.
1923
1924         * bindings/js/kjs_dom.cpp: (KJS::toJS): Corrected the wrapper classes for
1925         CDATASection, Comment, and EntityReference.
1926
1927         * bindings/js/kjs_html.cpp: Corrected the class name for HTMLElement
1928         (was "DOMHTMLElement") and HTMLCollection (was "Collection").
1929
1930         * bindings/objc/DOMImplementationFront.h:
1931         * bindings/objc/DOMImplementationFront.cpp:
1932         (WebCore::implementationFront): Added new overload that returns a front given
1933         a JavaScript wrapper. Needed by the code that makes the Objective-C wrapper.
1934
1935         * bindings/objc/WebScriptObject.mm:
1936         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
1937         Updated since createDOMWrapper is now in the WebCore namespace.
1938
1939         * bindings/scripts/CodeGeneratorObjC.pm: Update the naming scheme for the
1940         wrapper creation functions to use _wrapElement: rather then _elementWith:
1941         style. Removed now-unneeded special cases for things that needed to stay
1942         upper-case, since we don't have to do the whole lcfirst thing.
1943
1944         * html/HTMLCanvasElement.idl: Added #if so we can successfully generate the
1945         Objective-C wrapper for this class, even though we can't yet handle the
1946         DOMObject return type.
1947
1948         * html/HTMLOptionsCollection.idl: Added GenerateNativeConverter so we get
1949         an appropriate toJS function.
1950
1951         * bindings/objc/DOMEvents.mm:
1952         (+[DOMEvent _wrapEvent:]):
1953         * bindings/objc/DOMHTML.mm:
1954         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
1955         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
1956         * bindings/objc/DOMObject.mm:
1957         (-[DOMObject sheet]):
1958         * bindings/objc/DOMRGBColor.mm:
1959         (-[DOMRGBColor red]):
1960         (-[DOMRGBColor green]):
1961         (-[DOMRGBColor blue]):
1962         (-[DOMRGBColor alpha]):
1963         (+[DOMRGBColor _wrapRGBColor:]):
1964         * bindings/objc/DOMSVGPathSegInternal.mm:
1965         (+[DOMSVGPathSeg _wrapSVGPathSeg:]):
1966         * bindings/objc/DOMXPath.mm:
1967         (+[DOMNativeXPathNSResolver _wrapXPathNSResolver:]):
1968         * page/mac/WebCoreFrameBridge.mm:
1969         (-[WebCoreFrameBridge nodesFromList:]):
1970         (-[WebCoreFrameBridge elementWithName:inForm:]):
1971         (-[WebCoreFrameBridge formForElement:]):
1972         (-[WebCoreFrameBridge currentForm]):
1973         (-[WebCoreFrameBridge controlsInForm:]):
1974         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
1975         (-[WebCoreFrameBridge convertNSRangeToDOMRange:]):
1976         (-[WebCoreFrameBridge markDOMRange]):
1977         (-[WebCoreFrameBridge markedTextDOMRange]):
1978         (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
1979         (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
1980         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]):
1981         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
1982         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
1983         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
1984         (-[WebCoreFrameBridge increaseSelectionListLevel]):
1985         (-[WebCoreFrameBridge increaseSelectionListLevelOrdered]):
1986         (-[WebCoreFrameBridge increaseSelectionListLevelUnordered]):
1987         (-[WebCoreFrameBridge dragCaretDOMRange]):
1988         (-[WebCoreFrameBridge editableDOMRangeForPoint:]):
1989         (-[WebCoreFrameBridge characterRangeAtPoint:]):
1990         (-[WebCoreFrameBridge typingStyle]):
1991         (-[WebCoreFrameBridge rangeOfCharactersAroundCaret]):
1992         * platform/mac/ClipboardMac.mm:
1993         (WebCore::ClipboardMac::declareAndWriteDragImage):
1994         * platform/mac/PasteboardMac.mm:
1995         (WebCore::Pasteboard::writeSelection):
1996         Updated for new naming scheme.
1997
1998 2007-03-12  Timothy Hatcher  <timothy@apple.com>
1999
2000         Reviewed by Darin.
2001
2002         <rdar://problem/4990691> REGRESSION: Selecting text in Adium's Messages field causes horizontal shift
2003
2004         Corrected the recursive point conversion and scrolling done in scrollPointRecursively to use the
2005         document view of each NSClipView.
2006
2007         * platform/mac/ScrollViewMac.mm:
2008         (WebCore::ScrollView::scrollPointRecursively): Call convertPoint:fromView: on the document views,
2009         not the clip views as we encounter them. Then call constrainScrollPoint: on the converted point to
2010         constrain to the document view bounds. And finally call scrollPoint: on the document view, not the clip view.
2011
2012 2007-03-12  Antti Koivisto  <antti@apple.com>
2013
2014         Reviewed by Alexey.
2015
2016         Fix http://bugs.webkit.org/show_bug.cgi?id=12833
2017         REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
2018         <rdar://problem/5028159>
2019         
2020         Divide large text blocks (>64kB) over multiple text nodes. This limits linebox searches to
2021         a manageable subset.
2022         
2023         * dom/Text.cpp:
2024         (WebCore::Text::createWithLengthLimit):
2025         * dom/Text.h:
2026         * html/HTMLParser.cpp:
2027         (WebCore::HTMLParser::parseToken):
2028         * loader/TextDocument.cpp:
2029         (WebCore::TextTokenizer::write):
2030
2031 2007-03-12  David Hyatt  <hyatt@apple.com>
2032
2033         Fix a regression in printing.  Printer fonts need to be part of the
2034         font cache key, since printer fonts have different glyph widths.
2035         (Integer antialiasing is used for screen fonts but not for printer fonts.)
2036
2037         Reviewed by aroben
2038
2039         * platform/FontCache.cpp:
2040         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
2041         (WebCore::FontPlatformDataCacheKey::operator==):
2042         (WebCore::computeHash):
2043         (WebCore::FontCache::getCachedFontPlatformData):
2044
2045 2007-03-12  Lars Knoll <lars@trolltech.com>
2046
2047         add missing symbol to fix the Qt build again.
2048
2049         * platform/qt/SearchPopupMenuQt.cpp:
2050         (WebCore::SearchPopupMenu::enabled):
2051
2052 2007-03-12  Adele Peterson  <adele@apple.com>
2053
2054         Reviewed by Oliver.
2055
2056         Adding the ability to enable or disable a SearchPopupMenu.
2057
2058         * platform/SearchPopupMenu.h:
2059         * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
2060         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):
2061
2062 2007-03-12  Rob Buis  <buis@kde.org>
2063
2064         Reviewed by Nikolas Zimmermann.
2065
2066         http://bugs.webkit.org/show_bug.cgi?id=12500
2067         SVG fails to correctly handle all link style selectors
2068         http://bugs.webkit.org/show_bug.cgi?id=12567
2069         <text> elements ignore <a> children
2070
2071         Allow <a> inside svg text and handle xlink:show.
2072
2073         * ksvg2/svg/SVGAElement.cpp:
2074         (WebCore::SVGAElement::createRenderer):
2075         (WebCore::SVGAElement::defaultEventHandler):
2076         (WebCore::SVGAElement::childShouldCreateRenderer):
2077         * ksvg2/svg/SVGAElement.h:
2078         * ksvg2/svg/SVGElement.h:
2079         (WebCore::SVGElement::isTextContent):
2080         * ksvg2/svg/SVGTextContentElement.h:
2081         (WebCore::SVGTextContentElement::isTextContent):
2082         * ksvg2/svg/SVGTextElement.cpp:
2083         (WebCore::SVGTextElement::childShouldCreateRenderer):
2084         * rendering/SVGInlineFlowBox.cpp:
2085         (WebCore::translateBox):
2086         (WebCore::placePositionedBoxesHorizontally):
2087         (WebCore::placeBoxesVerticallyWithAbsBaseline):
2088
2089 2007-03-12  Adele Peterson  <adele@apple.com>
2090
2091         Reviewed by Oliver.
2092
2093         Add a missing parameter to the constructor.
2094
2095         * platform/PlatformKeyboardEvent.h:
2096         * platform/win/KeyEventWin.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2097
2098 2007-03-12  Lars Knoll <lars@trolltech.com>
2099
2100         Fix the Qt build. I still get crashes though :/
2101
2102         * platform/graphics/qt/ImageDecoderQt.cpp:
2103         (WebCore::ImageDecoderQt::clearFrame):
2104         * platform/graphics/qt/ImageDecoderQt.h:
2105         * platform/graphics/qt/ImageSourceQt.cpp:
2106         (WebCore::ImageSource::setData):
2107         (WebCore::ImageSource::frameIsCompleteAtIndex):
2108         (WebCore::ImageSource::clear):
2109         (WebCore::ImageSource::destroyFrameAtIndex):
2110         * platform/qt/ClipboardQt.cpp:
2111         (WebCore::ClipboardQt::ClipboardQt):
2112         * platform/qt/ClipboardQt.h:
2113         * platform/qt/DragDataQt.cpp:
2114         (WebCore::DragData::createClipboard):
2115
2116 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2117
2118         Not reviewed - gdk build fixes.
2119
2120         * platform/gdk/EditorClientGdk.cpp:
2121         (WebCore::EditorClientGdk::respondToChangedSelection): add stub
2122         * platform/gdk/EditorClientGdk.h:
2123         * platform/gdk/FrameGdk.cpp:
2124         * platform/gdk/TemporaryLinkStubs.cpp:
2125         (Editor::markMisspellings): add stub
2126
2127 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
2128
2129         Reviewed by Adele.
2130
2131         http://bugs.webkit.org/show_bug.cgi?id=12560
2132         W3C XPath test Text_Nodes.svg fails
2133
2134         * xml/XPathStep.cpp:
2135         (WebCore::XPath::Step::nodeTestMatches): Revert the fix, as the behavior doesn't appear 
2136         all that desirable as it did at first glance.
2137
2138 2007-03-11  Oliver Hunt  <oliver@apple.com>
2139
2140         Reviewed by hyatt.
2141
2142         Fix for <rdar://problem/5055690> ASSERTION failure on drop into 
2143         editable element with content changed on drop 
2144
2145         After setting the selection for a drop into an editable region 
2146         we make sure the we succeeded.  If we didn't we assume a focus handler
2147         or similar altered the element contents and try again, if the second
2148         attempt fails we bail out.
2149
2150         * page/DragController.cpp:
2151         (WebCore::setSelectionToDragCaret):
2152         (WebCore::DragController::concludeDrag):
2153
2154 2007-03-11  Oliver Hunt  <oliver@apple.com>
2155
2156         Reviewed by Adele.
2157
2158         Moving Frame{Mac}::respondToChangedSelection to Frame.cpp
2159         Added new EditorClient method to handle old bridge function
2160         
2161         * bridge/EditorClient.h:
2162            Added respondToChangedSelection to replace old bridge function
2163         * editing/Editor.cpp:
2164         (WebCore::Editor::respondToChangedSelection):
2165            Add client call to replace old bridge call from Frame::respondToChangedSelection
2166         * editing/SelectionController.cpp:
2167         (WebCore::SelectionController::setSelection):
2168            No longer directly call Editor as Frame::respondToChangedSelection
2169            makes the call
2170         * page/Frame.cpp:
2171         (WebCore::Frame::respondToChangedSelection):
2172            Moved from FrameMac, replaced bridge call with call to Editor
2173         * page/mac/FrameMac.mm:
2174            Moved respondToChangedSelection to Frame.cpp
2175         * page/mac/WebCoreFrameBridge.h:
2176            Removed respondToChangedSelection from bridge
2177         * page/qt/FrameQt.cpp:
2178            Remove stub method for respondToChangedSelection
2179
2180 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2181
2182         Reviewed by Brady Eidson.
2183
2184         Linux/gdk fix.
2185
2186         * loader/gdk/FrameLoaderClientGdk.cpp:
2187         (WebCore::FrameLoaderClientGdk::shouldGoToHistoryItem): return true so
2188         that FrameLoader:goBackOrForwards() works.
2189
2190 2007-03-10  Geoffrey Garen  <ggaren@apple.com>
2191
2192         Reviewed by Darin Adler.
2193
2194         Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and 
2195         JSCore causes a hang @ www.panoramas.dk
2196         
2197         See JavaScriptCore ChangeLog for details.
2198         
2199         * bindings/objc/WebScriptObject.mm:
2200         (_didExecute): Added helpful ASSERT.
2201         (+[WebScriptObject throwException:]): Added missing JSLock.
2202
2203 2007-03-11  Antti Koivisto  <antti@apple.com>
2204
2205         Reviewed by Hyatt.
2206
2207         Optimize linebox memory consumption:
2208         - move all bitfields to baseclass compacting them
2209         - make InlineTextBox::m_truncation unsigned short and make it relative to m_start
2210         - remove extremely rarely used EllipsisBox pointer from RootInlineBox and instead
2211           use a global hashmap to store it if needed
2212         - use minimum required number of bits to store BidiStatus enum variables in RootInlineBox
2213         - move overflow variables in RootInlineBox to a separate struct that is instantiated
2214           only if any of the variables is set to a value that can't trivially be derived from 
2215           box x, y, width and height
2216           
2217         As a result line box objects shrink:
2218             InlineBox: 44 -> 44 bytes
2219             InlineTextBox: 68 -> 60 bytes
2220             InlineFlowBox: 68 -> 64 bytes
2221             RootInlineBox: 128 -> 88 bytes
2222             
2223         The optimizations possiblity was noticed when debugging http://bugs.webkit.org/show_bug.cgi?id=12833
2224         Bug 12833: REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
2225         <rdar://problem/5028159>
2226         
2227         On that page the patch saves 11.5MB or some 21% of linebox memory consumption. It also
2228         actually improves selection performance somewhat by improving memory locality.
2229
2230         * rendering/InlineBox.h:
2231         (WebCore::InlineBox::InlineBox):
2232         * rendering/InlineFlowBox.h:
2233         (WebCore::InlineFlowBox::InlineFlowBox):
2234         * rendering/InlineTextBox.cpp:
2235         (WebCore::InlineTextBox::placeEllipsisBox):
2236         (WebCore::InlineTextBox::nodeAtPoint):
2237         (WebCore::InlineTextBox::paint):
2238         (WebCore::InlineTextBox::paintDecoration):
2239         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
2240         (WebCore::InlineTextBox::paintMarkedTextUnderline):
2241         * rendering/InlineTextBox.h:
2242         (WebCore::InlineTextBox::InlineTextBox):
2243         * rendering/RootInlineBox.cpp:
2244         (WebCore::throw):
2245         (WebCore::RootInlineBox::Overflow::operator delete):
2246         (WebCore::RootInlineBox::Overflow::destroy):
2247         (WebCore::RootInlineBox::destroy):
2248         (WebCore::RootInlineBox::detachEllipsisBox):
2249         (WebCore::RootInlineBox::clearTruncation):
2250         (WebCore::RootInlineBox::placeEllipsis):
2251         (WebCore::RootInlineBox::paintEllipsisBox):
2252         (WebCore::RootInlineBox::addHighlightOverflow):
2253         (WebCore::RootInlineBox::nodeAtPoint):
2254         (WebCore::RootInlineBox::adjustPosition):
2255         (WebCore::RootInlineBox::selectionTop):
2256         (WebCore::RootInlineBox::setLineBreakInfo):
2257         (WebCore::RootInlineBox::ellipsisBox):
2258         (WebCore::RootInlineBox::setVerticalOverflowPositions):
2259         (WebCore::RootInlineBox::setHorizontalOverflowPositions):
2260         (WebCore::RootInlineBox::setVerticalSelectionPositions):
2261         * rendering/RootInlineBox.h:
2262         (WebCore::RootInlineBox::RootInlineBox):
2263         (WebCore::RootInlineBox::topOverflow):
2264         (WebCore::RootInlineBox::bottomOverflow):
2265         (WebCore::RootInlineBox::leftOverflow):
2266         (WebCore::RootInlineBox::rightOverflow):
2267         (WebCore::RootInlineBox::lineBreakBidiStatus):
2268         (WebCore::RootInlineBox::selectionBottom):
2269         (WebCore::RootInlineBox::Overflow::Overflow):
2270
2271 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
2272
2273         Reviewed by Darin.
2274
2275         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
2276         XPath can be very slow
2277
2278         * xml/XPathExpression.cpp:
2279         (WebCore::XPathExpression::evaluate): Cache evaluationContext in a local variable.
2280
2281         * xml/XPathExpressionNode.cpp:
2282         (WebCore::XPath::Expression::evaluationContext):
2283         * xml/XPathExpressionNode.h:
2284         (WebCore::XPath::Expression::addSubExpression):
2285         (WebCore::XPath::Expression::subExprCount):
2286         (WebCore::XPath::Expression::subExpr):
2287         * xml/XPathFunctions.cpp:
2288         * xml/XPathFunctions.h:
2289         (WebCore::XPath::Function::setName):
2290         (WebCore::XPath::Function::arg):
2291         (WebCore::XPath::Function::argCount):
2292         (WebCore::XPath::Function::name):
2293         Made one-liners critical for performance inline.
2294
2295         * xml/XPathGrammar.y: Fully parse NodeTests, so that strings are no longer passed for what is
2296         essentially an enum. Use LocationPath accessors to add steps, instead of directly manipulating
2297         internal data members.
2298
2299         * xml/XPathParser.cpp:
2300         (WebCore::XPath::Parser::parseStatement):
2301         (WebCore::XPath::Parser::registerNodeTest):
2302         (WebCore::XPath::Parser::deleteNodeTest):
2303         * xml/XPathParser.h:
2304         Added support methods for changes in XPathGrammar.y.
2305
2306         * xml/XPathPath.cpp:
2307         (WebCore::XPath::Filter::evaluate): Cache evaluationContext in a local variable. Use swap() to avoid
2308         performing vector assignments.
2309         (WebCore::XPath::LocationPath::evaluate): Use swap() to avoid performing vector assignments.
2310         (WebCore::XPath::LocationPath::optimizeStepPair): This new method is called during LocationPath construction, 
2311         to simplify the path as it's being built. Currently, the only optimized case is "//*" - it is a basis for
2312         important operations that cannot be efficiently written in XPath 1.0, but can be optimized with a little bit
2313         of XPath 2.0.
2314         (WebCore::XPath::LocationPath::appendStep): A new accessor that modifies m_steps and calls optimizeStepPair().
2315         (WebCore::XPath::LocationPath::insertFirstStep): Ditto.
2316         * xml/XPathPath.h:
2317         (WebCore::XPath::LocationPath::setAbsolute): A new accessor.
2318
2319         * xml/XPathStep.h:
2320         (WebCore::XPath::Step::NodeTest::):
2321         (WebCore::XPath::Step::NodeTest::NodeTest):
2322         (WebCore::XPath::Step::NodeTest::kind):
2323         (WebCore::XPath::Step::NodeTest::data):
2324         Step::NodeTest is a new sub-class that represents a fully parsed NodeTest.
2325         (WebCore::XPath::Step::axis):
2326         (WebCore::XPath::Step::nodeTest):
2327         (WebCore::XPath::Step::nodeTestData):
2328         (WebCore::XPath::Step::namespaceURI):
2329         (WebCore::XPath::Step::predicates):
2330         (WebCore::XPath::Step::setAxis):
2331         (WebCore::XPath::Step::setNodeTest):
2332         (WebCore::XPath::Step::setNodeTestData):
2333         (WebCore::XPath::Step::setNamespaceURI):
2334         (WebCore::XPath::Step::setPredicates):
2335         New accessors that let optimizeStepPair() manipulate Step data.
2336
2337         * xml/XPathStep.cpp:
2338         (WebCore::XPath::Step::Step): Use the new NodeTest class.
2339         (WebCore::XPath::Step::evaluate): Cache evaluationContext in a local variable. Use swap() to avoid
2340         performing unneeded vector assignments.
2341         (WebCore::XPath::Step::nodesInAxis): Cosmetic changes.
2342         (WebCore::XPath::Step::nodeTestMatches): Use NodeTest instead of parsing the test from string each time.
2343         Added a partial implementation of XPath 2.0 element() node test.
2344
2345 2007-03-10  Alexey Proskuryakov  <ap@webkit.org>
2346
2347         Reviewed by Darin.
2348
2349         http://bugs.webkit.org/show_bug.cgi?id=12249
2350         FCKeditor: <hr>, <ul> and <ol> have id="undefined"
2351
2352         This fixes the attached reduction, but not the original issue.
2353
2354         Test: editing/execCommand/default-parameters.html
2355
2356         * dom/Document.h:
2357         * dom/Document.idl:
2358         Make second and third execCommand() parameters optional.
2359
2360 2007-03-10  Adele Peterson  <adele@apple.com>
2361
2362         Reviewed by Maciej.
2363
2364         Fix for http://bugs.webkit.org/show_bug.cgi?id=13028
2365         REGRESSION: textField:doCommandBySelector:inFrame: not being called properly
2366
2367         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
2368           Before calling the base class defaultEventHandler, which will call handleKeypress, call doTextFieldCommandFromEvent.        
2369
2370 2007-03-10  Mitz Pettel  <mitz@webkit.org>
2371
2372         Reviewed by Darin.
2373
2374         - fix http://bugs.webkit.org/show_bug.cgi?id=13013
2375           REGRESSION: Selection box does not scroll to where the focus jumps when pressing an alphanumeric key
2376
2377         Test: fast/forms/listbox-typeahead-scroll.html
2378
2379         * html/HTMLSelectElement.cpp:
2380         (WebCore::HTMLSelectElement::setSelectedIndex): Reordered to set the active selection's
2381         anchor and end before selecting the option, since the active selection is used to
2382         decide where to scroll when the selection is made.
2383         (WebCore::HTMLSelectElement::defaultEventHandler): Removed redundant check.
2384
2385 2007-03-10  Mitz Pettel  <mitz@webkit.org>
2386
2387         Reviewed by Darin.
2388
2389         - fix http://bugs.webkit.org/show_bug.cgi?id=12973
2390           REGRESSION: Reproducible assert while loading this test file if css is already in the cache
2391
2392         Test: fast/dom/css-cached-import-rule.html
2393
2394         Replaced some direct calls to document->stylesheetLoaded() with calls to
2395         the sheet's checkLoaded(). The latter calls back to the element's sheetLoaded() --
2396         which notifies the document of the load -- and then updates the sheet's
2397         loadCompleted() flag, ensuring that it stays in sync with whether the stylesheet
2398         is still considered pending by the document.
2399
2400         * dom/ProcessingInstruction.cpp:
2401         (WebCore::ProcessingInstruction::parseStyleSheet):
2402         * dom/StyleElement.cpp:
2403         (WebCore::StyleElement::childrenChanged):
2404         * html/HTMLLinkElement.cpp:
2405         (WebCore::HTMLLinkElement::process):
2406         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2407         * ksvg2/svg/SVGStyleElement.cpp:
2408         (WebCore::SVGStyleElement::sheetLoaded):
2409         * ksvg2/svg/SVGStyleElement.h:
2410
2411 2007-03-10  David Kilzer  <ddkilzer@webkit.org>
2412
2413         Reviewed by Darin.
2414
2415         - fix http://bugs.webkit.org/show_bug.cgi?id=9609
2416           REGRESSION: Missing image icon needs to be moved back to WebKit
2417
2418         * WebCore.exp: Export WebCore::Image::loadPlatformResource(const char*) for use in
2419         [WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:].
2420
2421 2007-03-09  Darin Adler  <darin@apple.com>
2422
2423         Reviewed by Justin.
2424
2425         - fix http://bugs.webkit.org/show_bug.cgi?id=8928
2426           <rdar://problem/5045708> REPRODUCIBLE ASSERT: Cannot paste HTML into a
2427           contenteditable region in an XHTML document (8928)
2428
2429         Test: editing/pasteboard/paste-xml.xhtml
2430
2431         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Added a check for 0
2432         here, since createContextualFragment can return 0 for XML documents that fail
2433         to parse. In my testing, callers all seem equipped to handle 0.
2434
2435 2007-03-09  Mitz Pettel  <mitz@webkit.org>
2436
2437         Reviewed by Darin.
2438
2439         - fix http://bugs.webkit.org/show_bug.cgi?id=9929
2440           REGRESSION: crash on logging in on mijnpostbank.nl
2441
2442         Test: http/tests/misc/onload-remove-iframe-crash-2.html
2443
2444         The resulted from an iframe's load event handler removing the iframe
2445         from the document.
2446
2447         * dom/Document.cpp:
2448         (WebCore::Document::implicitClose): Bail out early if an event handler
2449         removed the frame.
2450         * loader/FrameLoader.cpp:
2451         (WebCore::FrameLoader::FrameLoader):
2452         (WebCore::FrameLoader::clear):
2453         (WebCore::FrameLoader::checkCompleted): Protect the frame from deletion
2454         by event handlers.
2455         (WebCore::FrameLoader::checkCompletedTimerFired):
2456         (WebCore::FrameLoader::scheduleCheckCompleted):
2457         (WebCore::FrameLoader::detachFromParent): Schedule a completion check
2458         on the parent (in case the child is what has been keeping it from completing).
2459         * loader/FrameLoader.h:
2460
2461 2007-03-08  David Kilzer  <ddkilzer@webkit.org>
2462
2463         Reviewed by Beth.
2464
2465         - fix http://bugs.webkit.org/show_bug.cgi?id=13019
2466           REGRESSION (r20074): Forms don't submit on a variety of websites
2467
2468         No tests added since LayoutTests/fast/forms/document-write.html was timing out
2469         and causing a layout test failure.
2470
2471         * html/HTMLFormElement.cpp:
2472         (WebCore::HTMLFormElement::submit): Removed stray code.
2473
2474 2007-03-08  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2475
2476         Not reviewed - gdk build fix.
2477
2478         * platform/graphics/cairo/ImageSourceCairo.cpp:
2479         (WebCore::ImageSource::frameIsCompleteAtIndex): add empty stub
2480
2481 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
2482
2483         Reviewed by harrison
2484         
2485         <rdar://problem/4903193> 
2486         On particular page, Copy is so slow it seems like a hang
2487         
2488         ~2x speedup copying:
2489         http://shakespeare.mit.edu/henryviii/full.html 
2490         Also produces less bloated markup.
2491
2492         * editing/markup.cpp:
2493         (WebCore::startMarkup): Don't wrap text nodes in style spans.
2494         For Elements, don't inline styles inherited from ancestors.
2495         (WebCore::createMarkup): No longer necessary to find 
2496         the root's default style and pass it to startMarkup.
2497         Add a wrapper span around the markup with the styles
2498         that all nodes in the markup inherit (the inheritable 
2499         styles from the common ancestor container's computed style).
2500         Added a FIXME about unecessary markup for inline ancestors 
2501         up to the commonAncestorBlock.
2502
2503 2007-03-08  Darin Adler  <darin@apple.com>
2504
2505         Reviewed by Adele.
2506
2507         - <rdar://problem/4470381> multipart/form-data boundary security vulnerability
2508
2509         By making the form data boundary a string with some random data in it, we reduce
2510         the possibility that anyone could take advantage of it by creating a file that
2511         intentionally has the boundary string in it.
2512
2513         * html/HTMLFormElement.h: Removed boundary(), setBoundary(), and m_boundary.
2514         Marked a lot more stuff private.
2515         * html/HTMLFormElement.cpp:
2516         (WebCore::HTMLFormElement::HTMLFormElement): Removed code to initialize
2517         m_boundary.
2518         (WebCore::randomNumber): Added. Function that returns a random number, including
2519         seeding the random number generator the first time it's called. For now, usees the more
2520         random function random() on Mac OS X and the more-standard rand() on other platforms.
2521         (WebCore::HTMLFormElement::formData): Take a parameter with the form boundary string,
2522         and use that instead of m_boundary.
2523         (WebCore::getUniqueBoundaryString): Added. Makes a boundary string using random numbers
2524         and base 64 encoding.
2525         (WebCore::HTMLFormElement::submit): Call getUniqueBoundaryString and pass the boundary
2526         string into formData for multipart form posts.
2527
2528 2007-03-08  Maciej Stachowiak  <mjs@apple.com>
2529
2530         Reviewed by Adele.
2531         
2532         <rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588)
2533         http://bugs.webkit.org/show_bug.cgi?id=12588
2534
2535         Carefully revised which focus operations restore previous selection, which clear it, and which
2536         select the whole control contents.
2537         
2538         Tests:
2539         fast/forms/focus-selection-input.html
2540         fast/forms/focus-selection-textarea.html
2541         
2542         * dom/Element.cpp:
2543         (WebCore::Element::focus):
2544         * dom/Element.h:
2545         * html/HTMLInputElement.cpp:
2546         (WebCore::HTMLInputElement::focus):
2547         (WebCore::HTMLInputElement::accessKeyAction):
2548         * html/HTMLInputElement.h:
2549         * html/HTMLLabelElement.cpp:
2550         (WebCore::HTMLLabelElement::focus):
2551         (WebCore::HTMLLabelElement::accessKeyAction):
2552         * html/HTMLLabelElement.h:
2553         * html/HTMLLegendElement.cpp:
2554         (WebCore::HTMLLegendElement::focus):
2555         * html/HTMLLegendElement.h:
2556         * html/HTMLTextAreaElement.cpp:
2557         (WebCore::HTMLTextAreaElement::focus):
2558         * html/HTMLTextAreaElement.h:
2559         * page/FocusController.cpp:
2560         (WebCore::FocusController::advanceFocus):
2561
2562 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
2563
2564         Reviewed by harrison
2565
2566         <http://bugs.webkit.org/show_bug.cgi?id=12244>
2567         FCKeditor: Find dialog doesn't work
2568
2569         * bindings/js/kjs_window.cpp:
2570         (KJS::Window::find): Added.  This function doesn't yet 
2571         support whole word searches, searching in subframes, or
2572         opening the find dialog.
2573         (KJS::WindowFunc::callAsFunction):
2574         * bindings/js/kjs_window.h:
2575         (KJS::Window::):
2576
2577 2007-03-08  David Hyatt  <hyatt@apple.com>
2578
2579         Fix regression from throwing away frames of large animated images.  Alter
2580         animated images so that they refuse to advance the animation until the
2581         current displayed frame has been fully decoded.
2582
2583         Reviewed by ggaren
2584
2585         * platform/graphics/BitmapImage.cpp:
2586         (WebCore::BitmapImage::startAnimation):
2587         (WebCore::BitmapImage::advanceAnimation):
2588         * platform/graphics/ImageSource.h:
2589         * platform/graphics/cg/ImageSourceCG.cpp:
2590         (WebCore::ImageSource::frameIsCompleteAtIndex):
2591
2592 2007-03-08  David Hyatt  <hyatt@apple.com>
2593
2594         Fix 2% performance regression on the PLT.  Increase the large animated
2595         image cutoff from 1MB to 5MB.
2596
2597         In addition when pruning we will aggressively discard image sources.
2598
2599         Reviewed by ggaren
2600
2601         * platform/graphics/BitmapImage.cpp:
2602         (WebCore::BitmapImage::destroyDecodedData):
2603
2604 2007-03-08  Timothy Hatcher  <timothy@apple.com>
2605
2606         Reviewed by John.
2607
2608         <rdar://problem/4664697> highlighter SPI needs a node parameter to give more context
2609
2610         Pass the RenderObject's node to customHighlightLineRect and paintCustomHighlight.
2611
2612         * page/Frame.h:
2613         * page/mac/FrameMac.mm:
2614         (WebCore::Frame::customHighlightLineRect):
2615         (WebCore::Frame::paintCustomHighlight):
2616         * page/mac/WebCoreFrameBridge.h:
2617         * rendering/InlineTextBox.cpp:
2618         (WebCore::InlineTextBox::paintCustomHighlight):
2619         * rendering/RenderBox.cpp:
2620         (WebCore::RenderBox::paintCustomHighlight):
2621         * rendering/RootInlineBox.cpp:
2622         (WebCore::RootInlineBox::addHighlightOverflow):
2623         (WebCore::RootInlineBox::paintCustomHighlight):
2624
2625 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
2626
2627         Reviewed by harrison
2628         
2629         <http://bugs.webkit.org/show_bug.cgi?id=13000>
2630         Range.createContextualFragment is not supported
2631
2632         * dom/Range.cpp:
2633         (WebCore::Range::createContextualFragment): The
2634         "startContainer" may not be a container, if the
2635         range starts inside text.  In that case, look
2636         to the parent of the start node for an HTMLElement.
2637
2638 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
2639
2640         Reviewed by harrison
2641         
2642         <rdar://problem/5049671>
2643         Gmail Editor: With linked text, Remove Formatting doesn't always remove underline
2644
2645         * editing/Editor.cpp:
2646         (WebCore::Editor::removeFormattingAndStyle): Clear removed
2647         anchors after the deletion.
2648
2649 2007-03-08  David Kilzer  <ddkilzer@webkit.org>
2650
2651         Reviewed by NOBODY (build fix).
2652
2653         Added missing file for r20059:
2654         <rdar://problem/4708689> -- REGRESSION: Some symbols with 2-byte display as garbage in Hotmail.
2655
2656         File was taken from this svn repository which contained versions of ucnv.h and ucnv_err.h
2657         that were identical to ours:
2658         http://source.icu-project.org/repos/icu/icu/tags/release-3-2/source/common/unicode/ucnv_cb.h
2659
2660         * icu/unicode/ucnv_cb.h: Added.
2661
2662 2007-03-08  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
2663
2664         Gdk build fix.
2665
2666         * platform/graphics/cairo/ImageSourceCairo.cpp:
2667         (WebCore::ImageSource::~ImageSource):
2668         (WebCore::ImageSource::clear):
2669
2670 2007-03-08  Oliver Hunt  <oliver@apple.com>
2671
2672         Reviewed by Adam.
2673
2674         To match old TEC behaviour when using ICU we need to use 
2675         a few manual fallback encodings for the GBK/EUC-CN charsets
2676
2677         <rdar://problem/4708689> -- REGRESSION: Some symbols with 2-byte display as garbage in Hotmail.
2678
2679         * platform/TextCodecICU.cpp:
2680         (WebCore::TextCodecICU::TextCodecICU):
2681         (WebCore::TextCodecICU::createICUConverter):
2682         (WebCore::gbkEscapes):
2683         (WebCore::gbkCallbackEscape):
2684         (WebCore::gbkCallbackSubstitute):
2685         (WebCore::TextCodecICU::encode):
2686         * platform/TextCodecICU.h:
2687         (WebCore::TextCodecICU::needsGBKFallbacks):
2688         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
2689
2690 2007-03-08  Alexey Proskuryakov  <ap@webkit.org>
2691
2692         Build fix.
2693
2694         * xml/XPathUtil.cpp:
2695         (WebCore::XPath::stringValue):
2696
2697 2007-03-08  David Hyatt  <hyatt@apple.com>
2698
2699         This patch dramatically reduces the memory consumed by animated images.  For large animated GIFs (defined for
2700         now as >1mb in terms of decoded frame buffer size), we will now aggressively flush previous frames of the
2701         animated GIF and just re-decode them on the fly if the animation loops.
2702
2703         Whenever a large animated GIF has its animation reset, we will also just throw out everything and start
2704         the animation over (in order to get rid of any cached detritus held in the ImageSource).
2705
2706         With this patch and the sample GIF used to test, WebKit's memory consumption went from 160MB down to 16MB.
2707
2708         Reviewed by mjs
2709
2710         * platform/graphics/BitmapImage.cpp:
2711         (WebCore::BitmapImage::destroyDecodedData):
2712         (WebCore::BitmapImage::resetAnimation):
2713         (WebCore::BitmapImage::advanceAnimation):
2714         * platform/graphics/ImageSource.h:
2715         * platform/graphics/cg/ImageSourceCG.cpp:
2716         (WebCore::ImageSource::~ImageSource):
2717         (WebCore::ImageSource::clear):
2718
2719 2007-03-08  Alexey Proskuryakov  <ap@webkit.org>
2720
2721         Reviewed by Darin.
2722
2723         http://bugs.webkit.org/show_bug.cgi?id=13006
2724         XPath string-value is broken for some node types
2725
2726         Test: fast/xpath/string-value.html
2727
2728         * xml/XPathUtil.cpp:
2729         (WebCore::XPath::stringValue): Fix it :-)
2730
2731 2007-03-07  Anders Carlsson  <acarlsson@apple.com>
2732
2733         Reviewed by Adam.
2734
2735         <rdar://problem/4981000> 
2736         http://bugs.webkit.org/show_bug.cgi?id=12634
2737         REGRESSION: crash loading web archive (12634)
2738         
2739         The reason this bug wasn't always reproducible is that it involved sending an event to a plugin while 
2740         the page was loading. Before we send the event to the plugin we defer loads. The problem was that
2741         MainResourceLoader::setDefersLoad would not work with data loads.
2742         
2743         * loader/DocumentLoader.cpp:
2744         (WebCore::DocumentLoader::setRequest):
2745         Only set m_committed to false if we also have a valid unreachable URL.
2746         
2747         * loader/MainResourceLoader.cpp:
2748         (WebCore::MainResourceLoader::setDefersLoading):
2749         Make sure to stop and start data loads.
2750
2751 2007-03-07  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2752
2753         Not reviewed.
2754
2755         Gdk build fixes.
2756
2757         * platform/gdk/EditorClientGdk.cpp:
2758         (WebCore::EditorClientGdk::handleKeypress): renamed
2759         (WebCore::EditorClientGdk::handleInputMethodKeypress): add a stub
2760         * platform/gdk/EditorClientGdk.h:
2761         * platform/graphics/cairo/ImageSourceCairo.cpp:
2762         (WebCore::ImageSource::destroyFrameAtIndex): add a stub
2763
2764 2007-03-07  Alexey Proskuryakov  <ap@webkit.org>
2765
2766         Reviewed by Darin.
2767
2768         http://bugs.webkit.org/show_bug.cgi?id=13004
2769         Repeatedly calling XPathExpression.evaluate() causes crashes or memory leaks
2770
2771         Removed XPath::Expression::optimize() and related methods, since they were buggy and almost useless.
2772         Merged doEvaluate() into evaluate(), since this was all evaluate() was doing after the above changes.
2773
2774         Test: fast/xpath/evaluate-twice.html
2775
2776         * xml/XPathExpression.cpp:
2777         (WebCore::XPathExpression::evaluate):
2778         * xml/XPathExpressionNode.cpp:
2779         (WebCore::XPath::Expression::Expression):
2780         (WebCore::XPath::Expression::~Expression):
2781         * xml/XPathExpressionNode.h:
2782         * xml/XPathFunctions.cpp:
2783         (WebCore::XPath::FunLast::evaluate):
2784         (WebCore::XPath::FunPosition::evaluate):
2785         (WebCore::XPath::FunId::evaluate):
2786         (WebCore::XPath::FunLocalName::evaluate):
2787         (WebCore::XPath::FunNamespaceURI::evaluate):
2788         (WebCore::XPath::FunName::evaluate):
2789         (WebCore::XPath::FunCount::evaluate):
2790         (WebCore::XPath::FunString::evaluate):
2791         (WebCore::XPath::FunConcat::evaluate):
2792         (WebCore::XPath::FunStartsWith::evaluate):
2793         (WebCore::XPath::FunContains::evaluate):
2794         (WebCore::XPath::FunSubstringBefore::evaluate):
2795         (WebCore::XPath::FunSubstringAfter::evaluate):
2796         (WebCore::XPath::FunSubstring::evaluate):
2797         (WebCore::XPath::FunStringLength::evaluate):
2798         (WebCore::XPath::FunNormalizeSpace::evaluate):
2799         (WebCore::XPath::FunTranslate::evaluate):
2800         (WebCore::XPath::FunBoolean::evaluate):
2801         (WebCore::XPath::FunNot::evaluate):
2802         (WebCore::XPath::FunTrue::evaluate):
2803         (WebCore::XPath::FunLang::evaluate):
2804         (WebCore::XPath::FunFalse::evaluate):
2805         (WebCore::XPath::FunNumber::evaluate):
2806         (WebCore::XPath::FunSum::evaluate):
2807         (WebCore::XPath::FunFloor::evaluate):
2808         (WebCore::XPath::FunCeiling::evaluate):
2809         (WebCore::XPath::FunRound::evaluate):
2810         * xml/XPathPath.cpp:
2811         (WebCore::XPath::Filter::evaluate):
2812         (WebCore::XPath::LocationPath::evaluate):
2813         (WebCore::XPath::Path::evaluate):
2814         * xml/XPathPath.h:
2815         * xml/XPathPredicate.cpp:
2816         (WebCore::XPath::Number::evaluate):
2817         (WebCore::XPath::StringExpression::evaluate):
2818         (WebCore::XPath::Negative::evaluate):
2819         (WebCore::XPath::NumericOp::evaluate):
2820         (WebCore::XPath::EqTestOp::evaluate):
2821         (WebCore::XPath::LogicalOp::evaluate):
2822         (WebCore::XPath::Union::evaluate):
2823         * xml/XPathPredicate.h:
2824         * xml/XPathStep.cpp:
2825         * xml/XPathStep.h:
2826         * xml/XPathVariableReference.cpp:
2827         (WebCore::XPath::VariableReference::evaluate):
2828         * xml/XPathVariableReference.h:
2829
2830 2007-03-07  Sam Weinig  <sam@webkit.org>
2831
2832         Reviewed by Tim H.
2833
2834         Remove unused #import from Objective-C bindings and cleanup the order of #imports.
2835
2836         * bindings/scripts/CodeGeneratorObjC.pm:
2837
2838 2007-03-07  Sam Weinig  <sam@webkit.org>
2839
2840         Reviewed by Tim H.
2841
2842         Make sure the baseURI attribute generates for private Objective-C bindings.
2843
2844         * dom/Node.idl:
2845
2846 2007-03-07  Anders Carlsson  <acarlsson@apple.com>
2847
2848         Reviewed by Maciej.
2849
2850         <rdar://problem/4874059>
2851         REGRESSION: Painter IX:register - Crash in WebCore:: ResourceLoader::willSendRequest()
2852
2853         If a load is done from inside of an error delegate method that is called because we cancel another load, 
2854         the first load should be ignored since this is what shipping WebKit does. 
2855         
2856         (Actually, it does load the page in the data source but doesn't do anything with it since the data source
2857         won't have a web frame).
2858         
2859         * loader/FrameLoader.cpp:
2860         (WebCore::FrameLoader::load):
2861         Just bail out if m_isStoppingLoad is true.
2862
2863 2007-03-07  David Hyatt  <hyatt@apple.com>
2864
2865         Use CGImageRelease instead of CFRelease.
2866
2867         Reviewed by aroben
2868
2869         * platform/graphics/cg/ImageCG.cpp:
2870         (WebCore::FrameData::clear):
2871         * platform/graphics/cg/ImageSourceCG.cpp:
2872         (WebCore::ImageSource::destroyFrameAtIndex):
2873
2874 2007-03-07  David Hyatt  <hyatt@apple.com>
2875
2876         Fix a regression where the cache size overflows because of a double
2877         subtraction per resource when they got removed from the cache.  Add an
2878         assert to adjustSize to detect this case in the future.
2879
2880         Fix ImageSourceCG so that when we flush decoded data from our cache that
2881         we also flush it from the ImageSource.
2882
2883         Reviewed by mjs
2884
2885         * loader/Cache.cpp:
2886         (WebCore::Cache::adjustSize):
2887         * platform/graphics/BitmapImage.cpp:
2888         (WebCore::BitmapImage::~BitmapImage):
2889         (WebCore::BitmapImage::destroyDecodedData):
2890         * platform/graphics/Image.h:
2891         * platform/graphics/ImageSource.h:
2892         * platform/graphics/cg/ImageSourceCG.cpp:
2893         (WebCore::ImageSource::setData):
2894         (WebCore::ImageSource::destroyFrameAtIndex):
2895
2896 2007-03-07  Mitz Pettel  <mitz@webkit.org>
2897
2898         Reviewed by Darin.
2899
2900         - fix http://bugs.webkit.org/show_bug.cgi?id=13002
2901           Incomplete repaint of inset outlines
2902
2903         Test: fast/repaint/outline-inset.html
2904
2905         * rendering/RenderObject.cpp:
2906         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
2907
2908 2007-03-07  Oliver Hunt  <oliver@apple.com>
2909
2910         Reviewed by Antti.
2911
2912         Reset mouse down/drag state variables on mouse button release
2913         
2914         Fixes <rdar://problem/5044654>: Drag out of some QuickTime plug-ins converting into image drag
2915
2916         * page/EventHandler.cpp:
2917         (WebCore::EventHandler::handleMouseReleaseEvent):
2918
2919 2007-03-07  Adele Peterson  <adele@apple.com>
2920
2921         Reviewed by Darin.
2922
2923         WebCore part of fix for:
2924         http://bugs.webkit.org/show_bug.cgi?id=10871
2925         http://bugs.webkit.org/show_bug.cgi?id=12677
2926         <rdar://problem/4823129> REGRESSION: IME key events different in nightly
2927         <rdar://problem/4759563> REGRESSION: Return key is always sent when you confirm a clause in kotoeri
2928
2929         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler): Call handleInputMethodKeypress before actually dispatching the keypress event
2930           so that input methods have a chance to handle the event.  
2931           If the input method handles the event (by marking or unmarking text), then we don't need to send the keypress event.
2932           If an input method doesn't handle the event, then we'll save the data we need to perform the correct action (like what text to insert or what selector to use) 
2933           when we dispatch the keypress event.
2934
2935         * dom/KeyboardEvent.h: Added Mac-specific KeypressCommand struct, so we can store command info during handleInputMethodKeypress, and use it during handleKeypress.
2936         (WebCore::KeyboardEvent::keypressCommand):
2937         (WebCore::KeyboardEvent::setKeypressCommand):
2938
2939         * bridge/EditorClient.h:
2940         * editing/Editor.cpp:
2941         (WebCore::Editor::handleKeypress): Changed handleKeyPress to handleKeypress.
2942         (WebCore::Editor::handleInputMethodKeypress): Added.
2943         * editing/Editor.h:
2944
2945         * platform/graphics/svg/SVGImageEmptyClients.h:
2946         (WebCore::SVGEmptyEditorClient::handleKeypress): Changed handleKeyPress to handleKeypress.
2947         (WebCore::SVGEmptyEditorClient::handleInputMethodKeypress): Added.
2948
2949 2007-03-07  Rob Buis  <buis@kde.org>
2950
2951         Reviewed by Darin.
2952
2953         http://bugs.webkit.org/show_bug.cgi?id=12579
2954         WebKit fails SVG xml:base test
2955
2956         Implement DOM3 properties baseURI and documentURI to fix
2957         the testcase in bug 12579.
2958
2959         * bindings/js/kjs_dom.cpp:
2960         (KJS::DOMNode::getValueProperty):
2961         * bindings/js/kjs_domnode.h:
2962         (KJS::DOMNode::):
2963         * dom/Document.cpp:
2964         (WebCore::Document::documentURI):
2965         (WebCore::Document::setDocumentURI):
2966         (WebCore::Document::baseURI):
2967         * dom/Document.h:
2968         * dom/Document.idl:
2969         * dom/DocumentType.cpp:
2970         (WebCore::DocumentType::baseURI):
2971         * dom/DocumentType.h:
2972         * dom/Element.cpp:
2973         (WebCore::Element::baseURI):
2974         * dom/Element.h:
2975         * dom/Node.cpp:
2976         (WebCore::Node::baseURI):
2977         * dom/Node.h:
2978         * ksvg2/misc/SVGImageLoader.cpp:
2979         (WebCore::SVGImageLoader::updateFromElement):
2980         * ksvg2/svg/SVGImageElement.cpp:
2981         (WebCore::SVGImageElement::parseMappedAttribute):
2982         (WebCore::SVGImageElement::attach):
2983
2984 2007-03-07  Anders Carlsson  <acarlsson@apple.com>
2985
2986         Reviewed by Brady.
2987
2988         Remove some methods in FrameLoader that just calls down to the active document loader. Since each
2989         resource loader now has a pointer to its document loader, we can just call directly to the
2990         document loader.
2991
2992         * WebCore.exp:
2993         * loader/FrameLoader.cpp:
2994         * loader/FrameLoader.h:
2995         * loader/MainResourceLoader.cpp:
2996         (WebCore::MainResourceLoader::willSendRequest):
2997         (WebCore::MainResourceLoader::didReceiveResponse):
2998         * loader/SubresourceLoader.cpp:
2999         (WebCore::SubresourceLoader::SubresourceLoader):
3000         (WebCore::SubresourceLoader::didFinishLoading):
3001         (WebCore::SubresourceLoader::didFail):
3002         (WebCore::SubresourceLoader::didCancel):
3003         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
3004         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
3005         (WebCore::NetscapePlugInStreamLoader::didFail):
3006         (WebCore::NetscapePlugInStreamLoader::didCancel):
3007
3008 2007-03-06  Geoffrey Garen  <ggaren@apple.com>
3009
3010         Reviewed by Maciej Stachowiak.
3011         
3012         Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586
3013         PAC file: malloc deadlock sometimes causes a hang @ www.apple.com/pro/profiles/ (12586)
3014         
3015         No test because this is very difficult to repro, and the new ASSERTs in 
3016         JavaScriptCore catch the underlying cause while running normal layout tests.
3017         
3018         This is a modified version of r14752 on the branch.
3019         
3020         The fix is to use a bit inside each node, instead of a hash table, to track 
3021         which node subtrees are in the process of being marked. This avoids a call 
3022         to malloc inside mark().
3023         
3024         * bindings/js/kjs_binding.cpp:
3025         (KJS::domObjects):
3026         (KJS::domNodesPerDocument):
3027         * bindings/js/kjs_dom.cpp:
3028         (KJS::DOMNode::mark):
3029         * dom/Node.cpp:
3030         (WebCore::Node::Node):
3031         * dom/Node.h:
3032
3033 2007-03-06  David Hyatt  <hyatt@apple.com>
3034
3035         This patch reworks the WebCore memory cache to significantly reduce the amount of memory consumed by
3036         images in the cache and to enhance the accuracy of the cache size as an absolute bound for the objects
3037         contained within it.  WebCore's memory use over time should significantly improve as a result of these
3038         changes.
3039
3040         Cached resources now have both an encoded size (the original data stream) and a decoded size (an estimate of
3041         the amount of memory consumed by an expanded version of that resource, e.g., the decoded frames of an image).
3042         Both sizes now count towards the total size of the object and towards the allowed memory cache total.
3043
3044         By including both totals the reported size of resources will now be larger, and the cache will therefore become
3045         much more aggressive about flushing.
3046
3047         Objects are stored in size-adjusted and popularity-aware LRU lists as before, but encoded size is now always
3048         used when determining the correct LRU list.
3049
3050         The flush algorithm for the memory cache has been rewritten to first destroy decoded data before evicting
3051         resources.  By being able to compact its resources without evicting them, the memory cache can now hold many more
3052         unique resources (encoded) in the same amount of space.  Depending on how much of a hit we want to take from
3053         re-decoding images, the memory cache could in theory have its size significantly reduced now while still holding
3054         more resources than it did at the larger size!
3055
3056         Reviewed by mjs
3057
3058         * WebCore.xcodeproj/project.pbxproj:
3059         * loader/Cache.cpp:
3060         (WebCore::Cache::requestResource):
3061         (WebCore::Cache::prune):
3062         (WebCore::Cache::remove):
3063         (WebCore::Cache::lruListFor):
3064         (WebCore::Cache::adjustSize):
3065         * loader/Cache.h:
3066         * loader/CachedCSSStyleSheet.cpp:
3067         (WebCore::CachedCSSStyleSheet::data):
3068         * loader/CachedImage.cpp:
3069         (WebCore::CachedImage::CachedImage):
3070         (WebCore::CachedImage::allReferencesRemoved):
3071         (WebCore::CachedImage::clear):
3072         (WebCore::CachedImage::data):
3073         (WebCore::CachedImage::destroyDecodedData):
3074         (WebCore::CachedImage::decodedSize):
3075         (WebCore::CachedImage::decodedSizeChanged):
3076         (WebCore::CachedImage::shouldPauseAnimation):
3077         * loader/CachedImage.h:
3078         * loader/CachedResource.cpp:
3079         (WebCore::CachedResource::CachedResource):
3080         (WebCore::CachedResource::deref):
3081         (WebCore::CachedResource::setEncodedSize):
3082         * loader/CachedResource.h:
3083         (WebCore::CachedResource::allReferencesRemoved):
3084         (WebCore::CachedResource::size):
3085         (WebCore::CachedResource::encodedSize):
3086         (WebCore::CachedResource::decodedSize):
3087         (WebCore::CachedResource::destroyDecodedData):
3088         * loader/CachedScript.cpp:
3089         (WebCore::CachedScript::data):
3090         * loader/CachedXSLStyleSheet.cpp:
3091         (WebCore::CachedXSLStyleSheet::data):
3092         * platform/graphics/BitmapImage.cpp:
3093         (WebCore::BitmapImage::BitmapImage):
3094         (WebCore::BitmapImage::~BitmapImage):
3095         (WebCore::BitmapImage::destroyDecodedData):
3096         (WebCore::BitmapImage::pruneDecodedDataIfNeeded):
3097         (WebCore::BitmapImage::cacheFrame):
3098         (WebCore::BitmapImage::setNativeData):
3099         (WebCore::BitmapImage::shouldAnimate):
3100         (WebCore::BitmapImage::advanceAnimation):
3101         * platform/graphics/BitmapImage.h:
3102         (WebCore::BitmapImage::decodedSize):
3103         * platform/graphics/Image.cpp:
3104         (WebCore::Image::Image):
3105         * platform/graphics/Image.h:
3106         (WebCore::Image::destroyDecodedData):
3107         (WebCore::Image::decodedSize):
3108         (WebCore::Image::imageObserver):
3109         * platform/graphics/ImageAnimationObserver.h: Removed.
3110         * platform/graphics/ImageObserver.h: Added.
3111         (WebCore::ImageObserver::~ImageObserver):
3112         * platform/graphics/svg/SVGImage.cpp:
3113         (WebCore::SVGImage::SVGImage):
3114         * platform/graphics/svg/SVGImage.h:
3115
3116 2007-03-06  Alexey Proskuryakov  <ap@webkit.org>
3117
3118         Reviewed by Sam Weinig.
3119
3120         http://bugs.webkit.org/show_bug.cgi?id=12987
3121         Fix and import 4XPath test_numeric_expr.html
3122
3123         * xml/XPathPredicate.cpp:
3124         (WebCore::XPath::Negative::doEvaluate): Convert the argument to number.
3125         (WebCore::XPath::NumericOp::doEvaluate): Convert the arguments to numbers. Use a correct operation for mod.
3126         * xml/XPathStep.cpp:
3127         (WebCore::XPath::Step::nodesInAxis): Do not append parent node if there is none.
3128         * xml/XPathValue.cpp:
3129         (WebCore::XPath::Value::toNumber): Do not convert to DeprecatedString just to trim whitespace and to convert to double.
3130         * platform/DeprecatedString.cpp:
3131         (WebCore::DeprecatedStringData::makeAscii): Added a FIXME about unreliable makeAscii() behavior.
3132
3133 2007-03-06  Maciej Stachowiak  <mjs@apple.com>
3134
3135         Reviewed by Adele.
3136
3137         <rdar://problem/4619663> REGRESSION (NativePopup): Popup menu doesn't draw at the correct vertical position (9816)
3138         
3139         * platform/mac/PopupMenuMac.mm:
3140         (WebCore::PopupMenu::show): Make a temporary dummy view with the
3141         passed in rect, since AppKit will use the view bounds to determine
3142         what area to exclude when popping up a menu moved to the top of
3143         the screen.
3144
3145 2007-03-06  Geoffrey Garen  <ggaren@apple.com>
3146
3147         Reviewed by Maciej Stachowiak.
3148
3149         Fixed all known crashers exposed by run-webkit-tests --threaded [*]. See 
3150         JavaScriptCore ChangeLog for more details.
3151
3152         * bindings/js/kjs_binding.cpp:
3153         (KJS::domNodesPerDocument): Added thread safety ASSERT.
3154         (KJS::ScriptInterpreter::mark): Removed obsolete logic for marking unsafe
3155         objects when collecting on a secondary thread. The Collector takes care
3156         of this now.
3157
3158         * bindings/js/kjs_binding.h:
3159         (KJS::DOMObject::DOMObject): Used new API for specifying that WebCore
3160         objects should be garbage collected on the main thread only.
3161
3162         * bindings/js/kjs_window.cpp:
3163         (KJS::ScheduledAction::execute): Moved JSLock to cover implementedsCall() call,
3164         which, for some subclasses, ends up allocating garbage collected objects.
3165         (This fix was speculative. I didn't actually see a crash from this.)
3166         (KJS::Window::timerFired): Added JSLock around ScheduleAction destruction,
3167         since it destroys a KJS::List.
3168
3169         * bindings/objc/WebScriptObject.mm:
3170         (-[WebScriptObject setException:]): Added JSLock. (This fix was speculative. 
3171         I didn't actually see a crash from this.)
3172
3173         * bridge/mac/WebCoreScriptDebugger.mm:
3174         (-[WebCoreScriptCallFrame evaluateWebScript:]): Added JSLock. (This fix 
3175         was speculative. I didn't actually see a crash from this.)
3176
3177         * dom/Document.cpp:
3178         (WebCore::Document::~Document): Added JSLock around modification to 
3179         domNodesPerDocument(), which can be accessed concurrently during garbage 
3180         collection.
3181         * dom/Node.cpp:
3182         (WebCore::Node::setDocument): ditto.
3183         
3184         [*] fast/js/toString-stack-overflow.html is an exception. --threaded mode
3185         crashes this test because it causes the garbage collector to run frequently,
3186         and this test crashes if you happen to garbage collect while it's running.
3187         This is a known issue with stack overflow during the mark phase. It's
3188         not related to threading.
3189
3190 2007-03-06  Mark Rowe  <mrowe@apple.com>
3191
3192         Reviewed by Sam Weinig.
3193
3194         Fix http://bugs.webkit.org/show_bug.cgi?id=12942
3195         Bug 12942: ASSERTION FAILURE: qantas.com.au changing selected item in <select> via JS
3196
3197         Test: fast/dom/select-selectedIndex-bug-12942.html.
3198
3199         * html/HTMLSelectElement.cpp:
3200         (WebCore::HTMLSelectElement::recalcListItems): Reset m_lastOnChangeIndex when recalculating list items.
3201         * html/HTMLSelectElement.h:
3202
3203 2007-03-06  Brady Eidson  <beidson@apple.com>
3204
3205         Rubberstamped by Kevin Decker
3206
3207         20,000!
3208
3209         * ChangeLog: Point out revision 20,000
3210
3211 2007-03-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3212
3213         Not reviewed.
3214
3215         Gdk build fix.
3216
3217         * loader/gdk/FrameLoaderClientGdk.cpp: update userAgent() signature.
3218         (WebCore::FrameLoaderClientGdk::userAgent):
3219         * loader/gdk/FrameLoaderClientGdk.h: ditto.
3220
3221 2007-03-06  Mitz Pettel  <mitz@webkit.org>
3222
3223         Reviewed by Adele.
3224
3225         - fix http://bugs.webkit.org/show_bug.cgi?id=12986
3226           REGRESSION(NativeListBox): Listboxes not updated when resized dynamically
3227
3228         Test: fast/forms/select-change-listbox-size.html
3229
3230         * html/HTMLSelectElement.cpp:
3231         (WebCore::HTMLSelectElement::parseMappedAttribute): Reattach on list box size change.
3232
3233 2007-03-06  Mitz Pettel  <mitz@webkit.org>
3234
3235         Reviewed by Dave Hyatt.
3236
3237         - fix http://bugs.webkit.org/show_bug.cgi?id=12885
3238           REGRESSION (r19696): Incomplete background repaint
3239
3240         Tests: fast/repaint/content-into-overflow.html
3241                fast/repaint/overflow-into-content.html
3242
3243         Changed repaintAfterLayoutIfNeeded() to take, in addition to the clipped overflow
3244         rect, the unclipped border box plus outline, and to repaint any areas that
3245         were added or removed from that box, in addition to any areas added or removed
3246         from the clipped overflow rect.
3247
3248         * platform/graphics/svg/SVGResourceMarker.cpp:
3249         (WebCore::SVGResourceMarker::draw):
3250         * rendering/RenderBlock.cpp:
3251         (WebCore::RenderBlock::layoutBlock):
3252         * rendering/RenderBox.cpp:
3253         (WebCore::RenderBox::absoluteClippedOverflowRect): Renamed getAbsoluteRepaintRect() to
3254         this.
3255         * rendering/RenderBox.h:
3256         * rendering/RenderFlexibleBox.cpp:
3257         (WebCore::RenderFlexibleBox::layoutBlock):
3258         * rendering/RenderFlow.cpp:
3259         (WebCore::RenderFlow::absoluteClippedOverflowRect):
3260         * rendering/RenderFlow.h:
3261         * rendering/RenderForeignObject.cpp:
3262         (WebCore::RenderForeignObject::layout):
3263         * rendering/RenderHTMLCanvas.cpp:
3264         (WebCore::RenderHTMLCanvas::layout):
3265         * rendering/RenderImage.cpp:
3266         (WebCore::RenderImage::layout):
3267         * rendering/RenderLayer.cpp:
3268         (WebCore::RenderLayer::RenderLayer):
3269         (WebCore::RenderLayer::checkForRepaintOnResize):
3270         (WebCore::RenderLayer::updateLayerPositions):
3271         * rendering/RenderLayer.h:
3272         * rendering/RenderObject.cpp:
3273         (WebCore::RenderObject::repaint):
3274         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
3275         (WebCore::RenderObject::getAbsoluteRepaintRectWithOutline):
3276         (WebCore::RenderObject::absoluteClippedOverflowRect):
3277         (WebCore::RenderObject::absoluteOutlineBox):
3278         * rendering/RenderObject.h:
3279         * rendering/RenderPath.cpp:
3280         (WebCore::RenderPath::layout):
3281         (WebCore::RenderPath::absoluteClippedOverflowRect):
3282         (WebCore::RenderPath::absoluteRects):
3283         (WebCore::RenderPath::drawMarkersIfNeeded):
3284         * rendering/RenderPath.h:
3285         * rendering/RenderSVGContainer.cpp:
3286         (WebCore::RenderSVGContainer::layout):
3287         (WebCore::RenderSVGContainer::absoluteClippedOverflowRect):
3288         (WebCore::RenderSVGContainer::absoluteRects):
3289         * rendering/RenderSVGContainer.h:
3290         * rendering/RenderSVGHiddenContainer.cpp:
3291         (WebCore::RenderSVGHiddenContainer::absoluteClippedOverflowRect):
3292         * rendering/RenderSVGHiddenContainer.h:
3293         * rendering/RenderSVGImage.cpp:
3294         (WebCore::RenderSVGImage::imageChanged):
3295         (WebCore::RenderSVGImage::absoluteClippedOverflowRect):
3296         (WebCore::RenderSVGImage::absoluteRects):
3297         * rendering/RenderSVGImage.h:
3298         * rendering/RenderSVGText.cpp:
3299         (WebCore::RenderSVGText::absoluteClippedOverflowRect):
3300         (WebCore::RenderSVGText::layout):
3301         (WebCore::RenderSVGText::absoluteRects):
3302         * rendering/RenderSVGText.h:
3303         * rendering/RenderTable.cpp:
3304         (WebCore::RenderTable::layout):
3305         * rendering/RenderTableCell.cpp:
3306         (WebCore::RenderTableCell::absoluteClippedOverflowRect):
3307         * rendering/RenderTableCell.h:
3308         * rendering/RenderTableCol.cpp:
3309         (WebCore::RenderTableCol::absoluteClippedOverflowRect):
3310         * rendering/RenderTableCol.h:
3311         * rendering/RenderTableRow.cpp:
3312         (WebCore::RenderTableRow::absoluteClippedOverflowRect):
3313         * rendering/RenderTableRow.h:
3314         * rendering/RenderText.cpp:
3315         (WebCore::RenderText::absoluteClippedOverflowRect):
3316         * rendering/RenderText.h:
3317
3318 2007-03-06  Ian Eng <ian.eng.webkit@gmail.com>
3319
3320         Reviewed by Maciej.
3321
3322         - fixed http://bugs.webkit.org/show_bug.cgi?id=12720
3323         Bug 12720: Re-defining window.location.toString function keeps re-loading forever
3324
3325         * bindings/js/kjs_window.cpp:
3326         Disallow replacing functions in LocationTable, and return early without updating URL.
3327
3328 2007-03-06  Kevin McCullough  <kmccullough@apple.com>
3329
3330         Reviewed by Darin.
3331
3332         <http://bugs.webkit.org/show_bug.cgi?id=12686>
3333         REGRESSION: Bloglines.com Feeds tab cannot expand folders in TOT
3334         - Now all class constructors implement implementsHasInstance.
3335
3336         * bindings/scripts/CodeGeneratorJS.pm:
3337
3338 2007-03-07  Nikolas Zimmermann  <zimmermann@kde.org>
3339
3340         Reviewed by Rob & Oliver.
3341
3342         Preparations for the new SVG text engine.
3343
3344         Handle baseline-shift / kerning css values correctly.
3345         Recognize missing svg presentation attribute "font-size-adjust".
3346         Add all missing svg<->css property mappings in mapToEntry().
3347
3348         Doesn't affect any layout test (as these properties are not used w/o my text patch).
3349         While I'm at it, unify the macro names (RS_ -> SVG_RS_) & cleanup style a bit.
3350
3351         * ksvg2/css/CSSPropertyNames.in:
3352         * ksvg2/css/SVGCSSParser.cpp:
3353         (WebCore::CSSParser::parseSVGValue):
3354         * ksvg2/css/SVGCSSStyleSelector.cpp:
3355         (WebCore::CSSStyleSelector::applySVGProperty):
3356         * ksvg2/css/SVGRenderStyle.cpp:
3357         (WebCore::SVGRenderStyle::SVGRenderStyle):
3358         (WebCore::SVGRenderStyle::operator==):
3359         (WebCore::SVGRenderStyle::inheritedNotEqual):
3360         (WebCore::SVGRenderStyle::inheritFrom):
3361         * ksvg2/css/SVGRenderStyle.h:
3362         (WebCore::SVGRenderStyle::NonInheritedFlags::):
3363         (WebCore::SVGRenderStyle::setBitDefaults):
3364         * ksvg2/css/SVGRenderStyleDefs.cpp:
3365         (StyleTextData::StyleTextData):
3366         (StyleTextData::operator==):
3367         (StyleMiscData::StyleMiscData):
3368         (StyleMiscData::operator==):
3369         * ksvg2/css/SVGRenderStyleDefs.h:
3370         (WebCore::):
3371         (WebCore::StyleTextData::operator!=):
3372         * ksvg2/svg/SVGStyledElement.cpp:
3373         (WebCore::SVGStyledElement::cssPropertyIdForSVGAttributeName):
3374
3375 2007-03-06  Justin Garcia  <justin.garcia@apple.com>
3376
3377         Reviewed by kevin
3378         
3379         <http://bugs.webkit.org/show_bug.cgi?id=12245>
3380         FCKeditor: Remove Format sometimes doesn't work
3381         <rdar://problem/4786404>
3382         Underline style is not removed from selection after performing Remove Format
3383
3384         * editing/Editor.cpp:
3385         (WebCore::Editor::removeFormattingAndStyle): Re-wrote this.
3386
3387 2007-03-07  Nikolas Zimmermann  <zimmermann@kde.org>
3388
3389         Reviewed by Oliver.
3390
3391         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12979
3392         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12981
3393
3394         Guard against registering pending resources with empty id.
3395         Be careful with calling recalcStyle() in SVGUseElement, when change is "Detach" we
3396         have to use special code, as calling attach() on the shadow tree root element will crash,
3397         because it has no (direct) parent node, only a shadow parent node element.
3398
3399         * ksvg2/misc/SVGDocumentExtensions.cpp:
3400         (WebCore::SVGDocumentExtensions::addPendingResource):
3401         * ksvg2/svg/SVGUseElement.cpp:
3402         (WebCore::SVGUseElement::recalcStyle):
3403
3404 2007-03-06  Kevin Decker  <kdecker@apple.com>
3405
3406         Reviewed by Adele.
3407
3408         Fixed: <rdar://problem/5041660> REGRESSION: <keygen> element broken, prevents users from signing up for Thawte email certs
3409         
3410         * bindings/objc/DOM.mm:
3411         (WebCore::createElementClassMap): Added <keygen> to the DOM bindings so it can be accessed from Objective-C.
3412         * css/html4.css: Apply the look of the <select> element to <keygen>.
3413         * html/HTMLElementFactory.cpp:
3414         (WebCore::keygenConstructor): Added. 
3415         (WebCore::createFunctionMap): Added keygen.
3416         * html/HTMLSelectElement.cpp: Made const typeAheadTimeout variable static const. 
3417         (WebCore::HTMLSelectElement::HTMLSelectElement):  Fix both HTMLSelectElement constructors to initialize the
3418          same number of member variables. The fact that some fields were not initialized could (and would) crash the
3419          keygen element when selecting different items. Also removed m_typedString(String()) from the constructor
3420          initialization because this is not needed.
3421
3422 2007-03-06  Kevin McCullough  <kmccullough@apple.com>
3423
3424         Reviewed by Darin.
3425
3426         - Rename a function to clarify its purpose.
3427
3428         * WebCore.exp:
3429         * loader/FrameLoader.cpp:
3430         (WebCore::FrameLoader::registerURLSchemeAsLocal):
3431         * loader/FrameLoader.h:
3432
3433 2007-03-06  Adam Roben  <aroben@apple.com>
3434
3435         Build fix.
3436
3437         * WebCore.exp: Updated symbols.
3438
3439 2007-03-06  Adam Roben  <aroben@apple.com>
3440
3441         Reviewed by Anders.
3442
3443         Added a parameter to all StringTruncator methods to specify whether
3444         rounding hacks should be on or off.
3445
3446         No layout test possible.
3447
3448         * platform/StringTruncator.cpp:
3449         (WebCore::stringWidth): Added disableRoundingHacks parameter.
3450         (WebCore::truncateString): Ditto.
3451         (WebCore::StringTruncator::centerTruncate): Ditto.
3452         (WebCore::StringTruncator::rightTruncate): Ditto.
3453         (WebCore::StringTruncator::width): Ditto.
3454         * platform/StringTruncator.h: Ditto.
3455         * platform/mac/FileChooserMac.mm:
3456         (WebCore::FileChooser::basenameForWidth): Pass in false to
3457         centerTruncate so that the truncation matches the way the text will be
3458         rendered.
3459
3460 2007-03-06  Anders Carlsson  <acarlsson@apple.com>
3461
3462         Reviewed by Maciej.
3463
3464         <rdar://problem/5035045>
3465         REGRESSION: WebKit browser doesn't display image at http://www.metoffice.gov.uk/weather/satellite/index.html
3466         
3467         It turns out WinIE does allow you to access images by their id as special document properties. However, this is only
3468         allowed when the element also has a name attribute. The value of the name attribute is ignored and can even be empty!
3469         
3470         * bindings/js/kjs_html.cpp:
3471         (KJS::JSHTMLDocument::namedItemGetter):
3472         Return jsUndefined() if the collection is empty.
3473         
3474         * html/HTMLImageElement.cpp:
3475         (WebCore::HTMLImageElement::parseMappedAttribute):
3476         (WebCore::HTMLImageElement::insertedIntoDocument):
3477         (WebCore::HTMLImageElement::removedFromDocument):
3478         * html/HTMLImageElement.h:
3479         Add the id attribute value to the extra named item map.
3480         
3481         * html/HTMLNameCollection.cpp:
3482         (WebCore::HTMLNameCollection::traverseNextItem):
3483         Check for images with name attributes that match, as well as elements with id attributes that match where
3484         the element also has a name attribute.
3485
3486 2007-03-06  Anders Carlsson  <acarlsson@apple.com>
3487
3488         Reviewed by Adam.
3489
3490         WebCore part of patch to make it possible to have different user agents for different URLs.
3491
3492         * bindings/js/kjs_navigator.cpp:
3493         (KJS::Navigator::getValueProperty):
3494         * bindings/js/kjs_proxy.cpp:
3495         (WebCore::KJSProxy::initScriptIfNeeded):
3496         * loader/DocumentLoader.cpp:
3497         (WebCore::DocumentLoader::setLoading):
3498         * loader/FrameLoader.cpp:
3499         (WebCore::FrameLoader::userAgent):
3500         (WebCore::FrameLoader::loadResourceSynchronously):
3501         (WebCore::FrameLoader::applyUserAgent):
3502         * loader/FrameLoader.h:
3503         * loader/FrameLoaderClient.h:
3504         * platform/graphics/svg/SVGImageEmptyClients.h:
3505         (WebCore::SVGEmptyFrameLoaderClient::userAgent):
3506
3507 2007-03-05  Kevin McCullough  <kmccullough@apple.com>
3508
3509         Reviewed by Mark and Dave H.
3510
3511         - rdar://problem/5038491
3512         An oversight of the security fix that prevented remote from loading local is that it
3513         prevents user style sheets when the site is remote.  This fixes that.
3514
3515         * loader/Cache.cpp: Propogate and check user style sheet flag.
3516         (WebCore::createResource):
3517         (WebCore::Cache::requestResource):
3518         * loader/Cache.h: Propogate user style sheet flag.
3519         * loader/CachedCSSStyleSheet.cpp: Propogate user style sheet flag.
3520         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
3521         * loader/CachedCSSStyleSheet.h: Propogate user style sheet flag.
3522         * loader/DocLoader.cpp: Propogate user style sheet flag.
3523         (WebCore::DocLoader::requestResource):
3524         * loader/SubresourceLoader.cpp: Propogate and check user style sheet flag.
3525         (WebCore::SubresourceLoader::create):
3526         * loader/SubresourceLoader.h: Add check for user style sheet flag.
3527         * loader/loader.cpp: Propogate user style sheet flag.
3528         (WebCore::Loader::load):
3529         (WebCore::Loader::servePendingRequests):
3530         * loader/loader.h: Propogate user style sheet flag.
3531
3532 2007-03-06  Nikolas Zimmermann  <zimmermann@kde.org>
3533
3534         Reviewed by Darin.
3535
3536         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12936 (Master bug used to track all current use problems.)
3537
3538         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12926 (transform attribute not respected in nested <use> elements)