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