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