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