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