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