Reviewed by Darin, landed by ap.
[WebKit-https.git] / WebCore / ChangeLog
1 2006-01-04  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2
3         Reviewed by Darin, landed by ap.
4         
5         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6301
6           REGRESSION: Border repaint glitch
7
8         * khtml/rendering/render_object.cpp:
9         (RenderObject::repaintAfterLayoutIfNeeded): Repaint parts of the
10         border that moved.
11         * manual-tests/border-repaint-glitch.html: Added.
12
13 2005-12-30  Kimmo Kinnunen  <kimmo.kinnunen@nokia.com>
14
15         Reviewed by eseidel.
16
17         Changed use of QRect to QRectF in the points where SVG can have
18         fractional numbers
19         http://bugzilla.opendarwin.org/show_bug.cgi?id=4462
20
21         Added test cases:
22         * svg/custom/fractional-rects.svg: copy of rounded-rects.svg with
23         fractional coordinates.
24
25         * WebCore.xcodeproj/project.pbxproj:
26         * kwq/KWQWMatrix.h:
27         * kwq/KWQWMatrix.mm:
28         (QWMatrix::mapRect): mapRect for QRectF
29         * kwq/KWQRectF.h:
30         * kwq/KWQRectF.mm:  Added. QRectF impl
31         * kwq/KWQSizeF.h:
32         * kwq/KWQSizeF.mm:  Added.QSizeF impl
33         * kwq/KWQPointF.h:
34         * kwq/KWQPointF.mm: Added. QPointF impl
35         * kcanvas/KCanvasContainer.cpp:
36         (KCanvasContainer::fillContains):
37         (KCanvasContainer::strokeContains):
38         (KCanvasContainer::relativeBBox):
39         (KCanvasContainer::getAspectRatio): QRect -> QRectF
40         * kcanvas/KCanvasContainer.h:
41         * kcanvas/KCanvasFilters.cpp:
42         (KCanvasFilterEffect::subRegion):
43         (KCanvasFilterEffect::setSubRegion): QRect -> QRectF
44         * kcanvas/KCanvasFilters.h:
45         (KCanvasFilter::filterRect):
46         (KCanvasFilter::setFilterRect): QRect -> QRectF
47         (KCanvasFEConvolveMatrix::kernelSize):
48         (KCanvasFEConvolveMatrix::setKernelSize):
49         (KCanvasFEConvolveMatrix::targetOffset):
50         (KCanvasFEConvolveMatrix::setTargetOffset): QSize -> QSizeF
51         * kcanvas/KCanvasItem.cpp:
52         (RenderPath::fillContains):
53         (RenderPath::strokeContains):
54         (RenderPath::relativeBBox): QRect -> QRectF
55         * kcanvas/KCanvasItem.h:
56         * kcanvas/KCanvasResources.cpp:
57         (KCanvasMarker::draw): QRect -> QRectF
58         * kcanvas/KCanvasResources.h:
59         * kcanvas/KCanvasTreeDebug.cpp:
60         (hasFractions): helper function
61         (operator<<): QSizeF operator, QRectF operator
62         * kcanvas/KCanvasTreeDebug.h:
63         * kcanvas/device/KRenderingPaintServerGradient.cpp:
64         (KRenderingPaintServerLinearGradient::gradientStart):
65         (KRenderingPaintServerLinearGradient::setGradientStart):
66         (KRenderingPaintServerLinearGradient::gradientEnd):
67         (KRenderingPaintServerLinearGradient::setGradientEnd):
68         (KRenderingPaintServerRadialGradient::gradientCenter):
69         (KRenderingPaintServerRadialGradient::setGradientCenter):
70         (KRenderingPaintServerRadialGradient::gradientFocal):
71         (KRenderingPaintServerRadialGradient::setGradientFocal): QPoint -> QPointF
72         * kcanvas/device/KRenderingPaintServerGradient.h:
73         * kcanvas/device/KRenderingPaintServerPattern.cpp:
74         (KRenderingPaintServerPattern::Private::Private): x, y, width, height -> QRectF
75         (KRenderingPaintServerPattern::setBbox): replaced get/set methods
76         (KRenderingPaintServerPattern::bbox): replaced get/set methods
77         (KRenderingPaintServerPattern::externalRepresentation):
78         * kcanvas/device/KRenderingPaintServerPattern.h:
79         * kcanvas/device/quartz/KCanvasFilterQuartz.h:
80         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
81         (KCanvasFilterQuartz::prepareFilter):
82         (KCanvasFilterQuartz::applyFilter): QRect -> QRectF
83         * kcanvas/device/quartz/KCanvasItemQuartz.h:
84         (KCanvasItemQuartz::getAbsoluteRepaintRect): QRect -> QRectF
85         * kcanvas/device/quartz/KCanvasItemQuartz.mm:
86         (drawMarkerWithData):
87         (KCanvasItemQuartz::drawMarkersIfNeeded):
88         (KCanvasItemQuartz::paint): QRect -> QRectF
89         (KCanvasItemQuartz::nodeAtPoint): QPoint -> QPointF
90         (KCanvasItemQuartz::bboxForPath) :QRect -> QRectF
91         (KCanvasItemQuartz::hitsPath):
92         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
93         (KCanvasContainerQuartz::getAbsoluteRepaintRect): QRect -> QRectF
94         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
95         (KRenderingPaintServerPatternQuartz::draw): QRect -> QRectF
96         * khtml/rendering/render_object.h:
97         (khtml::RenderObject::relativeBBox):QRect -> QRectF
98         * ksvg2/svg/SVGFilterElementImpl.cpp:
99         (SVGFilterElementImpl::canvasResource): QRect -> QRectF
100         * ksvg2/svg/SVGFilterPrimitiveStandardAttributesImpl.cpp:
101         (SVGFilterPrimitiveStandardAttributesImpl::setStandardAttributes):
102         * ksvg2/svg/SVGLengthImpl.cpp:
103         (SVGLengthImpl::value): QRect -> QRectF
104         * ksvg2/svg/SVGLinearGradientElementImpl.cpp:
105         (SVGLinearGradientElementImpl::buildGradient): QPoint -> QPointF, removed integer conversions
106         * ksvg2/svg/SVGLocatableImpl.cpp:
107         (SVGLocatableImpl::getBBox): Rect -> QRectF
108         * ksvg2/svg/SVGPatternElementImpl.cpp:
109         (SVGPatternElementImpl::drawPatternContentIntoTile): QRect -> QRectF
110         * ksvg2/svg/SVGRadialGradientElementImpl.cpp:
111         (SVGRadialGradientElementImpl::buildGradient): QPoint -> QPointF, removed integer conversions
112         * ksvg2/svg/SVGSVGElementImpl.cpp:
113         (SVGSVGElementImpl::checkIntersection): QRect -> QRectF, removed integer conversions
114         (SVGSVGElementImpl::checkEnclosure): QRect -> QRectF, removed integer conversions
115
116 2006-01-03  Maciej Stachowiak  <mjs@apple.com>
117
118         Reviewed by Vicki.
119
120         - moved frame traversal code across from bridge, also dropped the children
121         array
122
123         * kwq/WebCoreBridge.h:
124         * kwq/WebCoreBridge.mm:
125         (-[WebCoreBridge firstChild]): Moved from WebBridge. Use new _firstChild
126         pointer.
127         (-[WebCoreBridge lastChild]): Moved from WebBridge. Use new _lastChild pointer.
128         (-[WebCoreBridge childCount]): Moved from WebBridge. Use _childCount variable.
129         (-[WebCoreBridge previousSibling]): Moved from WebBridge.
130         (-[WebCoreBridge nextSibling]): ditt
131         (-[WebCoreBridge isDescendantOfFrame:]): ditto
132         (-[WebCoreBridge traverseNextFrameStayWithin:]): ditto
133         (-[WebCoreBridge appendChild:]): Moved from WebBridge, maintain count and first/last
134         pointers.
135         (-[WebCoreBridge removeChild:]): Moved from WebBridge, maintain count and first/last
136         pointers.
137
138 2006-01-03  Justin Garcia  <justin.garcia@apple.com>
139
140         Reviewed by harrison
141
142         <http://bugzilla.opendarwin.org/show_bug.cgi?id=4609>
143         window.getSelection().toString() is undefined (range object 
144         returned from window.getSelection() is useless)
145
146         toString was defined as a method on the JS Selection object, 
147         but it didn't return anything.
148
149         Added layout test:
150         * editing/selection/toString.html
151
152         * khtml/ecma/kjs_window.cpp:
153         (KJS::SelectionFunc::callAsFunction):
154
155 2006-01-03  Geoffrey Garen  <ggaren@apple.com>
156
157         Reviewed by timo.
158
159         - Fixed: http://bugzilla.opendarwin.org/show_bug.cgi?id=6318
160         REGRESSION: Repro crash in JS called from Flash on bdash.net.nz
161
162         Since we clear all the plugin data structures in setView, we need to
163         clear the windowScriptObject as well. I had already done this in my
164         previous patch, but I didn't realize there are two windowScriptObjects 
165         -- one for Netscape PlugIns, and one for WebKit PlugIns.
166
167         * kwq/KWQKHTMLPart.mm:
168         (KWQKHTMLPart::setView): Clear the Netscape PlugIn windowScriptObject
169         as well.
170
171 2006-01-03  Anders Carlsson  <andersca@mac.com>
172
173         Reviewed by Eric.
174
175         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6358
176         JS objects missing "prototype" properties
177         
178         * khtml/ecma/XSLTProcessor.cpp:
179         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
180         * khtml/ecma/XSLTProcessor.h:
181         * khtml/ecma/domparser.cpp:
182         (KJS::DOMParserConstructorImp::DOMParserConstructorImp):
183         * khtml/ecma/xmlhttprequest.cpp:
184         (KJS::XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp):
185         * khtml/ecma/xmlserializer.cpp:
186         (KJS::XMLSerializerConstructorImp::XMLSerializerConstructorImp):
187         Add "prototype" property in constructors.
188
189 2006-01-03  Eric Seidel  <eseidel@apple.com>
190
191         Reviewed by darin.
192
193         REGRESSION: repro crash w/ invalid charset attribute on <script>
194         http://bugzilla.opendarwin.org/show_bug.cgi?id=6345
195         I also made some small spacing cleanup here.
196         I did *not* fix the usage in formData, as the move from KCharSet to
197         QTextCodec actually fixed a bug whereby if the first listed charset
198         in accept-charsets was invalid, we would assume latin1 instead of
199         checking for the next valid one before assuming system encoding.
200
201         * khtml/html/html_formimpl.cpp:
202         (DOM::HTMLFormElementImpl::formData): cleanup
203         * khtml/misc/loader.cpp:
204         (CachedCSSStyleSheet::CachedCSSStyleSheet): null check
205         (CachedScript::CachedScript): cleanup
206         (CachedXSLStyleSheet::CachedXSLStyleSheet): null check
207         (CachedXBLDocument::CachedXBLDocument): cleanup
208
209 2006-01-03  Justin Garcia  <justin.garcia@apple.com>
210
211         <http://bugzilla.opendarwin.org/show_bug.cgi?id=4904>
212         Bug with baseOffset and extentOffset in selections (for writely.com)
213         <rdar://problem/4259818>
214         selection object incorrect after double-clicking a word
215         
216         Reviewed by harrison
217
218         Changed the Selection object's anchor/focus properties to match 
219         Mozilla's Selection object API, added getRangeAt and outlined the 
220         rest of the API.
221         Cleaned up the JS Selection object (to do less work in the DOM binding).
222         Added an updateLayout call to VisiblePosition::init and removed some 
223         updateLayout calls from other parts of the editing code.
224         
225         Added layout tests:
226         * editing/selection/getRangeAt.html
227         * editing/selection/anchor-focus1.html
228         * editing/selection/anchor-focus2.html
229         * editing/selection/anchor-focus3.html
230         Updated expected results:
231         * editing/selection/unrendered-001-expected.txt
232
233         * khtml/ecma/kjs_window.cpp:
234         (KJS::Selection::getValueProperty):
235         (KJS::Selection::toString):
236         (KJS::SelectionFunc::callAsFunction):
237         * khtml/ecma/kjs_window.h:
238         (KJS::Selection::):
239         * khtml/editing/SelectionController.cpp:
240         (khtml::SelectionController::modify):
241         (khtml::SelectionController::type):
242         (khtml::SelectionController::toString):
243         (khtml::SelectionController::getRangeAt):
244         (khtml::SelectionController::setBaseAndExtent):
245         (khtml::SelectionController::setPosition):
246         (khtml::SelectionController::collapse):
247         (khtml::SelectionController::collapseToEnd):
248         (khtml::SelectionController::collapseToStart):
249         (khtml::SelectionController::empty):
250         (khtml::SelectionController::extend):
251         (khtml::SelectionController::validate):
252         * khtml/editing/SelectionController.h:
253         (khtml::SelectionController::part):
254         (khtml::SelectionController::baseNode):
255         (khtml::SelectionController::extentNode):
256         (khtml::SelectionController::baseOffset):
257         (khtml::SelectionController::extentOffset):
258         (khtml::SelectionController::anchorNode):
259         (khtml::SelectionController::anchorOffset):
260         (khtml::SelectionController::focusNode):
261         (khtml::SelectionController::focusOffset):
262         (khtml::SelectionController::isCollapsed):
263         * khtml/editing/visible_position.cpp:
264         (khtml::VisiblePosition::init):
265         (khtml::VisiblePosition::isCandidate):
266         * khtml/khtml_part.cpp:
267         (KHTMLPart::handleMousePressEventSingleClick):
268
269 2006-01-03  Anders Carlsson  <andersca@mac.com>
270
271         Reviewed by Maciej.
272
273         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5378
274         createDocument fails with DOM Exception 5 when passed empty qname
275         
276         * khtml/ecma/kjs_dom.cpp:
277         (KJS::DOMDOMImplementationProtoFunc::callAsFunction):
278         When passing null to createDocument, pass a null DOMString, and not
279         a DOMString containing the text "null".
280         
281         * khtml/xml/dom_docimpl.cpp:
282         (DOMImplementationImpl::createDocument):
283         Only validate the qualifiedName if it's not null or empty. Also, do not
284         create the document element if the qualifiedName is null or empty.
285
286 2006-01-03  Eric Seidel  <eseidel@apple.com>
287
288         Reviewed by darin.
289
290         No functionality changes, no tests possible.
291
292         khtml/editing should use RefPtr instead of manual ref/deref
293         http://bugzilla.opendarwin.org/show_bug.cgi?id=6109
294
295         Results in a slight performance gain < 1% on the PLT.
296
297         * khtml/editing/SelectionController.cpp:
298         (khtml::SelectionController::toRange):
299         * khtml/editing/SelectionController.h:
300         * khtml/editing/append_node_command.cpp:
301         (khtml::AppendNodeCommand::AppendNodeCommand):
302         (khtml::AppendNodeCommand::doApply):
303         (khtml::AppendNodeCommand::doUnapply):
304         * khtml/editing/append_node_command.h:
305         (khtml::AppendNodeCommand::~AppendNodeCommand):
306         (khtml::AppendNodeCommand::appendChild):
307         (khtml::AppendNodeCommand::parentNode):
308         * khtml/editing/apply_style_command.cpp:
309         (khtml::StyleChange::init):
310         (khtml::ApplyStyleCommand::removeInlineStyle):
311         * khtml/editing/apply_style_command.h:
312         * khtml/editing/composite_edit_command.cpp:
313         (khtml::CompositeEditCommand::deleteInsignificantText):
314         * khtml/editing/delete_from_text_node_command.cpp:
315         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
316         * khtml/editing/delete_from_text_node_command.h:
317         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand):
318         (khtml::DeleteFromTextNodeCommand::node):
319         * khtml/editing/delete_selection_command.cpp:
320         (khtml::DeleteSelectionCommand::initializePositionData):
321         (khtml::DeleteSelectionCommand::saveTypingStyleState):
322         (khtml::DeleteSelectionCommand::handleGeneralDelete):
323         (khtml::DeleteSelectionCommand::calculateEndingPosition):
324         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
325         (khtml::DeleteSelectionCommand::clearTransientState):
326         * khtml/editing/delete_selection_command.h:
327         * khtml/editing/edit_command.cpp:
328         (khtml::EditCommand::EditCommand):
329         (khtml::EditCommand::~EditCommand):
330         (khtml::EditCommand::setTypingStyle):
331         (khtml::EditCommand::styleAtPosition):
332         * khtml/editing/edit_command.h:
333         (khtml::EditCommand::document):
334         (khtml::EditCommand::typingStyle):
335         * khtml/editing/insert_into_text_node_command.cpp:
336         (khtml::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
337         * khtml/editing/insert_into_text_node_command.h:
338         (khtml::InsertIntoTextNodeCommand::~InsertIntoTextNodeCommand):
339         (khtml::InsertIntoTextNodeCommand::node):
340         * khtml/editing/insert_node_before_command.cpp:
341         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
342         (khtml::InsertNodeBeforeCommand::doApply):
343         (khtml::InsertNodeBeforeCommand::doUnapply):
344         * khtml/editing/insert_node_before_command.h:
345         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand):
346         (khtml::InsertNodeBeforeCommand::insertChild):
347         (khtml::InsertNodeBeforeCommand::refChild):
348         * khtml/editing/insert_paragraph_separator_command.cpp:
349         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
350         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand):
351         (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion):
352         (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion):
353         * khtml/editing/insert_paragraph_separator_command.h:
354         * khtml/editing/join_text_nodes_command.cpp:
355         (khtml::JoinTextNodesCommand::JoinTextNodesCommand):
356         (khtml::JoinTextNodesCommand::doApply):
357         (khtml::JoinTextNodesCommand::doUnapply):
358         * khtml/editing/join_text_nodes_command.h:
359         (khtml::JoinTextNodesCommand::~JoinTextNodesCommand):
360         (khtml::JoinTextNodesCommand::firstNode):
361         (khtml::JoinTextNodesCommand::secondNode):
362         * khtml/editing/jsediting.cpp:
363         * khtml/editing/markup.cpp:
364         (khtml::createMarkup):
365         (khtml::createFragmentFromMarkup):
366         (khtml::createFragmentFromText):
367         (khtml::createFragmentFromNodeList):
368         * khtml/editing/markup.h:
369         * khtml/editing/merge_identical_elements_command.cpp:
370         (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
371         (khtml::MergeIdenticalElementsCommand::doApply):
372         (khtml::MergeIdenticalElementsCommand::doUnapply):
373         * khtml/editing/merge_identical_elements_command.h:
374         (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand):
375         * khtml/editing/move_selection_command.cpp:
376         (khtml::MoveSelectionCommand::MoveSelectionCommand):
377         (khtml::MoveSelectionCommand::~MoveSelectionCommand):
378         (khtml::MoveSelectionCommand::doApply):
379         * khtml/editing/move_selection_command.h:
380         * khtml/editing/rebalance_whitespace_command.cpp:
381         * khtml/editing/rebalance_whitespace_command.h:
382         (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand):
383         * khtml/editing/remove_css_property_command.cpp:
384         (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand):
385         * khtml/editing/remove_css_property_command.h:
386         (khtml::RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand):
387         (khtml::RemoveCSSPropertyCommand::styleDeclaration):
388         * khtml/editing/remove_node_attribute_command.cpp:
389         (khtml::RemoveNodeAttributeCommand::RemoveNodeAttributeCommand):
390         * khtml/editing/remove_node_attribute_command.h:
391         (khtml::RemoveNodeAttributeCommand::~RemoveNodeAttributeCommand):
392         (khtml::RemoveNodeAttributeCommand::element):
393         * khtml/editing/remove_node_command.cpp:
394         (khtml::RemoveNodeCommand::RemoveNodeCommand):
395         (khtml::RemoveNodeCommand::doApply):
396         (khtml::RemoveNodeCommand::doUnapply):
397         * khtml/editing/remove_node_command.h:
398         (khtml::RemoveNodeCommand::~RemoveNodeCommand):
399         (khtml::RemoveNodeCommand::node):
400         * khtml/editing/remove_node_preserving_children_command.cpp:
401         (khtml::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
402         * khtml/editing/remove_node_preserving_children_command.h:
403         (khtml::RemoveNodePreservingChildrenCommand::~RemoveNodePreservingChildrenCommand):
404         (khtml::RemoveNodePreservingChildrenCommand::node):
405         * khtml/editing/replace_selection_command.cpp:
406         (khtml::ReplacementFragment::ReplacementFragment):
407         (khtml::ReplacementFragment::~ReplacementFragment):
408         (khtml::ReplacementFragment::enclosingBlock):
409         (khtml::ReplacementFragment::removeNodePreservingChildren):
410         (khtml::ReplacementFragment::removeNode):
411         (khtml::ReplacementFragment::insertFragmentForTestRendering):
412         (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment):
413         (khtml::ReplaceSelectionCommand::fixupNodeStyles):
414         (khtml::computeAndStoreNodeDesiredStyle):
415         (khtml::NodeDesiredStyle::NodeDesiredStyle):
416         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
417         (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
418         (khtml::ReplaceSelectionCommand::doApply):
419         (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
420         (khtml::ReplaceSelectionCommand::updateNodesInserted):
421         * khtml/editing/replace_selection_command.h:
422         (khtml::NodeDesiredStyle::node):
423         (khtml::NodeDesiredStyle::style):
424         (khtml::ReplacementFragment::root):
425         * khtml/editing/set_node_attribute_command.cpp:
426         (khtml::SetNodeAttributeCommand::SetNodeAttributeCommand):
427         * khtml/editing/set_node_attribute_command.h:
428         (khtml::SetNodeAttributeCommand::~SetNodeAttributeCommand):
429         (khtml::SetNodeAttributeCommand::element):
430         * khtml/editing/split_element_command.cpp:
431         (khtml::SplitElementCommand::SplitElementCommand):
432         (khtml::SplitElementCommand::doApply):
433         (khtml::SplitElementCommand::doUnapply):
434         * khtml/editing/split_element_command.h:
435         (khtml::SplitElementCommand::~SplitElementCommand):
436         * khtml/editing/split_text_node_command.cpp:
437         (khtml::SplitTextNodeCommand::SplitTextNodeCommand):
438         (khtml::SplitTextNodeCommand::doApply):
439         (khtml::SplitTextNodeCommand::doUnapply):
440         * khtml/editing/split_text_node_command.h:
441         (khtml::SplitTextNodeCommand::~SplitTextNodeCommand):
442         (khtml::SplitTextNodeCommand::node):
443         * khtml/editing/split_text_node_containing_element.cpp:
444         (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
445         (khtml::SplitTextNodeContainingElementCommand::doApply):
446         * khtml/editing/split_text_node_containing_element_command.h:
447         (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand):
448         * khtml/editing/visible_position.cpp:
449         (khtml::makeRange):
450         * khtml/editing/visible_position.h:
451         * khtml/editing/visible_text.cpp:
452         (khtml::TextIterator::range):
453         (khtml::SimplifiedBackwardsTextIterator::range):
454         (khtml::CharacterIterator::range):
455         (khtml::findPlainText):
456         * khtml/editing/visible_text.h:
457         (khtml::WordAwareIterator::range):
458         * khtml/editing/wrap_contents_in_dummy_span_command.cpp:
459         (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand):
460         (khtml::WrapContentsInDummySpanCommand::doApply):
461         (khtml::WrapContentsInDummySpanCommand::doUnapply):
462         * khtml/editing/wrap_contents_in_dummy_span_command.h:
463         (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand):
464         * kwq/DOMHTML.mm:
465         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
466         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
467         * kwq/WebCoreBridge.mm:
468         (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]):
469         (-[WebCoreBridge documentFragmentWithText:]):
470         (-[WebCoreBridge documentFragmentWithNodesAsParagraphs:]):
471
472 2006-01-03  Anders Carlsson  <andersca@mac.com>
473
474         Reviewed by Darin.
475
476         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5177
477         Javascript cloneNode(deep) does not clone form elements correctly
478
479         * khtml/html/html_elementimpl.cpp:
480         (HTMLElementImpl::cloneNode):
481         Call copyNonAttributeProperties on the new node.
482         
483         * khtml/html/html_formimpl.cpp:
484         (DOM::HTMLInputElementImpl::copyNonAttributeProperties):
485         * khtml/html/html_formimpl.h:
486         Copy m_value, m_checked and m_indeterminate here.
487         
488         * khtml/xml/dom_docimpl.cpp:
489         (DocumentImpl::importNode):
490         Call copyNonAttributeProperties on the new node.
491         
492         * khtml/xml/dom_elementimpl.cpp:
493         (ElementImpl::cloneNode):
494         Call copyNonAttributeProperties on the new node.
495         
496         * khtml/xml/dom_elementimpl.h:
497         (DOM::ElementImpl::copyNonAttributeProperties):
498         Add function declaration.
499
500 2006-01-02  Maciej Stachowiak  <mjs@apple.com>
501
502         Rubber stamped by Eric.
503
504         - remove the no longer used QIntDict
505
506         * kwq/KWQIntDict.h: Removed.
507
508 2006-01-03  Alexey Proskuryakov  <ap@nypop.com>
509
510         Reviewed by Eric.
511
512         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5609
513           XSLT document() doesn't handle relative paths
514
515         Test case: fast/xsl/xslt-relative-path.xml
516
517         * khtml/xsl/xslt_processorimpl.cpp:
518         (DOM::docLoaderFunc): Renamed from stylesheetLoadFunc. Use base URL when constructing URLs.
519         (DOM::XSLTProcessorImpl::transformToString):
520
521 2006-01-02  Vicki Murley  <vicki@apple.com>
522
523         Reviewed by Maciej.
524  
525         - fix for <rdar://problem/4389622> *Pan EU2* iframe swallows events for overlapping elements (part 2)
526
527         We originally added a call to passSubframeEventToSubframe here to fix the hand cursor updating problem
528         reported in <rdar://problem/4316201> REGRESSION: cursor and text in status bar is not updated when 
529         mousing over links in a frame (5509). However, when we return early after passSubframeEventToSubframe,
530         we fail to fire onmouseout events.  Since the call to passSubframeEventToSubframe was originally added
531         to fix the hand cursor updating problem, remove the early return and make cursor updating conditional
532         on passSubframeEventToSubframe.
533
534         * khtml/khtmlview.cpp:
535         (KHTMLView::viewportMouseMoveEvent):
536
537 2005-12-30  Darin Adler  <darin@apple.com>
538
539         Reviewed by Maciej.
540
541         - http://bugzilla.opendarwin.org/show_bug.cgi?id=4557
542           rename unusual strcmp and strcasecmp for DOMString family
543
544         Added new functions named equal and equalIgnoringCase.
545
546         * khtml/xml/dom_stringimpl.h: Changed the type of the length parameter to computeHash to unsigned
547         to match the rest of the interface. Added equal and equalIgnoringCase functions. Added a
548         version of the hash function that works on char* to CaseInsensitiveHash as preparation for an
549         atomic string change.
550         * khtml/xml/dom_stringimpl.cpp: Moved the QT_ALLOC_QCHAR_VEC and QT_DELETE_QCHAR_VEC macros
551         here, and changed them into inline functions.
552         (DOM::equal): Implemented.
553         (DOM::equalIgnoringCase): Implemented.
554         (DOM::DOMStringImpl::computeHash): Changed parameter type to unsigned to match other similar
555         functions.
556
557         * khtml/dom/dom_string.h: Removed unnecessary friend declarations. Changed operator
558         overloads for == and != to call through inline to DOMStringImpl. Replaced strcasecmp
559         with equalIgnoringCase, overloaded for one more combination of parameters. Removed strcmp.
560         * khtml/dom/dom_string.cpp: Removed functions that are now implemented in DOMStringImpl*.
561
562         * khtml/xml/dom_atomicstring.h: Removed a redundant const. Removed unnecessary
563         friend declarations. Removed AtomicString::equal. Filled out a larger set of == and
564         != operator implementations, mostly with inlines calling through to DOMStringImpl.
565         Renamed equalsIgnoreCase to equalIgnoringCase and filled out a larger set as above.
566         * khtml/xml/dom_atomicstring.cpp: Renamed AtomicString::equal to just ==.
567         Removed some implementation of == and equalsIgnoreCase that are replaced by inlines.
568
569         * khtml/html/html_listimpl.cpp:
570         (DOM::HTMLOListElementImpl::parseMappedAttribute):
571         (DOM::HTMLLIElementImpl::parseMappedAttribute):
572         Use the "==" operator instead of strcmp.
573
574         * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector):
575         Use equalIgnoringCase instead of equalsIgnoreCase.
576
577         * khtml/rendering/render_form.cpp:
578         (RenderSlider::updateFromElement): Fixed bug where a temporary DOMString was put into
579         a const DOMString&. Changed some DOMString to AtomicString as appropriate, and also
580         used equalIgnoringCase instead of strcasecmp.
581         (RenderSlider::slotSliderValueChanged): More of the same.
582
583         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::processHttpEquiv): Replaced use of strcasecmp
584         with equalIgnoringCase. Added parentheses to fix incorrect operator precedence in one case
585         (&& binds tighter than ||) which fixes a crash when using a http-equiv pragma when there
586         is no part (not sure how to reproduce that).
587
588         * khtml/khtml_part.cpp:
589         (updateState):
590         (KHTMLPart::selectionStartHasStyle):
591         * khtml/ecma/kjs_html.cpp: (KJS::KJS::HTMLDocument::putValueProperty):
592         * khtml/editing/apply_style_command.cpp:
593         (khtml::StyleChange::checkForLegacyHTMLStyleChange):
594         (khtml::StyleChange::currentlyHasStyle):
595         (khtml::hasTextDecorationProperty):
596         (khtml::ApplyStyleCommand::extractTextDecorationStyle):
597         (khtml::ApplyStyleCommand::extractAndNegateTextDecorationStyle):
598         * khtml/html/html_baseimpl.cpp:
599         (HTMLBodyElementImpl::parseMappedAttribute):
600         (HTMLFrameElementImpl::parseMappedAttribute):
601         * khtml/html/html_blockimpl.cpp:
602         (HTMLDivElementImpl::parseMappedAttribute):
603         (HTMLHRElementImpl::parseMappedAttribute):
604         (HTMLParagraphElementImpl::parseMappedAttribute):
605         (HTMLMarqueeElementImpl::parseMappedAttribute):
606         * khtml/html/html_elementimpl.cpp:
607         (HTMLElementImpl::parseMappedAttribute):
608         (HTMLElementImpl::addHTMLAlignment):
609         (HTMLElementImpl::setContentEditable):
610         * khtml/html/html_formimpl.cpp:
611         (DOM::HTMLFormElementImpl::parseMappedAttribute):
612         (DOM::HTMLButtonElementImpl::parseMappedAttribute):
613         (DOM::HTMLInputElementImpl::setInputType):
614         (DOM::HTMLInputElementImpl::parseMappedAttribute):
615         (DOM::HTMLKeygenElementImpl::appendFormData):
616         (DOM::HTMLTextAreaElementImpl::parseMappedAttribute):
617         * khtml/html/html_imageimpl.cpp: (DOM::HTMLAreaElementImpl::parseMappedAttribute):
618         * khtml/html/html_inlineimpl.cpp: (DOM::HTMLBRElementImpl::parseMappedAttribute):
619         * khtml/html/html_tableimpl.cpp: (DOM::HTMLTablePartElementImpl::parseMappedAttribute):
620         * khtml/html/htmlparser.cpp: (HTMLParser::handleError):
621         Use equalIgnoringCase instead of strcasecmp.
622
623 2005-12-30  Mitz Pettel  <opendarwin.org@mitzpettel.com>
624
625         Reviewed by Darin, landed by ap.
626         
627         Test: fast/text/justified-text-rect.html
628         
629         - WebCore part of fix for
630           http://bugzilla.opendarwin.org/show_bug.cgi?id=5461
631           Text width measured incorrectly when text-align: justify
632
633         * khtml/rendering/font.h:
634         * khtml/rendering/font.cpp:
635         (khtml::Font::selectionRectForText): Added.
636         * khtml/rendering/render_text.cpp:
637         (kthml::InlineTextBox::selectionRect): Use selectionRectForText. This
638         works for justified text as well, and avoids intermediate rounding which
639         resulted in selection rects narrower than AppKit's.
640         (khtml::InlineTextBox::positionForOffset): Use selectionRectForText,
641         which works for justified text as well.
642         * kwq/KWQFontMetrics.h:
643         * kwq/KWQFontMetrics.mm:
644         (QFontMetrics::selectionRectForText): Added.
645         * kwq/WebCoreTextRenderer.h:
646
647 2005-12-30  Alexey Proskuryakov  <ap@nypop.com>
648
649         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6289
650         REGRESSION: firstCharacterForRange(0, 0) returns a 0x0 rect
651
652         * khtml/editing/visible_text.cpp:
653         (khtml::TextIterator::rangeFromLocationAndLength):
654         Only special-case (0, 0) ranges for empty documents.
655
656 2005-12-30  Geoffrey Garen  <ggaren@apple.com>
657
658         Added test case for <rdar://problem/4268278> Submitting a form in onUnload event
659         handler causes crash in -[WebDataSource(WebPrivate) _commitIfReady:]
660
661         * manual-tests/onunload-form-submit-crash.html: Added.
662
663 2005-12-30  Anders Carlsson  <andersca@mac.com>
664
665         Reviewed by Eric.
666
667         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6297
668         XMLSerializer should use createMarkup.
669
670         * khtml/ecma/xmlserializer.cpp:
671         (KJS::XMLSerializerProtoFunc::callAsFunction):
672         Use createMarkup instead of NodeImpl::toString.
673
674         * khtml/editing/markup.cpp:
675         (khtml::startMarkup):
676         escape attribute values and ignore document fragment nodes.
677
678 2005-12-30  Eric Seidel  <eseidel@apple.com>
679
680         Reviewed by mjs.
681
682         No functional changes, thus no layout test.
683
684         Just removes debug NSLog() calls from ksvg2/kcanvas.
685         http://bugzilla.opendarwin.org/show_bug.cgi?id=6299
686
687         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
688         (KCanvasFilterQuartz::prepareFilter):
689         (KCanvasFilterQuartz::applyFilter):
690         (KCanvasFilterQuartz::getCIFilterStack):
691         (KCanvasFilterQuartz::imageForName):
692         (KCanvasFEBlendQuartz::getCIFilter):
693         (KCanvasFEColorMatrixQuartz::getCIFilter):
694         (KCanvasFEGaussianBlurQuartz::getCIFilter):
695         * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
696         (KCanvasClipperQuartz::applyClip):
697         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
698         (KRenderingDeviceContextQuartz::mapFromVisual):
699         (KRenderingDeviceContextQuartz::mapToVisual):
700         (KRenderingDeviceQuartz::createResource):
701         (KRenderingDeviceQuartz::createFilterEffect):
702         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
703         (drawShadingWithStyle):
704         (KRenderingPaintServerGradientQuartz::updateQuartzGradientCache):
705         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
706         (KRenderingPaintServerPatternQuartz::draw):
707         * ksvg2/svg/svgpathparser.cpp:
708         (SVGPathParser::parseSVG):
709
710 2005-12-29  Graham Dennis  <Graham.Dennis@gmail.com>
711
712         Reviewed by Hyatt.
713
714         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3579
715           In-place style-switching is leaving junk behind, messing up styles
716
717         * khtml/rendering/render_block.h: (khtml::RenderBlock::initMaxMarginValues):
718         Set all margin values in all cases.
719
720 2005-12-29  Eric Seidel  <eseidel@apple.com>
721
722         Reviewed by mjs.
723
724         XML documents with "html" in dtd name use XHTML entities when they shouldn't
725         http://bugzilla.opendarwin.org/show_bug.cgi?id=6290
726
727         * khtml/xml/xml_tokenizer.cpp:
728         (khtml::externalSubsetHandler): check for exact xhtml types
729
730 2005-12-29  Eric Seidel  <eseidel@apple.com>
731
732         Reviewed by mjs.
733
734         Close leak in CollectionInfo due to HashMap migration
735         http://bugzilla.opendarwin.org/show_bug.cgi?id=6295
736
737         * khtml/html/html_miscimpl.cpp:
738         (DOM::HTMLCollectionImpl::CollectionInfo::~CollectionInfo):
739         * khtml/html/html_miscimpl.h:
740
741 2005-12-29  Maciej Stachowiak  <mjs@apple.com>
742
743         Reviewed by Eric.
744
745         - finished frame traversal cleanup
746         http://bugzilla.opendarwin.org/show_bug.cgi?id=6293
747         
748         * kwq/WebCoreBridge.h: Removed childFrames method from WebCoreBridge protocol
749         since it is not actually used.
750
751 2005-12-29  Eric Seidel  <eseidel@apple.com>
752
753         Reviewed by mjs.
754
755         Leaks in XSLTProcessorImpl due to early exit in failure case
756         http://bugzilla.opendarwin.org/show_bug.cgi?id=6101
757
758         * khtml/xsl/xslt_processorimpl.cpp:
759         (DOM::xmlDocPtrFromNode): add "shouldDelete" argument
760         (DOM::XSLTProcessorImpl::transformToString): delete new'd xmlDoc
761
762 2005-12-29  Eric Seidel  <eseidel@apple.com>
763
764         File accidentally omitted from previous commit.
765
766         Remove QDict from khtml/html
767         http://bugzilla.opendarwin.org/show_bug.cgi?id=6230
768
769         * khtml/ecma/kjs_html.cpp:
770         (KJS::KJS::HTMLCollection::getNamedItems):
771
772 2005-12-29  Eric Seidel  <eseidel@apple.com>
773
774         Reviewed by mjs.
775
776         Remove QDict from khtml/html
777         http://bugzilla.opendarwin.org/show_bug.cgi?id=6230
778         Uses HashMap instead.
779
780         * khtml/html/html_miscimpl.cpp:
781         (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
782         (DOM::HTMLCollectionImpl::CollectionInfo::reset):
783         (DOM::HTMLCollectionImpl::namedItem):
784         (DOM::HTMLCollectionImpl::updateNameCache):
785         (DOM::HTMLCollectionImpl::namedItems):
786         (DOM::HTMLCollectionImpl::nextNamedItem):
787         (DOM::HTMLFormCollectionImpl::nextNamedItemInternal):
788         (DOM::HTMLFormCollectionImpl::updateNameCache):
789         * khtml/html/html_miscimpl.h:
790
791 2005-12-29  Eric Seidel  <eseidel@apple.com>
792
793         Reviewed by mjs.
794
795         DOMString/DOMStringImpl/AtomicString need enhancements before replacing QString
796         http://bugzilla.opendarwin.org/show_bug.cgi?id=6228
797         Added find(), contains(), startsWith() and endsWith() to DOMString
798         Uses the above functions throughout the code.
799         Small performance boost.
800
801         * khtml/css/css_base.cpp:
802         (CSSSelector::print):
803         * khtml/css/css_ruleimpl.cpp:
804         (DOM::CSSImportRuleImpl::init):
805         * khtml/css/css_valueimpl.cpp:
806         (DOM::CSSStyleDeclarationImpl::setProperty):
807         * khtml/css/cssparser.cpp:
808         (CSSParser::parseValue):
809         (CSSParser::parseDeclaration):
810         (CSSParser::parseContent):
811         * khtml/css/cssstyleselector.cpp:
812         (khtml::CSSStyleSelector::CSSStyleSelector):
813         (khtml::CSSStyleSelector::setEncodedURL):
814         (khtml::parseUASheet):
815         (khtml::cleanpath):
816         (khtml::CSSStyleSelector::checkSelector):
817         (khtml::CSSStyleSelector::checkOneSelector):
818         (khtml::CSSRuleSet::addRulesFromSheet):
819         (khtml::CSSStyleSelector::applyProperty):
820         * khtml/dom/dom_string.cpp:
821         * khtml/dom/dom_string.h:
822         (DOM::DOMString::contains):
823         (DOM::DOMString::find):
824         (DOM::DOMString::startsWith):
825         (DOM::DOMString::endsWith):
826         * khtml/html/html_formimpl.cpp:
827         (DOM::HTMLFormElementImpl::parseEnctype):
828         * khtml/khtml_part.cpp:
829         (KHTMLPart::requestFrame):
830         (KHTMLPart::submitForm):
831         * khtml/misc/decoder.cpp:
832         (Decoder::decode):
833         * khtml/xml/dom_atomicstring.h:
834         (DOM::AtomicString::length):
835         (DOM::AtomicString::operator []):
836         (DOM::AtomicString::contains):
837         (DOM::AtomicString::find):
838         (DOM::AtomicString::startsWith):
839         (DOM::AtomicString::endsWith):
840         * khtml/xml/dom_docimpl.cpp:
841         (DocumentImpl::processHttpEquiv):
842         * khtml/xml/dom_stringimpl.cpp:
843         (DOM::equal):
844         (DOM::equalCaseInsensitive):
845         (DOM::DOMStringImpl::find):
846         (DOM::DOMStringImpl::endsWith):
847         * khtml/xml/dom_stringimpl.h:
848         (DOM::DOMStringImpl::startsWith):
849
850 2005-12-29  Rob Buis  <rwlbuis@xs4all.nl>
851
852         Reviewed by eseidel.
853
854         WebCore+SVG has some problems with rounded rectangles
855         http://bugzilla.opendarwin.org/show_bug.cgi?id=6157
856
857         * ksvg2/svg/SVGRectElementImpl.cpp:
858         (SVGRectElementImpl::toPathData): fixed round rect calculations
859
860 2005-12-29  Mark Rowe  <opendarwin.org@bdash.net.nz>
861
862         Reviewed by eseidel, ggaren, darin.
863         
864         - http://bugzilla.opendarwin.org/show_bug.cgi?id=4301
865         Support HTML entities on pages parsed as XHTML
866
867         Added layout tests:
868         * fast/parser/entities-in-xhtml.xhtml
869
870         * khtml/xml/xml_tokenizer.cpp:
871         (khtml::XMLTokenizer::setIsXHTMLDocument): Track whether the XML document is XHTML.
872         (khtml::XMLTokenizer::isXHTMLDocument): Ditto.
873         (khtml::externalSubsetHandler): Ditto.
874         (khtml::XMLTokenizer::finish): Ditto.
875         (khtml::getXHTMLEntity): Look up the HTML entity.
876         (khtml::getEntityHandler): Look up the HTML entity if this is an XHTML document.
877         * khtml/html/kentities.h: Added.
878         * khtml/html/kentities.gperf: changed entity to Entity
879
880 2005-12-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
881
882         Reviewed by darin
883
884         - WebCore part of fix for
885           http://bugzilla.opendarwin.org/show_bug.cgi?id=3922
886           Variable word/letter spacing and full justification not supported for
887           ATSUI-rendered text
888
889         * khtml/rendering/font.h:
890         (khtml::Font::checkSelectionPoint): Make sure the complete run, used for
891         counting spaces and determining padding per space does not go beyond the
892         text box.
893
894 2005-12-28  Geoffrey Garen  <ggaren@apple.com>
895
896         Reviewed by mjs.
897
898         - Fixed <rdar://problem/4325722> crash in KJS::Bindings::dispatchJNICall
899         due to liveconnect call from Java after Java PlugInView has been 
900         deallocated @ www.binarybet.com
901         AKA
902         http://bugzilla.opendarwin.org/show_bug.cgi?id=5518
903
904         We had code that checked for whether a call came from a live PlugIn,
905         but the live PlugIn dictionary would only get cleared when the 
906         KWQKHTMLPart was destroyed. Since a single part can service multiple
907         loads, the dictionary needs to clear after each one.
908
909         No layout test because this bug is difficult to reproduce.
910
911         * kwq/KWQKHTMLPart.mm:
912         (KWQKHTMLPart::~KWQKHTMLPart):
913         (1) Unrelated cleanup: Removed manual clearing of form values,
914         replaced with call to clearRecordedFormValues().
915         (2) Replaced PlugIn dictionary cleanup code and view deref call
916         with call to setView(0), since much of this code was duplicated in
917         setView, and the stuff that wasn't duplicated needed to be.
918
919         (KWQKHTMLPart::setView):
920         (1) Removed some unnecessary braces.
921         (2) Added PlugIn dictionary cleanup code.
922         (3) New behavior: clear _bindingRoot and _windowScriptObject after
923         each view change. This is needed because after a call to
924         clenaupPluginRootObjects(), both objects have stale references.
925         (4) Changed a NULL to a 0.
926
927         (KWQKHTMLPart::cleanupPluginRootObjects): Removed extra space.
928
929 2005-12-28  Anders Carlsson  <andersca@mac.com>
930
931         Reviewed by Maciej.
932
933         - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6268
934         Add undetectable document.all
935         
936         * khtml/ecma/kjs_html.cpp:
937         (KJS::HTMLDocument::getValueProperty):
938         If "all" has been set to a new value, return the new value.
939         
940         (KJS::KJS::HTMLDocument::putValueProperty):
941         Allow "all" to be set to a new value.
942         
943         (KJS::HTMLAllCollection::toPrimitive):
944         Return jsNull() if the preferred type is NullType.
945         
946         (KJS::getAllHTMLCollection):
947         * khtml/ecma/kjs_html.h:
948         (KJS::HTMLAllCollection::HTMLAllCollection):
949         Add HTMLAllCollection, a subclass of HTMLCollection which should
950         be undetectable.
951         
952         (KJS::HTMLAllCollection::toBoolean):
953         Return false.
954
955 2005-12-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
956
957         Reviewed by Eric, landed by ap.
958         
959         Test: fast/block/basic/text-indent-rtl.html
960
961         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6214
962           text-indent in RTL block does the opposite
963
964         * khtml/rendering/render_block.cpp:
965         (khtml::RenderBlock::rightRelOffset): Subtract the indent instead of adding it.
966
967 2005-12-28  Mitz Pettel  <opendarwin.org@mitzpettel.com>
968
969         Reviewed by Darin, landed by ap.
970
971         Test: fast/dom/HTMLScriptElement/script-load-events.html
972
973         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5812
974           Generate load events for <script> elements
975
976         * khtml/html/html_headimpl.cpp:
977         (HTMLScriptElementImpl::parseMappedAttribute): Parse the onload and onerror attributes.
978         (HTMLScriptElementImpl::closeRenderer): Call base class's implementation.
979         (HTMLScriptElementImpl::notifyFinished): Dispatch load and error events.
980         * khtml/html/htmlparser.h:
981         * khtml/html/htmlparser.cpp:
982         (HTMLParser::parseToken): Return the node that was inserted.
983         * khtml/html/htmltokenizer.h: Added scriptNode, a RefPtr to the node corresponding
984         to the current load request.
985         * khtml/html/htmltokenizer.cpp:
986         (HTMLTokenizer::scriptHandler): Reset scriptNode if a load request was not made.
987         (HTMLTokenizer::parseTag): Set scriptNode to the node created from the script tag.
988         (HTMLTokenizer::processToken): Return the node that was inserted.
989         (HTMLTokenizer::notifyFinished): Reset scriptNode and dispatch load and error events.
990         * khtml/misc/loader.h:
991         (CachedScript::errorOccurred): Added.
992         * khtml/misc/loader.cpp:
993         (CachedScript::CachedScript):
994         (CachedScript::error):
995
996 2005-12-28  Alexey Proskuryakov  <ap@nypop.com>
997
998         Reviewed by Maciej.
999
1000         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6246
1001           TextIterator::rangeFromLocationAndLength() returns nil range for an 
1002           empty document
1003
1004         Test: editing/input/range-for-empty-document.html
1005
1006         * khtml/editing/visible_text.cpp:
1007         (khtml::TextIterator::rangeFromLocationAndLength):
1008         Handle the case of an empty document and (0, 0) requested range.
1009
1010 2005-12-28  Anders Carlsson  <andersca@mac.com>
1011
1012         Reviewed and landed by Geoff.
1013
1014         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6269
1015         ToT memory corruption
1016         
1017         * khtml/rendering/render_text.cpp:
1018         (khtml::RenderText::setText):
1019         Remove deref().
1020         
1021 2005-12-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1022
1023         Reviewed by Hyatt, landed by Darin.
1024         
1025         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5699
1026           REGRESSION: incomplete repaint
1027
1028         * khtml/rendering/render_object.cpp:
1029         (RenderObject::repaintAfterLayoutIfNeeded): Return false if only the
1030         size changed and not everything was repainted.
1031         * manual-tests/bugzilla-5699.html: Added.
1032
1033 2005-12-27  Sam Weinig  <sam.weinig@gmail.com>
1034
1035         Reviewed by Maciej, landed by Darin.
1036
1037         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=4101>
1038         CSS Fibonacci spiral using 4 images doesn't render correctly
1039
1040         Added layout tests:
1041         * fast/replaced/absolute-image-sizing.html
1042
1043         * khtml/rendering/render_box.cpp:
1044         (RenderBox::calcAbsoluteHorizontalValues): Use calcReplacedWidth() instead of intrinsicWidth()
1045         for replaced elements.
1046         (RenderBox::calcAbsoluteVerticalValues): Same thing for height.
1047
1048 2005-12-27  Darin Adler  <darin@apple.com>
1049
1050         Reviewed by Geoff and Eric.
1051
1052         - http://bugzilla.opendarwin.org/show_bug.cgi?id=6198
1053           use RefPtr a few places in RenderText and related classes
1054
1055         * khtml/html/htmltokenizer.h: Use RefPtr for some data members in Token.
1056         Also removed use of bitfields in Token, since there's no need to optimize storage here.
1057         * khtml/html/htmlparser.cpp:
1058         (HTMLParser::parseToken): Update for use of RefPtr in Token.
1059         (HTMLParser::textCreateErrorCheck): Ditto.
1060         (HTMLParser::commentCreateErrorCheck): Ditto.
1061         (HTMLParser::handleIsindex): Ditto.
1062         * khtml/html/htmltokenizer.cpp:
1063         (khtml::Token::addAttribute): Ditto.
1064         (khtml::HTMLTokenizer::processToken): Ditto.
1065
1066         * khtml/rendering/render_text.h: Reduce the number of includes, change
1067         SOFT_HYPHEN from a macro into a constant. Change originalString function
1068         to return a PassRefPtr instead of a RefPtr. Make str and m_generatedContentStr
1069         member be a RefPtr.
1070         * khtml/rendering/render_text.cpp:
1071         (khtml::RenderText::previousOffset): Update for use of RefPtr for str.
1072         (khtml::RenderText::nextOffset): Ditto.
1073         (khtml::RenderText::RenderText): Ditto.
1074         (khtml::RenderText::originalString): Change to return PassRefPtr, even though
1075         it's not necessary at this level (since it's a virtual function).
1076         (khtml::RenderText::posOfChar): Update for use of RefPtr for str.
1077         (khtml::RenderText::setText): Ditto.
1078         (khtml::RenderTextFragment::RenderTextFragment): Ditto.
1079         (khtml::RenderTextFragment::originalString): Change to return PassRefPtr.
1080
1081         * khtml/html/html_inlineimpl.cpp: Re-sorted list of includes, added newly-needed ones.
1082         * kwq/KWQRenderTreeDebug.cpp: Added new include needed since QPtrVector is no longer
1083         included by render_text.h.
1084
1085 2005-12-27  Darin Adler  <darin@apple.com>
1086
1087         Fix suggested by Mitz.
1088
1089         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6240
1090           REGRESSION: scrollbars in overflows don't work
1091
1092         * khtml/xml/dom2_eventsimpl.cpp: (DOM::MouseRelatedEventImpl::computePositions):
1093         Remove the code to compute pageX/Y from clientX/Y, because clientX/Y are not passed
1094         in correctly (in fact, what's passed in is pageX/Y)! I accidentally included part
1095         of my fix for clientX/Y in the original patch.
1096
1097 2005-12-27  Maks Orlovich <maksim@kde.org>
1098
1099         Reviewed and landed by Maciej.
1100
1101         - fixed 4405: <button> not listed in form collections.
1102         http://bugzilla.opendarwin.org/show_bug.cgi?id=4405
1103
1104         Test: fast/forms/button-in-forms-collection.html
1105
1106         * khtml/html/html_formimpl.h:
1107         (DOM::HTMLButtonElementImpl::isEnumeratable): override to return true
1108
1109 2005-12-25  Maciej Stachowiak  <mjs@apple.com>
1110
1111         Reviewed by Geoff.
1112
1113         - Remove WebFrame's parent frame pointer, instead rely on WebCore's parent concept
1114         http://bugzilla.opendarwin.org/show_bug.cgi?id=6241
1115
1116         * kwq/WebCoreBridge.h:
1117         * kwq/WebCoreBridge.mm:
1118         (-[WebCoreBridge parent]): New method, relies on the KHTMLPart's
1119         parent pointer.
1120
1121 2005-12-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1122
1123         Reviewed by eseidel.
1124         
1125         Test: fast/forms/domstring-replace-crash.html
1126
1127         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6236
1128           REGRESSION: Crash in DOMString::replace() in ToT (12/24/05)
1129
1130         * khtml/dom/dom_string.h:
1131         (DOMString::replace): Added check for null m_impl.
1132
1133 2005-12-24  Maciej Stachowiak  <mjs@apple.com>
1134
1135         Reviewed by Eric.
1136
1137         - replaced QPtrDict for Accessors structs with HashMap (also renamed some
1138         stray getSetInfo methods)
1139         http://bugzilla.opendarwin.org/show_bug.cgi?id=6223
1140
1141         * khtml/ecma/kjs_html.cpp:
1142         (KJS::HTMLElement::accessors):
1143         (KJS::HTMLElement::getValueProperty):
1144         (KJS::HTMLElement::putValueProperty):
1145         * khtml/ecma/kjs_html.h:
1146
1147 2005-12-24  Geoffrey Garen  <ggaren@apple.com>
1148
1149         Reviewed by eric.
1150
1151         http://bugzilla.opendarwin.org/show_bug.cgi?id=6231
1152
1153         - Fixed assertion failure in QString::mid caused by my last checkin. 
1154         parseWindowFeatures() sometimes called QString::mid() with a start 
1155         index past the end of the string but a length of 0. There were two 
1156         problems there. (1) parseWindowFeatures() shouldn't have gotten past 
1157         the end of the string. (2) QString had range truncating code that was 
1158         borked. So I fixed both.
1159
1160         * khtml/ecma/kjs_window.cpp:
1161         (KJS::parseWindowFeatures): One of the "past the end" tests was > 
1162         instead of >=.
1163         * kwq/KWQString.mm:
1164         (QString::mid): Truncate length *before* deciding whether to return 
1165         early. Also, compare start and data._length before computing 
1166         data._length - start, because the error case we're trying to catch 
1167         will almost certainly cause unsigned overflow.
1168         * manual-tests/window-open-features-parsing.html: Added trailing ',' 
1169         to uber-test to catch this failure, too.
1170
1171 2005-12-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1172
1173         Reviewed by Maciej.
1174
1175         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6221
1176           REGRESSION: Password field is blank error for secure websites using
1177           password field (ToT, 12/24/05)
1178
1179         * khtml/kwq/KWQSlot.mm:
1180         (KWQSlot::KWQSlot): Changed the parameter type of slotTextChanged to const DOMString &
1181         * khtml/rendering/render_form.h:
1182         * khtml/rendering/render_form.cpp:
1183         (RenderLineEdit::RenderLineEdit): ditto.
1184         (RenderLineEdit::slotTextChanged): ditto.
1185         (RenderFileButton::RenderFileButton): ditto.
1186         (RenderFileButton::slotTextChanged): ditto.
1187
1188 2005-12-22  Geoffrey Garen  <ggaren@apple.com>
1189     
1190         Reviewed by vicki (yay!), eric.
1191
1192         - Fixed: <rdar://problem/4377597> parsing of window.open features strings needs to be more forgiving
1193
1194         Manual test case: WebCore/manual-tests/window-open-features-parsing.html
1195         Also fixed: WebCore/manual-tests/window-open-features.html, which had an incorrect URL in it.
1196
1197         This patch is long. Luckily, it's also complicated.
1198
1199         The main thing I've done is to change our parsing of the window.open 'features' argument to match Win IE.
1200         This is important because we now implement the correct defaults for window.open, and resizing and
1201         scrolling are turned off by default. So, if we parse the 'features' string incorrectly, we'll end
1202         up with an annoying, incorrectly sized window that can't resize or scroll.
1203
1204         To honor a long-standing request by Eric, I factored out the parsing into two new functions:
1205         parseWindowFeatures and constrainToScreen. I also added support for "innerWidth" and "innerHeight,"
1206         since they're just synonyms for "width" and "height."
1207
1208         * khtml/ecma/kjs_window.cpp: removed "emit" statements, since emit is #defined as ""
1209         (KJS::parseDialogFeatures): renamed from parseFeatures, since we now have a 'parseWindowFeatures'.
1210         (KJS::showModalDialog): ditto on parseFeatures. Also added some missing initializations for WindowArgs data members.
1211         (KJS::parseWindowFeatures): new function, all new functionality.
1212         (KJS::constrainToScreen): new function, no new functionality -- just cut and pasted code that used to run as
1213         part of our parsing routine.
1214         (KJS::WindowFunc::callAsFunction):
1215         (1) Factored out previous parsing code.
1216         (2) Factored 17 lines of custom popup-blocking code into 3 lines that use pre-existing 'allowPopUp' function.
1217             Gratuitous, but it cried out to me.
1218         (3) Changed URL parsing to substitute "" for undefined *and* null values (we already did this for undefined),
1219             to avoid trying to navigate to 'http://null'.
1220         (4) Factore a multiline if () { if () {}} into an if ( && )
1221         (4) Removed the main body of code from a giant 'else' block by inserting early returns for the exceptional cases.
1222             This caused some things to show up in the diff even though they're just whitespace changes.
1223             I didn't actually change any code past the line "if (!str.isEmpty() && activePart)"
1224         * kwq/KWQKHTMLPartBrowserExtension.mm:
1225         (KHTMLPartBrowserExtension::createNewWindow): Added code to set toolbars to visible if toolBarVisible is true *or*
1226         locationBarVisible is true. The parser used to do this for us, but it's really the browser that's responsible for
1227         saying that the toolbar and the locationbar are the same thing. Hopefully, we can add a setLocationBarVisible delegate
1228         in the future so that other webkit clients can make their own UI decisions.
1229         * kwq/KWQKPartsBrowserExtension.h: Added locationBarVisible data member to WindowArgs structure and renamed
1230         toolBarsVisible to toolBarVisible (see above). Removed initialization code from WindowArgs structure because
1231         this file is for platform-specific code, and what defaults to use for window arguments is purely engine stuff.
1232
1233 2005-12-23  Eric Seidel  <eseidel@apple.com>
1234
1235         Reviewed by mjs.
1236
1237         Remove many use of .qstring()
1238         Convert several instances of QStrings to DOMStrings
1239         Add DOMString::replace(QChar, QChar)
1240         Remove (unused) KWQLabel, KWQKGlobal
1241         Slight performance improvement.
1242         Also fixed ChangeLog line endings from previous commit.
1243         http://bugzilla.opendarwin.org/show_bug.cgi?id=6138
1244
1245         No tests needed, no functionality changes.
1246
1247         * ChangeLog: Fixed line endings
1248         * ForwardingHeaders/kglobal.h: Removed.
1249         * ForwardingHeaders/qlabel.h: Removed.
1250         * WebCore.xcodeproj/project.pbxproj: removed KWQLabel
1251         * khtml/css/css_base.cpp:
1252         (CSSSelector::selectorText):
1253         * khtml/css/css_stylesheetimpl.cpp:
1254         (MediaListImpl::setMediaText):
1255         * khtml/css/cssstyleselector.cpp:
1256         (khtml::checkPseudoState):
1257         * khtml/dom/dom_string.h:
1258         (DOM::DOMString::replace):
1259         * khtml/ecma/kjs_css.cpp:
1260         (KJS::DOMCSSStyleDeclaration::put):
1261         * khtml/ecma/kjs_dom.cpp:
1262         (KJS::DOMNode::put):
1263         (KJS::DOMAttr::put):
1264         (KJS::DOMDocument::put):
1265         * khtml/ecma/kjs_events.cpp:
1266         (KJS::JSAbstractEventListener::handleEvent):
1267         * khtml/ecma/kjs_html.cpp:
1268         (KJS::KJS::HTMLDocument::put):
1269         (KJS::KJS::HTMLElementFunction::callAsFunction):
1270         (KJS::KJS::HTMLElement::put):
1271         (KJS::KJS::Context2DFunction::callAsFunction):
1272         (KJS::Context2D::putValueProperty):
1273         * khtml/ecma/kjs_proxy.cpp:
1274         (KJSProxyImpl::evaluate):
1275         * khtml/ecma/kjs_window.cpp:
1276         (KJS::Window::isSafeScript):
1277         (KJS::WindowFunc::callAsFunction):
1278         (KJS::ScheduledAction::execute):
1279         * khtml/ecma/xmlhttprequest.cpp:
1280         (KJS::XMLHttpRequest::send):
1281         (KJS::XMLHttpRequestProtoFunc::callAsFunction):
1282         * khtml/ecma/xmlhttprequest.h:
1283         * khtml/editing/jsediting.cpp:
1284         (DOM::JSEditor::queryCommandSupported):
1285         * khtml/editing/markup.cpp:
1286         (khtml::stringValueForRange):
1287         (khtml::startMarkup):
1288         * khtml/html/html_baseimpl.cpp:
1289         (HTMLBodyElementImpl::parseMappedAttribute):
1290         * khtml/html/html_elementimpl.cpp:
1291         (HTMLElementImpl::addHTMLAlignment):
1292         * khtml/html/html_formimpl.cpp:
1293         (DOM::HTMLFormElementImpl::formData):
1294         (DOM::HTMLInputElementImpl::appendFormData):
1295         (DOM::HTMLTextAreaElementImpl::updateValue):
1296         * khtml/html/html_headimpl.cpp:
1297         (HTMLLinkElementImpl::parseMappedAttribute):
1298         * khtml/html/html_imageimpl.cpp:
1299         (DOM::HTMLImageElementImpl::parseMappedAttribute):
1300         * khtml/html/html_objectimpl.cpp:
1301         (DOM::HTMLObjectElementImpl::parseMappedAttribute):
1302         (DOM::HTMLParamElementImpl::isURLAttribute):
1303         * khtml/html/html_objectimpl.h:
1304         * khtml/html/html_tableimpl.cpp:
1305         (DOM::HTMLTableElementImpl::addChild):
1306         (DOM::HTMLTableElementImpl::parseMappedAttribute):
1307         (DOM::HTMLTablePartElementImpl::parseMappedAttribute):
1308         (DOM::HTMLTableSectionElementImpl::addChild):
1309         (DOM::HTMLTableRowElementImpl::addChild):
1310         * khtml/html/htmltokenizer.cpp:
1311         (khtml::HTMLTokenizer::parseTag):
1312         * khtml/khtml_part.cpp:
1313         (KHTMLPart::executeScript):
1314         (KHTMLPart::checkEmitLoadEvent):
1315         * khtml/misc/loader.cpp:
1316         (CachedObject::finish):
1317         (CachedCSSStyleSheet::checkNotify):
1318         (CachedXSLStyleSheet::checkNotify):
1319         (CachedXBLDocument::checkNotify):
1320         (DocLoader::requestImage):
1321         (DocLoader::requestStyleSheet):
1322         (DocLoader::requestScript):
1323         (Loader::servePendingRequests):
1324         (Loader::cancelRequests):
1325         * khtml/rendering/render_applet.cpp:
1326         * khtml/rendering/render_block.cpp:
1327         (khtml::RenderBlock::updateFirstLetter):
1328         * khtml/rendering/render_box.cpp:
1329         (RenderBox::~RenderBox):
1330         * khtml/rendering/render_form.cpp:
1331         (RenderFormElement::slotTextChanged):
1332         (RenderLineEdit::updateFromElement):
1333         (RenderTextArea::updateFromElement):
1334         (RenderTextArea::text):
1335         * khtml/rendering/render_form.h:
1336         * khtml/rendering/render_frames.cpp:
1337         (RenderPartObject::updateWidget):
1338         * khtml/rendering/render_line.cpp:
1339         (khtml::EllipsisBox::paint):
1340         * khtml/rendering/render_list.cpp:
1341         (RenderListItem::paint):
1342         (RenderListMarker::paint):
1343         * khtml/rendering/render_text.cpp:
1344         (khtml::RenderText::RenderText):
1345         (khtml::RenderText::position):
1346         * khtml/xml/dom_docimpl.cpp:
1347         (DOMImplementationImpl::hasFeature):
1348         (DocumentImpl::getElementByAccessKey):
1349         (DocumentImpl::recalcStyleSelector):
1350         (DocumentImpl::defaultEventHandler):
1351         * khtml/xml/dom_elementimpl.cpp:
1352         (ElementImpl::recalcStyle):
1353         * khtml/xml/dom_nodeimpl.cpp:
1354         (DOM::NodeImpl::dump):
1355         (DOM::appendAttributeDesc):
1356         (DOM::NodeImpl::showNode):
1357         * khtml/xml/dom_stringimpl.cpp:
1358         (DOM::DOMStringImpl::lower):
1359         * khtml/xml/xml_tokenizer.cpp:
1360         (khtml::XMLTokenizer::executeScripts):
1361         * khtml/xsl/xsl_stylesheetimpl.cpp:
1362         (DOM::XSLStyleSheetImpl::loadChildSheets):
1363         * kwq/KWQKHTMLPart.h:
1364         * kwq/KWQKHTMLPart.mm:
1365         (KWQKHTMLPart::documentViewForNode):
1366         (KWQKHTMLPart::runJavaScriptAlert):
1367         (KWQKHTMLPart::runJavaScriptConfirm):
1368         (KWQKHTMLPart::runJavaScriptPrompt):
1369         (KWQKHTMLPart::addMessageToConsole):
1370         (KWQKHTMLPart::passWheelEventToChildWidget):
1371         (KWQKHTMLPart::shouldDragAutoNode):
1372         (KWQKHTMLPart::snapshotDragImage):
1373         (convertAttributesToUnderlines):
1374         (KWQKHTMLPart::setMarkedTextRange):
1375         (KWQKHTMLPart::mousePressNode):
1376         * kwq/KWQKGlobal.h: Removed.
1377         * kwq/KWQKGlobal.mm: Removed.
1378         * kwq/KWQLabel.h: Removed.
1379         * kwq/KWQLabel.mm: Removed.
1380         * kwq/KWQLineEdit.h:
1381         * kwq/KWQLineEdit.mm:
1382         (QLineEdit::setText):
1383         (QLineEdit::text):
1384         (QLineEdit::setAutoSaveName):
1385         (QLineEdit::setPlaceholderString):
1386         * kwq/KWQPainter.mm:
1387         (QPainter::compositeOperatorFromString):
1388         * kwq/KWQSignal.h:
1389         * kwq/KWQSignal.mm:
1390         (KWQSignal::call):
1391         * kwq/KWQSlot.h:
1392         * kwq/KWQSlot.mm:
1393         (KWQSlot::call):
1394         * kwq/KWQString.h:
1395         * kwq/KWQString.mm:
1396         * kwq/KWQTextEdit.h:
1397         * kwq/KWQTextEdit.mm:
1398         (QTextEdit::setText):
1399         (QTextEdit::text):
1400         (QTextEdit::textWithHardLineBreaks):
1401         * ksvg2/scripts/cssmakeprops: removed kglobal.h
1402         * ksvg2/scripts/cssmakevalues: removed kglobal.h
1403
1404 2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
1405
1406         Reviewed by Eric Seidel.
1407
1408         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5924
1409           Zero-length responses to XMLHTTPRequest mishandled
1410
1411         * khtml/ecma/xmlhttprequest.cpp (KJS::XMLHttpRequest::slotFinished):
1412           Make sure to fetch response headers and set the state to Loaded, if
1413           this hasn't been done already.
1414
1415 2005-12-23  Alexey Proskuryakov  <ap@nypop.com>
1416
1417         Reviewed by Eric Seidel.
1418
1419         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3565
1420           Posting data via XML HTTP Request doesnt work
1421
1422         * khtml/ecma/xmlhttprequest.cpp:
1423         (KJS::XMLHttpRequest::send): Set application/xml as a default Content-Type;
1424           use a proper codec for request body if a charset is specified.
1425         (KJS::XMLHttpRequest::getRequestHeader): Use getSpecificHeader.
1426         (KJS::XMLHttpRequest::getResponseHeader): Ditto.
1427         (KJS::XMLHttpRequest::getSpecificHeader): Factored out code from getResponseHeader.
1428         (KJS::XMLHttpRequestProtoFunc::callAsFunction): Removed a FIXME (this is done in send() now).
1429         * khtml/ecma/xmlhttprequest.h:
1430
1431 2005-12-22  Alexey Proskuryakov  <ap@nypop.com>
1432
1433         Reviewed by Darin Adler.
1434
1435         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6118
1436         Investigate not using the frameset charset as a default for frames
1437
1438         * khtml/khtml_part.cpp (KHTMLPart::write):
1439         Do not use the parent frame encoding as a default for sub-frames (revert
1440         rdar://3100151). 
1441
1442 2005-12-22  Maciej Stachowiak  <mjs@apple.com>
1443
1444         Reviewed by Eric.
1445
1446         - made RefPtr<DOMStringImpl> usable as a hashtable key/value
1447         - changed XSLTProcessorImpl to make use of this instead of a QDict.
1448         - partially fixed broken param handling for xslt
1449
1450         See LayoutTests for updated test case.
1451
1452         * khtml/xml/dom_stringimpl.cpp:
1453         * khtml/xml/dom_stringimpl.h:
1454         (KXMLCore::): Set things up so you can use RefPtr<DOMStringImpl> as
1455         a hashtable key (should already be usable as a value).
1456         * khtml/xsl/xslt_processorimpl.cpp:
1457         (DOM::xsltParamArrayFromParameterMap): Updated to use a HashMap of RefPtrs instead
1458         of QDict. Also, fixed bugs that would have kept this from ever working at all.
1459         (DOM::XSLTProcessorImpl::transformToString): ditto
1460         (DOM::XSLTProcessorImpl::setParameter): ditto
1461         (DOM::XSLTProcessorImpl::getParameter): ditto
1462         (DOM::XSLTProcessorImpl::removeParameter): ditto
1463         * khtml/xsl/xslt_processorimpl.h:
1464
1465 2005-12-21  Maciej Stachowiak  <mjs@apple.com>
1466
1467         Reviewed by Darin.
1468
1469         - update for new HashTranslator stuff
1470
1471         * khtml/xml/dom_atomicstring.cpp:
1472         (DOM::CStringTranslator::hash):
1473         (DOM::CStringTranslator::equal):
1474         (DOM::CStringTranslator::translate):
1475         (DOM::AtomicString::equal):
1476         (DOM::AtomicString::add):
1477         (DOM::QCharBufferTranslator::hash):
1478         (DOM::QCharBufferTranslator::equal):
1479         (DOM::QCharBufferTranslator::translate):
1480         * khtml/xml/dom_qname.cpp:
1481         (DOM::QNameComponentsTranslator::hash):
1482         (DOM::QNameComponentsTranslator::equal):
1483         (DOM::QNameComponentsTranslator::translate):
1484         (DOM::QualifiedName::QualifiedName):
1485
1486 2005-12-22  Adele Peterson  <adele@apple.com>
1487
1488         Reviewed by Darin.
1489
1490         Cleaned up a previous checkin by defining global const defaultForm.
1491
1492         * khtml/xml/dom_docimpl.cpp:
1493         (DocumentImpl::radioButtonChecked):
1494         (DocumentImpl::checkedRadioButtonForGroup):
1495         (DocumentImpl::removeRadioButtonGroup):
1496
1497 2005-12-22  Adele Peterson  <adele@apple.com>
1498
1499         Reviewed by Tim Hatcher.
1500
1501         Fixed <rdar://problem/4387433> Seed: Radio buttons behave incorrectly in Gmail settings
1502
1503         * khtml/html/html_formimpl.cpp:
1504         (DOM::HTMLFormElementImpl::registerFormElement): update radio button hash map when moving form elements around.
1505         (DOM::HTMLGenericFormElementImpl::insertedIntoTree): ditto.
1506         * khtml/html/html_formimpl.h:
1507         (DOM::HTMLGenericFormElementImpl::isRadioButton): Added.
1508         (DOM::HTMLInputElementImpl::isRadioButton): Added.
1509         * khtml/xml/dom_docimpl.cpp:
1510         (DocumentImpl::radioButtonChecked): 
1511         Added comment explaining that we use 1 for the default form.  We can't use a null pointer as a key for the hash map.
1512         (DocumentImpl::checkedRadioButtonForGroup): Added conversion of null form pointer to 1.
1513         (DocumentImpl::removeRadioButtonGroup): ditto.
1514
1515 2005-12-22  Anders Carlsson  <andersca@mac.com>
1516
1517         Reviewed by Eric.
1518
1519         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6196
1520         Would like to be able to define prototypes in headers
1521
1522         * khtml/ecma/XSLTProcessor.cpp:
1523         * khtml/ecma/domparser.cpp:
1524         * khtml/ecma/kjs_css.cpp:
1525         * khtml/ecma/kjs_dom.cpp:
1526         * khtml/ecma/kjs_events.cpp:
1527         * khtml/ecma/kjs_html.cpp:
1528         * khtml/ecma/kjs_range.cpp:
1529         * khtml/ecma/kjs_traversal.cpp:
1530         * khtml/ecma/kjs_views.cpp:
1531         * khtml/ecma/xmlhttprequest.cpp:
1532         * khtml/ecma/xmlserializer.cpp:
1533         Update for changes to JSC.
1534
1535 2005-12-22  Darin Adler  <darin@apple.com>
1536
1537         Reviewed by NOBODY (OOPS!).
1538
1539         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6198
1540           use RefPtr a few places in RenderText and related classes
1541
1542         * khtml/html/htmlparser.cpp:
1543         (HTMLParser::parseToken): Use get since text pointer is RefPtr now.
1544         (HTMLParser::textCreateErrorCheck): Ditto.
1545         (HTMLParser::commentCreateErrorCheck): Ditto.
1546         (HTMLParser::handleIsindex): Get rid of explicit deref, no longer needed.
1547
1548         * khtml/html/htmltokenizer.h: Make attrs and text fields of Token use
1549         RefPtr. Also stop using bit fields for the flags in Token -- there's no
1550         evidence this makes things faster.
1551         * khtml/html/htmltokenizer.cpp:
1552         (khtml::Token::addAttribute): Get rid of explicit ref, no longer needed.
1553         (khtml::HTMLTokenizer::processToken): Ditto.
1554
1555         * khtml/rendering/render_block.cpp: (khtml::RenderBlock::updateFirstLetter):
1556         Use a PassRefPtr.
1557
1558         * khtml/rendering/render_text.cpp:
1559         (khtml::RenderText::previousOffset): Use get since str pointer is RefPtr now.
1560         (khtml::RenderText::nextOffset): Ditto.
1561         (khtml::RenderText::RenderText): Get rid of explicit ref, no longer needed.
1562         Change to use initializer syntax instead of assignment.
1563         (khtml::RenderText::setStyle): Use PassRefPtr.
1564         (khtml::RenderText::originalString): Ditto.
1565         (khtml::RenderText::setText): Get rid of explicit ref, no longer needed.
1566         (khtml::RenderTextFragment::RenderTextFragment): Get rid of explicit ref,
1567         no longer needed.
1568         (khtml::RenderTextFragment::originalString): Use PassRefPtr.
1569
1570         * khtml/rendering/render_text.h: Change SOFT_HYPEN to be a constant rather than
1571         a preprocessor macro. Used PassRefPtr in a couple places. Made RenderText's str
1572         and RenderTextFragment's m_generatedContentStr be RefPtr.
1573
1574         * khtml/html/html_inlineimpl.cpp: Add a newly-needed include, sort them.
1575         * kwq/KWQRenderTreeDebug.cpp: Add a newly-needed include.
1576
1577 2005-12-22  Darin Adler  <darin@apple.com>
1578
1579         Reviewed by Eric.
1580
1581         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6193
1582           remove some unused KWQ code
1583
1584         * kcanvas/KCanvasCreator.cpp: (KCanvasCreator::self): Don't use static deleter for
1585         two reasons: (1) We don't want any globals with constructors in any of our frameworks
1586         because they slow down framework load time. (2) There's no need to destroy this object at
1587         process termination time -- it's extra work with no benefit. Because of both these
1588         reasons, our KStaticDeleter implementation was basically a no-op.
1589         * ksvg2/svg/SVGDOMImplementationImpl.cpp: (SVGDOMImplementationImpl::self): Ditto.
1590         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setDocumentChanged): Ditto.
1591
1592         * khtml/html/html_canvasimpl.cpp: Removed include of kstringhandler.h.
1593         * khtml/html/html_imageimpl.cpp: Ditto.
1594
1595         * khtml/khtmlpart_p.h: Removed something that was in an "APPLE_CANGES" ifdef.
1596
1597         * ForwardingHeaders/kstaticdeleter.h: Removed.
1598         * ForwardingHeaders/kstringhandler.h: Removed.
1599         * kwq/KWQKStaticDeleter.h: Removed.
1600         * kwq/KWQKStringHandler.h: Removed.
1601         * kwq/KWQKStringHandler.mm: Removed.
1602
1603         * WebCore.xcodeproj/project.pbxproj: Removed files.
1604
1605 2005-12-22  Darin Adler  <darin@apple.com>
1606
1607         Reviewed by Eric.
1608
1609         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6192
1610           add support for non-standard &nsup; entity (implemented in other browsers)
1611
1612         * khtml/html/kentities.gperf: Add "nsup" to table.
1613         * khtml/html/htmltokenizer.cpp: Removed old workaround for inlining issue that no
1614         longer seems to be necessary; also touches the file which is important because
1615         Xcode doesn't seem to understand the dependency on kentities.gperf and the need
1616         to recompile.
1617
1618 2005-12-22  Darin Adler  <darin@apple.com>
1619
1620         Reviewed by Eric.
1621
1622         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6167
1623           RenderStyle default constructor should initialize its members for speed
1624
1625         * khtml/rendering/DataRef.h: (khtml::DataRef::operator=): Eliminate an extra
1626         branch by doing ref before deref instead of == check.
1627
1628         * khtml/rendering/render_style.cpp:
1629         (khtml::initDefaultStyle): Added. Function to initialize the default style
1630         for use in constructor.
1631         (khtml::RenderStyle::RenderStyle): Changed constructor to initalize all the
1632         members with constructor syntax instead of using assignment on all of them.
1633         * khtml/rendering/render_style.h: Removed static data member _default --
1634         it's now a file scope global instead.
1635
1636 2005-12-21  Darin Adler  <darin@apple.com>
1637
1638         Reviewed by Justin.
1639
1640         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6142
1641           intermittent failures in some paste tests
1642
1643         * khtml/editing/apply_style_command.cpp:
1644         (khtml::ApplyStyleCommand::applyBlockStyle): Call new updateLayout member function.
1645         (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1646         (khtml::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): Ditto.
1647         * khtml/editing/composite_edit_command.cpp:
1648         (khtml::CompositeEditCommand::addBlockPlaceholderIfNeeded): Ditto.
1649         (khtml::CompositeEditCommand::findBlockPlaceholder): Ditto.
1650         (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1651         * khtml/editing/delete_selection_command.cpp:
1652         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1653         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1654         * khtml/editing/edit_command.cpp:
1655         (khtml::EditCommand::apply): Ditto.
1656         (khtml::EditCommand::unapply): Ditto.
1657         (khtml::EditCommand::reapply): Ditto.
1658         (khtml::EditCommand::updateLayout): Added. Calls updateLayoutIgnorePendingStylesheets
1659         on the document.
1660         * khtml/editing/edit_command.h: Added updateLayout member function.
1661         * khtml/editing/insert_line_break_command.cpp:
1662         (khtml::InsertLineBreakCommand::doApply): Call new updateLayout member function.
1663         * khtml/editing/insert_paragraph_separator_command.cpp:
1664         (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1665         * khtml/editing/jsediting.cpp:
1666         (DOM::JSEditor::execCommand): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
1667         (DOM::JSEditor::queryCommandEnabled): Ditto.
1668         (DOM::JSEditor::queryCommandIndeterm): Ditto.
1669         (DOM::JSEditor::queryCommandState): Ditto.
1670         (DOM::JSEditor::queryCommandValue): Ditto.
1671         * khtml/editing/markup.cpp: (khtml::createMarkup): Ditto.
1672         * khtml/editing/replace_selection_command.cpp:
1673         (khtml::ReplacementFragment::insertFragmentForTestRendering): Ditto.
1674         (khtml::ReplaceSelectionCommand::fixupNodeStyles): Call new updateLayout member function.
1675         (khtml::ReplacementFragment::computeStylesUsingTestRendering): Call
1676         updateLayoutIgnorePendingStylesheets instead of updateLayout.
1677         (khtml::ReplaceSelectionCommand::doApply): Call new updateLayout member function.
1678         (khtml::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): Ditto.
1679         (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
1680         * khtml/editing/visible_units.cpp:
1681         (khtml::previousLinePosition): Call updateLayoutIgnorePendingStylesheets instead of updateLayout.
1682         (khtml::nextLinePosition): Ditto.
1683         * khtml/html/html_elementimpl.cpp:
1684         (HTMLElementImpl::innerText): Ditto.
1685         * kwq/WebCoreBridge.mm:
1686         (-[WebCoreBridge setSelectedDOMRange:affinity:closeTyping:]): Ditto.
1687         (-[WebCoreBridge smartDeleteRangeForProposedRange:]): Ditto.
1688
1689 2005-12-21  Darin Adler  <darin@apple.com>
1690
1691         Reviewed by Geoff.
1692
1693         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6177
1694           move event code from JavaScript binding into DOM implementation
1695
1696         * khtml/ecma/kjs_events.cpp:
1697         (KJS::DOMMouseEvent::getValueProperty): Change everything to just call through instead of doing
1698         the work here.
1699         (KJS::DOMWheelEvent::getValueProperty): Ditto.
1700
1701         * khtml/xml/dom2_eventsimpl.h:
1702         (DOM::MouseRelatedEventImpl::offsetX):
1703         (DOM::MouseRelatedEventImpl::offsetY):
1704         * khtml/xml/dom2_eventsimpl.cpp:
1705         (DOM::MouseRelatedEventImpl::MouseRelatedEventImpl): Initialize new m_pageX, m_pageY, m_layerX,
1706         m_layerY, m_offsetX, and m_offsetY.
1707         (DOM::MouseRelatedEventImpl::computePositions): Renamed from computeLayerPos since it handles
1708         page position andoffset position too now.
1709         (DOM::MouseRelatedEventImpl::pageX): Added. Not in header since it's virtual.
1710         (DOM::MouseRelatedEventImpl::pageY): Ditto.
1711         (DOM::MouseRelatedEventImpl::x): Added, with FIXME since it should change eventually.
1712         (DOM::MouseRelatedEventImpl::y): Ditto.
1713         (DOM::MouseEventImpl::initMouseEvent): Call computePositions instead of computeLayerPos.
1714         (DOM::MouseEventImpl::toElement): Added.
1715         (DOM::MouseEventImpl::fromElement): Added.
1716
1717 2005-12-21  Timothy Hatcher  <timothy@apple.com>
1718
1719         * WebCore.xcodeproj/project.pbxproj:
1720           Set tab width to 8, indent width to 4 and uses tabs to false per file.
1721
1722 2005-12-21  John Sullivan  <sullivan@apple.com>
1723
1724         Reviewed by Tim Omernick and Darin Adler.
1725         
1726         - fixed HiDPI problem with forms auto-fill menu width
1727
1728         No test cases added; this code is used for "chrome" only.
1729
1730         * kwq/DOMHTML.mm:
1731         (-[DOMHTMLInputElement _rectOnScreen]):
1732         convert entire rect to window coordinates, not just origin
1733
1734 2005-12-21  David Harrison  <harrison@apple.com>
1735
1736         Reviewed by Justin.
1737
1738         <rdar://problem/4039777> Pasting particular snippet of HTML containing list items and a link creates too many list items
1739         - Fixed paste crash by making calling RenderBox::deleteLineBoxWrapper() from RenderObject::remove(),
1740         so that the connection is broken before the InlineBox's parent gets deleted.
1741         - Fixed overzealous style changes when setting the style on a specific range of elements.  These specific
1742         ranges are derived programmatically, e.g. as a part of pasting, so they must be respected exactly rather
1743         than modified by converting the endpoints to VisiblePositions.
1744         
1745         Test cases coming soon.
1746
1747         * khtml/editing/apply_style_command.cpp:
1748         (khtml::ApplyStyleCommand::ApplyStyleCommand):
1749         (khtml::ApplyStyleCommand::updateStartEnd):
1750         (khtml::ApplyStyleCommand::startPosition):
1751         (khtml::ApplyStyleCommand::endPosition):
1752         (khtml::ApplyStyleCommand::applyBlockStyle):
1753         (khtml::ApplyStyleCommand::applyRelativeFontStyleChange):
1754         (khtml::ApplyStyleCommand::applyInlineStyle):
1755         (khtml::ApplyStyleCommand::removeInlineStyle):
1756         (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded):
1757         (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded):
1758         (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
1759         (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
1760         (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1761         (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1762         (khtml::ApplyStyleCommand::joinChildTextNodes):
1763         * khtml/editing/apply_style_command.h:
1764         * khtml/editing/composite_edit_command.cpp:
1765         (khtml::CompositeEditCommand::applyStyle):
1766         * khtml/editing/composite_edit_command.h:
1767         * khtml/editing/insert_line_break_command.cpp:
1768         (khtml::InsertLineBreakCommand::doApply):
1769         * khtml/editing/replace_selection_command.cpp:
1770         (khtml::ReplaceSelectionCommand::fixupNodeStyles):
1771         (khtml::ReplaceSelectionCommand::completeHTMLReplacement):
1772         * khtml/rendering/render_box.cpp:
1773         (RenderBox::destroy):
1774         (RenderBox::deleteLineBoxWrapper):
1775         * khtml/rendering/render_box.h:
1776         * khtml/rendering/render_list.cpp:
1777         (RenderListMarker::~RenderListMarker):
1778         (RenderListMarker::setStyle):
1779         * khtml/rendering/render_object.cpp:
1780         (RenderObject::remove):
1781         * khtml/rendering/render_object.h:
1782         * khtml/rendering/render_replaced.cpp:
1783         (RenderWidget::destroy):
1784
1785 2005-12-20  Adele Peterson  <adele@apple.com>
1786
1787         Reviewed by Darin.
1788
1789         Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5911
1790         REGRESSION: Page scroll position jumps when clicking on word in editable div
1791
1792         I moved the scrolling code out of setFocusNode, and consolidated some of the focus code to scroll when necessary.
1793
1794         * khtml/html/html_formimpl.cpp: Removed HTMLButtonElementImpl::blur, HTMLButtonElementImpl::focus, HTMLInputElementImpl::blur, HTMLInputElementImpl::focus.  
1795         New code in ElementImpl::focus will now handle these cases.  This allows tabbing through the elements to go through the same code path as calling focus() on an element.  
1796         Before, focus() would scroll to reveal for any form elements that had a RenderWidget, but wouldn't scroll for anchor elements, or any of the new form elements.  
1797         Now the behavior will be more consistent.
1798         (DOM::HTMLLabelElementImpl::focus): calls ElementImpl::focus.
1799         (DOM::HTMLLegendElementImpl::focus): ditto.
1800         * khtml/html/html_formimpl.h:
1801         * khtml/khtml_part.cpp:
1802         (KHTMLPart::selectAll): calls new function selectContentsOfNode
1803         (KHTMLPart::selectContentsOfNode): factored out code to selectAll for a particular node- which is useful for contenteditable elements.
1804         * khtml/khtml_part.h: added selectContentsOfNode
1805         * khtml/xml/dom_docimpl.cpp:
1806         (DocumentImpl::setFocusNode): removed scrolling code.
1807         * khtml/xml/dom_elementimpl.cpp:
1808         (ElementImpl::focus): Calls updateLayout in case focus() is called before there's a renderer.
1809         Makes a selection for editable elements (right now we select all, but this will change).
1810         Doesn't scroll if the renderer is a RenderWidget, since that is handled when the view becomes first responder.  This will go away when we convert the rest of our form elements.
1811         * kwq/KWQKHTMLPart.mm:
1812         (KWQKHTMLPart::revealSelection): Made this more like centerSelectionInVisibleArea  where we get the right rectangle if the selection is a caret.
1813         (KWQKHTMLPart::nextKeyViewInFrame): call ElementImpl::focus() for the node.  This will set the selection too, which used to be done here.
1814
1815 2005-12-20  Alexey Proskuryakov  <ap@nypop.com>
1816
1817         Reviewed by justin
1818         
1819         <http://bugzilla.opendarwin.org/show_bug.cgi?id=4682>
1820         -[WebHTMLView firstRectForCharacterRange:] is using _selectedRange instead of the given range if no marked text
1821
1822         Added layout tests:
1823         * editing/input/firstrectforcharacterrange-styled
1824         * editing/input/firstrectforcharacterrange-plain
1825
1826         * khtml/editing/visible_text.cpp:
1827         (khtml::TextIterator::rangeFromLocationAndLength): 
1828         Return null if the range isn't found, instead of a startless/endless 
1829         range.  Set the end if the requested location+length is out of bounds.
1830         * kwq/WebCoreBridge.mm:
1831         (-[WebCoreBridge convertToDOMRange:]): Handle larged unsigned values 
1832         before calling rangeWithLocationAndLength, which expects signed ints.
1833
1834 2005-12-20  Adele Peterson  <adele@apple.com>
1835
1836         Reviewed by Darin.
1837
1838         Fix for <rdar://problem/4387630> REGRESSION: <select> element's onClick event doesn't fire @ bugweb.apple.com
1839
1840         * kwq/KWQKHTMLPart.mm:
1841         (KWQKHTMLPart::passSubframeEventToSubframe): only pass mouse down for khtmlviews.
1842
1843 2005-12-20  Justin Garcia  <justin.garcia@apple.com>
1844
1845         Reviewed by eric, thatcher
1846         
1847         <rdar://problem/4172984> KWQExceptions needs to use @try/@catch instead of relying on NSException.h internals
1848         
1849         Needed to undef try/catch because of 4333439.  Moved the 
1850         declarations of variables that are returned from within a @try 
1851         block outside the @try block (because of "might be clobbered by 
1852         a longjmp or vfork" warnings).  Moved some return statements
1853         inside the @try block to fix volatilization errors with gcc4.
1854
1855         * WebCore.xcodeproj/project.pbxproj:
1856         * WebCorePrefix.h:
1857         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
1858         (KCanvasFEBlendQuartz::getCIFilter):
1859         (KCanvasFEColorMatrixQuartz::getCIFilter):
1860         (KCanvasFECompositeQuartz::getCIFilter):
1861         (getPointLightVectors):
1862         (getLightVectors):
1863         (getNormalMap):
1864         (KCanvasFEDiffuseLightingQuartz::getCIFilter):
1865         (KCanvasFEFloodQuartz::getCIFilter):
1866         (KCanvasFEImageQuartz::getCIFilter):
1867         (KCanvasFEMergeQuartz::getCIFilter):
1868         (KCanvasFESpecularLightingQuartz::getCIFilter):
1869         * kwq/KWQExceptions.h:
1870         * kwq/KWQExceptions.mm:
1871         (KWQReportBlockedException):
1872         * kwq/KWQFileButton.mm:
1873         (KWQFileButton::sizeForCharacterWidth):
1874         (KWQFileButton::frameGeometry):
1875         * kwq/KWQKCursor.mm:
1876         (+[NSCursor _WebCore_cursorWithName:hotSpot:_WebCore_cursorWithName:hotSpot:]):
1877         * kwq/KWQKHTMLPart.mm:
1878         (KWQKHTMLPart::createPart):
1879         (KWQKHTMLPart::nextKeyView):
1880         (KWQKHTMLPart::runJavaScriptPrompt):
1881         (KWQKHTMLPart::keyEvent):
1882         (KWQKHTMLPart::sendContextMenuEvent):
1883         (KWQKHTMLPart::fileWrapperForElement):
1884         (KWQKHTMLPart::attributedString):
1885         (KWQKHTMLPart::imageFromRect):
1886         * kwq/KWQKHTMLPartBrowserExtension.mm:
1887         * kwq/KWQLineEdit.mm:
1888         (QLineEdit::sizeForCharacterWidth):
1889         * kwq/KWQListBox.mm:
1890         (QListBox::sizeForNumberOfLines):
1891         * kwq/KWQLoader.mm:
1892         (KWQCheckCacheObjectStatus):
1893         * kwq/KWQWidget.mm:
1894         (QWidget::frameGeometry):
1895         (QWidget::mapFromGlobal):
1896
1897 2005-12-20  David Harrison  <harrison@apple.com>
1898
1899         <rdar://problem/4294417> Cannot un-italicize some text after triple clicking it
1900
1901         Reviewed by Justin.
1902
1903         * khtml/editing/apply_style_command.cpp:
1904         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
1905         Removed check for tab span because ApplyStyleCommand::removeCSSStyle() already makes the same check.
1906
1907 2005-12-20  Justin Garcia  <justin.garcia@apple.com>
1908
1909         <rdar://problem/4387270> editing/deleting/delete-3800834-fix failing
1910         <http://bugzilla.opendarwin.org/show_bug.cgi?id=6160> REGRESSION: Crash when running editing/deleting/delete-3800834-fix.html
1911         <http://bugzilla.opendarwin.org/show_bug.cgi?id=6161> REGRESSION: crash when pressing tab in editable WebHTMLView
1912
1913         Reviewed by darin
1914     
1915         Some callers call setAttribute on a floating element.  So, using 
1916         a RefPtr for the element inside addAttribute can destroy
1917         it.
1918
1919         * khtml/xml/dom_elementimpl.cpp:
1920         (NamedAttrMapImpl::addAttribute):
1921
1922 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
1923
1924         Reviewed by Darin.
1925
1926         - fixed leak in createAttributeMap
1927         http://bugzilla.opendarwin.org/show_bug.cgi?id=6162
1928
1929         * khtml/xml/dom_elementimpl.cpp:
1930         (StyledElementImpl::createAttributeMap): the new attribute map
1931         is going in a RefPtr, don't also ref it manually.
1932
1933 2005-12-20  Maciej Stachowiak  <mjs@apple.com>
1934
1935         Reviewed by Darin.
1936
1937         - change an assignment to a contructor declaration to build with PassRefPtr
1938         leak fix changes
1939
1940         * ksvg2/svg/SVGTransformableImpl.cpp:
1941         (SVGTransformableImpl::parseTransformAttribute):
1942
1943 2005-12-20  Geoffrey Garen  <ggaren@apple.com>
1944
1945         Reviewed by John.
1946
1947         Fixed <rdar://problem/4310363> JavaScript window.open: Height is 1 
1948         pixel short, and related bugs.
1949
1950         There were a few bugs here.
1951         (1) Our code took size arguments and applied them to the window's
1952             content rect. That's incorrect. The Rhino book says the arguments 
1953             should apply to the WebView. Other things that occupy the content 
1954             rect include the tab bar, the status bar, and the 1 pixel border 
1955             between brushed metal and document. All of these used to impinge 
1956             on the web page's display area.
1957
1958             The fix is to calculate sizing based on the WebView instead of
1959             the content rect. This means that the webViewContentRect and 
1960             setContentRect delegate methods are obsolete and no longer called
1961             by any of our code. (setContentRect was never called in the 
1962             first place.)
1963
1964         (2) None of our sizing accounted for scaled resolutions.
1965
1966             The fix is to ask the WebView to scale all coordintes for us.
1967
1968         (3) Our code assumed that all window accoutrements were on by default.
1969             Safari works that way, but other WebKit clients might not.
1970
1971             The fix is always to explicitly set an on/off state.
1972         
1973         (a) To facilitate scaling, I added a new bridge method, webView, to 
1974         access the webView.
1975
1976         (b) For internal consistency, I changed ___Bars to ___bars in bridge 
1977         methods, and ___bars to ___Bars in WinArgs data members. (Interestingly,
1978         the different classes in our code are evenly divided on which format to 
1979         use.)
1980         
1981         Added manual test:
1982         * manual-tests/window-open-features.html: Added.
1983         * manual-tests/resources/200x200.png: Added.
1984         * manual-tests/resources/popup200x200.html: Added.
1985
1986         * khtml/ecma/kjs_window.cpp:
1987         (KJS::showModalDialog): see (b)
1988         (KJS::WindowFunc::callAsFunction): see (b)
1989         * kwq/KWQKHTMLPart.mm:
1990         (KWQKHTMLPart::statusbarVisible): see (b)
1991         * kwq/KWQKHTMLPartBrowserExtension.mm:
1992         (KHTMLPartBrowserExtension::createNewWindow):
1993         At the top of this method, I just did some formatting cleanup and
1994         moved the 'referrer' variable closer to where it's used.
1995         The changes in the middle of the method are (3), the bottom, (2).
1996         * kwq/KWQKPartsBrowserExtension.h:
1997         (KParts::WindowArgs::WindowArgs): see (b)
1998         * kwq/WebCoreBridge.h: see (a)
1999
2000 2005-12-20  Eric Seidel  <eseidel@apple.com>
2001
2002         Reviewed by mjs.
2003
2004         Leaks when running SVG tests
2005         http://bugzilla.opendarwin.org/show_bug.cgi?id=6156
2006         No additional tests necessary, leaks already caught by other tests.
2007
2008         * kcanvas/KCanvasFilters.cpp:
2009         (KCanvasFEDiffuseLighting::setLightSource): takes ownership
2010         (KCanvasFESpecularLighting::setLightSource): takes ownership
2011         * kcanvas/KCanvasFilters.h:
2012         (KCanvasFEDiffuseLighting::KCanvasFEDiffuseLighting): added
2013         (KCanvasFEDiffuseLighting::~KCanvasFEDiffuseLighting): added
2014         (KCanvasFEDiffuseLighting::lightSource): fixed spacing
2015         (KCanvasFESpecularLighting::KCanvasFESpecularLighting): added
2016         (KCanvasFESpecularLighting::~KCanvasFESpecularLighting): added
2017         (KCanvasFESpecularLighting::lightSource): fixed spacing
2018         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2019         (KRenderingDeviceQuartz::stringForPath): added missing CFRelease
2020
2021 2005-12-20  Eric Seidel  <eseidel@apple.com>
2022
2023         Reviewed by darin.
2024
2025         Remove additional bit-rotted DEBUG* ifdefs from WebCore.
2026         This removes PARSER_DEBUG, FORMS_DEBUG and CSS_STYLESHEET_DEBUG.
2027         http://bugzilla.opendarwin.org/show_bug.cgi?id=5931
2028         No tests possible, only removing dead code.
2029
2030         * khtml/css/css_stylesheetimpl.cpp:
2031         (CSSStyleSheetImpl::parseString):
2032         (CSSStyleSheetImpl::isLoading):
2033         * khtml/html/html_formimpl.cpp:
2034         (DOM::HTMLFormElementImpl::formData):
2035         (DOM::HTMLFormElementImpl::submit):
2036         (DOM::HTMLFormElementImpl::reset):
2037         (DOM::HTMLGenericFormElementImpl::getForm):
2038         * khtml/html/htmlparser.cpp:
2039         (HTMLParser::processCloseTag):
2040         (HTMLParser::createHead):
2041
2042 2005-12-20  Eric Seidel  <eseidel@apple.com>
2043
2044         Reviewed by darin.
2045
2046         Move Decoder onto Shared<T> and clients onto RefPtr.
2047         http://bugzilla.opendarwin.org/show_bug.cgi?id=6107
2048         No test cases possible, no functional changes.
2049
2050         * khtml/ecma/XSLTProcessor.cpp:
2051         (KJS::XSLTProcessorProtoFunc::callAsFunction):
2052         * khtml/ecma/xmlhttprequest.cpp:
2053         (KJS::XMLHttpRequest::XMLHttpRequest):
2054         (KJS::XMLHttpRequest::~XMLHttpRequest):
2055         (KJS::XMLHttpRequest::changeState):
2056         (KJS::XMLHttpRequest::abort):
2057         (KJS::XMLHttpRequest::slotFinished):
2058         (KJS::XMLHttpRequest::slotData):
2059         * khtml/ecma/xmlhttprequest.h:
2060         * khtml/khtml_part.cpp:
2061         (KHTMLPart::clear):
2062         (KHTMLPart::begin):
2063         (KHTMLPart::write):
2064         * khtml/khtmlpart_p.h:
2065         (KHTMLPartPrivate::KHTMLPartPrivate):
2066         * khtml/misc/decoder.cpp:
2067         (Decoder::Decoder):
2068         (Decoder::~Decoder):
2069         * khtml/misc/decoder.h:
2070         * khtml/misc/loader.h:
2071         * khtml/xml/dom_docimpl.cpp:
2072         (DocumentImpl::DocumentImpl):
2073         (DocumentImpl::~DocumentImpl):
2074         (DocumentImpl::prepareMouseEvent):
2075         (DocumentImpl::setDecoder):
2076         * khtml/xml/dom_docimpl.h:
2077         (DOM::DocumentImpl::decoder):
2078         * khtml/xsl/xslt_processorimpl.cpp:
2079         (DOM::XSLTProcessorImpl::createDocumentFromSource):
2080
2081 2005-12-19  Darin Adler  <darin@apple.com>
2082
2083         Reviewed by Maciej.
2084
2085         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6143
2086           DOM::ElementImpl should use a RefPtr for the attribute map
2087
2088         * khtml/xml/dom_elementimpl.cpp:
2089         (ElementImpl::ElementImpl): Remove code to initialize the pointer; not needed since
2090         RefPtr gets initialized to 0.
2091         (ElementImpl::~ElementImpl): Remove code to deref the pointer; RefPtr handles that.
2092         (ElementImpl::attributes): Add get() call to get raw pointer.
2093         (ElementImpl::setAttributeMap): Remove code to deref the old map and set the new map.
2094         But added code to clear the element pointer from the old map (missing in the old
2095         version). Also added a FIXME.
2096         (ElementImpl::createAttributeMap): Remove ref(); RefPtr handles that.
2097         (NamedAttrMapImpl::addAttribute): Use a RefPtr to guarantee the element does not go
2098         away in the middle of dispatching DOM events.
2099         (StyledElementImpl::attributeChanged): Clean up code by using the inline function
2100         mappedAttributes() instead of doing type casts.
2101         (StyledElementImpl::parseMappedAttribute): Ditto.
2102         (StyledElementImpl::getClassList): Ditto.
2103
2104         * khtml/xml/dom_elementimpl.h: Make ElementImpl::namedAttrMap be a RefPtr instead
2105         of raw pointer. Added an overload of StyledElementImpl::mappedAttributes for both
2106         const and non-const.
2107
2108         * khtml/xml/dom_nodeimpl.cpp: (DOM::NodeImpl::addChild): Use a RefPtr to ref/deref
2109         the child so that it doesn't leak.
2110
2111         * khtml/html/htmlparser.h: Changed isindex to use a RefPtr.
2112         * khtml/html/htmlparser.cpp:
2113         (HTMLParser::~HTMLParser): Removed now-unneeded ref.
2114         (HTMLParser::isindexCreateErrorCheck): Remove now-unneeded deref/ref.
2115         (HTMLParser::handleIsindex): Put isindex element into a RefPtr. This prevents a
2116         crash that was otherwise happening during layout tests (caused indirectly by
2117         the changes above).
2118         (HTMLParser::startBody): Added call to get().
2119
2120 2005-12-19  Darin Adler  <darin@apple.com>
2121
2122         Reviewed by Geoff Garen and Eric Seidel.
2123
2124         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4923
2125           stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
2126
2127         * ForwardingHeaders/kxmlcore/AlwaysInline.h: Added.
2128         * WebCorePrefix.h: Removed the use of <ostream>.
2129
2130         * kwq/KWQDef.h: Removed now-unused Q_INT64, Q_INT16, Q_UINT16, qRound, and _KWQ_IOSTREAM_.
2131
2132         * kwq/KWQKHTMLPart.h: Removed some unneeded headers and added forward-declarations of classes
2133         instead. Corrected some incorrect member function declarations.
2134         * kwq/KWQKHTMLPart.mm: Added a now-needed header.
2135
2136         * khtml/ecma/kjs_window.cpp: Removed the <cmath> workaround.
2137         * khtml/rendering/bidi.cpp: Added include of AlwaysInline.h and removed a
2138         lot of unnecessary includes.
2139         * khtml/rendering/render_canvasimage.cpp: Removed the <cmath> workaround.
2140         * khtml/rendering/render_image.cpp: Removed the <cmath> workaround.
2141         * khtml/rendering/render_text.cpp: Added include of AlwaysInline.h and removed a
2142         lot of unnecessary includes.
2143
2144         * ksvg2/css/SVGCSSStyleSelector.cpp: (KDOM::CSSStyleSelector::applySVGProperty):
2145         * ksvg2/svg/SVGAnimateColorElementImpl.cpp: (SVGAnimateColorElementImpl::calculateColor):
2146         * ksvg2/svg/SVGAnimateTransformElementImpl.cpp: (SVGAnimateTransformElementImpl::handleTimerEvent):
2147         * ksvg2/svg/SVGAnimationElementImpl.cpp: (SVGAnimationElementImpl::closeRenderer):
2148         * ksvg2/svg/SVGLinearGradientElementImpl.cpp: (SVGLinearGradientElementImpl::buildGradient):
2149         * ksvg2/svg/SVGPatternElementImpl.cpp: (SVGPatternElementImpl::notifyAttributeChange):
2150         * ksvg2/svg/SVGRadialGradientElementImpl.cpp: (SVGRadialGradientElementImpl::buildGradient):
2151         Replaced use of qRound with use of lroundf or lround as appropriate.
2152
2153         * kwq/KWQCString.h:
2154         * kwq/KWQCString.mm:
2155         * kwq/KWQDateTime.h:
2156         * kwq/KWQDateTime.mm:
2157         * kwq/KWQMap.h:
2158         * kwq/KWQMemArray.h:
2159         * kwq/KWQPoint.mm:
2160         * kwq/KWQPointArray.h:
2161         * kwq/KWQPtrList.h:
2162         * kwq/KWQPtrStack.h:
2163         * kwq/KWQPtrVector.h:
2164         * kwq/KWQRect.h:
2165         * kwq/KWQRect.mm:
2166         * kwq/KWQSize.h:
2167         * kwq/KWQSize.mm:
2168         * kwq/KWQValueList.h:
2169         Removed _KWQ_IOSTREAM_ code that was used at one time for unit tests, but is now unneeded,
2170         and requires <ostream>.
2171
2172 2005-12-19  Darin Adler  <darin@apple.com>
2173
2174         Reviewed by Geoff Garen and John Sullivan.
2175
2176         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4312
2177           XMLHttpRequest headers that have two CRLF sequences lead to Obj-C exception
2178
2179         I found this by code inspection after examining a security report about
2180         vulnerabilities in other browsers' XMLHttpRequest implementations.
2181
2182         * kwq/KWQLoader.mm:
2183         (+[NSDictionary _webcore_dictionaryWithHeaderString:_webcore_dictionaryWithHeaderString:]):
2184         Check length of string before calling characterAtIndex:0 since it will fail for an empty string.
2185
2186 2005-12-19  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2187
2188         Reviewed by Beth
2189
2190         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6149
2191           REGRESSION (WebCore-417.5): horizontal scrollbar in overflow with top
2192           border doesn't receive mouse events
2193
2194         * khtml/rendering/render_block.cpp:
2195         (khtml::RenderBlock::isPointInScrollbar):
2196         Removed borderTop() from horizontal scrollbar rect computation.
2197         * manual-tests/scrollbar-hittest2.html: Added.
2198
2199 2005-12-19  Alexey Proskuryakov  <ap@nypop.com>
2200
2201         Reviewed by Darin, committed by Adele.
2202
2203         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=5744
2204           XMLHttpRequest does not apply page encoding after assigning via innerHtml
2205
2206         * khtml/ecma/xmlhttprequest.cpp:
2207         (getMIMEType): A helper function to get MIME type from a Content-Type string.
2208         (getCharset): A helper function to get charset from a Content-Type string.
2209         (KJS::XMLHttpRequest::getValueProperty): Factored out responseIsXML().
2210         (KJS::XMLHttpRequest::getResponseHeader): Return QString instead of JSValue
2211           (to get rid of unnecessary JSLocks).
2212         (KJS::XMLHttpRequest::responseIsXML): A new method that analyses Content-Type.
2213         (KJS::XMLHttpRequest::slotData): Use a correct charset for responses, see bug for details.
2214         (KJS::XMLHttpRequestProtoFunc::callAsFunction): Update for getResponseHeader() changes
2215         * khtml/ecma/xmlhttprequest.h:
2216
2217 == Rolled over to ChangeLog-2005-12-19 ==