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