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