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