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