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