Remove redundant line.
[WebKit-https.git] / WebCore / ChangeLog
1 2007-03-29  Adam Treat  <adam@staikos.net>
2
3         Reviewed and committed by George Staikos.
4
5         Remove redundant line.
6
7         * platform/qt/FontDataQt.cpp:
8         (WebCore::FontData::platformInit):
9
10 2007-03-29  Adam Treat  <adam@staikos.net>
11
12         Reviewed by David Hyatt, committed by George Staikos.
13
14         Take into account the entire run length to get a proper selection.
15         Doesn't seem to affect the Mac build but is a problem for Qt.
16
17         * platform/Font.cpp:
18         (WebCore::WidthIterator::WidthIterator):
19
20 2007-03-29  David Hyatt  <hyatt@apple.com>
21
22         Fix for <rdar://problem/4545060>, technorati and arstechnica fail because of getComputedStyle not
23         reporting display:none properly when it is set.  This is bugzilla bug 13103.
24
25         Reviewed by mitz
26
27         * css/CSSComputedStyleDeclaration.cpp:
28         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
29
30 2007-03-28  Oliver Hunt  <oliver@apple.com>
31
32         Reviewed by Hyatt.
33
34         Rename DocLoader::setPasteInProgress, etc to more generic 
35         setAllowStaleResources, etc
36
37         * editing/Editor.cpp:
38         (WebCore::Editor::paste):
39         * loader/DocLoader.cpp:
40         (WebCore::DocLoader::DocLoader):
41         (WebCore::DocLoader::checkForReload):
42         * loader/DocLoader.h:
43         (WebCore::DocLoader::setAllowStaleResources):
44         * page/DragController.cpp:
45         (WebCore::DragController::concludeDrag):
46
47 2007-03-28  Oliver Hunt  <oliver@apple.com>
48
49         Reviewed by Anders and Steve.
50
51         Add a flag to DocLoader to prevent it from reloading 
52         when performing a paste or drop operation.
53         
54         Remove m_cachePolicy from CachedResource as it is never used
55         
56         Fixes rdar://problem/5044366 : REGRESSION: Repro ASSERT failures 
57         dragging image into GMail message in _web_writeImage and 
58         documentFragmentFromDragData
59
60         * editing/Editor.cpp:
61         (WebCore::Editor::paste):
62           prevent the docloader from reloading resources on paste
63         * html/HTMLImageLoader.cpp:
64         (WebCore::HTMLImageLoader::updateFromElement):
65         * loader/Cache.cpp:
66         (WebCore::createResource):
67         * loader/CachedCSSStyleSheet.cpp:
68         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
69         * loader/CachedCSSStyleSheet.h:
70         * loader/CachedImage.cpp:
71         (WebCore::CachedImage::CachedImage):
72         * loader/CachedImage.h:
73         * loader/CachedResource.cpp:
74         (WebCore::CachedResource::CachedResource):
75         * loader/CachedResource.h:
76         * loader/CachedScript.cpp:
77         (WebCore::CachedScript::CachedScript):
78         * loader/CachedScript.h:
79         * loader/CachedXBLDocument.cpp:
80         (WebCore::CachedXBLDocument::CachedXBLDocument):
81         * loader/CachedXBLDocument.h:
82         * loader/CachedXSLStyleSheet.cpp:
83         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
84         * loader/CachedXSLStyleSheet.h:
85         * loader/DocLoader.cpp:
86         (WebCore::DocLoader::DocLoader):
87            Tidy up constructor initialise new field
88         (WebCore::DocLoader::checkForReload):
89            Prevent reload when pasting
90         * loader/DocLoader.h:
91         (WebCore::DocLoader::setPasteInProgress):
92           new field and setter
93         * page/DragController.cpp:
94         (WebCore::DragController::concludeDrag):
95           prevent the docloader from reloading resources on drop
96
97 2007-03-27  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
98
99         Not reviewed - fix typo in gdk build.
100
101         * platform/gdk/ScrollViewGdk.cpp:
102         (WebCore::ScrollView::contentsToWindow):
103
104 2007-03-28  Maciej Stachowiak  <mjs@apple.com>
105         
106         Reviewed by Darin.
107         
108         - fixed <rdar://problem/4820817> Autoscroll is broken in Mail.app (message jumps around when trying to select text)
109                 
110         Handle scrolling external scrollviews around the webview during
111         autoscroll or when scrolling into view.
112         
113         This should also restore performance on BenchJS test 6 lost due to Tim's partial fix.
114
115         * page/FrameView.cpp:
116         (WebCore::FrameView::scrollRectIntoViewRecursively):
117         * page/FrameView.h:
118         * platform/ScrollView.h:
119         * platform/gdk/ScrollViewGdk.cpp:
120         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
121         (WebCore::ScrollView::scrollRectIntoViewRecursively):
122         * platform/mac/ScrollViewMac.mm:
123         (WebCore::ScrollView::visibleContentRect):
124         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
125         (WebCore::ScrollView::scrollRectIntoViewRecursively):
126         (WebCore::ScrollView::updateContents):
127         * platform/qt/ScrollViewQt.cpp:
128         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
129         (WebCore::ScrollView::scrollRectIntoViewRecursively):
130         * platform/win/ScrollViewWin.cpp:
131         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
132         * platform/win/TemporaryLinkStubs.cpp:
133         (WebCore::ScrollView::scrollRectIntoViewRecursively):
134         * rendering/RenderLayer.cpp:
135         (WebCore::RenderLayer::scrollRectToVisible):
136        
137 2007-03-28  Jungshik Shin  <jungshik.shin@gmail.com>
138
139         Reviewed  and landed by Darin
140
141         Get rid of some misuses of |islower| and |tolower| for non-ASCII characters.
142         http://bugs.webkit.org/show_bug.cgi?id=13138
143
144         * platform/StringImpl.cpp:
145         (WebCore::StringImpl::isLower):
146         (WebCore::StringImpl::lower):
147         (WebCore::StringImpl::equalIgnoringCase):
148
149 2007-03-28  Antti Koivisto  <antti@apple.com>
150
151         Reviewed by Hyatt.
152
153         Fix <rdar://problem/5092653>
154         REGRESSION: Image decoding making scrolling slow
155         
156         If decoder gave back a null frame (which I think happens regularly if you don't have full frame 
157         data yet for image that does not decode incrementally) m_decodedSize was incremented anyway. This
158         led to massive growth in calculated image size and eventually made cache prune constantly. 
159         
160         No test, I don't know how to make one for this.
161
162         * platform/graphics/BitmapImage.cpp:
163         (WebCore::BitmapImage::cacheFrame):
164
165 2007-03-28  Adele Peterson  <adele@apple.com>
166
167         Reviewed by Kevin M.
168
169         WebCore part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
170
171         * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
172         Convert return value to a string.  This matches the behavior in Safari 2.0.
173
174 2007-03-28  Alexey Proskuryakov  <ap@webkit.org>
175
176         Reviewed by Darin.
177
178         http://bugs.webkit.org/show_bug.cgi?id=13190
179         XPath incorrectly handles namespaces on attributes
180
181         * xml/XPathStep.cpp:
182         (WebCore::XPath::Step::nodesInAxis): Added a special case for faster attribute lookup; gives a slight but 
183         measurable performance improvement for bug 13021.
184         (WebCore::XPath::Step::nodeMatches): Fixed NameTest for attribute nodes.
185
186         * xml/XPathStep.h:
187         (WebCore::XPath::Step::NodeTest::NodeTest):
188         (WebCore::XPath::Step::NodeTest::namespaceURI):
189         (WebCore::XPath::Step::nodeTest):
190         (WebCore::XPath::Step::setNodeTest):
191         Move m_namespaceURI to NodeTest, where it belongs. Removed unused m_nodeTestData (oops!).
192
193         * xml/XPathGrammar.y:
194         * xml/XPathPath.cpp:
195         (WebCore::XPath::LocationPath::optimizeStepPair):
196         Accounted for the above change.
197
198 2007-03-28  Oliver Hunt  <oliver@apple.com>
199
200         rs=Hyatt.
201
202         Rollout local changes :-/
203
204         * loader/Cache.cpp:
205         (WebCore::Cache::pruneAllResources):
206         (WebCore::Cache::remove):
207
208 2007-03-28  Oliver Hunt  <oliver@apple.com>
209
210         Reviewed by Hyatt.
211
212         Roll out r20511 due to incredible badness
213
214         * loader/Cache.cpp:
215         (WebCore::Cache::pruneAllResources):
216         (WebCore::Cache::remove):
217
218 2007-03-27  Oliver Hunt  <oliver@apple.com>
219
220         Reviewed by Adam.
221
222         Don't enforce text-selection drag delay when we are
223         going to drag an image anyway.
224
225         Fixes rdar://problem/4668935
226
227         * page/EventHandler.cpp:
228         (WebCore::EventHandler::handleDrag):
229
230 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
231
232         Build fix
233         
234         * editing/markup.cpp:
235         (WebCore::startMarkup):
236
237 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
238
239         Reviewed by darin
240         
241         <rdar://problem/5091898> REGRESSION: GMail Editor: A line of underlined text copied with Select All pastes with wrong font family
242         
243         createMarkup skipped elements if they were blocks
244         when called from moveParagraphs (because that function 
245         must receive only inline content).  This patch adds 
246         code to inline these blocks instead of skipping them 
247         so that we don't lose any of the style that they 
248         contribute to the copied markup.
249
250         * editing/markup.cpp:
251         (WebCore::startMarkup): Add an inlineBlocks option.
252         Make sure to overwrite display:block coming from
253         a style sheet or the inline style declaration.
254         (WebCore::createMarkup): Don't refuse to include a 
255         specialCommonAncestor that's a block if we were asked 
256         to include only inline content, since we can now inline 
257         block elements in startMarkup.
258
259 2007-03-27  Adele Peterson  <adele@apple.com>
260
261         Reviewed by Hyatt.
262
263         Fix for <rdar://problem/5026141> REGRESSION: Aperture Viewer Flashes when switching from Index Page to Detail page in Web Gallery
264
265         This disables the paint that occurs after WebCore finishes loading the document.  We should reenable this when we
266         move the dispatchDidFinishLoad delegate callback to happen around the same time as the JS onload call.  See <rdar://problem/5092361>.
267
268         * dom/Document.cpp: (WebCore::Document::implicitClose):
269
270 2007-03-26  Justin Garcia  <justin.garcia@apple.com>
271
272         Reviewed by darin
273         
274         <rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
275         <rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
276         <rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
277         <rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented
278
279         * css/CSSComputedStyleDeclaration.cpp:
280         (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties):
281         If a node's text fill color is invalid, then its children use 
282         their font-color as their text fill color (they don't inherit 
283         it).  Likewise for stroke color.
284
285 2007-03-27  Anders Carlsson  <acarlsson@apple.com>
286
287         * platform/ScrollBar.h:
288         Use wtf/MathExtras.h instead of math.h
289
290 2007-03-27  Zack Rusin  <zrusin@trolltech.com>
291
292         Fix the compile - when using math.h functions
293         actually include the header with them.
294
295         * platform/ScrollBar.h:
296
297 2007-03-27  Oliver Hunt  <oliver@apple.com>
298
299         Reviewed by Maciej.
300
301         The WebArchiver needs all the subresources of a document to be accessible
302         through the DocLoader, so we can't remove a CachedResource simultaneously
303         from the global Cache and all DocLoaders, just because it needs to be 
304         reloaded in one.
305
306         Fixes rdar://problem/5044366
307
308         * loader/Cache.cpp:
309         (WebCore::Cache::remove):
310            Don't evict the resource from all DocLoaders
311         * manual-tests/test-iframes-loading-the-same-resource.html: Added.
312            Alas it wasn't possible to make a nice layout test, even this manual test
313            is not entirely deterministic
314
315 2007-03-27  Mark Rowe  <mrowe@apple.com>
316
317         Build fix.
318
319         * platform/GlyphBuffer.h:
320         (WebCore::GlyphBuffer::clear):
321
322 2007-03-27  Dave Hyatt  <hyatt@apple.com>
323
324         Add support for glyph offsets to the GlyphBuffer.
325        
326         Reviewed by olliej
327
328         * platform/Font.cpp:
329         (WebCore::Font::drawGlyphBuffer):
330         * platform/GlyphBuffer.h:
331         (WebCore::GlyphBuffer::clear):
332         (WebCore::GlyphBuffer::swap):
333         (WebCore::GlyphBuffer::offsetAt):
334         (WebCore::GlyphBuffer::add):
335
336 2007-03-27  Antti Koivisto  <antti@apple.com>
337
338         Keep buildbot happy.
339
340         * platform/mac/PlatformScrollBarMac.mm:
341         (WebCore::PlatformScrollbar::scrollbarHit):
342
343 2007-03-26  Antti Koivisto  <antti@apple.com>
344
345         Reviewed by Darin.
346         
347         On Mac, support fine grained wheel events generated by trackpad and Mighty Mouse.
348         http://bugs.webkit.org/show_bug.cgi?id=13134
349         <rdar://problem/5076249?
350
351         * WebCore.exp:
352             Export _wkGetWheelEventDeltas
353         * page/EventHandler.cpp:
354         (WebCore::EventHandler::handleWheelEvent):
355             Remove (0, 0) scroll event hack, it is not needed anymore.
356             Do per-pixel scrolling for fine grained events.
357         * platform/PlatformWheelEvent.h:
358         (WebCore::PlatformWheelEvent::isContinuous):
359             Add new m_isContinuous boolean to indicate fine grained wheel events.
360         * platform/ScrollBar.cpp:
361         (WebCore::Scrollbar::Scrollbar):
362         (WebCore::Scrollbar::setValue):
363         (WebCore::Scrollbar::setSteps):
364         (WebCore::Scrollbar::scroll):
365         * platform/ScrollBar.h:
366         (WebCore::Scrollbar::value):
367             Use float to represent current position to support finer grained scrolling.
368             Add ScrollByPixel, remove ScrollByWheel (which was same as ScrollByLine anyway)
369         * platform/ScrollTypes.h:
370         (WebCore::):
371         * platform/gdk/WheelEventGdk.cpp:
372         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
373             Initalize m_isContinuous
374         * platform/mac/WebCoreSystemInterface.h:
375         * platform/mac/WebCoreSystemInterface.mm:
376             Add wkGetWheelEventDeltas for getting fine grained wheel events
377         * platform/mac/WheelEventMac.mm:
378         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
379             Get the wheel deltas using new wkGetWheelEventDeltas interface
380         * platform/qt/WheelEventQt.cpp:
381         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
382             Initalize m_isContinuous
383         * rendering/RenderListBox.cpp:
384         (WebCore::RenderListBox::calcHeight):
385             Pass item height to scrollbar
386
387 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
388
389         Reviewed by Darin Adler.
390
391         Fixed <rdar://problem/5088234> REGRESSION: Crash occurs at WebCore::Node::
392         createRendererIfNeeded() when changing map views with MS Virtual Earth 
393         (http://www.ziprealty.com/)
394         
395         The cause of the crash was the insertion of a <script> element whose
396         script removed it from the document. The <script> element would then be 
397         garbage when the insertion routine went on to attach() it.
398         
399         The solution here is to check that an element is still your child before
400         trying to attach() it. This matches the style of checks we do elsewhere
401         in the node insertion and removal code.
402
403         * dom/ContainerNode.cpp:
404         (WebCore::ContainerNode::insertBefore):
405         (WebCore::ContainerNode::replaceChild):
406         (WebCore::ContainerNode::appendChild):
407
408 2007-03-26  David Carson  <dacarson@gmail.com>
409
410         Reviewed by Darin, landed by Anders.
411
412         Manual test case for: REGRESSION (r19559): Java applet crash
413         http://bugs.webkit.org/show_bug.cgi?id=13142
414         <rdar://problem/5080340>
415
416         * manual-tests/liveconnect-applet-get-boolean.html: Added.
417         * manual-tests/resources/CheckerApplet.class: Added.
418         * manual-tests/resources/CheckerApplet.java: Added.
419
420 2007-03-26  Mitz Pettel  <mitz@webkit.org>
421
422         Reviewed and landed by Darin.
423
424         - fix http://bugs.webkit.org/show_bug.cgi?id=13194
425           <rdar://problem/5087738>
426           REGRESSION: Selection rects are wrong for images in search results from images.google.com
427
428         Test: fast/replaced/selection-rect-in-table-cell.html
429
430         * rendering/RenderReplaced.cpp:
431         (WebCore::RenderReplaced::selectionRect):
432
433 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
434
435         Removed now-stale #includes of <assert.h>.
436         
437         * WebCorePrefix.h:
438         * config.h:
439         * css/CSSGrammar.y:
440         * platform/Arena.cpp:
441         * platform/KURL.cpp:
442         * platform/SegmentedString.h:
443         * rendering/DataRef.h:
444         * rendering/RenderArena.cpp:
445
446 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
447
448         Reviewed by Kevin McCulough.
449
450         Global replace of "assert(" with "ASSERT(" to assist debugging. Removed
451         one instance of commented-out code containing "assert(" instead of replacing it.
452
453 2007-03-25  Antti Koivisto  <antti@apple.com>
454
455         Reviewed by Adam.
456
457         Fix <rdar://problem/5049842>
458         Gmail Editor: Dragging message text in the message body results in a crash at WebCore::Frame::eventHandler()
459
460         Null check frame in m_dragTarget, it might be gone already.
461
462         * page/EventHandler.cpp:
463         (WebCore::EventHandler::updateDragAndDrop):
464         (WebCore::EventHandler::cancelDragAndDrop):
465         (WebCore::EventHandler::performDragAndDrop):
466
467 2007-03-25  Alexey Proskuryakov  <ap@webkit.org>
468
469         Reviewed by Darin.
470
471         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
472         XPath can be very slow
473
474         * xml/XPathExpression.cpp:
475         (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
476         from being destroyed in time.
477
478         * dom/Attr.cpp:
479         (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
480         * dom/ContainerNode.h:
481         (WebCore::ContainerNode::fastSetFirstChild):
482         (WebCore::ContainerNode::fastSetLastChild):
483         Added operations that let Attr hack internal ContainerNode data (evil, but fast!).
484
485         * xml/XPathStep.cpp:
486         (WebCore::XPath::Step::evaluate):
487         (WebCore::XPath::Step::nodesInAxis):
488         (WebCore::XPath::Step::nodeMatches):
489         * xml/XPathStep.h:
490         Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future 
491         optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).
492
493 2007-03-24  Mitz Pettel  <mitz@webkit.org>
494
495         Reviewed by Darin.
496
497         - fix http://bugs.webkit.org/show_bug.cgi?id=13156
498           REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar
499
500         Test: fast/text/midword-break-after-breakable-char.html
501
502         Breaking in the middle of the word
503         is allowed only if no breaking opportunity between words has occurred yet. The
504         first position on the line should not be considered "between words" even if
505         it is a breaking opportunity.
506         
507         * rendering/bidi.cpp:
508         (WebCore::RenderBlock::findNextLineBreak): Changed according to the above. Also
509         cleaned up a couple of lines.
510
511 2007-03-24  David Hyatt  <hyatt@apple.com>
512
513         Fix for bugzilla bug 13187, place a hard limit on the amount of decoded data that WebCore will keep
514         around even on live pages (pages being displayed in tabs/windows or in the back/forward cache).
515         Images will decode to paint and once the decoded data exceeds the cache size, the decoded data will be
516         tossed.
517
518         Refine the flushing algorithm to apply the two-pass decode/evict model to each LRU-SP queue individually, rather
519         than to all the lists at once.  This allows the cache to evict large encoded resources before flushing small
520         or frequently accessed decoded onces.
521
522         Added information on live/decoded data to the cache statistics.
523
524         Reviewed by darin
525
526         * loader/Cache.cpp:
527         (WebCore::Cache::Cache):
528         (WebCore::Cache::pruneLiveResources):
529         (WebCore::Cache::pruneAllResources):
530         (WebCore::Cache::setMaximumSize):
531         (WebCore::Cache::remove):
532         (WebCore::Cache::lruListFor):
533         (WebCore::Cache::removeFromLRUList):
534         (WebCore::Cache::insertInLRUList):
535         (WebCore::Cache::liveLRUListFor):
536         (WebCore::Cache::removeFromLiveResourcesList):
537         (WebCore::Cache::insertInLiveResourcesList):
538         (WebCore::Cache::addToLiveResourcesSize):
539         (WebCore::Cache::removeFromLiveResourcesSize):
540         (WebCore::Cache::adjustSize):
541         (WebCore::Cache::getStatistics):
542         * loader/Cache.h:
543         (WebCore::Cache::TypeStatistic::TypeStatistic):
544         * loader/CachedImage.cpp:
545         (WebCore::CachedImage::decodedSizeWillChange):
546         (WebCore::CachedImage::decodedSizeChanged):
547         * loader/CachedImage.h:
548         * loader/CachedResource.cpp:
549         (WebCore::CachedResource::CachedResource):
550         (WebCore::CachedResource::ref):
551         (WebCore::CachedResource::deref):
552         (WebCore::CachedResource::setEncodedSize):
553         (WebCore::CachedResource::liveResourceAccessed):
554         * loader/CachedResource.h:
555         (WebCore::CachedResource::liveAccessCount):
556         (WebCore::CachedResource::resetLiveAccessCount):
557         (WebCore::CachedResource::increaseLiveAccessCount):
558         * platform/graphics/BitmapImage.cpp:
559         (WebCore::BitmapImage::destroyDecodedData):
560         (WebCore::BitmapImage::cacheFrame):
561         * platform/graphics/ImageObserver.h:
562         * rendering/RenderBox.cpp:
563         (WebCore::RenderBox::paintBackgroundExtended):
564         * rendering/RenderImage.cpp:
565         (WebCore::RenderImage::paint):
566         * rendering/RenderListMarker.cpp:
567         (WebCore::RenderListMarker::paint):
568         * rendering/RenderObject.cpp:
569         (WebCore::RenderObject::paintBorderImage):
570
571 2007-03-24  Darin Adler  <darin@apple.com>
572
573         Reviewed by Mitz.
574
575         - fix http://bugs.webkit.org/show_bug.cgi?id=13123
576           CSS selectors that use :lang, :not, and namespaces do not serialize correctly
577
578         Test: fast/css/css-selector-text.html
579
580         * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Add the namespace
581         prefix for tag or attribute names, the sub-selector for :not, and the argument
582         for :lang.
583
584 2007-03-24  Brady Eidson  <beidson@apple.com>
585
586         Reviewed by Adam
587
588         <rdar://problem/5086210> - Move RetainPtr to WTF
589
590         * ForwardingHeaders/wtf/RetainPtr.h: Added.
591         * WebCore.xcodeproj/project.pbxproj: Removed WebCore/RetainPtr.h
592         
593         * history/HistoryItem.h: Changed #include to <wtf/RetainPtr.h>
594         * history/PageCache.h: Ditto
595         * page/mac/WebCoreFrameBridge.mm: Ditto
596         * platform/ContextMenu.h: Ditto
597         * platform/ContextMenuItem.h: Ditto
598         * platform/DragImage.h: Ditto
599         * platform/FileChooser.h: Ditto
600         * platform/PlatformKeyboardEvent.h: Ditto
601         * platform/PopupMenu.h: Ditto
602         * platform/SharedBuffer.h: Ditto
603         * platform/cf/RetainPtr.h: Removed.
604         * platform/graphics/Icon.h: Changed #include
605         * platform/mac/ClipboardMac.h: Ditto
606         * platform/mac/PasteboardMac.mm: Ditto
607         * platform/mac/WidgetMac.mm: Ditto
608         * platform/network/AuthenticationChallenge.h: Ditto
609         * platform/network/ResourceError.h: Ditto
610         * platform/network/ResourceHandle.h: Ditto
611         * platform/network/ResourceRequest.h: Ditto
612         * platform/network/ResourceResponse.h: Ditto
613         * rendering/RenderThemeMac.mm: Ditto
614
615 2007-03-24  Mitz Pettel  <mitz@webkit.org>
616
617         Fix for <rdar://problem/5086797>, layoutPending is now reporting incorrect results, which will lead
618         to all sorts of layout issues.  This is in bugzilla as 13179.
619
620         Reviewed by hyatt
621
622         - fix http://bugs.webkit.org/show_bug.cgi?id=13179
623           REGRESSION (r20410): In debug builds, loading a certain page is suspended until redisplay is forced
624
625         Moved the root->needsLayout() check from layoutPending() to needsLayout()
626         to restore the behavior before r20324.
627
628         * page/FrameView.cpp:
629         (WebCore::FrameView::layoutPending):
630         (WebCore::FrameView::needsLayout):
631
632 2007-03-24  Mitz Pettel  <mitz@webkit.org>
633
634         Reviewed by Adele.
635
636         - fix http://bugs.webkit.org/show_bug.cgi?id=13180
637               <rdar://problem/5084478>
638           Another debug build crash from ASSERTION FAILED: !needsLayout()
639
640         No test possible because updateRendering() is always called after script
641         execution.
642
643         * page/FrameView.cpp:
644         (WebCore::FrameView::layout): Get the layout root after calling recalcStyle()
645         since a style recalc may result in needing to do start layout at the root.
646
647 2007-03-24  Nikolas Zimmermann  <zimmermann@kde.org>
648
649         Not reviewed. Build fix.
650
651         Fix FloatRect vs. IntRect confusion.
652
653         * rendering/RenderSVGImage.cpp:
654         (WebCore::RenderSVGImage::nodeAtPoint):
655
656 2007-03-25  Mark Rowe  <mrowe@apple.com>
657
658         Fix incorrect radar number.
659
660         * platform/network/mac/ResourceHandleMac.mm:
661         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]):
662
663 2007-03-23  Nikolas Zimmermann  <zimmermann@kde.org>
664
665         Reviewed by Oliver.
666
667         Fix all known RenderSVGImage problems.
668
669         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12126 (RenderSVGImage seems to suffer from integer overflow)
670         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12442 (raster images disappearing during script execution (SVG))
671         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12572 (WebKit does not properly invalidate image region after image load)
672
673         Added test: svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
674
675         In RenderSVGImage::paint, do not call shouldPaint() as this will never work properly for SVG renderers, as shouldPaint
676         doesn't take into account any special SVG transformation (localTransform/absoluteTransform). Just remove the call.
677
678         Fix hit detection on RenderSVGImage - it didn't work properly at all. No idea why I didn't notice before.
679         Thanks Andreas Neumann once again for writing excellent bug reports and pointing me to them :-)
680
681         The carto.net navigation tools work as expected now, and also the "dock like" image effect example.
682
683         * rendering/RenderSVGImage.cpp:
684         (WebCore::RenderSVGImage::paint):
685         (WebCore::RenderSVGImage::nodeAtPoint):
686
687 2007-03-24  Mitz Pettel  <mitz@webkit.org>
688
689         Reviewed by Dave Hyatt.
690
691         - http://bugs.webkit.org/show_bug.cgi?id=13177
692           Suppress control characters in the ATSUI code path
693
694         * platform/mac/FontMac.mm:
695         (WebCore::overrideLayoutOperation):
696         (WebCore::ATSULayoutParameters::initialize):
697
698 2007-03-24  David Hyatt  <hyatt@apple.com>
699
700         Fix for <rdar://problem/5086400>, images scrolled offscreen continue to animate.  Safari 2 would
701         halt animations when images were no longer visible.
702
703         Reviewed by mjs, olliej
704
705         * platform/graphics/BitmapImage.cpp:
706         (WebCore::BitmapImage::advanceAnimation):
707
708 2007-03-24  David Hyatt  <hyatt@apple.com>
709
710         Fix for <rdar://problem/508328>, sluggish text entry in search field.  Make sure
711         our size actually changed before we decide to do a full repaint because of background/border
712         complexities.
713
714         Reviewed by aroben
715
716         * rendering/RenderObject.cpp:
717         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
718
719 2007-03-23  Dave Hyatt  <hyatt@apple.com>
720
721         Fix for <rdar://problem/5048219>, spurious glyphs in gmail.   This is bugzilla bug 13136, which
722         will remain open to cover patching the complex text path.
723         
724         Reviewed by aroben
725
726         * platform/Font.cpp:
727         (WebCore::Font::glyphDataForCharacter):
728         * platform/Font.h:
729         (WebCore::Font::treatAsZeroWidthSpace):
730         * platform/GlyphPageTreeNode.cpp:
731         (WebCore::GlyphPageTreeNode::initializePage):
732
733 2007-03-23  Mitz Pettel  <mitz@webkit.org>
734
735         Reviewed by Adele.
736
737         - fix http://bugs.webkit.org/show_bug.cgi?id=13153
738           REGRESSION: Visual highlighting of pre-populated blank line in textarea is broken
739
740         - fix a bug where selecting across a soft line break did not highlight to
741           the end of the first line if it contained skipped whitespace
742
743         Test: fast/text/selection-hard-linebreak.html
744
745         * rendering/InlineTextBox.cpp:
746         (WebCore::InlineTextBox::selectionState): Changed to treat a selection that ends on the
747         end of a hard line break as if it ends after the line break. Fixed the case of a selection
748         that starts and ends in the same text object as the box but does not intersect it
749         to return SelectionNone instead of selectionBoth.
750
751 2007-03-23  Mitz Pettel  <mitz@webkit.org>
752
753         Reviewed by Adele.
754
755         - fix http://bugs.webkit.org/show_bug.cgi?id=13124
756           REGRESSION: Reproducible crash in Widget::getView
757
758         Test: fast/frames/hover-timer-crash.html
759
760         * page/Frame.cpp:
761         (WebCore::Frame::setView): Added a call to EventHandler::clear().
762
763 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
764
765         Reviewed by adele
766
767         <rdar://problem/5078739> 
768         Crash in in ReplaceSelectionCommand if the fragment contains only a style span
769
770         * editing/ReplaceSelectionCommand.cpp:
771         (WebCore::ReplaceSelectionCommand::doApply): Check 
772         for an empty fragment after removing a redundant
773         style span instead of before.
774
775 2007-03-23  David Hyatt  <hyatt@apple.com>
776
777         <rdar://problem/5085063>
778
779         Fix non-looping animation on cuteoverload.com. Just always flush
780         decoded data for large animated images to avoid our cache getting
781         out of sync with the image source.
782
783         Reviewed by ggaren
784
785         * platform/graphics/BitmapImage.cpp:
786         (WebCore::BitmapImage::advanceAnimation):
787
788 2007-03-23  Adele Peterson  <adele@apple.com>
789
790         Reviewed by Darin.
791
792         Fix for <rdar://problem/5061024> REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
793         http://bugs.webkit.org/show_bug.cgi?id= 13020
794
795         No known way to add a layout test for this.  We would need a way to know exactly how the event was consumed.
796
797         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler):
798           If the keypress event has its default behavior prevented, then we should consider the keydown event handled.
799
800 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
801
802         Reviewed by darin
803
804         <rdar://problem/5080333> 
805         REGRESSION: Selection changes when changing the alignment of an image
806         
807         Regression occurred when we started using moveParagraphs
808         to move content in applyBlockStyle.  moveParagraphs 
809         moves by copying, deleting and reinserting content, and
810         so must be accompanied by selection preservation code.
811         That code uses rangeFromLocationAndLength and rangeLength,
812         which use TextIterators, which don't emit anything for images 
813         and other replaced elements, causing this bug.
814
815         * editing/ApplyStyleCommand.cpp:
816         (WebCore::ApplyStyleCommand::applyBlockStyle): Ask rangeLength 
817         and rangeFromLocationAndLength to request that their
818         TextIterators emit spaces for replaced elements.
819         Use rangeCompliantEquivalent()s when creating a Range from
820         VisiblePositions, since some VisiblePositions have illegal
821         deepEquivalent()s.
822         * editing/CompositeEditCommand.cpp:
823         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
824         * editing/TextIterator.cpp:
825         (WebCore::TextIterator::TextIterator):
826         (WebCore::TextIterator::handleReplacedElement): Emit
827         a space if requested.
828         (WebCore::TextIterator::representNodeOffsetZero): Emit
829         ranges before m_node, not around m_lastTextNode.  These
830         ranges should represent the part of the document associated
831         with the emitted character. 
832         (WebCore::TextIterator::rangeLength): Take in the new bool.
833         (WebCore::TextIterator::rangeFromLocationAndLength): Ditto.
834         Also, don't loop an extra time after finding the end of the
835         range when we're looking for zero length ranges.  This appeared
836         to be a workaround for the bugs fixed in representNodeOffsetZero
837         in this patch.
838         * editing/TextIterator.h:
839
840 2007-03-24  Mark Rowe  <mrowe@apple.com>
841
842         Rubber-stamped by Darin.
843
844         * Configurations/WebCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
845
846 2007-03-23  Darin Adler  <darin@apple.com>
847
848         * html/HTMLBodyElement.cpp: Fix comment typo.
849
850 2007-03-23  Adam Treat  <adam@staikos.net>
851
852         Reviewed and committed by George.
853
854         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
855         XMLNames is required in any case.
856
857         * WebCore.pro:
858
859 2007-03-23  Darin Adler  <darin@apple.com>
860
861         Reviewed by Hyatt.
862
863         - <rdar://problem/5074439> handle margins on frame and iframe elements
864           without involving FrameView, FrameLoader, etc.
865
866         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
867         Grab the margin from the frame directly here. There was no real benefit
868         to doing this via FrameView. Later we can delete quite a bit of unneeded code
869         here and in WebKit that exists only to set up the margin values in FrameView,
870         which are now unused.
871
872 2007-03-23  Adele Peterson  <adele@apple.com>
873
874         Reviewed by Darin.
875
876         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
877         http://bugs.webkit.org/show_bug.cgi?id=13121
878
879         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
880         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
881         use the m_originalValue for hidden input elements.
882
883         * html/HTMLInputElement.cpp:
884         (WebCore::HTMLInputElement::closeRenderer):
885         (WebCore::HTMLInputElement::reset):
886         (WebCore::HTMLInputElement::setValue):
887         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
888         * html/HTMLInputElement.h:
889
890 2007-03-23  Mitz Pettel  <mitz@webkit.org>
891
892         Reviewed by Dave Hyatt.
893
894         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
895               <rdar://problem/5083995>
896           List markers positioned incorrectly and don't repaint properly on Oxford homepage
897
898         Test: fast/lists/marker-image-error.html
899
900         * rendering/RenderListMarker.cpp:
901         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
902         the image failed to load, since that means we will use a bullet instead.
903
904 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
905
906         Fix the compile.
907
908         * platform/graphics/qt/ImageSourceQt.cpp:
909
910 2007-03-22  Dave Hyatt  <hyatt@apple.com>
911
912         Fix for <rdar://problem/5083072>.
913
914         * page/Frame.cpp:
915         (WebCore::Frame::setPrinting):
916         (WebCore::Frame::forceLayoutWithPageWidthRange):
917         * page/Frame.h:
918         * page/mac/WebCoreFrameBridge.mm:
919         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
920
921 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
922
923         Reviewed by Ada.
924
925         <rdar://problem/5074974>
926         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
927         
928         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
929         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
930         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
931         HTTP server (and not a web archive).
932
933 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
934
935         Not reviewed - gdk build fix.
936
937         * platform/graphics/cairo/ImageSourceCairo.cpp:
938
939 2007-03-22  Dave Hyatt  <hyatt@apple.com>
940
941         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
942         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
943         size changes (making it be the size of the initial containing block according to CSS2.1), but
944         we should still handle this case gracefully in case it comes up again.
945        
946         Reviewed by olliej
947
948         * page/EventHandler.cpp:
949         (WebCore::EventHandler::handleWheelEvent):
950
951 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
952
953         Reviewed by kevin
954
955         <rdar://problem/5081257> 
956         REGRESSION: New Mail signatures start out empty
957
958         * editing/VisiblePosition.cpp:
959         (WebCore::VisiblePosition::canonicalPosition): Allow
960         descent from positions inside the document into an 
961         editable body.
962
963 2007-03-22  Brady Eidson  <beidson@apple.com>
964
965         Reviewed by Adele and John
966
967         <rdar://5043528> - Prepare for new API
968         
969         * platform/network/ResourceHandle.cpp:
970         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
971
972 2007-03-22  Beth Dakin  <bdakin@apple.com>
973
974         Patch by Hyatt, reviewed and committed by me.
975
976         Does not reproduce consistently, so a layout test does not seem 
977         possible.
978
979         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
980         needsLayout()) in RenderView::paint()
981
982         * page/FrameView.cpp:
983         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
984         layout timer is active. There may be times that we don't have a 
985         body yet so we cannot schedule layout yet, but the root still needs 
986         layout.  
987
988 2007-03-22  John Sullivan  <sullivan@apple.com>
989
990         Reviewed by Darin
991         
992         Followup for recent fix to 5079700, found by assertion added to Safari.
993
994         * page/mac/FrameMac.mm:
995         (WebCore::Frame::searchForLabelsBeforeElement):
996         Fixed another place in this method where an empty NSString was being returned instead of nil.
997         Cleaned up the style a little too.
998
999 2007-03-22  David Hyatt  <hyatt@apple.com>
1000
1001         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
1002         the image source, it is no longer needed.
1003
1004         Reviewed by beth
1005
1006         * platform/graphics/BitmapImage.cpp:
1007         (WebCore::BitmapImage::destroyDecodedData):
1008
1009 2007-03-22  David Harrison  <harrison@apple.com>
1010
1011         Reviewed by Geoff, Darin.
1012
1013         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
1014         
1015         * platform/mac/ThreadCheck.mm:
1016         (WebCore::_WebCoreThreadViolationCheck):
1017         Change default on Tiger to NSLog rather than raise an exception.
1018
1019 2007-03-22  Darin Adler  <darin@apple.com>
1020
1021         Reviewed by Brady.
1022
1023         - use binary_search instead of hash table; slightly better performance and
1024           less memory use
1025
1026         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
1027         Use binary_search.
1028
1029 2007-03-22  Darin Adler  <darin@apple.com>
1030
1031         Reviewed by Adele.
1032
1033         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
1034
1035         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
1036         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
1037         There was no reason for this crucial loading step to be left to the client.
1038
1039 2007-03-22  David Hyatt  <hyatt@apple.com>
1040
1041         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
1042         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
1043
1044         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
1045         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
1046
1047         Reviewed by aroben
1048
1049         * page/FrameView.cpp:
1050         (WebCore::FrameView::adjustViewSize):
1051         (WebCore::FrameView::needsLayout):
1052         (WebCore::FrameView::setNeedsLayout):
1053         * page/FrameView.h:
1054         * page/mac/WebCoreFrameBridge.mm:
1055         (-[WebCoreFrameBridge needsLayout]):
1056         (-[WebCoreFrameBridge setNeedsLayout]):
1057         * rendering/RenderView.cpp:
1058         (WebCore::RenderView::paint):
1059
1060 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
1061
1062         Reviewed by Beth Dakin.
1063         
1064         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
1065         accept "extra" coordinates -- virtually all commands accept them.
1066
1067         * ksvg2/svg/SVGParserUtilities.cpp:
1068         (WebCore::SVGPathParser::parseSVG):
1069
1070 2007-03-21  David Harrison  <harrison@apple.com>
1071
1072         Reviewed by hyatt.
1073
1074         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
1075
1076         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
1077         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
1078         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
1079         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
1080         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
1081         
1082         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
1083         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
1084
1085         * platform/SharedBuffer.h:
1086         Declare createCFData().
1087         
1088         * platform/graphics/cg/ImageSourceCG.cpp:
1089         (WebCore::ImageSource::setData):
1090         Call createCFData instead of createNSData.
1091         
1092         * platform/graphics/cg/PDFDocumentImage.cpp:
1093         (WebCore::PDFDocumentImage::dataChanged):
1094         Call createCFData instead of createNSData.
1095         
1096        * platform/mac/SharedBufferMac.mm:
1097         (WebCore::SharedBuffer::createCFData):
1098         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
1099         
1100 2007-03-21  Mitz Pettel  <mitz@webkit.org>
1101
1102         Reviewed by Darin.
1103
1104         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
1105           Regression: Scrollbar not resizing after display none
1106
1107         Test: fast/dynamic/view-overflow.html
1108
1109         * rendering/RenderView.cpp:
1110         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
1111         before calling docHeight() and docWidth(), since the former act as a lower
1112         bound for the latter.
1113
1114 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
1115
1116         Reviewed by Beth Dakin.
1117         
1118         A little cleanup based work I've been doing on the SVG parsers.
1119
1120         * ksvg2/svg/SVGParserUtilities.h:
1121         (WebCore::skipString):
1122         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
1123         SVGParserUtilities.h, so it could be with all its friends. Renamed 
1124         "checkString" to "skipString" to match the rest of the code and to be 
1125         clear about which functions move the buffer pointer.
1126         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
1127         * ksvg2/svg/SVGTransformable.cpp:
1128         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
1129         returns. Removed unnecessary magic number.
1130
1131 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
1132
1133         Reviewed by Beth Dakin.
1134         
1135         Fixed <rdar://problem/5078471> SVG rgb color parser runs past end of 
1136         buffer when running fuzzing test
1137
1138         * ksvg2/svg/SVGColor.cpp:
1139         (WebCore::parseNumberOrPercent): Check for past the end condition.
1140         (WebCore::SVGColor::colorFromRGBColorString): Reversed "read past end
1141         of buffer, then check if you're past the end" logic.
1142
1143 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
1144
1145         Reviewed by Beth Dakin.
1146         
1147         Fixed <rdar://problem/5079410> SVG path parser hangs, exhausts memory when 
1148         running fuzzer test
1149
1150         * ksvg2/svg/SVGParserUtilities.cpp:
1151         (WebCore::SVGPathParser::parseSVG): Don't assume that extra digits are
1152         always preceded by an 'M' or an 'm'.
1153
1154 2007-03-21  John Sullivan  <sullivan@apple.com>
1155
1156         Reviewed by Adam
1157         
1158         - fixed <rdar://problem/5079700> REGRESSION (r19702): Name/password aren't autofilled 
1159           or saved for .Mac homepage login
1160
1161         * page/mac/FrameMac.mm:
1162         (WebCore::Frame::searchForLabelsBeforeElement):
1163         don't count empty strings as valid results
1164
1165 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
1166
1167         Reviewed by darin
1168
1169         * editing/markup.cpp:
1170         (WebCore::styleFromMatchedRulesAndInlineDecl): 
1171         Release the RefPtr to avoid increasing/decreasing
1172         the refcount unnecessarily.
1173         (WebCore::propertyMissingOrEqualToNone): Added and used
1174         instead of converting values to strings.
1175         (WebCore::elementHasTextDecorationProperty): 
1176         (WebCore::createMarkup):
1177
1178 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
1179
1180         Reviewed by oliver
1181
1182         <rdar://problem/5075944> 
1183         REGRESSION: Partially selected underlined content pastes as plain text
1184         
1185         We stopped adding markup for all the ancestors
1186         of lastClosed up to the commonAncestorBlock
1187         because it was adding a lot of unnecessary markup.
1188         This caused us to lose underlining when copying a 
1189         partially selected underlined element (even though 
1190         we put all styles that the copied markup inherits 
1191         into a style span, because the text-decoration 
1192         isn't inheritable).
1193
1194         * editing/markup.cpp:
1195         (WebCore::styleFromMatchedRulesAndInlineDecl): Moved
1196         code here.
1197         (WebCore::elementHasTextDecorationProperty): Added.
1198         (WebCore::createMarkup): If the copied markup has a
1199         text-decoration because some common ancestor has
1200         a text-decoration property set, include that ancestor
1201         and all its descendants in the copied markup.
1202
1203 2007-03-21  Oliver Hunt  <oliver@apple.com>
1204
1205         Reviewed by Antti.
1206
1207         Update a few SVG attribute parsers to be more defensive against
1208         reading beyond the end of input. 
1209
1210         Fixes rdar://problem/5077218 -- SVG transform parser runs past
1211         end of buffer when running fuzzing test
1212
1213         * ksvg2/svg/SVGParserUtilities.cpp:
1214         (WebCore::SVGPathParser::parseSVG):
1215         * ksvg2/svg/SVGParserUtilities.h:
1216         (WebCore::skipOptionalSpacesOrDelimiter):
1217         * ksvg2/svg/SVGTransformable.cpp:
1218         (WebCore::parseTransformParamList):
1219         (WebCore::SVGTransformable::parseTransformAttribute):
1220
1221 2007-03-21  Alexey Proskuryakov  <ap@webkit.org>
1222
1223         Reviewed by Mitz.
1224
1225         http://bugs.webkit.org/show_bug.cgi?id=13140
1226         Crash after loading SVG fragment with XMLHttpRequest (Yosemite Map Geology Layer)
1227
1228         Test: svg/carto.net/frameless-svg-parse-error.html
1229
1230         * ksvg2/misc/SVGDocumentExtensions.cpp:
1231         (WebCore::SVGDocumentExtensions::reportError): Added a null check.
1232         (WebCore::SVGDocumentExtensions::reportWarning): Ditto.
1233
1234 2007-03-21  Beth Dakin  <bdakin@apple.com>
1235
1236         Reviewed by Geoff.
1237
1238         Fix for <rdar://problem/5072678> Crash in
1239         RenderLayer::scrollRectToVisible with MallocScribble enabled
1240
1241         I tried to fix this earlier today but my fix caused a regression
1242         scrolling through RSS pages. It turns out that sometimes scroll
1243         events need to propagate immediately, and sometimes they must be
1244         delayed or they risk deleting objects that are expected to be
1245         around after the event has propagated. Mitz's original fix made
1246         sheduleEvent() only delay events that happen during layout. This
1247         fix marks two other places in addition to layout where events also
1248         need to be delayed. These two places are places that were marked
1249         with FIXMEs that Mitz removed in his original patch. (There was a
1250         third FIXME in RenderLayer::updateScrollInfoAfterLayout() but that
1251         case is only called through layout and is covered by Mitz's
1252         original patch.)
1253
1254         * page/FrameView.cpp:
1255         (WebCore::FrameView::~FrameView): Added assertion.
1256         (WebCore::FrameView::layout): Call new functions to increment and 
1257         decrement the queued events count.
1258         (WebCore::FrameView::pauseScheduledEvents):
1259         (WebCore::FrameView::resumeScheduledEvents): Decrement queued 
1260         events count and dispatch events if the count has zeroed.
1261         * page/FrameView.h:
1262         * rendering/RenderLayer.cpp:
1263         (WebCore::RenderLayer::scrollRectToVisible):
1264         (WebCore::Marquee::start):
1265
1266 2007-03-21  Mitz Pettel  <mitz@webkit.org>
1267
1268         Reviewed by John Sullivan.
1269
1270         - fix http://bugs.webkit.org/show_bug.cgi?id=13130
1271           REGRESSION: Sometimes a frame resizer keeps following the mouse after mouseup
1272
1273         * rendering/RenderFrameSet.cpp:
1274         (WebCore::RenderFrameSet::userResize): Reordered the code to allow resizing
1275         to be terminated by a mouseup event regardless of whether the frameset needs
1276         layout.
1277
1278 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
1279
1280         Reviewed by Oliver.
1281
1282         <rdar://problem/5077252> 
1283         In NetNewsWire 2.1.1 and 3.0d62, a crash occurs after triple-clicking a link on the page
1284         
1285         * loader/FrameLoader.cpp:
1286         (WebCore::FrameLoader::load):
1287         Move the m_inStopAllLoaders check to the load function that's common for loading a request or substitute data.
1288
1289 2007-03-20  Brady Eidson  <beidson@apple.com>
1290
1291         Reviewed by Anders.
1292
1293         <rdar://problem/5073391> and http://bugs.webkit.org/show_bug.cgi?id=13137
1294
1295         Crash in IconDatabase when private browsing is enabled.
1296
1297         The problem was caused by http://trac.webkit.org/projects/webkit/changeset/20182 
1298         which changed many uses of char[] and Vector<char> to SharedBuffer.  The patch
1299         tended to literally replace a Vector<char> with RefPtr<SharedBuffers> but forgot
1300         to enforce the concept that Vector<char>'s always exist, whereas RefPtr<SharedBuffers>
1301         can be null.  This led to derefs.
1302
1303         I took the opportunity to rework the iconDB functions to live in a SharedBuffer 
1304         world, as that didn't exist when they were originally written - now they just return
1305         SharedBuffers instead of taking a Vector<char>& as a parameter
1306
1307         * loader/icon/IconDatabase.cpp:
1308         (WebCore::IconDatabase::imageDataForIconURL): Return a SharedBuffer
1309         (WebCore::IconDatabase::iconForPageURL): Null check the SharedBuffer before asking
1310           it if it's empty
1311         (WebCore::IconDatabase::imageDataForIconURLQuery): Return a new SharedBuffer
1312
1313         * loader/icon/IconDatabase.h: Return SharedBuffer's instead of taking Vector<char>&'s
1314
1315 2007-03-20  Adam Roben  <aroben@apple.com>
1316
1317         Rubberstamped by Adele.
1318
1319         Roll out r20348 because it was causing crashes.
1320
1321         * page/FrameView.cpp:
1322         (WebCore::FrameViewPrivate::FrameViewPrivate):
1323         (WebCore::FrameView::layout):
1324         (WebCore::FrameView::scheduleEvent):
1325
1326 2007-03-20  Timothy Hatcher  <timothy@apple.com>
1327
1328         Reviewed by Kevin Decker.
1329
1330         Rolling out part of r19828 that caused a scrolling regression in Mail.
1331
1332         <rdar://problem/4820817> Message jumps around when trying to select text
1333
1334         * platform/mac/ScrollViewMac.mm:
1335         (WebCore::ScrollView::visibleContentRect):
1336         (WebCore::ScrollView::updateContents):
1337
1338 2007-03-20  Brady Eidson  <beidson@apple.com>
1339
1340         Reviewed by John
1341
1342         <rdar://5071341> - Crash in IconLoader::finishLoading()
1343         
1344         Though the reproducibility of the crash is still elusive, there's been a crasher likely uncovered 
1345         Hyatt's recent caching changings to the IconLoader.  This crash tends to hit on sites without favicons,
1346         that serve up complex 404 pages, often when the load is cancelled or redirected.  Occasionally, it *seems*
1347         the IconLoader is getting failed/cancelled twice.
1348         
1349         This patch adds some assertions and a "fail gracefully in a release build" check that will have to
1350         serve us until we know more about the cause.
1351
1352         * loader/icon/IconLoader.cpp:
1353         (WebCore::IconLoader::didFail): Add an assertion to catch this case
1354         (WebCore::IconLoader::finishLoading): Add an assertion to catch the case, and fail
1355           gracefully in debug builds.  Also add an efficiency check to not commit to the DB if there is no
1356           IconURL
1357
1358 2007-03-20  Antti Koivisto  <antti@apple.com>
1359
1360         Reviewed by Darin.
1361
1362         - fix http://bugs.webkit.org/show_bug.cgi?id=10747
1363         REGRESSION: Using two fingers on a trackpad to scroll inside a text area makes the whole page move
1364         <rdar://problem/5045710>
1365         
1366         Eat smooth scroll events in WebCore if pointer is over scrollable area. Not
1367         really a good fix, smooth scrolling should be supported properly. It should do for now.
1368
1369         * page/EventHandler.cpp:
1370         (WebCore::EventHandler::handleWheelEvent):
1371         * rendering/RenderListBox.cpp:
1372         (WebCore::RenderListBox::isScrollable):
1373         * rendering/RenderListBox.h:
1374         * rendering/RenderObject.cpp:
1375         (WebCore::RenderObject::isScrollable):
1376         * rendering/RenderObject.h:
1377         * rendering/RenderTextControl.cpp:
1378         (WebCore::RenderTextControl::isScrollable):
1379         * rendering/RenderTextControl.h:
1380
1381 2007-03-20  Beth Dakin  <bdakin@apple.com>
1382
1383         Reviewed by Geoff.
1384
1385         Covered by existing test case.
1386
1387         Fix for <rdar://problem/5072678> Crash in 
1388         RenderLayer::scrollRectToVisible with MallocScribble enabled
1389
1390         This removes some code that was added with http://bugs.webkit.org/
1391         show_bug.cgi?id=8360. This code was not needed to fix that bug, but 
1392         the idea behind it was that there are times when it is safe for 
1393         scheduleEvent() to propagate the event immediately. The 
1394         MallocScribble crash revealed that this assumption was a bit too 
1395         broad; the cause of the crash was that we were propagating events 
1396         immediately when it was not safe. Mitz and I discussed this online 
1397         and we agree that the safest solution is to revert to the old 
1398         behavior here, and always delay the propagation of the event. 
1399
1400         * page/FrameView.cpp:
1401         (WebCore::FrameViewPrivate::FrameViewPrivate):
1402         (WebCore::FrameView::layout):
1403         (WebCore::FrameView::scheduleEvent):
1404
1405 2007-03-20  Brady Eidson  <beidson@apple.com>
1406
1407         Reviewed by John Sullivan
1408
1409         Add some very helpful logging to the IconLoader's SubresourceLoaderClient impl.
1410
1411         * loader/icon/IconLoader.cpp:
1412         (WebCore::IconLoader::didReceiveResponse):
1413         (WebCore::IconLoader::didReceiveData):
1414         (WebCore::IconLoader::didFail):
1415         (WebCore::IconLoader::didFinishLoading):
1416
1417 2007-03-20  Justin Garcia  <justin.garcia@apple.com>
1418
1419         Reviewed by darin
1420
1421         <rdar://problem/5071074> 
1422         REGRESSION: Links are pasted as plain text at certain positions
1423         
1424         moveParagraphs calls createMarkup without annotation, which leaves
1425         out anchor elements that aren't fully selected.
1426
1427         * editing/CompositeEditCommand.cpp:
1428         (WebCore::CompositeEditCommand::moveParagraphs): We don't want 
1429         createMarkup to do full annotation here.  Doing so could include 
1430         special ancestor blocks, which would prevent the copied content 
1431         from appearing in the destination paragraph when it's re-inserted.  
1432         Annotation would also inline styles from style sheets,  which is 
1433         unnecessary because the content is being moved to the same 
1434         document it's being moved from.
1435         Added a new bool to createMarkup that when true allows markup for 
1436         special ancestors as long as they are inline when annotation is off.
1437         * editing/markup.cpp:
1438         (WebCore::createMarkup): Don't set specialCommonAncestor if annotation
1439         is off, unless it's inline and we've been told it's ok to include such
1440         elements.
1441         * editing/markup.h:
1442
1443 2007-03-20  Alexey Proskuryakov  <ap@webkit.org>
1444
1445         Reviewed by Darin.
1446
1447         http://bugs.webkit.org/show_bug.cgi?id=12497
1448         Implement XPath result ordering.
1449
1450         XPath::NodeVector typedef is replaced with a real XPath::NodeSet class that knows how 
1451         to sort itself, and can remember whether it has been already sorted.
1452
1453         * CMakeLists.txt:
1454         * WebCore.pro:
1455         * WebCore.xcodeproj/project.pbxproj:
1456         * WebCoreSources.bkl:
1457         Added XPathNodeSet files.
1458
1459         * xml/XPathExpression.cpp: Fixed includes.
1460
1461         * xml/XPathFunctions.cpp:
1462         (WebCore::XPath::FunId::evaluate): Mark the resulting node-set as unsorted.
1463         (WebCore::XPath::FunLocalName::evaluate): Replacing NodeVector with NodeSet.
1464         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
1465         (WebCore::XPath::FunName::evaluate): Ditto.
1466         (WebCore::XPath::FunCount::evaluate): Ditto.
1467         (WebCore::XPath::FunSum::evaluate): Ditto.
1468
1469         * xml/XPathNodeSet.cpp: Added.
1470         (WebCore::XPath::parentWithDepth):
1471         (WebCore::XPath::sortBlock):
1472         (WebCore::XPath::NodeSet::sort): Sort the node-set in document order.
1473         (WebCore::XPath::NodeSet::reverse): Reverse the order (useful for making axes such as 
1474         parent or ancestor sorted).
1475         (WebCore::XPath::NodeSet::firstNode): Returns the first node in document order; currently
1476         implemented via fully sorting the node-set, but this can obviously be optimized.
1477         (WebCore::XPath::NodeSet::anyNode): Added for symmetry with firstNode().
1478         
1479         * xml/XPathNodeSet.h: Added.
1480         (WebCore::XPath::NodeSet::NodeSet):
1481         (WebCore::XPath::NodeSet::operator=):
1482         (WebCore::XPath::NodeSet::size):
1483         (WebCore::XPath::NodeSet::isEmpty):
1484         (WebCore::XPath::NodeSet::operator[]):
1485         (WebCore::XPath::NodeSet::reserveCapacity):
1486         (WebCore::XPath::NodeSet::clear):
1487         (WebCore::XPath::NodeSet::swap):
1488         (WebCore::XPath::NodeSet::append):
1489         (WebCore::XPath::NodeSet::markSorted):
1490         (WebCore::XPath::NodeSet::isSorted):
1491         Most of these methods just call Vector counterparts. 
1492
1493         * xml/XPathParser.cpp: Updated the copyright notice.
1494
1495         * xml/XPathPath.cpp:
1496         (WebCore::XPath::Filter::evaluate): Replacing NodeVector with NodeSet.
1497         (WebCore::XPath::Path::evaluate): Ditto.
1498         (WebCore::XPath::LocationPath::evaluate): Replacing NodeVector with NodeSet. This function
1499         always marks the result as unsorted, because it is hard to tell whether a step breaks node order.
1500         Identifying and implementing special cases when it is not necessary to do so is an important
1501         future optimization.
1502
1503         * xml/XPathPath.h: Replacing NodeVector with NodeSet.
1504         * xml/XPathPredicate.cpp:
1505         (WebCore::XPath::EqTestOp::compare): Replacing NodeVector with NodeSet.
1506         (WebCore::XPath::Union::evaluate): Replacing NodeVector with NodeSet. Currently, Union just
1507         marks the result as unordered; we can consider using merge sort to avoid this.
1508
1509         * xml/XPathResult.cpp:
1510         (WebCore::XPathResult::XPathResult): Replacing NodeVector with NodeSet.
1511         (WebCore::XPathResult::singleNodeValue): Ditto.
1512         (WebCore::XPathResult::snapshotLength): Ditto.
1513         (WebCore::XPathResult::iterateNext): Ditto.
1514         (WebCore::XPathResult::snapshotItem): Ditto.
1515         (WebCore::XPathResult::convertTo): Ditto. Sort the result when requested to.
1516
1517         * xml/XPathResult.h: Replacing NodeVector with NodeSet.
1518
1519         * xml/XPathStep.cpp:
1520         (WebCore::XPath::Step::evaluate): If the input is not sorted, mark the output as such, too.
1521         (WebCore::XPath::Step::nodesInAxis): Fixed a number of bugs when enumerating with an
1522         attribute context node.
1523         (WebCore::XPath::Step::nodeTestMatches): Replacing NodeVector with NodeSet.
1524         * xml/XPathStep.h: Ditto.
1525
1526         * xml/XPathUtil.cpp:
1527         (WebCore::XPath::isValidContextNode): XPath data model doesn't put attribute data into child
1528         nodes, so passing such node as a context could cause problems.
1529
1530         * xml/XPathUtil.h: Removed NodeVector typedef.
1531
1532         * xml/XPathValue.cpp:
1533         (WebCore::XPath::Value::Value):
1534         (WebCore::XPath::Value::toNodeSet):
1535         (WebCore::XPath::Value::toBoolean):
1536         (WebCore::XPath::Value::toNumber):
1537         (WebCore::XPath::Value::toString):
1538         * xml/XPathValue.h:
1539         (WebCore::XPath::Value::):
1540         (WebCore::XPath::Value::isNodeSet):
1541         Replacing NodeVector with NodeSet.
1542
1543 2007-03-21  Mark Rowe  <mrowe@apple.com>
1544
1545         Build fix.
1546
1547         * bindings/objc/WebScriptObject.mm:
1548         (-[WebScriptObject methodForSelector:]):
1549         (-[WebScriptObject respondsToSelector:]):
1550
1551 2007-03-21  Mark Rowe  <mrowe@apple.com>
1552
1553         Reviewed by Tim Hatcher.
1554
1555         Fix for http://bugs.webkit.org/show_bug.cgi?id=13129.
1556         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup.
1557
1558         Some cross-language scripting bridges use the presence of -(int)count to determine
1559         whether to treat objects as sequence-like.  All WebScriptObject's exposed this method
1560         which lead to non-collection WebScriptObject's being mishandled by PyObjC.  We now
1561         expose -count only when the object we wrap looks like a collection from a JavaScript
1562         point of view (eg, it has a length property).
1563
1564         * bindings/objc/WebScriptObject.mm:
1565         (-[WebScriptObject _shouldRespondToCount]):
1566         (-[WebScriptObject methodForSelector:]):
1567         (-[WebScriptObject respondsToSelector:]):
1568         (-[WebScriptObject _count]):
1569         * bindings/objc/WebScriptObjectPrivate.h:
1570
1571 2007-03-20  Darin Adler  <darin@apple.com>
1572
1573         * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent):
1574         Fix obvious typo in the change from last night -- forgot to assign to the variable.
1575
1576 2007-03-20  Dave Hyatt  <hyatt@apple.com>
1577
1578         Refactor fonts a bit for portability.
1579        
1580         Reviewed by aroben
1581
1582         * platform/Font.cpp:
1583         (WebCore::Font::drawSimpleText):
1584         (WebCore::Font::drawGlyphBuffer):
1585         (WebCore::Font::floatWidthForSimpleText):
1586         * platform/Font.h:
1587         * platform/FontData.h:
1588         (WebCore::FontData::isSystemFont):
1589         (WebCore::FontData::scriptCache):
1590         * platform/GlyphBuffer.h:
1591         (WebCore::GlyphBuffer::add):
1592
1593 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
1594
1595         Reviewed by Adam.
1596
1597         Stub out a couple of CFNetwork backend functions.
1598         
1599         * platform/network/ResourceHandle.h:
1600
1601 2007-03-19  Oliver Hunt  <oliver@apple.com>
1602
1603         Reviewed by Ada.
1604
1605         Protect against possibility of JS detaching a frame (and losing its view)
1606         midway through a mouse move.
1607
1608         * page/EventHandler.cpp:
1609         (WebCore::EventHandler::handleMouseMoveEvent):
1610
1611 2007-03-19  Alexey Proskuryakov  <ap@webkit.org>
1612
1613         Reviewed by Darin.
1614
1615         http://bugs.webkit.org/show_bug.cgi?id=13107
1616         XPath should raise an exception when trying to parse an unknown function
1617
1618         Test: fast/xpath/invalid-functions.html
1619
1620         * xml/XPathFunctions.cpp:
1621         (WebCore::XPath::createFunction): Return 0 if the function couldn't be created.
1622         * xml/XPathGrammar.y: Handle nulls returned from createFunction().
1623
1624 2007-03-19  Adele Peterson  <adele@apple.com>
1625
1626         Reviewed by Beth.
1627
1628         Fix for http://bugs.webkit.org/show_bug.cgi?id=13087
1629         <rdar://problem/5064316> REGRESSION: Allow setting the checked attribute in js and in markup for unnamed radio buttons (dominos.com)
1630
1631         Test: fast/forms/radio_checked_name.html
1632
1633         We were matching a WinIE quirk that does not allow a user to check and uncheck an unnamed radio button.  But they still
1634         allow the checked attribute to be set in html, and changed in javascript.  So this change matches that behavior.
1635
1636         * html/HTMLInputElement.cpp:
1637         (WebCore::HTMLInputElement::parseMappedAttribute): We no longer need a special call to setChecked when parsing the name
1638          attribute, since we setChecked will now work with unnamed radio buttons.
1639         (WebCore::HTMLInputElement::preDispatchEventHandler): Added comment.
1640         (WebCore::HTMLInputElement::setChecked): Don't check for the unnamed radio button case here.
1641         (WebCore::HTMLInputElement::postDispatchEventHandler): Don't call setChecked for unnamed radio buttons.
1642         (WebCore::HTMLInputElement::defaultEventHandler): ditto.
1643
1644 2007-03-19  Adam Roben  <aroben@apple.com>
1645
1646         Rubberstamped by Oliver.
1647
1648         * bridge/JavaScriptStatistics.cpp: Added missing header for
1649         correctness.
1650
1651 2007-03-19  Andrew Wellington  <proton@wiretapped.net>
1652
1653         Reviewed by Maciej.
1654
1655         Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1656
1657         * WebCore.xcodeproj/project.pbxproj:
1658
1659 2007-03-19  Justin Garcia  <justin.garcia@apple.com>
1660
1661         Reviewed by darin
1662         
1663         <rdar://problem/5071074> 
1664         REGRESSION: Links that aren't fully selected copy and paste as only text
1665         
1666         We stopped adding markup for all commonAncestorBlocks
1667         and the ancestors of lastClosed up to them because it 
1668         was adding a lot of unnecessary markup.
1669
1670         * editing/markup.cpp:
1671         (WebCore::createMarkup): Also include markup for nodes
1672         up to an enclosing anchor.  Cleaned up the code for
1673         including special common ancestors a bit.
1674
1675 2007-03-19  Nikolas Zimmermann  <zimmermann@kde.org>
1676
1677         Reviewed by Lars Knoll.
1678
1679         Fix crash when opening a SVG document which contains SVG elements, but no <svg> root element.
1680         Moving the mouse was crashing WebKit. Fixes svg/hixie/dynamic/006.xml.
1681
1682         * rendering/RenderObject.cpp:
1683         (WebCore::RenderObject::updateHitTestResult):
1684
1685 2007-03-19  Mitz Pettel  <mitz@webkit.org>
1686
1687         Reviewed by Hyatt.
1688
1689         - fix http://bugs.webkit.org/show_bug.cgi?id=13117
1690         REGRESSION (r14658): Flickering text fields when updating via javascript
1691
1692         * page/Frame.cpp:
1693         (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
1694         * page/Frame.h:
1695         * page/mac/WebCoreFrameBridge.mm:
1696         (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
1697         if not adjusting view size.
1698         (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
1699         layout instead of just whether the root needs layout.
1700
1701 2007-03-18  Nikolas Zimmermann  <zimmermann@kde.org>
1702
1703         Reviewed by Maciej.
1704
1705         Make JS function calls on POD-types (ie. SVGLength) take effect.
1706         Calling ie. newValueInSpecifiedUnits on SVGLength works as expected.
1707
1708         This worked fine before we switched to SVGLength POD type, so this
1709         can be considered as P1 regression fix.
1710
1711         Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though
1712         it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString
1713         doesn't work as expected - needs a seperated fix.
1714
1715         * bindings/scripts/CodeGeneratorJS.pm:
1716
1717 2007-03-19  Adele Peterson  <adele@apple.com>
1718
1719         Reviewed by Adam.
1720
1721         Adding comments and a little cleanup from my last checkin.
1722
1723         * html/HTMLSelectElement.cpp:
1724         (WebCore::HTMLSelectElement::setSelectedIndex): Removed commented out assert.  Added comment about how we use onChange.
1725         (WebCore::HTMLSelectElement::selectAll): Added comment about how we use saveLastSelection and onChange.
1726         (WebCore::HTMLSelectElement::dispatchFocusEvent): ditto.
1727         (WebCore::HTMLSelectElement::dispatchBlurEvent): ditto.
1728         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): ditto.
1729         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): ditto.
1730         (WebCore::HTMLSelectElement::menuListOnChange): Added assert that usesMenuList() is true.
1731         (WebCore::HTMLSelectElement::listBoxOnChange): Added assert that usesMenuList() is false.
1732         (WebCore::HTMLSelectElement::saveLastSelection): Added early return for menu lists.
1733
1734 2007-03-19  Mitz Pettel  <mitz@webkit.org>
1735
1736         Reviewed by Tim Hatcher.
1737
1738         - fix http://bugs.webkit.org/show_bug.cgi?id=13091
1739           REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
1740
1741         Test: fast/innerHTML/additional-inline-style.html
1742
1743         * editing/markup.cpp:
1744         (WebCore::startMarkup): Changed to add inline style based on CSS rules only
1745         in AnnotateForInterchange mode.
1746
1747 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
1748
1749         Compile fix.
1750
1751         * platform/qt/ScrollViewQt.cpp:
1752         (WebCore::ScrollView::update):
1753
1754 2007-03-19  Adam Roben  <aroben@apple.com>
1755
1756         Reviewed by Hyatt and Maciej.
1757
1758         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
1759         part of <rdar://problem/5071653>.
1760
1761         All layout tests pass.
1762
1763         * WebCore.exp: Updated.
1764         * WebCore.xcodeproj/project.pbxproj: Updated.
1765         * bridge/JavaScriptStatistics.cpp: Moved from
1766         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
1767         (WebCore::collect):
1768         (WebCore::JavaScriptStatistics::objectCount):
1769         (WebCore::JavaScriptStatistics::interpreterCount):
1770         (WebCore::JavaScriptStatistics::protectedObjectCount):
1771         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
1772         (WebCore::JavaScriptStatistics::garbageCollect):
1773         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
1774         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
1775         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
1776         * bridge/JavaScriptStatistics.h: Added.
1777         * bridge/mac/WebCoreJavaScript.h: Removed.
1778         * bridge/mac/WebCoreJavaScript.mm: Removed.
1779
1780 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
1781
1782         Reviewed by Mark.
1783
1784         - avoid static construction (and global variable access) in a smarter, more portable way,
1785         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
1786         
1787         * bindings/js/JSCustomXPathNSResolver.cpp:
1788         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1789         * bindings/js/JSHTMLInputElementBase.cpp:
1790         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
1791         * bindings/js/JSHTMLOptionElementConstructor.cpp:
1792         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
1793         * bindings/js/JSXMLHttpRequest.cpp:
1794         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
1795         * bindings/js/JSXSLTProcessor.cpp:
1796         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
1797         * bindings/js/kjs_dom.cpp:
1798         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
1799         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
1800         * bindings/js/kjs_events.cpp:
1801         (KJS::JSAbstractEventListener::handleEvent):
1802         * bindings/js/kjs_html.cpp:
1803         (KJS::HTMLElementFunction::HTMLElementFunction):
1804         (KJS::JSHTMLCollection::getOwnPropertySlot):
1805         * bindings/js/kjs_window.cpp:
1806         (KJS::ScheduledAction::execute):
1807         * bindings/objc/WebScriptObject.mm:
1808         * bindings/scripts/CodeGeneratorJS.pm:
1809
1810 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
1811
1812         Reviewed by Mark Rowe
1813
1814         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
1815
1816         * WebCore.xcodeproj/project.pbxproj:
1817
1818 2007-03-18  David Hyatt  <hyatt@apple.com>
1819
1820         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
1821         and resizing to be more like other browsers.
1822
1823         Reviewed by ggaren
1824
1825         fast/frames/no-frame-borders.html
1826
1827         * html/HTMLFrameElement.cpp:
1828         (WebCore::HTMLFrameElement::HTMLFrameElement):
1829         (WebCore::HTMLFrameElement::attach):
1830         (WebCore::HTMLFrameElement::parseMappedAttribute):
1831         * html/HTMLFrameElement.h:
1832         (WebCore::HTMLFrameElement::hasFrameBorder):
1833         * html/HTMLFrameElementBase.cpp:
1834         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
1835         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
1836         * html/HTMLFrameElementBase.h:
1837         * html/HTMLFrameSetElement.cpp:
1838         (WebCore::HTMLFrameSetElement::attach):
1839         * html/HTMLFrameSetElement.h:
1840         (WebCore::HTMLFrameSetElement::hasFrameBorder):
1841         * html/HTMLIFrameElement.cpp:
1842         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
1843         * rendering/RenderFrame.cpp:
1844         (WebCore::RenderFrame::edgeInfo):
1845         * rendering/RenderFrame.h:
1846         * rendering/RenderFrameSet.cpp:
1847         (WebCore::RenderFrameSet::paint):
1848         (WebCore::RenderFrameSet::GridAxis::resize):
1849         (WebCore::RenderFrameSet::fillFromEdgeInfo):
1850         (WebCore::RenderFrameSet::computeEdgeInfo):
1851         (WebCore::RenderFrameSet::edgeInfo):
1852         (WebCore::RenderFrameSet::layout):
1853         (WebCore::RenderFrameSet::startResizing):
1854         (WebCore::RenderFrameSet::continueResizing):
1855         (WebCore::RenderFrameSet::canResizeRow):
1856         (WebCore::RenderFrameSet::canResizeColumn):
1857         (WebCore::RenderFrameSet::splitPosition):
1858         (WebCore::RenderFrameSet::hitTestSplit):
1859         (WebCore::RenderFrameSet::dump):
1860         * rendering/RenderFrameSet.h:
1861         (WebCore::):
1862         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
1863         (WebCore::FrameEdgeInfo::preventResize):
1864         (WebCore::FrameEdgeInfo::allowBorder):
1865         (WebCore::FrameEdgeInfo::setPreventResize):
1866         (WebCore::FrameEdgeInfo::setAllowBorder):
1867
1868 2007-03-19  Mark Rowe  <mrowe@apple.com>
1869
1870         Rubber-stamped by Brady.
1871
1872         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
1873
1874         * ChangeLog:
1875         * WebCore.vcproj/WebCore/build-generated-files.sh:
1876         * manual-tests/ATSU-bad-layout.html:
1877         * manual-tests/accidental-strict-mode.html:
1878         * manual-tests/applet-param-no-name.html:
1879         * manual-tests/bidi-parens.html:
1880         * manual-tests/bugzilla-3855.html:
1881         * manual-tests/bugzilla-4840.html:
1882         * manual-tests/bugzilla-6821.html:
1883         * manual-tests/containing-block-position-chage.html:
1884         * manual-tests/contenteditable-link.html:
1885         * manual-tests/css3-cursor-fallback-quirks.html:
1886         * manual-tests/css3-cursor-fallback-strict.html:
1887         * manual-tests/custom-cursors.html:
1888         * manual-tests/dictionary-scrolled-iframe.html:
1889         * manual-tests/dom-manipulation-on-resize.html:
1890         * manual-tests/drag-image-to-address-bar.html:
1891         * manual-tests/empty-link-target.html:
1892         * manual-tests/empty-title-popup.html:
1893         * manual-tests/first-line-style-crash.html:
1894         * manual-tests/invalid-mouse-event.html:
1895         * manual-tests/left-overflow-repaint.html:
1896         * manual-tests/linkjump-3.html:
1897         * manual-tests/log-keypress-events.html:
1898         * manual-tests/named-window-blank-target.html:
1899         * manual-tests/plain-text-paste.html:
1900         * manual-tests/plugin-controller-datasource.html:
1901         * manual-tests/pre-tab-selection-rect.html:
1902         * manual-tests/redirection-target.html:
1903         * manual-tests/redraw-page-cache-visited-links.html:
1904         * manual-tests/reset-initiatedDrag.html:
1905         * manual-tests/resources/named-window-blank-target-step2.html:
1906         * manual-tests/resources/named-window-blank-target-step3.html:
1907         * manual-tests/resources/named-window-blank-target-step4.html:
1908         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
1909         * manual-tests/scrollbar-hittest.html:
1910         * manual-tests/scrollbar-hittest2.html:
1911         * manual-tests/subview-click-assertion.html:
1912         * manual-tests/tabbing-input-google.html:
1913         * manual-tests/text-field-autoscroll.html:
1914         * manual-tests/textarea-after-stylesheet-link.html:
1915         * manual-tests/textarea-focus.html:
1916         * manual-tests/whitespace-pre-affinity.html:
1917
1918 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1919
1920         Not reviewed - gdk build fix.
1921
1922         * platform/gdk/ScrollViewGdk.cpp:
1923         (WebCore::ScrollView::update): add a stub
1924
1925 2007-03-18  Brady Eidson  <beidson@apple.com>
1926
1927         Reviewed by Hyatt
1928
1929         http://bugs.webkit.org/show_bug.cgi?id=13111
1930         When stopped a load before it completes, partial images become the 
1931         broken image icon
1932
1933         * loader/loader.cpp:
1934         (WebCore::Loader::didFail): Split off into a method that knows the 
1935           difference between failed and cancelled.  If a load is cancelled,
1936           don't call error() on the object - only remove it from the cache
1937         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
1938         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
1939
1940 2007-03-18  Mitz Pettel  <mitz@webkit.org>
1941
1942         Reviewed by Adele.
1943
1944         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
1945           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
1946
1947         Test: fast/forms/input-text-word-wrap.html
1948
1949         * rendering/RenderTextControl.cpp:
1950         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
1951         'word-wrap:normal'.
1952
1953 2007-03-18  Dan Waylonis  <waylonis@mac.com>
1954
1955         Reviewed by Tim Hatcher.
1956
1957         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
1958         Bug 13005: WebScriptObject +throwException needs NULL check.
1959
1960         Add checking for NULL interpreter before throwing exception.
1961
1962         * bindings/objc/WebScriptObject.mm:
1963         (+[WebScriptObject throwException:]):
1964
1965 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
1966
1967         Reviewed by Oliver Hunt.
1968         
1969         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
1970         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
1971         (Style Change Through JavaScript Blanks Content)
1972         
1973         When indexing into collections, treat the empty string as an invalid argument,
1974         instead of the number 0.
1975
1976         * bindings/js/kjs_html.cpp:
1977         (KJS::JSHTMLCollection::getOwnPropertySlot):
1978         (KJS::JSHTMLCollection::callAsFunction):
1979         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
1980
1981 2007-03-18  David Hyatt  <hyatt@apple.com>
1982
1983         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
1984
1985         Reviewed by aroben
1986
1987         * platform/graphics/IntRect.h:
1988         * rendering/RenderFrameSet.cpp:
1989         (WebCore::RenderFrameSet::paintColumnBorder):
1990         (WebCore::RenderFrameSet::paintRowBorder):
1991
1992 2007-03-18  David Hyatt  <hyatt@apple.com>
1993
1994         Change the frameborder color to be light gray for framesets.
1995
1996         Reviewed by aroben
1997
1998         * rendering/RenderFrameSet.cpp:
1999         (WebCore::borderFillColor):
2000         (WebCore::RenderFrameSet::paintColumnBorder):
2001         (WebCore::RenderFrameSet::paintRowBorder):
2002
2003 2007-03-18  David Hyatt  <hyatt@apple.com>
2004
2005         Make iframes work properly with frameborder="0".
2006
2007         Reviewed by aroben
2008
2009         * html/HTMLIFrameElement.cpp:
2010         (WebCore::HTMLIFrameElement::mapToEntry):
2011         (WebCore::HTMLIFrameElement::parseMappedAttribute):
2012
2013 2007-03-18  David Hyatt  <hyatt@apple.com>
2014
2015         Add a 2px border by default to <iframe>s for compatibility with other browsers.
2016
2017         Reviewed by aroben
2018
2019         * css/html4.css:
2020
2021 2007-03-18  David Hyatt  <hyatt@apple.com>
2022
2023         Move frame borders out of WebKit and into WebCore.
2024
2025         Reviewed by aroben, olliej
2026
2027         * bridge/mac/FrameViewMac.mm:
2028         * css/html4.css:
2029         * html/HTMLFrameSetElement.cpp:
2030         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
2031         (WebCore::HTMLFrameSetElement::mapToEntry):
2032         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
2033         (WebCore::HTMLFrameSetElement::attach):
2034         * html/HTMLFrameSetElement.h:
2035         (WebCore::HTMLFrameSetElement::hasBorderColor):
2036         * page/FrameView.cpp:
2037         (WebCore::FrameViewPrivate::FrameViewPrivate):
2038         * page/FrameView.h:
2039         * page/mac/WebCoreFrameBridge.h:
2040         * platform/graphics/IntRect.h:
2041         (WebCore::IntRect::topLeft):
2042         (WebCore::IntRect::topRight):
2043         (WebCore::IntRect::bottomLeft):
2044         (WebCore::IntRect::bottomRight):
2045         * rendering/RenderFrame.cpp:
2046         (WebCore::RenderFrame::viewCleared):
2047         * rendering/RenderFrameSet.cpp:
2048         (WebCore::borderStartEdgeColor):
2049         (WebCore::borderEndEdgeColor):
2050         (WebCore::RenderFrameSet::paintColumnBorder):
2051         (WebCore::RenderFrameSet::paintRowBorder):
2052         (WebCore::RenderFrameSet::paint):
2053         * rendering/RenderFrameSet.h:
2054         * rendering/RenderPartObject.cpp:
2055         (WebCore::RenderPartObject::viewCleared):
2056         * rendering/RenderView.cpp:
2057         (WebCore::RenderView::repaintViewRectangle):
2058
2059 2007-03-17  David Hyatt  <hyatt@apple.com>
2060
2061         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
2062         happens before any timers set by the onload can fire).
2063
2064         Reviewed by aroben
2065
2066         * dom/Document.cpp:
2067         (WebCore::Document::implicitClose):
2068         * platform/ScrollView.h:
2069         * platform/mac/ScrollViewMac.mm:
2070         (WebCore::ScrollView::update):
2071
2072 2007-03-17  Dave Hyatt  <hyatt@apple.com>
2073
2074         Prevent starvation of user input and painting when processing timers.
2075         If we are already in the processing of a custom timer message, don't allow that
2076         processing to do another PostMessage.  Force SetTimer to be used instead.
2077       
2078         Reviewed by ggaren
2079
2080        * platform/win/SharedTimerWin.cpp:
2081         (WebCore::TimerWindowWndProc):
2082         (WebCore::setSharedTimerFireTime):
2083
2084 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
2085
2086         Reviewed by Beth Dakin.
2087
2088         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
2089         closing View Source window
2090         
2091         I award myself 0 points, and may God have mercy on my soul.
2092
2093         * bindings/js/kjs_proxy.cpp:
2094         (WebCore::KJSProxy::~KJSProxy):
2095
2096 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2097
2098         Not reviewed - gdk build fix.
2099
2100         * platform/gdk/TemporaryLinkStubs.cpp:
2101         (Pasteboard::writeURL):
2102
2103 2007-03-17  David Hyatt  <hyatt@apple.com>
2104
2105         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
2106         unless we actually have a border/background.
2107
2108         Reviewed by Brady
2109
2110         * rendering/RenderImage.cpp:
2111         (WebCore::RenderImage::imageChanged):
2112
2113 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
2114
2115         Reviewed by Sam Weinig.
2116
2117         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
2118         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
2119         Added test: svg/custom/use-css-events.svg
2120
2121         In general this fixes the peepo.co.uk website.
2122
2123         Forgot to pass the actual StyleChange to the recalcStyle() function,
2124         when calling it on the shadow tree root element.
2125
2126         * ksvg2/svg/SVGUseElement.cpp:
2127         (WebCore::SVGUseElement::recalcStyle):
2128
2129 2007-03-17  Timothy Hatcher  <timothy@apple.com>
2130
2131         Reviewed by Mark Rowe.
2132
2133         Made Version.xcconfig smarter when building for different configurations.
2134         Now uses the 522+ OpenSource version for Debug and Release, while using the
2135         full 522.4 version for Production builds. The system prefix is also computed
2136         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
2137
2138         * Configurations/Version.xcconfig:
2139         * Configurations/WebCore.xcconfig:
2140
2141 2007-03-17  Antti Koivisto  <antti@apple.com>
2142
2143         Reviewed by Adele.
2144
2145         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
2146         REGRESSION: Can't add item to cart at lnt.com (JS type error)
2147         <rdar://problem/4722863>
2148         
2149         Emulate Firefox behavior where form elements accessed by a name
2150         can be accessed with that name later even if the name changes or
2151         even if element is removed from the document.
2152         
2153         This is loosely based on Darin's earlier patch for the same problem but
2154         is much less expansive. It takes somewhat different approach to more closely
2155         mimic Firefox behavior. Includes expanded test case.
2156
2157         * bindings/js/JSHTMLFormElementCustom.cpp:
2158         (WebCore::JSHTMLFormElement::canGetItemsForName):
2159             Use new the HTMLFormElement::getNamedElements() method
2160         (WebCore::JSHTMLFormElement::nameGetter):
2161             Use new the HTMLFormElement::getNamedElements() method
2162         * html/HTMLFormElement.cpp:
2163         (WebCore::HTMLFormElement::HTMLFormElement):
2164         (WebCore::HTMLFormElement::~HTMLFormElement):
2165         (WebCore::HTMLFormElement::elementForAlias):
2166         (WebCore::HTMLFormElement::addElementAlias):
2167             Maintain a map of known element aliases
2168         (WebCore::HTMLFormElement::getNamedElements):
2169             Get a list of elements matching the name, based both their
2170             current names and known aliases (earlier names).
2171             Keep the alias list in sync.
2172         * html/HTMLFormElement.h:
2173
2174 2007-03-17  Adele Peterson  <adele@apple.com>
2175
2176         Reviewed by Hyatt.
2177
2178         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
2179         http://bugs.webkit.org/show_bug.cgi?id=12725
2180
2181         Test: updated fast/forms/listbox-onchange.html
2182
2183         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
2184         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
2185         they just have to be up-to-date before we execute an action that may trigger onChange.
2186
2187         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
2188           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
2189           that notifyOptionSelected won't get called when the call originates from the select element.
2190         * html/HTMLOptionElement.h:
2191
2192         * html/HTMLSelectElement.cpp:
2193         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
2194         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
2195          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
2196          the HTMLSelectElement.
2197         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
2198         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
2199         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
2200         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
2201          since it will get saved before we call onChange.
2202         (WebCore::HTMLSelectElement::reset): ditto.
2203         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
2204          on blur.
2205         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
2206         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
2207         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
2208          onchange during mouseup, or after autoscroll).
2209         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
2210
2211         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
2212         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
2213         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
2214         * html/HTMLSelectElement.h:
2215         * platform/PopupMenu.h:
2216
2217 2007-03-16  Oliver Hunt  <oliver@apple.com>
2218
2219         Reviewed by Hyatt.
2220
2221         The old canSaveAsWebArchive call was necessary as stand alone
2222         images used to be rendered by ImageDocument.
2223
2224         Fixes rdar://problem/5061252
2225
2226         * dom/Clipboard.cpp:
2227         * dom/Clipboard.h:
2228         (WebCore::Clipboard::setDragHasStarted):
2229         * page/DragClient.h:
2230         (WebCore::DragClient::declareAndWriteDragImage):
2231         * platform/mac/ClipboardMac.mm:
2232         (WebCore::ClipboardMac::declareAndWriteDragImage):
2233
2234 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
2235
2236         Reviewed by Maciej.
2237
2238         <rdar://problem/4869095>
2239         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
2240         
2241         * xml/xmlhttprequest.cpp:
2242         (WebCore::XMLHttpRequest::send):
2243
2244 2007-03-16  Brady Eidson  <beidson@apple.com>
2245
2246         Rubberstamped by Tim Hatcher
2247
2248         Update the hash table header for Window object properties
2249
2250         * bindings/js/kjs_window.cpp:
2251
2252 2007-03-16  Brady Eidson  <beidson@apple.com>
2253
2254         Reviewed by Anders
2255
2256         <rdar://problem/5061826> and
2257         http://bugs.webkit.org/show_bug.cgi?id=12863
2258         Implement window.stop()
2259
2260         * bindings/js/kjs_window.cpp:
2261         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
2262         * bindings/js/kjs_window.h:
2263         (KJS::Window::): Add "Stop"
2264
2265 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
2266
2267         Reviewed by Brady Eidson.
2268
2269         Fixed dir creation to account for already existing dirs and missing leading
2270         dirs in path.
2271         
2272         * loader/icon/IconDatabase.cpp:
2273         (WebCore::makeAllDirectories):
2274
2275 2007-03-16  David Hyatt  <hyatt@apple.com>
2276
2277         Fix for 13084, assertion failure in the Cache.  Convert the client list
2278         to a HashCountedSet so that multiple refs and derefs are allowed.
2279
2280         Fix RenderImage so that if it has the same image used as a background/border
2281         and as the foreground that it will repaint properly (can be tested using
2282         border-image and a foreground image).
2283
2284         Optimize list marker so that it doesn't waste time in the base class method,
2285         since list markers don't support background or border images.
2286
2287         Reviewed by andersca
2288
2289         * ChangeLog:
2290         * loader/CachedResource.cpp:
2291         (WebCore::CachedResource::ref):
2292         * loader/CachedResource.h:
2293         * loader/CachedResourceClientWalker.cpp:
2294         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
2295         * loader/CachedResourceClientWalker.h:
2296         * rendering/RenderImage.cpp:
2297         (WebCore::RenderImage::imageChanged):
2298         * rendering/RenderListMarker.cpp:
2299         (WebCore::RenderListMarker::imageChanged):
2300
2301 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
2302
2303         Reviewed by Anders Carlsson.
2304         
2305         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
2306         seen on buildbot
2307
2308         The problem was that we were initializing the same WebScriptObject twice.
2309         This caused it to leak its original set of ivars.
2310         
2311         I think some refactoring could prevent this situation from arising in the
2312         first place, but I'm just adding a check at the call site for now, to do 
2313         the simplest thing.
2314
2315         * bindings/objc/WebScriptObject.mm:
2316         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
2317         against multiple calls.
2318
2319         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
2320         to setImp because "init" vs "initialize" was a too subtle indication that
2321         one was a Cocoa initializer and one was not.
2322
2323 2007-03-16  Lars Knoll <lars@trolltech.com>
2324
2325         don't use #import in .cpp files.
2326
2327         * editing/qt/EditorQt.cpp:
2328
2329 2007-03-16  Lars Knoll <lars@trolltech.com>
2330
2331         Fix the Qt build once again.
2332
2333         * platform/qt/PasteboardQt.cpp:
2334         (WebCore::Pasteboard::Pasteboard):
2335         (WebCore::Pasteboard::writeSelection):
2336         (WebCore::Pasteboard::plainText):
2337         (WebCore::Pasteboard::documentFragment):
2338         (WebCore::Pasteboard::writeURL):
2339         (WebCore::Pasteboard::writeImage):
2340         (WebCore::Pasteboard::clear):
2341
2342 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
2343
2344         Gdk build fix.
2345
2346         * loader/gdk/FrameLoaderClientGdk.cpp:
2347         (WebCore::FrameLoaderClientGdk::blockedError):
2348         * loader/gdk/FrameLoaderClientGdk.h:
2349
2350 2007-03-15  Beth Dakin  <bdakin@apple.com>
2351
2352         Reviewed by Geoff.
2353
2354         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
2355         (r19761-19779): Copy image no longer includes image address 
2356         (rdar://5067927)
2357
2358         writeURL() does not need an isImage parameter. Now that it accepts 
2359         the types as a parameter, we can just declare the appropriate image 
2360         types within writeImage and send them to writeURL(). Also, 
2361         declaring the types twice is what broke this.
2362
2363         * platform/Pasteboard.h:
2364         * platform/mac/PasteboardMac.mm:
2365         (WebCore::Pasteboard::writeURL):
2366         (WebCore::Pasteboard::writeImage):
2367
2368 2007-03-15  Adele Peterson  <adele@apple.com>
2369
2370         Reviewed by Kevin Decker.
2371
2372         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
2373
2374         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2375           Only setTextFromOption if the menu isn't visible.
2376
2377 2007-03-15  Brady Eidson  <beidson@apple.com>
2378
2379         Reviewed by Oliver
2380
2381         A few platform specific tweaks
2382
2383         * platform/cf/RetainPtr.h:
2384         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
2385         
2386         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
2387
2388 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
2389
2390         Reviewed by Geoff and Steve.
2391
2392         * config.h: Remove unneeded hack.
2393
2394 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
2395
2396         Reviewed by john
2397         
2398         <rdar://problem/5062376> 
2399         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
2400         
2401         Bring back the remove step in applyBlockStyle.  It's 
2402         necessary because addBlockStyleIfNeeded assumes that 
2403         the properties it adds aren't already on the block that 
2404         it adds them to.
2405
2406         * editing/ApplyStyleCommand.cpp:
2407         (WebCore::ApplyStyleCommand::applyBlockStyle): 
2408         Bring back the remove step (added a testcase).
2409         Don't do the add step if m_removeOnly is true (no testcase
2410         because there aren't any clients using removeOnly functionality
2411         to remove styles yet, only styled elemets).
2412         Moved the code for creating new blocks up one level
2413         to this function so that we can pass blocks to removeCSSStyle.
2414         When converting VisiblePositions to indices and vice versa,
2415         use the highest node in the shadow tree if we're in one as
2416         the scope (working on a testcase).
2417         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
2418         applyBlockStyle.
2419         * editing/ApplyStyleCommand.h: 
2420
2421 2007-03-15  Brady Eidson  <beidson@apple.com>
2422
2423         Reviewed by Maciej
2424
2425         <rdar://problem/4429701>
2426         Implements a port blocking black list that matches Firefox's
2427
2428         * loader/FrameLoader.cpp:
2429         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
2430         * loader/FrameLoader.h:
2431
2432         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
2433
2434         * loader/ResourceLoader.cpp:
2435         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
2436         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
2437           error to fail with for the didFail() call
2438         * loader/ResourceLoader.h:
2439
2440         * platform/graphics/svg/SVGImageEmptyClients.h:
2441         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
2442
2443         * platform/network/ResourceHandle.cpp:
2444         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
2445           deferred failure on a timer
2446         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
2447         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
2448         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
2449         * platform/network/ResourceHandle.h:
2450         * platform/network/ResourceHandleClient.h:
2451         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
2452
2453 2007-03-15  Beth Dakin  <bdakin@apple.com>
2454
2455         Reviewed by Hyatt.
2456
2457         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
2458         RenderBlock::layoutInlineChildren seen on buildbot
2459
2460         This leak appeared after http://trac.webkit.org/projects/webkit/
2461         changeset/20188. This change shifted line boxes around in 
2462         removeChild(). But since removeChild() calls 
2463         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
2464         removed once we actually lay out anyway. So this patch fixes the 
2465         leak by deleting the line boxes instead of shifting them around. 
2466
2467         * editing/IndentOutdentCommand.cpp:
2468         (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
2469         updateLayout(). This fixes an assertion I got in editing/
2470         execCommand/4976800.html This is very similar to the line box fix I 
2471         made recently (http://trac.webkit.org/projects/webkit/changeset/
2472         20177). We need to update layout before relying on VisiblePositions 
2473         after removing a node.
2474         * rendering/RenderBlock.cpp:
2475         (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
2476         since this functionality is needed in three places now.
2477         (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
2478         deleteLinesForBlock().
2479         (WebCore::RenderBlock::removeChild): Same.
2480         * rendering/RenderBlock.h:
2481
2482 2007-03-15  Timothy Hatcher  <timothy@apple.com>
2483
2484         Reviewed by John.
2485
2486         * Factored out most of our common build settings into .xcconfig files. Anything that was common in
2487           each build configuration was factored out into the shared .xcconfig file.
2488         * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
2489         * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
2490         * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
2491
2492         * Configurations/Base.xcconfig: Added.
2493         * Configurations/DebugRelease.xcconfig: Added.
2494         * Configurations/Version.xcconfig: Added.
2495         * Configurations/WebCore.xcconfig: Added.
2496         * Info.plist:
2497         * WebCore.xcodeproj/project.pbxproj:
2498
2499 2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2500
2501         Not reviewed - gdk build fixes.
2502
2503         * platform/gdk/EditorClientGdk.cpp:
2504         (WebCore::EditorClientGdk::handleKeypress):
2505         * platform/graphics/cairo/ImageSourceCairo.cpp:
2506         (WebCore::ImageSource::setData):
2507         * platform/graphics/gdk/ImageGdk.cpp:
2508         (WebCore::Image::loadPlatformResource):
2509
2510 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
2511
2512         Reviewed by john
2513         
2514         ~2x speed up of 5k rich text paste:
2515         http://shakespeare.mit.edu/hamlet/full.html        
2516
2517         * editing/ReplaceSelectionCommand.cpp:
2518         (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
2519         level style span if it's unnecessary before inserting
2520         into the document, it's faster than doing it after.
2521         * editing/ReplaceSelectionCommand.h: Exposed 
2522         ReplacementFragment::removeNodePreservingChildren so that
2523         the style span can be removed using non-undoable removes,
2524         like the rest of the removes done on the ReplacementFragment.
2525         * editing/markup.cpp:
2526         (WebCore::createMarkup): Make the style span the top level
2527         element, otherwise it's useless.  This also facilitates the
2528         optimization mentioned above.
2529         When including markup for a fully selected root, include markup
2530         for all the nodes beneath that fully selected root, to preserve 
2531         the structure and appearance of the copied markup.  Did this
2532         by merging with the code for adding markup for descendants of
2533         special commonAncestorBlocks.
2534
2535 2007-03-15  Beth Dakin  <bdakin@apple.com>
2536
2537         Rubber-stamped by Adele.
2538
2539         Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
2540         (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
2541         and rdar://4722863) because it causes a horrible memory-trasher. 
2542
2543         * bindings/js/JSHTMLFormElementCustom.cpp:
2544         (WebCore::JSHTMLFormElement::canGetItemsForName):
2545         (WebCore::JSHTMLFormElement::nameGetter):
2546         * bindings/js/kjs_dom.cpp:
2547         (KJS::):
2548         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
2549         (KJS::DOMNamedNodesCollection::lengthGetter):
2550         (KJS::DOMNamedNodesCollection::indexGetter):
2551         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
2552         * bindings/js/kjs_dom.h:
2553         (KJS::DOMNamedNodesCollection::classInfo):
2554         * bindings/js/kjs_html.cpp:
2555         (KJS::JSHTMLCollection::getNamedItems):
2556         * dom/ChildNodeList.cpp:
2557         (WebCore::ChildNodeList::ChildNodeList):
2558         (WebCore::ChildNodeList::length):
2559         (WebCore::ChildNodeList::item):
2560         (WebCore::ChildNodeList::nodeMatches):
2561         * dom/ChildNodeList.h:
2562         * dom/NameNodeList.cpp:
2563         (WebCore::NameNodeList::NameNodeList):
2564         (WebCore::NameNodeList::item):
2565         (WebCore::NameNodeList::nodeMatches):
2566         * dom/NameNodeList.h:
2567         (WebCore::NameNodeList::rootNodeAttributeChanged):
2568         * dom/Node.cpp:
2569         (WebCore::TagNodeList::TagNodeList):
2570         (WebCore::TagNodeList::nodeMatches):
2571         (WebCore::Node::registerNodeList):
2572         (WebCore::Node::unregisterNodeList):
2573         * dom/Node.h:
2574         * dom/NodeList.cpp:
2575         (WebCore::NodeList::NodeList):
2576         (WebCore::NodeList::~NodeList):
2577         (WebCore::NodeList::recursiveLength):
2578         (WebCore::NodeList::itemForwardsFromCurrent):
2579         (WebCore::NodeList::itemBackwardsFromCurrent):
2580         (WebCore::NodeList::recursiveItem):
2581         (WebCore::NodeList::itemWithName):
2582         (WebCore::NodeList::rootNodeChildrenChanged):
2583         * dom/NodeList.h:
2584         (WebCore::NodeList::rootNodeAttributeChanged):
2585         * html/HTMLFormElement.cpp:
2586         (WebCore::HTMLFormElement::HTMLFormElement):
2587         (WebCore::HTMLFormElement::~HTMLFormElement):
2588         (WebCore::HTMLFormElement::formData):
2589         (WebCore::HTMLFormElement::parseMappedAttribute):
2590         (WebCore::HTMLFormElement::removeFormElement):
2591         * html/HTMLFormElement.h:
2592         * html/HTMLGenericFormElement.cpp:
2593         (WebCore::HTMLGenericFormElement::parseMappedAttribute):
2594         (WebCore::HTMLGenericFormElement::insertedIntoTree):
2595         * html/HTMLGenericFormElement.h:
2596         * html/HTMLInputElement.cpp:
2597         (WebCore::HTMLInputElement::parseMappedAttribute):
2598
2599 2007-03-15  Geoffrey Garen  <ggaren@apple.com>
2600
2601         Added an assert to help catch a bug. Hopefully someone will hit it!
2602         
2603         * bindings/js/kjs_proxy.cpp:
2604         (WebCore::KJSProxy::~KJSProxy):
2605
2606 2007-03-14  Oliver Hunt  <oliver@apple.com>
2607
2608         Reviewed by Adele.
2609
2610         Fix for rdar://problem/5061737.
2611         
2612         This was a regression from the original Objective-C -> C++ conversion
2613         for the drag logic.  We don't need to call Range::startNode as we just
2614         need the document that contains the range.   
2615
2616         * page/DragController.cpp:
2617         (WebCore::documentFragmentFromDragData):
2618
2619 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2620
2621         Reviewed by Hyatt.
2622
2623         - http://bugs.webkit.org/show_bug.cgi?id=13071
2624           REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
2625
2626         Test: fast/loader/text-document-wrapping.html
2627
2628         * loader/TextDocument.cpp:
2629         (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
2630
2631 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2632
2633         Reviewed by Hyatt.
2634
2635         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
2636           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
2637
2638         Test: fast/text/whitespace/pre-wrap-last-char.html
2639
2640         * rendering/bidi.cpp:
2641         (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.
2642
2643 2007-03-14  David Hyatt  <hyatt@apple.com>
2644
2645         Add asserts to help catch double refs and double derefs of CachedResources.
2646
2647         Reviewed by mjs
2648
2649         * loader/CachedResource.cpp:
2650         (WebCore::CachedResource::ref):
2651         (WebCore::CachedResource::deref):
2652
2653 2007-03-14  Alice Liu  <alice.liu@apple.com>
2654
2655         Rubber-stamped by Hyatt.
2656
2657         Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
2658
2659         * loader/icon/IconDataCache.cpp:
2660         (WebCore::IconDataCache::writeToDatabase):
2661
2662 === Safari-5522.4 ===
2663
2664 2007-03-14  Adele Peterson  <adele@apple.com>
2665
2666         Reviewed by Adam.
2667
2668         Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up
2669
2670         When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.
2671
2672         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):
2673
2674 2007-03-14  Steve Falkenburg  <sfalken@apple.com>
2675
2676         Reviewed by Adam.
2677
2678         Added missing null check in case this is called on a subframe
2679         that hasn't started loading.
2680
2681         * page/Frame.cpp:
2682         (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.
2683
2684 2007-03-14  Antti Koivisto  <antti@apple.com>
2685
2686         Reviewed by Geoff.
2687
2688         Fix http://bugs.webkit.org/show_bug.cgi?id=13060
2689         REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
2690         <rdar://5060208>
2691         
2692         Script evaluation may have dereffed the CachedScript object already, causing double deref and
2693         eventually m_liveResourcesSize underflow.
2694
2695         * html/HTMLScriptElement.cpp:
2696         (WebCore::HTMLScriptElement::notifyFinished):
2697
2698 2007-03-14  Adele Peterson  <adele@apple.com>
2699
2700         Reviewed by Darin.
2701
2702         Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
2703         Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
2704         the event is only used by the newly added commands.  But in the future, many (and possibly all) of
2705         these editing commands will need to consider the event so they are applied to the correct selection.
2706
2707         * WebCore.exp:
2708         * editing/Editor.cpp:
2709         (WebCore::execCopy):
2710         (WebCore::execCut):
2711         (WebCore::execDelete):
2712         (WebCore::execBackwardDelete):
2713         (WebCore::execForwardDelete):
2714         (WebCore::execMoveBackward):
2715         (WebCore::execMoveBackwardAndModifySelection):
2716         (WebCore::execMoveUpByPageAndModifyCaret):
2717         (WebCore::execMoveDown):
2718         (WebCore::execMoveDownAndModifySelection):
2719         (WebCore::execMoveForward):
2720         (WebCore::execMoveForwardAndModifySelection):
2721         (WebCore::execMoveDownByPageAndModifyCaret):
2722         (WebCore::execMoveLeft):
2723         (WebCore::execMoveLeftAndModifySelection):
2724         (WebCore::execMoveRight):
2725         (WebCore::execMoveRightAndModifySelection):
2726         (WebCore::execMoveToBeginningOfDocument):
2727         (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
2728         (WebCore::execMoveToBeginningOfSentence):
2729         (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
2730         (WebCore::execMoveToBeginningOfLine):
2731         (WebCore::execMoveToBeginningOfLineAndModifySelection):
2732         (WebCore::execMoveToBeginningOfParagraph):
2733         (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
2734         (WebCore::execMoveToEndOfDocument):
2735         (WebCore::execMoveToEndOfDocumentAndModifySelection):
2736         (WebCore::execMoveToEndOfSentence):
2737         (WebCore::execMoveToEndOfSentenceAndModifySelection):
2738         (WebCore::execMoveToEndOfLine):
2739         (WebCore::execMoveToEndOfLineAndModifySelection):
2740         (WebCore::execMoveToEndOfParagraph):
2741         (WebCore::execMoveToEndOfParagraphAndModifySelection):
2742         (WebCore::execMoveParagraphBackwardAndModifySelection):
2743         (WebCore::execMoveParagraphForwardAndModifySelection):
2744         (WebCore::execMoveUp):
2745         (WebCore::execMoveUpAndModifySelection):
2746         (WebCore::execMoveWordBackward):
2747         (WebCore::execMoveWordBackwardAndModifySelection):
2748         (WebCore::execMoveWordForward):
2749         (WebCore::execMoveWordForwardAndModifySelection):
2750         (WebCore::execMoveWordLeft):
2751         (WebCore::execMoveWordLeftAndModifySelection):
2752         (WebCore::execMoveWordRight):
2753         (WebCore::execMoveWordRightAndModifySelection):
2754         (WebCore::execPaste):
2755         (WebCore::execSelectAll):
2756         (WebCore::execToggleBold):
2757         (WebCore::execToggleItalic):
2758         (WebCore::execRedo):
2759         (WebCore::execUndo):
2760         (WebCore::execInsertTab):
2761         (WebCore::execInsertBacktab):
2762         (WebCore::execInsertNewline):
2763         (WebCore::execInsertLineBreak):
2764         (WebCore::enabled):
2765         (WebCore::canPaste):
2766         (WebCore::hasEditableSelection):
2767         (WebCore::hasEditableRangeSelection):
2768         (WebCore::hasRangeSelection):
2769         (WebCore::hasRichlyEditableSelection):
2770         (WebCore::canRedo):
2771         (WebCore::canUndo):
2772         (WebCore::CommandEntry::):
2773         (WebCore::Editor::toggleBold):
2774
2775         (WebCore::Editor::execCommand): Added optional event parameter.
2776         (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
2777         (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
2778          Performs the actual insertion without dispatching any event.
2779         * editing/Editor.h:
2780         * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
2781           Call insertTextWithoutSendingTextEvent.
2782
2783 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
2784
2785         Reviewed by darin
2786         
2787         ~3x speedup pasting 5k lines of rich text:
2788         http://shakespeare.mit.edu/hamlet/full.html
2789         ~2x speedup pasting 10k lines of plain text
2790         
2791         * css/CSSComputedStyleDeclaration.cpp:
2792         (WebCore::computedStyle): Added for convenience.
2793         * css/CSSComputedStyleDeclaration.h:
2794         * editing/ReplaceSelectionCommand.cpp:
2795         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
2796         The code that pushed down the top level style span had
2797         a bug in it that made it do unnecessary work.  Instead of
2798         fixing the bug I removed the code because it was used to 
2799         help see more redundancies in second level style spans, but 
2800         createMarkup now *only* creates a top level style span.
2801         Only remove redundant styles from style spans and only remove
2802         unstyled elements if they are style spans.  FF doesn't
2803         remove redundant styles from elements, or remove redundant 
2804         font tags on copy/paste.  We could offer this functionality 
2805         through a separate "cleanup" command.
2806         * editing/markup.cpp:
2807         (WebCore::createMarkup): Only add markup for ancestors of 
2808         lastClosed if we're including markup for acommonAncestorBlock 
2809         (we do this for commonAncestorBlocks like tables and lists),
2810         otherwise it's unnecessary/redundant.
2811
2812 2007-03-14  Anders Carlsson  <acarlsson@apple.com>
2813
2814         Reviewed by Ada.
2815
2816         Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
2817         data, since SubresourceLoaderClients now make use of that buffer.
2818         
2819         * loader/SubresourceLoader.cpp:
2820         (WebCore::SubresourceLoader::didReceiveData):
2821
2822 2007-03-14  Administrator  <acarlsson@apple.com>
2823
2824         Get the size from the shared buffer.
2825         
2826         * platform/graphics/cg/ImageSourceCG.cpp:
2827         (WebCore::ImageSource::setData):
2828         * platform/graphics/cg/PDFDocumentImage.cpp:
2829         (WebCore::PDFDocumentImage::dataChanged):
2830
2831 2007-03-14  Mitz Pettel  <mitz@webkit.org>
2832
2833         Reviewed by Hyatt, thumbs up by Darin.
2834
2835         - fix http://bugs.webkit.org/show_bug.cgi?id=12782
2836           Reproducible crash in BidiContext::deref
2837
2838         Test: fast/dynamic/anonymous-block-orphaned-lines.html
2839
2840         * rendering/InlineBox.cpp:
2841         (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
2842         * rendering/RenderBlock.cpp:
2843         (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
2844         anonymous blocks being destroyed instead of leaving them orphaned, which
2845         is what caused this crash. The boxes will be deleted on the next layout, but
2846         this ensures consistency in the mean time.
2847
2848 2007-03-14  Lars Knoll <lars@trolltech.com>
2849
2850         Reviewed by Antti.
2851
2852         Fix the Qt build.
2853         Add a getter to SharedBuffer that returns a reference to the internal
2854         Vector to avoid an extra copy of the data.
2855
2856         * platform/SharedBuffer.h:
2857         (WebCore::SharedBuffer::buffer):
2858         * platform/graphics/qt/ImageQt.cpp:
2859         (WebCore::Image::loadPlatformResource):
2860         * platform/graphics/qt/ImageSourceQt.cpp:
2861         (WebCore::detectImageFormat):
2862         (WebCore::createDecoder):
2863         (WebCore::ImageSource::setData):
2864
2865 2007-03-14  Antti Koivisto  <antti@apple.com>
2866
2867         Reviewed by Mitz.
2868         
2869         Fix <rdar://problem/5058774>
2870         REGRESSION: In Mail, caret appears oversized when typing in a To Do note
2871         
2872         Horizontal and vertical were switched. Was regression from
2873         http://trac.webkit.org/projects/webkit/changeset/20103
2874
2875         * rendering/RootInlineBox.cpp:
2876         (WebCore::RootInlineBox::addHighlightOverflow):
2877
2878 2007-03-14  David Hyatt  <hyatt@apple.com>
2879
2880         Tweak the data() functions of stylesheets and scripts to be internally consistent.
2881
2882         * loader/CachedCSSStyleSheet.cpp:
2883         (WebCore::CachedCSSStyleSheet::data):
2884         * loader/CachedScript.cpp:
2885         (WebCore::CachedScript::data):
2886         * loader/CachedXSLStyleSheet.cpp:
2887         (WebCore::CachedXSLStyleSheet::data):
2888
2889 2007-03-14  David Hyatt  <hyatt@apple.com>
2890
2891         Fix Radar 5050688.  
2892
2893         For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
2894         the memory consumption down while giant images are animating.
2895
2896         Reviewed by andersca
2897
2898         * platform/graphics/BitmapImage.cpp:
2899         (WebCore::BitmapImage::BitmapImage):
2900         (WebCore::BitmapImage::destroyDecodedData):
2901         (WebCore::BitmapImage::dataChanged):
2902         (WebCore::BitmapImage::advanceAnimation):
2903         * platform/graphics/BitmapImage.h:
2904
2905 2007-03-14  David Hyatt  <hyatt@apple.com>
2906
2907         Make sure to use CFDataCreateWithBytesNoCopy where we can.
2908
2909         Reviewed by andersca
2910
2911         * platform/graphics/cg/ImageSourceCG.cpp:
2912         (WebCore::ImageSource::setData):
2913         * platform/graphics/cg/PDFDocumentImage.cpp:
2914         (WebCore::PDFDocumentImage::dataChanged):
2915
2916 2007-03-13  David Hyatt  <hyatt@apple.com>
2917
2918         Fix for bugzilla bug 13050 and also radar p1 5050645.
2919
2920         This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
2921         images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
2922         database.
2923
2924         There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
2925         making their own.  Even ImageIO uses the SharedBuffer while decoding.
2926
2927         The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
2928         of 100mb.
2929
2930         Reviewed by olliej, mjs
2931
2932         * WebCore.exp:
2933         * loader/CachedCSSStyleSheet.cpp:
2934         (WebCore::CachedCSSStyleSheet::data):
2935         * loader/CachedCSSStyleSheet.h:
2936         * loader/CachedImage.cpp:
2937         (WebCore::CachedImage::data):
2938         * loader/CachedImage.h:
2939         * loader/CachedResource.cpp:
2940         (WebCore::CachedResource::CachedResource):
2941         (WebCore::CachedResource::~CachedResource):
2942         * loader/CachedResource.h:
2943         (WebCore::CachedResource::data):
2944         * loader/CachedScript.cpp:
2945         (WebCore::CachedScript::data):
2946         * loader/CachedScript.h:
2947         * loader/CachedXSLStyleSheet.cpp:
2948         (WebCore::CachedXSLStyleSheet::data):
2949         * loader/CachedXSLStyleSheet.h:
2950         * loader/DocLoader.cpp:
2951         (WebCore::DocLoader::checkCacheObjectStatus):
2952         * loader/ImageDocument.cpp:
2953         (WebCore::ImageTokenizer::writeRawData):
2954         (WebCore::ImageTokenizer::finish):
2955         * loader/icon/IconDataCache.cpp:
2956         (WebCore::IconDataCache::setImageData):
2957         (WebCore::IconDataCache::writeToDatabase):
2958         * loader/icon/IconDataCache.h:
2959         * loader/icon/IconDatabase.cpp:
2960         (WebCore::IconDatabase::imageDataForIconURL):
2961         (WebCore::IconDatabase::iconForPageURL):
2962         (WebCore::IconDatabase::setIconDataForIconURL):
2963         (WebCore::IconDatabase::setHaveNoIconForIconURL):
2964         (WebCore::IconDatabase::imageDataForIconURLQuery):
2965         * loader/icon/IconDatabase.h:
2966         * loader/icon/IconLoader.cpp:
2967         (WebCore::IconLoader::startLoading):
2968         (WebCore::IconLoader::didReceiveResponse):
2969         (WebCore::IconLoader::didReceiveData):
2970         (WebCore::IconLoader::didFail):
2971         (WebCore::IconLoader::finishLoading):
2972         (WebCore::IconLoader::clearLoadingState):
2973         * loader/icon/IconLoader.h:
2974         * loader/icon/SQLStatement.cpp:
2975         (WebCore::SQLStatement::getColumnBlobAsVector):
2976         (WebCore::SQLStatement::isExpired):
2977         * loader/icon/SQLStatement.h:
2978         * loader/loader.cpp:
2979         (WebCore::Loader::didFinishLoading):
2980         (WebCore::Loader::didReceiveData):
2981         * page/mac/WebCoreFrameBridge.mm:
2982         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2983         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
2984         * platform/SharedBuffer.h:
2985         (WebCore::SharedBuffer::isEmpty):
2986         * platform/graphics/BitmapImage.cpp:
2987         (WebCore::BitmapImage::destroyDecodedData):
2988         (WebCore::BitmapImage::dataChanged):
2989         * platform/graphics/BitmapImage.h:
2990         * platform/graphics/Image.cpp:
2991         (WebCore::Image::setData):
2992         * platform/graphics/Image.h:
2993         (WebCore::Image::dataChanged):
2994         (WebCore::Image::data):
2995         * platform/graphics/ImageSource.h:
2996         * platform/graphics/cg/ImageSourceCG.cpp:
2997         (WebCore::ImageSource::setData):
2998         * platform/graphics/cg/PDFDocumentImage.cpp:
2999         (WebCore::PDFDocumentImage::dataChanged):
3000         * platform/graphics/cg/PDFDocumentImage.h:
3001         * platform/graphics/mac/ImageMac.mm:
3002         (WebCore::Image::loadPlatformResource):
3003         * platform/graphics/svg/SVGImage.cpp:
3004         (WebCore::SVGImage::setData):
3005         * platform/mac/PasteboardMac.mm:
3006         (WebCore::fileWrapperForImage):
3007
3008 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
3009
3010         Reviewed by darin
3011         
3012         <rdar://problem/5046875> 
3013         Gmail Editor: Applying alignment to selected text in message also applies alignment to signature
3014
3015         * editing/ApplyStyleCommand.cpp:
3016         (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
3017         there is a block style to apply.
3018         (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
3019         It was unnecessary and removed properties from blocks that could contain 
3020         content outside the range being operated on (added a testcase).
3021         (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
3022         instead of if-nesting.
3023         * editing/ApplyStyleCommand.h:
3024         * editing/CompositeEditCommand.cpp:
3025         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
3026         Return the new block, if one was created.  Use moveParagraphs to move
3027         paragraphs into the new block, instead of moving nodes.  The old code moved
3028         too much (added a testcase).
3029         * editing/CompositeEditCommand.h:
3030
3031 2007-03-13  Oliver Hunt  <oliver@apple.com>
3032
3033         Reviewed by Brady.
3034
3035         To fix <rdar://problem/5044366> we now pass a NSString
3036         representation of the URL extracted with _web_originalDataAsString
3037         instead of relying on [NSURL absoluteString] in the bridge
3038
3039         * page/mac/WebCoreFrameBridge.h:
3040         * page/mac/WebCoreFrameBridge.mm:
3041         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
3042
3043 2007-03-13  Brady Eidson  <beidson@apple.com>
3044
3045         Reviewed by Anders
3046
3047         <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache
3048
3049         Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
3050         didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
3051         out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
3052         resources being cached.
3053         
3054         Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
3055         didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
3056         
3057         In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
3058         I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
3059         completely load.
3060
3061         Note that the layout test for this - if possible - will require other enhancements including possibly adding
3062         support for window.stop().  That task is documented in <rdar://problem/5061826>
3063
3064         * loader/FrameLoader.cpp:
3065         (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
3066           more perfectly restore the original behavior - including only caching HTML documents via the 
3067           m_client->canCachePage() call
3068         (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
3069           purpose
3070           - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
3071           cachability of a page
3072
3073         * loader/loader.cpp:
3074         (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
3075           loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.
3076
3077 2007-03-13  Beth Dakin  <bdakin@apple.com>
3078
3079         Rendering part reviewed by Hyatt. Editing part consulted with and 
3080         rubber stamped by Justin and Harrison.
3081
3082         Fix for <rdar://problem/5025925> A hang occurs in Safari when 
3083         attempting to print page at http://www.pcadvisor.co.uk
3084
3085         * rendering/RenderBlock.cpp:
3086         (WebCore::RenderBlock::makeChildrenNonInline): 
3087         RenderBlock::makeChildrenNonInline() takes a block's inline 
3088         children and turns them into block children. If the children had 
3089         line boxes, those boxes were being leaked. In the layout test I 
3090         added with the change (and at pcadvisor.co.uk during printing) 
3091         children were being made non-inline, and then they were being made 
3092         inline again. This meant that some of the children ended up 
3093         pointing to totally stale line boxes that are normally just leaked. 
3094         This caused an infinite loop in RenderFlow::destroy(). This patch 
3095         simply deletes everyone's line boxes in 
3096         RenderBlock::makeChildrenNonInline()
3097
3098         * editing/InsertParagraphSeparatorCommand.cpp:
3099         (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
3100         of this fix is that I added a call to updateLayout in 
3101         InsertParagraphSeparatorCommand::doApply(). One layout test 
3102         (editing/spelling/spelling.html) was changed by my patch to 
3103         RenderBlock. doApply() inserts a node into the render tree. In at 
3104         least one case in spelling.html, that caused some line boxes to be 
3105         deleted. Back in doApply() this meant that the RenderTree was out-
3106         of-date, and we mistakenly thought we were at the end of the 
3107         paragraph. This caused us to insert a RenderBR() at the end of the 
3108         tree instead of an empty RenderText(). No one seems to know exactly 
3109         why we insert either, or if the change is necessarily a problem. It 
3110         is clear, though, that the RenderTree in doApply() is out-of-date 
3111         after inserting the node and deleting some line boxes, so it seems 
3112         prudent to call into updateLayout().
3113
3114 2007-03-13  Adam Roben  <aroben@apple.com>
3115
3116         Reviewed by Anders.
3117
3118         * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.
3119
3120 2007-03-13  Beth Dakin  <bdakin@apple.com>
3121
3122         Reviewed by Maciej.
3123
3124         Export DocumentLoader::setFrame(). Part of fix for <rdar://
3125         problem/4277074> 8F32: Help Viewer crashed on clicking link - 
3126         KHTMLView::viewportMouseReleaseEvent (12647)
3127
3128         * WebCore.exp:
3129
3130 2007-03-13  Darin Adler  <darin@apple.com>
3131
3132         Reviewed by Maciej.
3133
3134         - fix http://bugs.webkit.org/show_bug.cgi?id=12794
3135           <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
3136           finishes loading due to unclosed canvas tag (12794)
3137
3138         Change <canvas> elements so that their contents are parsed normally,
3139         but not rendered. This change fixes the bug, because normal parsing
3140         rules close the <canvas> element in that case. The special parser
3141         stuff was just getting in the way.
3142
3143         Also do some basic cleanup to the HTML parser. This was motivated by
3144         an earlier version of this patch that made even more changes to the
3145         parser, but the cleanup is still worth landing.
3146
3147         Test: fast/canvas/canvas-hides-fallback.html
3148         Test: fast/canvas/script-inside-canvas-fallback.html
3149         Test: fast/canvas/unclosed-canvas-1.html
3150         Test: fast/canvas/unclosed-canvas-2.html
3151         Test: fast/canvas/unclosed-canvas-3.html
3152         Test: fast/canvas/unclosed-canvas-4.html
3153
3154         * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
3155         renderer is a RenderHTMLCanvas or not.
3156         * html/HTMLCanvasElement.cpp:
3157         (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
3158         a RenderHTMLCanvas. If it's not, let the default code create the default type
3159         of renderer, which will result in fallback content being visible. The
3160         RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
3161         boolean accordingly. Since the actual storage for the canvas is allocated lazily
3162         when you actually get a drawing context, we don't need to do anything special
3163         to prevent it when JavaScript is disabled; the relevant functions won't be called.
3164         (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
3165         RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
3166         the DOM element that relies on the renderer type.
3167
3168         * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
3169         Noncopyable. Changed the Document parameter to the constructor to instead
3170         be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
3171         Removed unused noSpaces function and unneeded public doc() function.
3172         Moved data members all down to the end so you can see them together in order.
3173         Renamed map to m_currentMapElement and isindex to m_isindexElement.
3174         Removed unused end and headLoaded data members.  Renamed m_fragment to
3175         m_isParsingFragment to make it clearer that it's a boolean, not a fragment.
3176
3177         * html/HTMLParser.cpp:
3178         (WebCore::HTMLParser::HTMLParser): Changed to use member construction
3179         syntax instead of calling reset(). This is especially helpful in the
3180         fragment case, where calling reset() later on is illegal, so not using
3181         it in the constructor lets us assert.
3182         (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
3183         calling setCurrent for its side effect.
3184         (WebCore::HTMLParser::reset): Updated for member name changes and removal
3185         and to use document instead of doc().
3186         (WebCore::HTMLParser::setCurrent): Use document instead of doc().
3187         (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
3188         m_inCanvasBeforeFirstOpenTag data member to false.
3189         (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
3190         top of the function, and added a FIXME about the strange case there where
3191         we don't skip yet stay in skip mode. Updated for renaming and doc().
3192         (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
3193         (WebCore::HTMLParser::handleError): Ditto.
3194         (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
3195         (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
3196         (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
3197         (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
3198         (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
3199         Canvas fallback is now handled in the DOM, not the parser. Updated for
3200         renaming and doc().
3201         (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
3202         constant.
3203         (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
3204         (WebCore::HTMLParser::isInline): Ditto.
3205         (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
3206         (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
3207         the local variable Elem to elem.
3208         (WebCore::HTMLParser::createHead): Ditto.
3209         (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
3210         (WebCore::HTMLParser::startBody): Updated for renaming and doc().
3211         (WebCore::HTMLParser::finished): Ditto.
3212
3213 2007-03-13  David Hyatt  <hyatt@apple.com>
3214
3215         Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
3216         clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
3217         data.  Since we're about to be destroyed this is just wasteful.
3218
3219         When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
3220         since we've established that ImageIO can actually crash if you yank the rug out from under it like that.
3221
3222         Reviewed by ggaren
3223
3224         * loader/Cache.cpp:
3225         (WebCore::Cache::prune):
3226         * platform/graphics/BitmapImage.cpp:
3227         (WebCore::BitmapImage::~BitmapImage):
3228
3229 2007-03-13  Anders Carlsson  <acarlsson@apple.com>
3230
3231         Try fixing the Qt build.
3232         
3233         * editing/Editor.h:
3234         (WebCore::Editor::setStartNewKillRingSequence):
3235
3236 2007-03-13  David Harrison  <harrison@apple.com>
3237
3238         Reviewed by Justin.
3239
3240         <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
3241         <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content
3242
3243         For rdar://5031181, properly extend the selection before the killring handling, and
3244         make sure plainText of that selection returns a linefeed.
3245         
3246         For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
3247         even though the range deletion implicitly stopped it via changing the selection.
3248         
3249         A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
3250         only difference between the two was whether to emit a newline when the range started
3251         with a blockflow element. No callers actually need that any more.
3252
3253         Tests added:
3254         * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
3255         * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
3256         * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
3257         * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.
3258
3259         * editing/Editor.cpp:
3260         (WebCore::Editor::deleteRange):
3261         Clear the "start new kill ring sequence" setting, because it was set to true
3262         when the selection was updated by deleting the range.
3263         
3264         (WebCore::Editor::deleteWithDirection):
3265         If extending the selection to the end of paragraph resulted in a caret selection,
3266         extend by character, to handle the case when the selection started as a caret at
3267         the end of paragraph.
3268         
3269         * editing/TextIterator.cpp:
3270         (WebCore::TextIterator::TextIterator):
3271         Initialize new member variables for tracking handling of the beginning of the range.
3272         
3273         (WebCore::TextIterator::advance):
3274         Call representNodeOffsetZero on the m_endContainer.
3275         Move visibility checks into handleTextNode and handleReplacedElement.
3276         
3277         (WebCore::TextIterator::handleTextNode):
3278         (WebCore::TextIterator::handleTextBox):
3279         Call emitText.
3280         
3281         (WebCore::TextIterator::handleReplacedElement):
3282         Moved visibility check into here.
3283         
3284         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
3285         
3286         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
3287         (WebCore::TextIterator::representNodeOffsetZero):
3288         New. Emits proper sequence when encountering offset 0 of a node, including the
3289         m_endContainer. Started with code from handleNonTextNode.
3290         
3291         (WebCore::TextIterator::handleNonTextNode):
3292         Call representNodeOffsetZero.
3293         
3294         (WebCore::TextIterator::exitNode):
3295         Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
3296         was collapsed, and before any other emitted content.
3297         
3298         (WebCore::TextIterator::emitCharacter):
3299         
3300         (WebCore::TextIterator::emitText):
3301         New. Consolidates code used by handleText and handleTextBox.
3302         
3303         (WebCore::CharacterIterator::CharacterIterator):
3304         Removed RUNFINDER.
3305
3306         (WebCore::WordAwareIterator::WordAwareIterator):
3307         Removed RUNFINDER.
3308         
3309         (WebCore::WordAwareIterator::advance):
3310         Formatting.
3311
3312         (WebCore::TextIterator::rangeLength):
3313         Formatting.
3314         
3315         * editing/TextIterator.h:
3316         Added member variables for tracking handling of the beginning of the range.
3317         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
3318         
3319         * editing/visible_units.cpp:
3320         (WebCore::nextBoundary):
3321         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
3322
3323 2007-03-13  David Hyatt  <hyatt@apple.com>
3324
3325         Clean up the null image case in CachedImage::data to make sure the size totals will stay accurate.
3326         I'm not convinced this case can even be hit, but I'm cleaning it up just in case.
3327
3328         * loader/CachedImage.cpp:
3329         (WebCore::CachedImage::data):
3330
3331 2007-03-13  David Hyatt  <hyatt@apple.com>
3332
3333         Reorder the call to allReferencesRemoved, since otherwise the live object size will become
3334         incorrect.
3335
3336         * loader/CachedResource.cpp:
3337         (WebCore::CachedResource::deref):
3338
3339 2007-03-13  Antti Koivisto  <antti@apple.com>
3340
3341         Reviewed by Darin.
3342         
3343         Fix http://bugs.webkit.org/show_bug.cgi?id=11083
3344         REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
3345         <rdar://problem/4757650>
3346         
3347         Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
3348
3349         * page/EventHandler.cpp:
3350         (WebCore::EventHandler::defaultTabEventHandler):
3351
3352 2007-03-13  David Hyatt  <hyatt@apple.com>
3353
3354         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
3355         destroy decoded data when clearing out a partially loaded image that had an error, since the destructor
3356         (although it does destroy the data) disconnects the observer so that the notification doesn't happen.
3357
3358         Some CachedImages aren't in the cache (like image documents).  When the decoded size of such an image
3359         changes we should not notify the cache, since - newsflash - we aren't actually in it.
3360
3361         Reviewed by ggaren
3362
3363         * loader/CachedImage.cpp:
3364         (WebCore::CachedImage::clear):
3365         (WebCore::CachedImage::decodedSizeChanged):
3366
3367 2007-03-13  Darin Adler  <darin@apple.com>
3368
3369         Reviewed by Tim Hatcher and John Sullivan.
3370
3371         - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at
3372           com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502
3373
3374         * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect):
3375         This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count:
3376         method was never really safe to call unless it was AppKit that called your
3377         drawRect: method. Changed it to call drawSingleRect: instead. A little ugly,
3378         but seems to work and will almost certainly fix the bug.
3379
3380 2007-03-13  Nikolas Zimmermann  <zimmermann@kde.org>
3381
3382         Reviewed by Maciej.
3383
3384         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12974
3385
3386         Call forgetGenericContext in JSSVGPathSeg destructor, otherwhise
3387         we'll hit an ASSERT in a debug build, when running svg/custom/js-update-path-changes.svg
3388         a few dozen times in a single WebKit instance. The ASSERT is good and just warns that
3389         there was already a generic context pointer registered, and the new "to be registered"
3390         object already exists, but pointing to a different object. That's because garbage collection
3391         calls the JSSVGPathSeg destructor, but that didn't cleanup the generic context map.
3392
3393         Only JSSVGPathSeg is hit by this problem, as it's the only non SVGAnimated* type
3394         using the generic context system while using a custom JSSVGPathSegList implementation.
3395
3396         Also cleanup JSSVGPathSegListCustom code to call the static forgetGenericContext
3397         method instead of doing the same using custom code.
3398
3399         * bindings/js/JSSVGPathSegListCustom.cpp:
3400         (WebCore::removeFromPathSegContextMap):
3401         (WebCore::JSSVGPathSegList::clear):
3402         (WebCore::JSSVGPathSegList::removeItem):
3403         * bindings/scripts/CodeGeneratorJS.pm:
3404
3405 2007-03-13  Darin Adler  <darin@apple.com>
3406
3407         Reviewed by Adele.
3408
3409         - fix http://bugs.webkit.org/show_bug.cgi?id=12595
3410           <rdar://problem/4722863> REGRESSION: Can't add item to cart at lnt.com
3411           (JS type error) (12595)
3412
3413         Test: fast/forms/old-names.html
3414
3415         * bindings/js/JSHTMLFormElementCustom.cpp:
3416         (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has
3417         nothing for a given name, try the form's oldNamedElement function.
3418         (WebCore::JSHTMLFormElement::nameGetter): Ditto.
3419
3420         * bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use
3421         a class derived from NodeList.
3422         * bindings/js/kjs_dom.cpp: Ditto.
3423
3424         * bindings/js/kjs_html.cpp:
3425         (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived
3426         from NodeList to be used for the named items result from a collection -- uses a
3427         vector of node pointers.
3428         (KJS::VectorNodeList::length): Added.
3429         (KJS::VectorNodeList::item): Added.
3430         (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper
3431         for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
3432
3433         * dom/ChildNodeList.h:
3434         * dom/ChildNodeList.cpp:
3435         (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList,
3436         since NodeList is now a simpler class.
3437         (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
3438
3439         * dom/NameNodeList.h:
3440         * dom/NameNodeList.cpp:
3441         (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList,
3442         since NodeList is now a simpler class.
3443         (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and
3444         parameter change.
3445
3446         * dom/Node.h: Change register/unregister functions to take TreeNodeList.
3447         * dom/Node.cpp:
3448         (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList,
3449         since NodeList is now a simpler abstract class.
3450         (WebCore::TagNodeList::elementMatches): Updated for name and parameter change.
3451         (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList.
3452         (WebCore::Node::unregisterNodeList): Ditto.
3453
3454         * dom/NodeList.h: Broke NodeList into a simpler base class and a derived class
3455         with the machinery for iterating a tree, called TreeNodeList.
3456         * dom/NodeList.cpp:
3457         (WebCore::NodeList::~NodeList): Added.
3458         (WebCore::NodeList::itemWithName): Factored out of the old itemWithName.
3459         (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList.
3460         (WebCore::TreeNodeList::~TreeNodeList): Ditto.
3461         (WebCore::TreeNodeList::recursiveLength): Ditto.
3462         (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto.
3463         (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto.
3464         (WebCore::TreeNodeList::recursiveItem): Ditto.
3465         (WebCore::TreeNodeList::itemWithName): Factored half of this into this function,
3466         the other half in NodeList::itemWithName.
3467         (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline.
3468         (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
3469
3470         * html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement
3471         fucntions, and a map called m_oldNames. Also removed m_boundary, which I
3472         thought I had already done.
3473         * html/HTMLFormElement.cpp:
3474         (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0.
3475         Switched the rest of the members to initialization syntax.
3476         (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames.
3477         (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference
3478         to one element under each of its old names.
3479         (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element
3480         that once had a given name.
3481
3482         * html/HTMLGenericFormElement.h:
3483         * html/HTMLGenericFormElement.cpp:
3484         (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name
3485         attribute changes, tell the form about the old name.
3486         (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form
3487         about an element, also store away the old name so that we can use it
3488         when the name changes later.
3489
3490         * html/HTMLInputElement.cpp:
3491         (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the
3492         base class in the nameAttr case, so the code in HTMLGenericFormElement
3493         above will get called in the input element case.
3494
3495 2007-03-13  Antti Koivisto  <antti@apple.com>
3496
3497         Reviewed by Alexey.
3498
3499         Alexey spotted a DOS by using string of 64k unbreakable character in
3500         fix for http://bugs.webkit.org/show_bug.cgi?id=12833
3501
3502         * dom/Text.cpp:
3503         (WebCore::Text::createWithLengthLimit):
3504
3505 2007-03-13  Lars Knoll <lars@trolltech.com>
3506
3507         Fix the Qt build
3508
3509         * WebCore.pro:
3510
3511 2007-03-13  Rob Buis  <buis@kde.org>
3512
3513         Reviewed by Darin.
3514
3515         http://bugs.webkit.org/show_bug.cgi?id=12576
3516         WebKit does not support xlink:show attributes
3517
3518         Make an exception for non-empty targets, these should be opened
3519         in a new window, unless the value is _self.
3520
3521         * ksvg2/svg/SVGAElement.cpp:
3522         (WebCore::SVGAElement::defaultEventHandler):
3523
3524 2007-03-13  David Hyatt  <hyatt@apple.com>
3525
3526         - fix cache issues seen in http://bugs.webkit.org/show_bug.cgi?id=13050
3527           6 objects and ~200MB leaked after opening then closing tab
3528           <rdar://problem/5058714>
3529
3530         Double the encoded size of images for now.  We do this to account for a bug in ImageIO where they hold
3531         a separate copy of image data.  See <rdar://problem/5050645>.
3532
3533         Reviewed by aroben.
3534
3535         * loader/CachedImage.cpp:
3536         (WebCore::CachedImage::data):
3537
3538 2007-03-12  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3539
3540         Not reviewed - gdk build fix.
3541
3542         * platform/gdk/TemporaryLinkStubs.cpp:
3543         (SearchPopupMenu::enabled): add missing stub.
3544
3545 2007-03-12  David Kilzer  <ddkilzer@kilzer.net>
3546
3547         Reviewed by Darin.
3548
3549         - fix http://bugs.webkit.org/show_bug.cgi?id=13045
3550           REGRESSION: Blackboard CourseWare Error with Nightlies after Mar 8
3551
3552         * html/HTMLFormElement.cpp:
3553         (WebCore::getUniqueBoundaryString): Speculative fix: remove dashes from
3554         the boundary prefix that appear after non-dash characters.