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