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