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