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