b7b4e69949372ce8e20abbde202ce2e8a7ace66e
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-11-08  Chris Blumenberg  <cblu@apple.com>
2
3         Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
4
5         Reviewed by john.
6
7         * kwq/KWQTextField.mm:
8         (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
9         * kwq/WebCoreBridge.h:
10
11 2004-11-08  David Harrison  <harrison@apple.com>
12
13         Reviewed by Darin.
14         
15         Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
16
17         * khtml/editing/htmlediting.cpp:
18         (khtml::DeleteSelectionCommand::moveNodesAfterNode):
19         * khtml/xml/dom_nodeimpl.cpp:
20         (NodeImpl::enclosingInlineElement):
21         * khtml/xml/dom_nodeimpl.h:
22
23 2004-11-05  Chris Blumenberg  <cblu@apple.com>
24
25         Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
26
27         Reviewed by rjw.
28
29         * khtml/editing/htmlediting.cpp:
30         (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
31         * khtml/editing/visible_position.cpp:
32         (khtml::VisiblePosition::character): new, returns the character for the position
33         * khtml/editing/visible_position.h:
34         * kwq/KWQKHTMLPart.h:
35         * kwq/KWQKHTMLPart.mm:
36         (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
37         * kwq/WebCoreBridge.h:
38
39 === Safari-170 ===
40
41 2004-11-05  Adele Amchan  <adele@apple.com>
42
43         Reviewed by Darin
44
45         Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
46         and a workaround for displaying transparent backgrounds for textareas.
47
48         * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
49         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
50         * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
51           on the contentView, and on the textView.
52
53 2004-11-04  David Hyatt  <hyatt@apple.com>
54
55         Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
56         darin or ken).
57         
58         Reviewed by darin or ken
59
60         * khtml/rendering/bidi.cpp:
61         (khtml::appendRunsForObject):
62         (khtml::RenderBlock::skipWhitespace):
63         (khtml::RenderBlock::findNextLineBreak):
64         * khtml/rendering/render_block.cpp:
65         (khtml::RenderBlock::lowestPosition):
66         (khtml::RenderBlock::rightmostPosition):
67         (khtml::RenderBlock::leftmostPosition):
68         * khtml/rendering/render_box.cpp:
69         (RenderBox::position):
70         * khtml/rendering/render_box.h:
71         (khtml::RenderBox::staticX):
72         (khtml::RenderBox::staticY):
73         * khtml/rendering/render_layer.cpp:
74         (RenderLayer::updateLayerPosition):
75         (RenderLayer::convertToLayerCoords):
76         * khtml/rendering/render_line.cpp:
77         (khtml::InlineFlowBox::placeBoxesHorizontally):
78         * khtml/rendering/render_object.h:
79         (khtml::RenderObject::staticX):
80         (khtml::RenderObject::staticY):
81
82         Finish turning on XSLT.  Make sure child stylesheets can load.
83         
84         * khtml/xsl/xslt_processorimpl.cpp:
85         (DOM::stylesheetLoadFunc):
86         (DOM::XSLTProcessorImpl::transformDocument):
87
88 2004-11-04  David Hyatt  <hyatt@apple.com>
89
90         Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
91         happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
92         keyword and length values.
93
94         Reviewed by darin
95
96         * khtml/css/cssparser.cpp:
97         (CSSParser::parseValue):
98         (CSSParser::addBackgroundValue):
99         (CSSParser::parseBackgroundShorthand):
100         (CSSParser::parseBackgroundColor):
101         (CSSParser::parseBackgroundImage):
102         (CSSParser::parseBackgroundPositionXY):
103         (CSSParser::parseBackgroundPosition):
104         (CSSParser::parseBackgroundProperty):
105         (CSSParser::parseColorFromValue):
106         * khtml/css/cssparser.h:
107         * khtml/css/cssstyleselector.cpp:
108         (khtml::CSSStyleSelector::adjustRenderStyle):
109         (khtml::CSSStyleSelector::applyProperty):
110         (khtml::CSSStyleSelector::mapBackgroundAttachment):
111         (khtml::CSSStyleSelector::mapBackgroundImage):
112         (khtml::CSSStyleSelector::mapBackgroundRepeat):
113         (khtml::CSSStyleSelector::mapBackgroundXPosition):
114         (khtml::CSSStyleSelector::mapBackgroundYPosition):
115         * khtml/css/cssstyleselector.h:
116         * khtml/rendering/render_box.cpp:
117         (RenderBox::paintRootBoxDecorations):
118         (RenderBox::paintBoxDecorations):
119         (RenderBox::paintBackgrounds):
120         (RenderBox::paintBackground):
121         (RenderBox::paintBackgroundExtended):
122         * khtml/rendering/render_box.h:
123         * khtml/rendering/render_form.cpp:
124         (RenderFieldset::paintBoxDecorations):
125         * khtml/rendering/render_line.cpp:
126         (khtml::InlineFlowBox::paintBackgrounds):
127         (khtml::InlineFlowBox::paintBackground):
128         (khtml::InlineFlowBox::paintBackgroundAndBorder):
129         * khtml/rendering/render_line.h:
130         * khtml/rendering/render_object.cpp:
131         (RenderObject::setStyle):
132         (RenderObject::updateBackgroundImages):
133         (RenderObject::getVerticalPosition):
134         * khtml/rendering/render_object.h:
135         (khtml::RenderObject::paintBackgroundExtended):
136         * khtml/rendering/render_style.cpp:
137         (m_next):
138         (BackgroundLayer::BackgroundLayer):
139         (BackgroundLayer::~BackgroundLayer):
140         (BackgroundLayer::operator=):
141         (BackgroundLayer::operator==):
142         (BackgroundLayer::fillUnsetProperties):
143         (BackgroundLayer::cullEmptyLayers):
144         (StyleBackgroundData::StyleBackgroundData):
145         (StyleBackgroundData::operator==):
146         (RenderStyle::diff):
147         (RenderStyle::adjustBackgroundLayers):
148         * khtml/rendering/render_style.h:
149         (khtml::OutlineValue::operator==):
150         (khtml::OutlineValue::operator!=):
151         (khtml::BackgroundLayer::backgroundImage):
152         (khtml::BackgroundLayer::backgroundXPosition):
153         (khtml::BackgroundLayer::backgroundYPosition):
154         (khtml::BackgroundLayer::backgroundAttachment):
155         (khtml::BackgroundLayer::backgroundRepeat):
156         (khtml::BackgroundLayer::next):
157         (khtml::BackgroundLayer::isBackgroundImageSet):
158         (khtml::BackgroundLayer::isBackgroundXPositionSet):
159         (khtml::BackgroundLayer::isBackgroundYPositionSet):
160         (khtml::BackgroundLayer::isBackgroundAttachmentSet):
161         (khtml::BackgroundLayer::isBackgroundRepeatSet):
162         (khtml::BackgroundLayer::setBackgroundImage):
163         (khtml::BackgroundLayer::setBackgroundXPosition):
164         (khtml::BackgroundLayer::setBackgroundYPosition):
165         (khtml::BackgroundLayer::setBackgroundAttachment):
166         (khtml::BackgroundLayer::setBackgroundRepeat):
167         (khtml::BackgroundLayer::clearBackgroundImage):
168         (khtml::BackgroundLayer::clearBackgroundXPosition):
169         (khtml::BackgroundLayer::clearBackgroundYPosition):
170         (khtml::BackgroundLayer::clearBackgroundAttachment):
171         (khtml::BackgroundLayer::clearBackgroundRepeat):
172         (khtml::BackgroundLayer::setNext):
173         (khtml::BackgroundLayer::operator!=):
174         (khtml::BackgroundLayer::containsImage):
175         (khtml::BackgroundLayer::hasImage):
176         (khtml::BackgroundLayer::hasFixedImage):
177         (khtml::RenderStyle::setBitDefaults):
178         (khtml::RenderStyle::hasBackground):
179         (khtml::RenderStyle::hasFixedBackgroundImage):
180         (khtml::RenderStyle::outlineWidth):
181         (khtml::RenderStyle::outlineStyle):
182         (khtml::RenderStyle::outlineStyleIsAuto):
183         (khtml::RenderStyle::outlineColor):
184         (khtml::RenderStyle::backgroundColor):
185         (khtml::RenderStyle::backgroundImage):
186         (khtml::RenderStyle::backgroundRepeat):
187         (khtml::RenderStyle::backgroundAttachment):
188         (khtml::RenderStyle::backgroundXPosition):
189         (khtml::RenderStyle::backgroundYPosition):
190         (khtml::RenderStyle::accessBackgroundLayers):
191         (khtml::RenderStyle::backgroundLayers):
192         (khtml::RenderStyle::outlineOffset):
193         (khtml::RenderStyle::resetOutline):
194         (khtml::RenderStyle::setBackgroundColor):
195         (khtml::RenderStyle::setOutlineWidth):
196         (khtml::RenderStyle::setOutlineStyle):
197         (khtml::RenderStyle::setOutlineColor):
198         (khtml::RenderStyle::clearBackgroundLayers):
199         (khtml::RenderStyle::inheritBackgroundLayers):
200         (khtml::RenderStyle::setOutlineOffset):
201         * khtml/rendering/render_table.cpp:
202         (RenderTable::paintBoxDecorations):
203         (RenderTableCell::paintBoxDecorations):
204
205 2004-11-04  David Hyatt  <hyatt@apple.com>
206
207         Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
208         Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
209
210         Reviewed by darin
211
212         * kwq/KWQTextCodec.mm:
213         (KWQTextDecoder::convertLatin1):
214         (KWQTextDecoder::convertUTF16):
215         (KWQTextDecoder::convertUsingTEC):
216         (KWQTextDecoder::toUnicode):
217
218 2004-11-04  David Hyatt  <hyatt@apple.com>
219
220         Make sure line-height returns the correct value for normal.
221         
222         Reviewed by darin
223
224         * khtml/css/css_computedstyle.cpp:
225         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
226
227 2004-11-04  David Harrison  <harrison@apple.com>
228
229         Reviewed by Ken Kocienda.
230
231                 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
232                 
233         * khtml/editing/htmlediting.cpp:
234         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
235         to, but not including, the enclosingBlockFlowElement) rather than just the source element.
236         Fixed to insert after the destination subtree, rather than the destination element.  Handles
237         edge case of deleting back to the top of the tree, where there is nothing left to insert after.
238         * khtml/xml/dom_nodeimpl.cpp:
239         (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
240         * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
241         * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
242         * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
243
244 2004-11-03  Ken Kocienda  <kocienda@apple.com>
245
246         Reviewed by me
247         
248         More layout tests.
249
250         * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
251         * layout-tests/editing/deleting/delete-br-008.html: Added.
252         * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
253         * layout-tests/editing/deleting/delete-br-009.html: Added.
254         * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
255         * layout-tests/editing/deleting/delete-br-010.html: Added.
256
257 2004-11-03  Maciej Stachowiak  <mjs@apple.com>
258
259         Fix by Yasuo Kida, reviewed by me.
260
261         <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
262         
263         * kwq/KWQKHTMLPart.mm:
264         (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
265         same as a nil range - setting an empty marked range should clear
266         the marked range entirely.
267
268 2004-11-02  Maciej Stachowiak  <mjs@apple.com>
269
270         Reviewed by Dave Hyatt (when I originally coded it).
271
272         WebCore part of fix for:
273
274         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
275         
276         * kwq/WebCoreBridge.h:
277         * kwq/WebCoreBridge.mm:
278         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
279         DOMRange, or if the range is split into multiple lines, the rect for the part on
280         the first line only.
281         
282         * khtml/rendering/render_object.cpp:
283         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
284         for the overrides below.
285         * khtml/rendering/render_object.h:
286         * khtml/rendering/render_box.cpp:
287         (RenderBox::caretRect):
288         * khtml/rendering/render_box.h:
289         * khtml/rendering/render_br.cpp:
290         (RenderBR::caretRect):
291         * khtml/rendering/render_br.h:
292         * khtml/rendering/render_flow.cpp:
293         (RenderFlow::caretRect):
294         * khtml/rendering/render_flow.h:
295         * khtml/rendering/render_text.cpp:
296         (RenderText::caretRect):
297
298 2004-11-02  Ken Kocienda  <kocienda@apple.com>
299
300         Reviewed by Hyatt
301
302         Implemented command to insert a block in response to typing a return key (even though
303         I am not turning that on by default with this patch....that will come later). 
304         
305         This new command is called InsertParagraphSeparatorCommand.
306         
307         Reworked the command and function names associated with inserting content into a 
308         document. Before this patch, there were inputXXX and insertXXX variants, with the
309         former used for more high-level actions and the latter used for lower-level stuff.
310         However, this was confusing as the AppKit uses insertXXX for everything. This resulted
311         in an insertXXX command going through an inputXXX WebCore step and then finally to an
312         insertXXX WebCore step. To make this less confusing, I have changes all the names to
313         be insertXXX, and modified the lower-level operations so that it is clear what they do.
314         
315         * khtml/editing/htmlediting.cpp:
316         (khtml::EditCommandPtr::isInsertTextCommand): Name change.
317         (khtml::EditCommand::isInsertTextCommand): Ditto.
318         (khtml::CompositeEditCommand::inputText): Ditto.
319         (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
320         (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
321         (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
322         (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
323         (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
324         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
325         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
326         (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
327         (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
328         (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
329         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
330         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
331         (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
332         (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
333         (khtml::InsertIntoTextNode::doApply): Ditto.
334         (khtml::InsertIntoTextNode::doUnapply): Ditto.
335         (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
336         (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
337         (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
338         (khtml::InsertLineBreakCommand::doApply):
339         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
340         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
341         (khtml::InsertNodeBeforeCommand::doApply): Ditto.
342         (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
343         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
344         (khtml::InsertParagraphSeparatorCommand::doApply):
345         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
346         Class name change, was InsertNewlineCommandInQuotedContentCommand.
347         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
348         (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
349         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
350         (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
351         (khtml::InsertTextCommand::doApply): Ditto.
352         (khtml::InsertTextCommand::deleteCharacter): Ditto.
353         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
354         (khtml::InsertTextCommand::input): Ditto.
355         (khtml::InsertTextCommand::insertSpace): Ditto.
356         (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
357         (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
358         (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
359         (khtml::TypingCommand::insertParagraphSeparator): New function.
360         (khtml::TypingCommand::doApply): Name changes, as above.
361         (khtml::TypingCommand::insertText): Ditto.
362         (khtml::TypingCommand::deleteKeyPressed): Ditto.
363         (khtml::TypingCommand::preservesTypingStyle): Ditto.
364         * khtml/editing/htmlediting.h:
365         (khtml::DeleteFromTextNodeCommand::node): Name change.
366         (khtml::DeleteFromTextNodeCommand::offset): Ditto.
367         (khtml::DeleteFromTextNodeCommand::count): Ditto.
368         (khtml::InsertIntoTextNode::text): Ditto.
369         (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
370         (khtml::InsertNodeBeforeCommand::refChild): Ditto.
371         (khtml::TypingCommand::): Ditto.
372         * khtml/editing/jsediting.cpp: Name changes, as above.
373         * kwq/WebCoreBridge.h:
374         * kwq/WebCoreBridge.mm:
375         (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
376         (-[WebCoreBridge insertParagraphSeparator]): New function.
377         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
378
379 2004-11-01  Kevin Decker  <kdecker@apple.com>
380
381         Reviewed by rjw.
382
383         fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
384         once and for all. 
385
386         * khtml/ecma/kjs_window.cpp:
387         (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
388
389 2004-11-01  Darin Adler  <darin@apple.com>
390
391         Reviewed by Hyatt.
392
393         - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
394
395         * khtml/css/html4.css: Use color: initial for textarea and related ones.
396
397 2004-11-01  Ken Kocienda  <kocienda@apple.com>
398
399         Reviewed by John
400
401         Fix for this bug:
402         
403         <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
404
405         * khtml/css/css_computedstyle.cpp:
406         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
407         implementation here into new copyPropertiesInSet helper. This now calls the
408         generalized copyPropertiesInSet function with the arguments needed to make copying
409         inheritable work.
410         * khtml/css/css_computedstyle.h:
411         * khtml/css/css_valueimpl.cpp:
412         (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
413         In order to do apply block properties, "regular" style declarations need to do style
414         diffs as well.
415         (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
416         except that it uses a different set of properties that apply only to blocks.
417         (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
418         and copies out those properties listed in a pre-defined set.
419         * khtml/css/css_valueimpl.h:
420         * khtml/editing/htmlediting.cpp:
421         (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
422         block, factoring out some of the special case code that should now only run in the inline case.
423         (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
424         (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
425         special handling for "legacy" HTML styles like <B> and <I>.
426         (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
427         style changes into different kinds. CSS specifies certain properties only apply to certain
428         element types. This set of changes now recognizes two such separate cases: styles that apply
429         to blocks, and styles that apply to inlines.
430         (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
431         (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
432         (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
433         with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
434         done so that the function can be passed a portion of the styles being applied so that block styles
435         and inline styles can be handled separately.
436         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
437         (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
438         (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
439         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
440         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
441         * khtml/editing/htmlediting.h:
442         (khtml::StyleChange::): Changed as described above.
443         (khtml::StyleChange::usesLegacyStyles):
444         (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
445         it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
446         when text align changes.
447         * khtml/khtml_part.cpp:
448         (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
449         the passed-in argument.
450         (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
451         is a caret. Formerly, this just set typing style and made no visible changes to the document.
452
453         New tests.
454
455         * layout-tests/editing/editing.js: Added some glue to change text align.
456         * layout-tests/editing/style/block-style-001-expected.txt: Added.
457         * layout-tests/editing/style/block-style-001.html: Added.
458         * layout-tests/editing/style/block-style-002-expected.txt: Added.
459         * layout-tests/editing/style/block-style-002.html: Added.
460         * layout-tests/editing/style/block-style-003-expected.txt: Added.
461         * layout-tests/editing/style/block-style-003.html: Added.
462
463 === Safari-169 ===
464
465 2004-10-29  Darin Adler  <darin@apple.com>
466
467         Reviewed by NOBODY (OOPS!).
468
469         - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
470
471         * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
472         before advancing one character; before it did it backwards.
473
474 2004-10-29  Chris Blumenberg  <cblu@apple.com>
475
476         Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
477
478         Reviewed by kocienda, adele.
479
480         * khtml/rendering/render_frames.cpp:
481         (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
482
483 2004-10-29  Darin Adler  <darin@apple.com>
484
485         Reviewed by Chris.
486
487         - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
488
489         * khtml/khtmlview.cpp:
490         (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
491         deleted before this function finishes running.
492         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
493         (KHTMLView::viewportMouseReleaseEvent): Ditto.
494         (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
495         is guaranteed to do ref/deref as needed.
496
497         * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
498
499 2004-10-28  Chris Blumenberg  <cblu@apple.com>
500
501         Enabled XSLT on Panther. See intrigue mail for compiling instructions.
502
503         Reviewed by darin.
504
505         * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
506         * WebCorePrefix.h: always use XSLT
507
508 2004-10-28  Ken Kocienda  <kocienda@apple.com>
509
510         Reviewed by Chris
511
512         Fix for these bugs:
513         
514         <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
515         <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
516         
517         * khtml/editing/htmlediting.cpp:
518         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
519         to initialization list, zeroing them out.
520         (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
521         handle a delete of content in special cases where the only thing selected is a BR. This
522         code path is much simpler than the newly-named performGeneralDelete, and detects when no
523         content merging should be done between blocks. This aspect of the change fixes 3854848.
524         One of the special cases added fixes 3803832.
525         (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
526         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
527         like the other helpers in this class.
528         (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
529         (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
530         * khtml/editing/htmlediting.h: Added new helper and changed an old one.
531
532 2004-10-28  Chris Blumenberg  <cblu@apple.com>
533
534         Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
535
536         Reviewed by darin.
537
538         * kwq/KWQKHTMLPart.mm:
539         (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
540
541 2004-10-28  Ken Kocienda  <kocienda@apple.com>
542
543         Reviewed by Harrison
544
545         Reorganization of delete command functionality so that doApply is not
546         several hundred lines long. This is not a squeaky-clean cleanup, but
547         it is a step in the right direction. No functionality changes.
548
549         * khtml/editing/htmlediting.cpp:
550         (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
551         (khtml::DeleteSelectionCommand::initializePositionData): New helper.
552         (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
553         (khtml::DeleteSelectionCommand::performDelete): Ditto.
554         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
555         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
556         (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
557         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
558         (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
559         (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
560         * khtml/editing/htmlediting.h:
561
562 2004-10-28  Ken Kocienda  <kocienda@apple.com>
563
564         Reviewed by me
565
566         * khtml/editing/htmlediting.cpp:
567         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
568         new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
569
570 2004-10-27  Ken Kocienda  <kocienda@apple.com>
571
572         Reviewed by Chris
573
574         * khtml/editing/htmlediting.cpp:
575         (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
576         whether content not in the block containing the start of the selection is moved to that block
577         after the selection is deleted.
578         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
579         (khtml::DeleteSelectionCommand::doApply): Ditto.
580         (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
581         to handle the case of inserting a newline when in quoted content in Mail.
582         (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
583         (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
584         (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
585         (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
586         (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
587         (khtml::TypingCommand::doApply): Ditto.
588         (khtml::TypingCommand::preservesTypingStyle): Ditto.
589         * khtml/editing/htmlediting.h: Add new delclarations.
590         (khtml::TypingCommand::): Ditto.
591         * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
592         * kwq/WebCoreBridge.mm:
593         (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
594
595 2004-10-26  Chris Blumenberg  <cblu@apple.com>
596
597         Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
598
599         Reviewed by dave.
600
601         * khtml/ecma/kjs_dom.cpp:
602         (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
603         * khtml/ecma/kjs_dom.h:
604         (KJS::DOMElement::):
605         * khtml/ecma/kjs_dom.lut.h:
606         (KJS::):
607
608 2004-10-26  David Hyatt  <hyatt@apple.com>
609
610         Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
611         the previous line.
612         
613         Reviewed by kocienda
614
615         * khtml/rendering/bidi.cpp:
616         (khtml::RenderBlock::layoutInlineChildren):
617
618 2004-10-26  David Hyatt  <hyatt@apple.com>
619
620         Convert selectionRect() from using a list to a dict and patch it to be like setSelection.  It was still trying
621         to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
622         
623         Reviewed by kocienda
624
625         * khtml/rendering/render_canvas.cpp:
626         (RenderCanvas::selectionRect):
627         * khtml/rendering/render_object.h:
628         (khtml::RenderObject::hasSelectedChildren):
629
630 2004-10-26  Ken Kocienda  <kocienda@apple.com>
631
632         Reviewed by Hyatt
633         
634         Fix for this bug::
635         
636         <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
637
638         * khtml/editing/htmlediting.cpp:
639         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
640         let the caller know if a placeholder was removed.
641         (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
642         removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
643         some cases, the selection was still set on the removed BR, and this was the cause of the
644         crash.
645         * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
646
647 2004-10-26  Darin Adler  <darin@apple.com>
648
649         Reviewed by Chris.
650
651         - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
652
653         * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
654
655 2004-10-26  Ken Kocienda  <kocienda@apple.com>
656
657         Reviewed by John
658
659         * khtml/editing/htmlediting.cpp:
660         (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
661         with a zero-length string. That triggers an assert. Call deleteText instead, 
662         using the same indices that are passed to replaceText.
663         
664         Cleaned up the asserts in these three functions below, making them
665         more consistent. This is not needed for the fix, but I tripped over
666         these in the course of debugging.
667         
668         (khtml::InsertTextCommand::InsertTextCommand):
669         (khtml::InsertTextCommand::doApply):
670         (khtml::InsertTextCommand::doUnapply):
671
672 2004-10-25  Adele Amchan <adele@apple.com>
673
674         Reviewed by Darin.
675
676         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
677         * khtml/xml/dom_docimpl.h:
678
679 2004-10-25  Adele Amchan  <adele@apple.com>
680
681         Reviewed by me, code change by Darin.
682
683         * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
684
685 2004-10-25  Ken Kocienda  <kocienda@apple.com>
686
687         Oops. These two test results changed with my last checkin, for the better.
688
689         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
690         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
691
692 2004-10-25  Ken Kocienda  <kocienda@apple.com>
693
694         Reviewed by Chris
695
696         Fix for this bug:
697         
698         <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
699
700         * khtml/editing/htmlediting.cpp:
701         (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
702         expand the selection outwards when the selection is on the visible boundary of a root
703         editable element. This fixes the bug. Note that this function also contains a little code
704         I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
705         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
706         (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
707         * khtml/editing/htmlediting.h: Declare new helpers.
708         * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
709         * layout-tests/editing/deleting/delete-select-all-001.html: Added.
710         * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
711         * layout-tests/editing/deleting/delete-select-all-002.html: Added.
712         * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
713         * layout-tests/editing/deleting/delete-select-all-003.html: Added.
714
715 2004-10-25  Ken Kocienda  <kocienda@apple.com>
716
717         Added some more editing layout tests.
718
719         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
720         * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
721         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
722         * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
723         * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
724         * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
725         * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
726         * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
727         * layout-tests/editing/inserting/typing-003-expected.txt: Added.
728         * layout-tests/editing/inserting/typing-003.html: Added.
729
730 2004-10-25  Ken Kocienda  <kocienda@apple.com>
731
732         Reviewed by John
733
734         * khtml/rendering/bidi.cpp:
735         (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
736             yesterday quite right: words that should have been placed on the next line were instead
737         appearing on the line before, beyond the right margin. This was a one-word only error
738         based on moving the line break object when it should have stayed put. Here is the rule:
739         The line break object only moves to after the whitespace on the end of a line if that 
740         whitespace caused line overflow when its width is added in.
741
742 2004-10-25  Adele Amchan  <adele@apple.com>
743
744         Reviewed by Darin.
745  
746         Fix for <rdar://problem/3619890> Feature request: designMode        
747
748         This change implements the designMode property of a document.  This is an IE property that is also supported by Mozilla.  
749         This will enable more JS editing compatibility.
750
751         * khtml/ecma/kjs_html.cpp:
752         (KJS::HTMLDocument::tryGet): added case for designMode
753         (KJS::HTMLDocument::putValue): added case for designMode
754         * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
755         * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
756         * khtml/xml/dom_docimpl.cpp:
757         (DocumentImpl::DocumentImpl): initialize m_designMode member variable
758         (DocumentImpl::setDesignMode): added function to assign m_designMode value
759         (DocumentImpl::getDesignMode): return m_designMode value
760         (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value. 
761             Otherwise, it will just return the m_designMode value.
762         (DocumentImpl::parentDocument):
763         * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
764         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
765
766 2004-10-22  Ken Kocienda  <kocienda@apple.com>
767
768         Reviewed by Hyatt
769
770         Fix for this bug:
771         
772         <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
773
774         * khtml/editing/htmlediting.cpp:
775         (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
776         everything that could be affected.
777         (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
778         braces, making it act as a comma operator, with a zero value as the right value!!! This made
779         an important check always fail!!! It turns out that we do not want the constant at all, since
780         that constant is only needed when checking a computed style, not an inline style as is being
781         done here.
782         (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
783         (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
784         RangeImpl::compareBoundaryPoints to perform the required check.
785         * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
786
787 2004-10-22  Ken Kocienda  <kocienda@apple.com>
788
789         Reviewed by Hyatt
790         
791         Fix for this bugs:
792         
793         <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
794         <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
795     
796         * khtml/rendering/bidi.cpp:
797         (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
798         it is when we are editing, add in the space of the current character when calculating the width
799         of committed plus uncommitted characters. If this value exceeds the width of the line, move up
800         the line break object and call skipWhitespace to move past the end of the whitespace.
801
802 === Safari-168 ===
803
804 2004-10-22  Ken Kocienda  <kocienda@apple.com>
805
806         * WebCore.pbproj/project.pbxproj:
807          Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
808
809 2004-10-21  David Hyatt  <hyatt@apple.com>
810
811         Reviewed by darin
812         
813         Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
814         
815         <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
816         <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
817         
818         * khtml/rendering/render_block.cpp:
819         (khtml::getInlineRun):
820         (khtml::RenderBlock::makeChildrenNonInline):
821
822 2004-10-21  David Hyatt  <hyatt@apple.com>
823
824         Fix for 3810389, crash because of continuation() craziness.  Revert back to the old behavior of
825         making sure that all line boxes get deleted and recreated when inlines are split because of a block.
826         
827         Reviewed darin
828
829         * khtml/rendering/render_inline.cpp:
830         (RenderInline::splitFlow):
831
832 2004-10-21  Ken Kocienda  <kocienda@apple.com>
833
834         Reviewed by Darin
835         
836         Significant improvement to the way that whitespace is handled during editing.
837
838         * khtml/editing/htmlediting.cpp:
839         (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
840         two being added with this name) that delete "insignificant" unrendered text.
841         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
842         calculates the downstream position to use as the endpoint for the deletion, and
843         then calls deleteInsignificantText with this start and end.
844         (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
845         (khtml::InputNewlineCommand::doApply): Ditto.
846         (khtml::InputTextCommand::input): Ditto.
847         * khtml/editing/htmlediting.h: Add new declarations.
848         
849         Modified layout test results:
850         * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
851         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
852         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
853         * layout-tests/editing/deleting/delete-selection-001-expected.txt:
854         * layout-tests/editing/deleting/delete-tab-001-expected.txt:
855         * layout-tests/editing/deleting/delete-tab-004-expected.txt:
856         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
857         * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
858         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
859         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
860         * layout-tests/editing/inserting/insert-br-001-expected.txt:
861         * layout-tests/editing/inserting/insert-br-004-expected.txt:
862         * layout-tests/editing/inserting/insert-br-005-expected.txt:
863         * layout-tests/editing/inserting/insert-br-006-expected.txt:
864         * layout-tests/editing/inserting/insert-tab-001-expected.txt:
865         * layout-tests/editing/inserting/insert-tab-002-expected.txt:
866         * layout-tests/editing/inserting/insert-tab-004-expected.txt:
867         * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
868         * layout-tests/editing/inserting/typing-001-expected.txt:
869         * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
870         * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
871         * layout-tests/editing/style/typing-style-003-expected.txt:
872         * layout-tests/editing/undo/redo-typing-001-expected.txt:
873         * layout-tests/editing/undo/undo-typing-001-expected.txt:
874
875 2004-10-21  David Hyatt  <hyatt@apple.com>
876
877         Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
878         it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
879         
880         Reviewed by darin
881
882         * khtml/rendering/render_block.cpp:
883         (khtml::getInlineRun):
884
885 2004-10-20  David Hyatt  <hyatt@apple.com>
886
887         Add better dumping of overflow information for scrolling regions.
888
889         Fix for 3726524, crash in updateLayerPosition.  Make sure anonymous elements properly remove themselves
890         from the render tree so that layers and so forth are cleaned up.
891         
892         Reviewed by darin
893
894         * khtml/rendering/render_container.cpp:
895         (RenderContainer::detach):
896         * khtml/rendering/render_layer.h:
897         (khtml::RenderLayer::scrollXOffset):
898         (khtml::RenderLayer::scrollYOffset):
899         * kwq/KWQRenderTreeDebug.cpp:
900         (write):
901
902 2004-10-20  David Hyatt  <hyatt@apple.com>
903
904         Fix for 3791146, make sure all lines are checked when computing overflow.
905         
906         Reviewed by kocienda
907
908         * khtml/rendering/bidi.cpp:
909         (khtml::RenderBlock::computeHorizontalPositionsForLine):
910         (khtml::RenderBlock::layoutInlineChildren):
911         (khtml::RenderBlock::findNextLineBreak):
912         (khtml::RenderBlock::checkLinesForOverflow):
913         * khtml/rendering/render_block.h:
914
915 2004-10-20  David Hyatt  <hyatt@apple.com>
916
917         Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
918         
919         Reviewed by kocienda
920
921         * khtml/rendering/break_lines.cpp:
922         (khtml::isBreakable):
923
924 2004-10-20  Darin Adler  <darin@apple.com>
925
926         Reviewed by John.
927
928         - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
929
930         * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
931         Create a palette with the background and foreground colors in it and set it on the widget.
932
933         * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
934         with APPLE_CHANGES. Removed palette and palette-related function members.
935         * khtml/rendering/render_style.cpp:
936         (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
937         (RenderStyle::diff): No palette to compare.
938
939         * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
940         * kwq/KWQLineEdit.mm:
941         (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
942         (QLineEdit::text): Made const.
943
944         * kwq/KWQTextEdit.h: Added setPalette override.
945         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
946         based on palette.
947
948         * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
949         per color group, and only a single color group per palette.
950         * kwq/KWQColorGroup.mm: Removed.
951         * kwq/KWQPalette.mm: Removed.
952         * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
953
954         * kwq/KWQApplication.h: Removed unused palette function.
955         * kwq/KWQApplication.mm: Ditto.
956
957         * kwq/KWQWidget.h: Removed unsetPalette.
958         * kwq/KWQWidget.mm: Ditto.
959
960         - fixed storage leak
961
962         * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
963         Roll in storage leak fix from KDE guys.
964
965 2004-10-19  David Hyatt  <hyatt@apple.com>
966
967         Reviewed by kocienda
968
969         More cleanup of block layout.  Eliminates the separate step for tables that dont fit on a line with a float
970         and consolidates it with clearing.
971
972         Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
973         
974         * khtml/rendering/render_block.cpp:
975         (khtml::getInlineRun):
976         (khtml::RenderBlock::layoutBlock):
977         (khtml::RenderBlock::adjustFloatingBlock):
978         (khtml::RenderBlock::collapseMargins):
979         (khtml::RenderBlock::clearFloatsIfNeeded):
980         (khtml::RenderBlock::estimateVerticalPosition):
981         (khtml::RenderBlock::layoutBlockChildren):
982         (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
983         (khtml::RenderBlock::getClearDelta):
984         (khtml::RenderBlock::calcBlockMinMaxWidth):
985         * khtml/rendering/render_block.h:
986         * khtml/rendering/render_frames.cpp:
987         (RenderFrameSet::layout):
988         * khtml/xml/dom_textimpl.cpp:
989         (TextImpl::rendererIsNeeded):
990
991         Fix for 3841060, regression with * in frames.  Reviewed by kocienda.
992         
993         * layout-tests/fast/frames/002-expected.txt: Added.
994         * layout-tests/fast/frames/002.html: Added.
995
996  2004-10-19  Darin Adler  <darin@apple.com>
997
998         Reviewed by Maciej.
999
1000         - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
1001
1002         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
1003         scripts being loaded here. If the current code being run is the external script itself, then we don't want
1004         to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
1005         assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
1006         wrong since there can be a script loading in that case too. Layout tests check for both problems.
1007
1008         * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
1009         * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
1010         * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
1011
1012         * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
1013
1014 2004-10-18  Darin Adler  <darin@apple.com>
1015
1016         Reviewed by Dave Hyatt.
1017
1018         - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
1019
1020         * khtml/html/htmltokenizer.cpp:
1021         (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
1022         (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
1023         we only want to look at loadingExtScript if m_executingScript is 0.
1024
1025 2004-10-18  Ken Kocienda  <kocienda@apple.com>
1026
1027         Reviewed by Hyatt
1028
1029         Fix for this bug:
1030         
1031         <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
1032
1033         * khtml/css/css_valueimpl.cpp:
1034         (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
1035         Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the 
1036         lifecycle issues associated with creating a string to be returned in the ident case.
1037         * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
1038         * khtml/css/cssstyleselector.cpp:
1039         (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
1040
1041 2004-10-18  Chris Blumenberg  <cblu@apple.com>
1042
1043         Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
1044
1045         Reviewed by kocienda.
1046
1047         * khtml/rendering/render_frames.cpp:
1048         (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
1049
1050 2004-10-15  Chris Blumenberg  <cblu@apple.com>
1051
1052         Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
1053
1054         Reviewed by john.
1055
1056         * kwq/DOM-CSS.mm:
1057         (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
1058         * kwq/DOMPrivate.h:
1059
1060 2004-10-15  Ken Kocienda  <kocienda@apple.com>
1061
1062         Reviewed by Hyatt
1063
1064         * khtml/rendering/bidi.cpp:
1065         (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
1066         skipping after a clean line break, in addition to the cases already 
1067         checked for.
1068         * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
1069         * layout-tests/editing/inserting/insert-br-007.html: Added.
1070         * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
1071         * layout-tests/editing/inserting/insert-br-008.html: Added.
1072
1073 === Safari-167 ===
1074
1075 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1076
1077         Reviewed by John
1078
1079         Fix for this bug:
1080         
1081         <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
1082
1083         * khtml/editing/visible_position.cpp:
1084         (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
1085         position code to new-style VisiblePosition code. In retrospect, this code was misguided.
1086         Since we do a good job of insulating external code from the internal workings of 
1087         VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
1088         in the case of this bug, was doing harm. Simply removing this code makes the bug
1089         go away and does not cause any editing layout test regresssions.
1090
1091 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1092
1093         Reviewed by Hyatt
1094
1095         * khtml/rendering/bidi.cpp:
1096         (khtml::skipNonBreakingSpace): New helper.
1097         (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
1098         at the start of a block. This was preventing users from typing spaces in empty
1099         documents.
1100         * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
1101         * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
1102
1103 2004-10-14  Adele Amchan  <adele@apple.com>
1104
1105         Reviewed by Darin and Ken.
1106
1107         fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
1108
1109         This change shifts some code around so that the code that determines what typing style
1110         is in effect is called before deleteUnrenderedText is called.  Two asserts are also added
1111         to ensure that start and end nodes of the selection are in the document.
1112
1113         * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
1114
1115 2004-10-14  Adele Amchan  <adele@apple.com>
1116
1117         Reviewed by Ken
1118         
1119         This change makes these three functions virtual so that the work is being done in KWQHTMLPart 
1120         instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
1121
1122         * khtml/khtml_part.cpp:
1123         (KHTMLPart::shouldBeginEditing):
1124         (KHTMLPart::shouldEndEditing):
1125         (KHTMLPart::isContentEditable):
1126         * khtml/khtml_part.h:
1127         * kwq/KWQKHTMLPart.h:
1128
1129 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1130
1131         Reviewed by John
1132
1133         Final fix for these bugs:
1134         
1135         <rdar://problem/3806306> HTML editing puts spaces at start of line
1136         <rdar://problem/3814252> HTML editing groups space with word causing wrapping
1137
1138         This change sets some new CSS properties that have been added to WebCore to 
1139         enable whitespace-handling and line-breaking features that make WebView work
1140         more like a text editor.
1141
1142         * khtml/css/cssstyleselector.cpp:
1143         (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties 
1144         based on property value.
1145         * khtml/html/html_elementimpl.cpp:
1146         (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties 
1147         based on attribute value.
1148         * khtml/khtml_part.cpp:
1149         (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
1150         body element.
1151         (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
1152         body element.
1153         (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
1154         (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
1155         * khtml/khtml_part.h: Add new declarations.
1156         * kwq/WebCoreBridge.h: Ditto.
1157         * kwq/WebCoreBridge.mm:
1158         (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
1159         (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
1160         (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
1161         (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
1162
1163 2004-10-14  John Sullivan  <sullivan@apple.com>
1164
1165         Reviewed by Ken.
1166         
1167         - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
1168
1169         * khtml/editing/htmlediting.cpp:
1170         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
1171         needed a nil check to handle empty document case
1172
1173 2004-10-13  Maciej Stachowiak  <mjs@apple.com>
1174
1175         Reviewed by Ken.
1176
1177         <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
1178         
1179         - I fixed this by turning off all colormatching for WebKit
1180         content. We might turn it back on later. For now, it's possible to
1181         turn it on temporarily by defining COLORMATCH_EVERYTHING.
1182         
1183         * WebCorePrefix.h:
1184         * khtml/ecma/kjs_html.cpp:
1185         (KJS::Context2DFunction::tryCall):
1186         (Context2D::colorRefFromValue):
1187         (Gradient::getShading):
1188         * khtml/rendering/render_canvasimage.cpp:
1189         (RenderCanvasImage::createDrawingContext):
1190         * kwq/KWQColor.mm:
1191         (QColor::getNSColor):
1192         * kwq/KWQPainter.h:
1193         * kwq/KWQPainter.mm:
1194         (CGColorFromNSColor):
1195         (QPainter::selectedTextBackgroundColor):
1196         (QPainter::rgbColorSpace):
1197         (QPainter::grayColorSpace):
1198         (QPainter::cmykColorSpace):
1199         * kwq/WebCoreGraphicsBridge.h:
1200         * kwq/WebCoreGraphicsBridge.m:
1201         (-[WebCoreGraphicsBridge createRGBColorSpace]):
1202         (-[WebCoreGraphicsBridge createGrayColorSpace]):
1203         (-[WebCoreGraphicsBridge createCMYKColorSpace]):
1204
1205 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1206
1207         Reviewed by Hyatt
1208
1209         * khtml/css/css_valueimpl.cpp:
1210         (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
1211         is non-null before appending.
1212
1213 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1214
1215         Update expected results for improved behavior as a result of fix to 3816768.
1216     
1217         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
1218         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1219         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
1220
1221 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1222
1223         Reviewed by Richard
1224
1225         * khtml/css/css_computedstyle.cpp:
1226         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
1227         for getting -khtml-line-break and -khml-nbsp-mode.
1228
1229 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1230
1231         Reviewed by John
1232
1233         Fix for this bug:
1234         
1235         <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly 
1236         moves caret out of block.
1237
1238         The issue here is that an empty block with no explicit height set by style collapses
1239         to zero height, and does so immediately after the last bit of content is removed from
1240         it (as a result of deleting text with the delete key for instance). Since zero-height
1241         blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
1242         
1243         The fix is to detect when a block has not been removed itself, but has had all its 
1244         contents removed. In this case, a BR element is placed in the block, one that is
1245         specially marked as a placeholder. Later, if the block ever receives content, this
1246         placeholder is removed.
1247
1248         * khtml/editing/htmlediting.cpp:
1249         (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
1250         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
1251         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
1252         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
1253         Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong 
1254         (it's very clear that we needs to be able to move more than just text nodes). This may expose
1255         bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
1256         made the test case in the bug work.
1257         (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
1258         removeBlockPlaceholderIfNeeded.
1259         (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
1260         (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
1261         * khtml/editing/htmlediting.h: Declare new functions.
1262
1263 2004-10-13  Richard Williamson   <rjw@apple.com>
1264
1265         Added support for -apple-dashboard-region:none.  And fixed
1266         a few computed style problems.
1267
1268         Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
1269         Reviewed by Hyatt.
1270
1271         * khtml/css/css_computedstyle.cpp:
1272         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1273         * khtml/css/css_valueimpl.cpp:
1274         (CSSPrimitiveValueImpl::cssText):
1275         * khtml/css/cssparser.cpp:
1276         (CSSParser::parseValue):
1277         (CSSParser::parseDashboardRegions):
1278         * khtml/css/cssstyleselector.cpp:
1279         (khtml::CSSStyleSelector::applyProperty):
1280         * khtml/rendering/render_style.cpp:
1281         (RenderStyle::noneDashboardRegions):
1282         * khtml/rendering/render_style.h:
1283         * kwq/KWQKHTMLPart.mm:
1284         (KWQKHTMLPart::dashboardRegionsDictionary):
1285
1286 2004-10-13  David Hyatt  <hyatt@apple.com>
1287
1288         Rework block layout to clean it up and simplify it (r=kocienda).  
1289
1290         Also fixing the style sharing bug (r=mjs).
1291         
1292         * khtml/rendering/render_block.cpp:
1293         (khtml::RenderBlock::MarginInfo::MarginInfo):
1294         (khtml::RenderBlock::layoutBlock):
1295         (khtml::RenderBlock::adjustPositionedBlock):
1296         (khtml::RenderBlock::adjustFloatingBlock):
1297         (khtml::RenderBlock::handleSpecialChild):
1298         (khtml::RenderBlock::handleFloatingOrPositionedChild):
1299         (khtml::RenderBlock::handleCompactChild):
1300         (khtml::RenderBlock::insertCompactIfNeeded):
1301         (khtml::RenderBlock::handleRunInChild):
1302         (khtml::RenderBlock::collapseMargins):
1303         (khtml::RenderBlock::clearFloatsIfNeeded):
1304         (khtml::RenderBlock::estimateVerticalPosition):
1305         (khtml::RenderBlock::determineHorizontalPosition):
1306         (khtml::RenderBlock::setCollapsedBottomMargin):
1307         (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
1308         (khtml::RenderBlock::handleBottomOfBlock):
1309         (khtml::RenderBlock::layoutBlockChildren):
1310         (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
1311         (khtml::RenderBlock::addOverHangingFloats):
1312         * khtml/rendering/render_block.h:
1313         (khtml::RenderBlock::maxTopMargin):
1314         (khtml::RenderBlock::maxBottomMargin):
1315         (khtml::RenderBlock::CompactInfo::compact):
1316         (khtml::RenderBlock::CompactInfo::block):
1317         (khtml::RenderBlock::CompactInfo::matches):
1318         (khtml::RenderBlock::CompactInfo::clear):
1319         (khtml::RenderBlock::CompactInfo::set):
1320         (khtml::RenderBlock::CompactInfo::CompactInfo):
1321         (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
1322         (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
1323         (khtml::RenderBlock::MarginInfo::clearMargin):
1324         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
1325         (khtml::RenderBlock::MarginInfo::setTopQuirk):
1326         (khtml::RenderBlock::MarginInfo::setBottomQuirk):
1327         (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
1328         (khtml::RenderBlock::MarginInfo::setPosMargin):
1329         (khtml::RenderBlock::MarginInfo::setNegMargin):
1330         (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
1331         (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
1332         (khtml::RenderBlock::MarginInfo::setMargin):
1333         (khtml::RenderBlock::MarginInfo::atTopOfBlock):
1334         (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
1335         (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
1336         (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
1337         (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
1338         (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
1339         (khtml::RenderBlock::MarginInfo::quirkContainer):
1340         (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
1341         (khtml::RenderBlock::MarginInfo::topQuirk):
1342         (khtml::RenderBlock::MarginInfo::bottomQuirk):
1343         (khtml::RenderBlock::MarginInfo::posMargin):
1344         (khtml::RenderBlock::MarginInfo::negMargin):
1345         (khtml::RenderBlock::MarginInfo::margin):
1346         * khtml/rendering/render_box.cpp:
1347         (RenderBox::calcAbsoluteVertical):
1348         * khtml/rendering/render_box.h:
1349         (khtml::RenderBox::marginTop):
1350         (khtml::RenderBox::marginBottom):
1351         (khtml::RenderBox::marginLeft):
1352         (khtml::RenderBox::marginRight):
1353         * khtml/rendering/render_image.cpp:
1354         (RenderImage::setImage):
1355         * khtml/rendering/render_object.cpp:
1356         (RenderObject::sizesToMaxWidth):
1357         * khtml/rendering/render_object.h:
1358         (khtml::RenderObject::collapsedMarginTop):
1359         (khtml::RenderObject::collapsedMarginBottom):
1360         (khtml::RenderObject::maxTopMargin):
1361         (khtml::RenderObject::maxBottomMargin):
1362         (khtml::RenderObject::marginTop):
1363         (khtml::RenderObject::marginBottom):
1364         (khtml::RenderObject::marginLeft):
1365         (khtml::RenderObject::marginRight):
1366         * khtml/rendering/render_text.h:
1367         (khtml::RenderText::marginLeft):
1368         (khtml::RenderText::marginRight):
1369         * khtml/xml/dom_elementimpl.cpp:
1370         (ElementImpl::recalcStyle):
1371
1372 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1373
1374         Reviewed by John
1375
1376         Fix for this bug:
1377         
1378         <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
1379
1380         * khtml/editing/selection.cpp:
1381         (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
1382         This will make it seem like the run ends on the next line.
1383
1384 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1385
1386         Reviewed by Hyatt
1387
1388         Fix for this bug:
1389         
1390         <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
1391
1392         * khtml/editing/htmlediting.cpp:
1393         (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
1394         row, section, or column.
1395         (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
1396         of table structure when doing deletes, rather than deleting the structure elements themselves.
1397         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
1398         of table structure. We may want to revisit this some day, but this seems like the best behavior
1399         to me now.
1400         (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
1401         where needed.
1402         * khtml/editing/htmlediting.h: Add declarations for new functions.
1403
1404 2004-10-12  Richard Williamson   <rjw@apple.com>
1405
1406         Fixed access to DOM object via WebScriptObject API.
1407         The execution context for DOM objects wasn't being found.       
1408         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
1409         Reviewed by Chris
1410
1411         Fixed <rdar://problem/3831063> regions use left offset instead of top offset
1412         Reviewed by John
1413
1414         * khtml/khtml_part.h:
1415         * khtml/rendering/render_object.cpp:
1416         (RenderObject::addDashboardRegions):
1417         * kwq/DOM.mm:
1418         (-[DOMNode isContentEditable]):
1419         (-[DOMNode KJS::Bindings::]):
1420         * kwq/KWQKHTMLPart.h:
1421         * kwq/KWQKHTMLPart.mm:
1422         (KWQKHTMLPart::executionContextForDOM):
1423
1424 2004-10-12  Ken Kocienda  <kocienda@apple.com>
1425
1426         Reviewed by Hyatt
1427
1428         Fix for this bug:
1429
1430         <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
1431     
1432         * kwq/KWQKHTMLPart.mm:
1433         (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
1434         insert our style-checking node is done with an appendChild rather than an insertBefore. Note 
1435         that this table-related problem was exposed by fixing Selection::layout(), which I did
1436         yesterday. This change simply improves things even more so that we do not crash in the
1437         scenario described in the bug.
1438
1439 2004-10-11  Ken Kocienda  <kocienda@apple.com>
1440
1441         Reviewed by John
1442
1443         This is a partial fix to this bug:
1444         
1445         <rdar://problem/3832886> increase quote level on new mail document leads to immediate 
1446         crash in caret painting code
1447         
1448         To eliminate the bad behavior for good, I have done some investigations in Mail code,
1449         and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
1450         blocks (like blockquote elements used for quoting) to documents without giving those 
1451         blocks some content (so they have a height).
1452
1453         I added some other crash protections below.
1454
1455         * khtml/editing/selection.cpp:
1456         (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
1457         the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
1458         a couple position-has-renderer assertion checks.
1459         * kwq/KWQKHTMLPart.mm:
1460         (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
1461         may not yield a position. This assertion is a holdover from before we had VisiblePosition.
1462         (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
1463         calls to helpers.
1464
1465 2004-10-11  Darin Adler  <darin@apple.com>
1466
1467         Reviewed by John.
1468
1469         - fixed <rdar://problem/3834230> empty table can result in division by 0
1470
1471         * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
1472         Added 0 check; rolled in from KDE.
1473
1474 2004-10-11  Darin Adler  <darin@apple.com>
1475
1476         Reviewed by John.
1477
1478         - fixed <rdar://problem/3818712> form checkbox value property is read only
1479
1480         The underlying problem was that we were storing two separate values for all
1481         form elements; one for the value property (JavaScript) and the other for the
1482         value attribute (DOM). This is a good idea for text input, but not for other types.
1483
1484         * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
1485         Added private storesValueSeparateFromAttribute function.
1486         * khtml/html/html_formimpl.cpp:
1487         (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
1488         if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
1489         (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
1490         switch so that we will get a warning if a type is left out.
1491         (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
1492         (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
1493         separately from the attribute. Otherwise, we just want to lave it alone
1494         (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
1495         on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
1496         (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
1497         supposed to be stored separate from the attribute.
1498         (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
1499         input elements, and false for the others.
1500
1501 2004-10-11  Darin Adler  <darin@apple.com>
1502
1503         Reviewed by John.
1504
1505         - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
1506
1507         * khtml/rendering/render_form.cpp:
1508         (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
1509         (RenderCheckBox::slotStateChanged): Added call to onChange.
1510
1511 2004-10-11  Ken Kocienda  <kocienda@apple.com>
1512
1513         Reviewed by Darin
1514
1515         Finish selection affinity implementation. This includes code to set the
1516         affinity correctly when clicking with the mouse, and clearing the
1517         affinity when altering the selection using any of the Selection object
1518         mutation functions.
1519
1520         Each instance of the positionForCoordinates, inlineBox and caretRect 
1521         functions have been changed to include an EAffinity argument to give results
1522         which take this bit into account.
1523
1524         * khtml/editing/selection.cpp:
1525         (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
1526         (khtml::Selection::modifyAffinity): New function to compute affinity based on
1527         modification constants.
1528         (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
1529         (khtml::Selection::modifyExtendingRightForward): Ditto.
1530         (khtml::Selection::modifyMovingRightForward): Ditto.
1531         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
1532         (khtml::Selection::modifyMovingLeftBackward): Ditto.
1533         (khtml::Selection::modify): Support saving, restoring, and then calculating new
1534         affinity value as needed. 
1535         (khtml::Selection::xPosForVerticalArrowNavigation):
1536         (khtml::Selection::clear): Reset affinity to UPSTREAM.
1537         (khtml::Selection::setBase): Ditto.
1538         (khtml::Selection::setExtent): Ditto.
1539         (khtml::Selection::setBaseAndExtent): Ditto.
1540         (khtml::Selection::layout): Pass affinity to caretRect().
1541         (khtml::Selection::validate): Pass along affinity parameter to new functions that
1542         require it.
1543         (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
1544         keep this code working with changes made in selectionForLine().
1545         (khtml::endOfLastRunAt): Ditto.
1546         (khtml::selectionForLine): Make this function work for all renderers, not just text
1547         renderers.
1548         * khtml/editing/selection.h:
1549         (khtml::operator==): Consider affinity in equality check.
1550         * khtml/editing/visible_units.cpp:
1551         (khtml::previousLinePosition): Pass affinity argument to function so it can take this 
1552         information into account while processing.
1553         (khtml::nextLinePosition): Ditto.
1554         (khtml::previousParagraphPosition): Ditto.
1555         (khtml::nextParagraphPosition): Ditto.
1556         * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
1557         * khtml/khtml_events.cpp:
1558         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1559         as this function is being removed.
1560         * khtml/khtml_part.cpp:
1561         (KHTMLPart::isPointInsideSelection): Ditto.
1562         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1563         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1564         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1565         call to positionForCoordinates, and set resulting affinity on the selection.
1566         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
1567         NodeImpl::positionForCoordinates, as this function is being removed.
1568         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1569         * khtml/rendering/render_block.cpp:
1570         (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
1571         * khtml/rendering/render_block.h:
1572         * khtml/rendering/render_box.cpp:
1573         (RenderBox::caretRect): Ditto.
1574         * khtml/rendering/render_box.h:
1575         * khtml/rendering/render_br.cpp:
1576         (RenderBR::positionForCoordinates): Ditto.
1577         (RenderBR::caretRect): Ditto.
1578         (RenderBR::inlineBox): Ditto.
1579         * khtml/rendering/render_br.h:
1580         * khtml/rendering/render_container.cpp:
1581         (RenderContainer::positionForCoordinates): Ditto.
1582         * khtml/rendering/render_container.h:
1583         * khtml/rendering/render_flow.cpp:
1584         (RenderFlow::caretRect): Ditto.
1585         * khtml/rendering/render_flow.h:
1586         * khtml/rendering/render_inline.cpp:
1587         (RenderInline::positionForCoordinates): Ditto.
1588         * khtml/rendering/render_inline.h:
1589         * khtml/rendering/render_object.cpp:
1590         (RenderObject::caretRect): Ditto.
1591         (RenderObject::positionForCoordinates): Ditto.
1592         (RenderObject::inlineBox): Ditto.
1593         * khtml/rendering/render_object.h:
1594         * khtml/rendering/render_replaced.cpp:
1595         (RenderReplaced::positionForCoordinates): Ditto.
1596         * khtml/rendering/render_replaced.h:
1597         * khtml/rendering/render_text.cpp:
1598         (RenderText::positionForCoordinates): Ditto.
1599         (firstRendererOnNextLine): New helper used by caretRect().
1600         (RenderText::caretRect): Now takes an affinity argument.
1601         (RenderText::inlineBox): Ditto.
1602         * khtml/rendering/render_text.h:
1603         * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
1604         * khtml/xml/dom_nodeimpl.h: Ditto.
1605         * khtml/xml/dom_position.cpp:
1606         (DOM::Position::previousLinePosition): Now takes an affinity argument.
1607         (DOM::Position::nextLinePosition): Ditto.
1608         * khtml/xml/dom_position.h:
1609         * kwq/WebCoreBridge.h:
1610         * kwq/WebCoreBridge.mm:
1611         (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
1612         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
1613         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
1614         NodeImpl::positionForCoordinates, as this function is being removed.
1615
1616 2004-10-11  Darin Adler  <darin@apple.com>
1617
1618         Reviewed by Ken.
1619
1620         - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
1621
1622         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
1623         Scroll to reveal the text area, don't scroll to reveal the text view itself.
1624         Scrolling the text view ended up putting it at the top left, regardless of
1625         where the insertion point is.
1626
1627 2004-10-11  Darin Adler  <darin@apple.com>
1628
1629         Reviewed by Ken.
1630
1631         - fixed <rdar://problem/3831546> More text is copied than is visually selected
1632
1633         The bug here is that upstream was moving a position too far.
1634
1635         * khtml/xml/dom_position.cpp:
1636         (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
1637         in for various checks. Also use local variables a bit more for slightly more efficiency.
1638         (DOM::Position::downstream): Ditto.
1639
1640 2004-10-11  Darin Adler  <darin@apple.com>
1641
1642         Reviewed by Ken.
1643
1644         - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
1645
1646         * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
1647         * khtml/xml/dom2_eventsimpl.cpp:
1648         (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
1649         (EventImpl::idToType): Changed to use table.
1650
1651 2004-10-10  John Sullivan  <sullivan@apple.com>
1652
1653         - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
1654
1655         (-[KWQAccObject accessibilityActionNames]):
1656         check for nil m_renderer
1657
1658 2004-10-09  Darin Adler  <darin@apple.com>
1659
1660         Reviewed by Kevin.
1661
1662         - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
1663
1664         * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
1665         I'm landing later, but it does no harm to add these now.
1666         * kwq/KWQTextArea.mm:
1667         (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
1668         determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
1669         where we don't want it to track the text view. This caused the bug. 
1670         (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
1671         (-[KWQTextArea setTextColor:]): Added.
1672         (-[KWQTextArea setBackgroundColor:]): Added.
1673
1674 2004-10-09  Darin Adler  <darin@apple.com>
1675
1676         Reviewed by Adele.
1677
1678         - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
1679
1680         The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
1681         This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
1682         "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
1683         call for <meta> redirect and not preventing tokenizing when that's in effect.
1684
1685         * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
1686         isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
1687         * khtml/khtml_part.cpp:
1688         (KHTMLPart::openURL): Updated for new constant name.
1689         (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
1690         does the special case for redirection during load; a <meta> refresh can never be one of those special
1691         redirects during a load because it redirects the frame itself, not another frame. Also tightened up
1692         the logic by always stopping the redirect timer even if we aren't restarting it.
1693         (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
1694         so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
1695         and renamed to locationChangeScheduledDuringLoad.
1696         (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
1697         returns true only for location changes and history navigation, not <meta> redirects.
1698         (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
1699         and got rid of a silly timer delay computation that always resulted in 0.
1700
1701         * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
1702         and also renamed one of the existing values.
1703
1704         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
1705         of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
1706
1707         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
1708         instead of calling scheduleRedirection with delay of 0.
1709         * khtml/ecma/kjs_window.cpp:
1710         (Window::put): Ditto.
1711         (WindowFunc::tryCall): Ditto.
1712         (Location::put): Ditto.
1713         (LocationFunc::tryCall): Ditto.
1714
1715 2004-10-09  Darin Adler  <darin@apple.com>
1716
1717         Reviewed by Kevin.
1718
1719         - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does
1720
1721         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
1722
1723 2004-10-09  Darin Adler  <darin@apple.com>
1724
1725         Reviewed by Kevin.
1726
1727         - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
1728
1729         * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
1730         makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
1731         a copy of the function in each file as an init routine for the framework.
1732
1733         * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
1734         globals; their constructors were showing up as init routines for the framework.
1735
1736         * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
1737         * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
1738         a normal function. When it was an inline function, the constructors for the per-file
1739         copies of the globals were showing up as init routines for the framework.
1740
1741 2004-10-09  Chris Blumenberg  <cblu@apple.com>
1742
1743         Fixed: 
1744         <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
1745         <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
1746         <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
1747
1748         Reviewed by hyatt, kocienda.
1749
1750         * khtml/rendering/render_layer.cpp:
1751         (RenderLayer::scroll): new
1752         * khtml/rendering/render_layer.h:
1753         * khtml/rendering/render_object.cpp:
1754         (RenderObject::scroll): new
1755         * khtml/rendering/render_object.h:
1756         * kwq/KWQKHTMLPart.h:
1757         * kwq/KWQKHTMLPart.mm:
1758         (KWQKHTMLPart::scrollOverflow): new
1759         (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
1760         (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
1761         * kwq/KWQScrollBar.h:
1762         * kwq/KWQScrollBar.mm:
1763         (QScrollBar::setValue): return a bool
1764         (QScrollBar::scrollbarHit): ditto
1765         (QScrollBar::scroll): new
1766         * kwq/WebCoreBridge.h:
1767         * kwq/WebCoreBridge.mm:
1768         (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
1769         (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
1770         (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
1771
1772 2004-10-06  David Hyatt  <hyatt@apple.com>
1773
1774         Back out style sharing perf fix.
1775         
1776         * khtml/css/cssstyleselector.cpp:
1777         (khtml::CSSStyleSelector::locateCousinList):
1778         (khtml::CSSStyleSelector::canShareStyleWithElement):
1779         (khtml::CSSStyleSelector::locateSharedStyle):
1780         * khtml/css/cssstyleselector.h:
1781         * khtml/html/html_elementimpl.h:
1782         (DOM::HTMLElementImpl::inlineStyleDecl):
1783         * khtml/xml/dom_elementimpl.cpp:
1784         (ElementImpl::recalcStyle):
1785         * khtml/xml/dom_elementimpl.h:
1786
1787 === Safari-166 ===
1788
1789 2004-10-05  David Hyatt  <hyatt@apple.com>
1790
1791         Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
1792
1793         * khtml/css/cssstyleselector.cpp:
1794         (khtml::CSSStyleSelector::locateCousinList):
1795         (khtml::CSSStyleSelector::elementsCanShareStyle):
1796         (khtml::CSSStyleSelector::locateSharedStyle):
1797         (khtml::CSSStyleSelector::styleForElement):
1798
1799 2004-10-05  Ken Kocienda  <kocienda@apple.com>
1800
1801         Reviewed by Hyatt
1802
1803         * khtml/rendering/bidi.cpp:
1804         (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
1805         broke layout tests involving compacts.
1806
1807 2004-10-05  Ken Kocienda  <kocienda@apple.com>
1808
1809         Reviewed by Darin
1810
1811         Finish selection affinity implementation. This includes code to set the
1812         affinity correctly when clicking with the mouse, and clearing the
1813         affinity when altering the selection using any of the Selection object
1814         mutation functions.
1815
1816         Each instance of the positionForCoordinates function in the render tree
1817         has been changed to include an EAffinity argument. It is now the job of this
1818         function to set the selection affinity.
1819
1820         * khtml/editing/selection.cpp:
1821         (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
1822         (khtml::Selection::modify): Ditto.
1823         (khtml::Selection::clear): Ditto.
1824         (khtml::Selection::setBase): Ditto.
1825         (khtml::Selection::setExtent): Ditto.
1826         (khtml::Selection::setBaseAndExtent): Ditto.
1827         * khtml/editing/selection.h:
1828         (khtml::operator==): Consider affinity in equality check.
1829         * khtml/khtml_events.cpp:
1830         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
1831         as this function is being removed.
1832         * khtml/khtml_part.cpp: 
1833         (KHTMLPart::isPointInsideSelection): Ditto.
1834         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
1835         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1836         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
1837         call to positionForCoordinates, and set resulting affinity on the selection.
1838         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
1839         NodeImpl::positionForCoordinates, as this function is being removed.
1840         (KHTMLPart::khtmlMouseReleaseEvent):
1841         * khtml/rendering/render_block.cpp:
1842         (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
1843         * khtml/rendering/render_block.h:
1844         * khtml/rendering/render_br.cpp:
1845         (RenderBR::positionForCoordinates): Ditto.
1846         * khtml/rendering/render_br.h:
1847         * khtml/rendering/render_container.cpp:
1848         (RenderContainer::positionForCoordinates): Ditto.
1849         * khtml/rendering/render_container.h:
1850         * khtml/rendering/render_inline.cpp:
1851         (RenderInline::positionForCoordinates): Ditto.
1852         * khtml/rendering/render_inline.h:
1853         * khtml/rendering/render_object.cpp:
1854         (RenderObject::positionForCoordinates): Ditto.
1855         * khtml/rendering/render_object.h:
1856         * khtml/rendering/render_replaced.cpp:
1857         (RenderReplaced::positionForCoordinates): Ditto.
1858         * khtml/rendering/render_replaced.h:
1859         * khtml/rendering/render_text.cpp:
1860         (RenderText::positionForCoordinates): Ditto.
1861         * khtml/rendering/render_text.h:
1862         * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
1863         * khtml/xml/dom_nodeimpl.h: Ditto.
1864         * kwq/WebCoreBridge.mm:
1865         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
1866         NodeImpl::positionForCoordinates, as this function is being removed.
1867
1868 2004-10-05  David Hyatt  <hyatt@apple.com>
1869
1870         Fix style sharing optimization to be fast again.  Go back to using pointer comparisons when looking for
1871         cousins to share.
1872         
1873         Reviewed by darin
1874
1875         * khtml/css/cssstyleselector.cpp:
1876         (khtml::CSSStyleSelector::locateCousinList):
1877         * khtml/rendering/render_object.cpp:
1878         (RenderObject::setStyleInternal):
1879         * khtml/rendering/render_object.h:
1880         * khtml/xml/dom_elementimpl.cpp:
1881         (ElementImpl::recalcStyle):
1882
1883 2004-10-05  David Hyatt  <hyatt@apple.com>
1884
1885         Fix lists so that they properly participate in line layout as though they are text (when text bullets are
1886         used) and as images (when image bullets are used).
1887         
1888         Reviewed by kocienda
1889
1890         * khtml/rendering/render_list.cpp:
1891         (RenderListMarker::createInlineBox):
1892         * khtml/rendering/render_list.h:
1893         (khtml::ListMarkerBox:::InlineBox):
1894         (khtml::ListMarkerBox::isText):
1895
1896 2004-10-05  Ken Kocienda  <kocienda@apple.com>
1897
1898         Reviewed by Darin
1899
1900         Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
1901         we want is downstreamDeepEquivalent, as the deepEquivalent function returns
1902         an upstream position.
1903
1904         * khtml/editing/selection.cpp:
1905         (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
1906         UPSTREAM uses deepEquivalent.
1907         * khtml/editing/visible_position.cpp:
1908         (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing 
1909         upstreamDeepEquivalent.
1910         * khtml/editing/visible_position.h
1911
1912 2004-10-05  David Hyatt  <hyatt@apple.com>
1913
1914         New selection gap-filling architecture.  Makes the gap-filling much more like NSTextView and puts the responsibility
1915         for gap-filling in the block.  Fixes numerous bugs with selection drawing including bidi issues, incorrect old
1916         horizontal gap filling, and selection performance issues.
1917         
1918         Reviewed by kocienda
1919
1920         * khtml/html/html_imageimpl.cpp:
1921         (HTMLImageLoader::notifyFinished):
1922         * khtml/misc/khtmllayout.h:
1923         (khtml::GapRects::left):
1924         (khtml::GapRects::center):
1925         (khtml::GapRects::right):
1926         (khtml::GapRects::uniteLeft):
1927         (khtml::GapRects::uniteCenter):
1928         (khtml::GapRects::uniteRight):
1929         (khtml::GapRects::unite):
1930         (khtml::GapRects::operator QRect):
1931         (khtml::GapRects::operator==):
1932         (khtml::GapRects::operator!=):
1933         * khtml/rendering/font.cpp:
1934         (Font::drawHighlightForText):
1935         * khtml/rendering/font.h:
1936         * khtml/rendering/render_block.cpp:
1937         (khtml:::RenderFlow):
1938         (khtml::RenderBlock::removeChild):
1939         (khtml::RenderBlock::paintObject):
1940         (khtml::RenderBlock::paintEllipsisBoxes):
1941         (khtml::RenderBlock::setSelectionState):
1942         (khtml::RenderBlock::shouldPaintSelectionGaps):
1943         (khtml::RenderBlock::isSelectionRoot):
1944         (khtml::RenderBlock::selectionGapRects):
1945         (khtml::RenderBlock::paintSelection):
1946         (khtml::RenderBlock::fillSelectionGaps):
1947         (khtml::RenderBlock::fillInlineSelectionGaps):
1948         (khtml::RenderBlock::fillBlockSelectionGaps):
1949         (khtml::RenderBlock::fillHorizontalSelectionGap):
1950         (khtml::RenderBlock::fillVerticalSelectionGap):
1951         (khtml::RenderBlock::fillLeftSelectionGap):
1952         (khtml::RenderBlock::fillRightSelectionGap):
1953         (khtml::RenderBlock::getHorizontalSelectionGapInfo):
1954         (khtml::RenderBlock::leftSelectionOffset):
1955         (khtml::RenderBlock::rightSelectionOffset):
1956         * khtml/rendering/render_block.h:
1957         (khtml::RenderBlock::hasSelectedChildren):
1958         (khtml::RenderBlock::selectionState):
1959         (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
1960         (khtml::RenderBlock::BlockSelectionInfo::rects):
1961         (khtml::RenderBlock::BlockSelectionInfo::state):
1962         (khtml::RenderBlock::BlockSelectionInfo::block):
1963         (khtml::RenderBlock::selectionRect):
1964         * khtml/rendering/render_box.cpp:
1965         (RenderBox::position):
1966         * khtml/rendering/render_br.cpp:
1967         (RenderBR::inlineBox):
1968         * khtml/rendering/render_br.h:
1969         (khtml::RenderBR::selectionRect):
1970         (khtml::RenderBR::paint):
1971         * khtml/rendering/render_canvas.cpp:
1972         (RenderCanvas::selectionRect):
1973         (RenderCanvas::setSelection):
1974         * khtml/rendering/render_canvasimage.cpp:
1975         (RenderCanvasImage::paint):
1976         * khtml/rendering/render_image.cpp:
1977         (RenderImage::paint):
1978         * khtml/rendering/render_image.h:
1979         * khtml/rendering/render_line.cpp:
1980         (khtml::InlineBox::nextLeafChild):
1981         (khtml::InlineBox::prevLeafChild):
1982         (khtml::InlineBox::selectionState):
1983         (khtml::InlineFlowBox::addToLine):
1984         (khtml::InlineFlowBox::firstLeafChild):
1985         (khtml::InlineFlowBox::lastLeafChild):
1986         (khtml::InlineFlowBox::firstLeafChildAfterBox):
1987         (khtml::InlineFlowBox::lastLeafChildBeforeBox):
1988         (khtml::InlineFlowBox::selectionState):
1989         (khtml::RootInlineBox::fillLineSelectionGap):
1990         (khtml::RootInlineBox::setHasSelectedChildren):
1991         (khtml::RootInlineBox::selectionState):
1992         (khtml::RootInlineBox::firstSelectedBox):
1993         (khtml::RootInlineBox::lastSelectedBox):
1994         (khtml::RootInlineBox::selectionTop):
1995         (khtml::RootInlineBox::block):
1996         * khtml/rendering/render_line.h:
1997         (khtml::RootInlineBox::RootInlineBox):
1998         (khtml::RootInlineBox::hasSelectedChildren):
1999         (khtml::RootInlineBox::selectionHeight):
2000         * khtml/rendering/render_object.cpp:
2001         (RenderObject::selectionColor):
2002         * khtml/rendering/render_object.h:
2003         (khtml::RenderObject::):
2004         (khtml::RenderObject::selectionState):
2005         (khtml::RenderObject::setSelectionState):
2006         (khtml::RenderObject::selectionRect):
2007         (khtml::RenderObject::canBeSelectionLeaf):
2008         (khtml::RenderObject::hasSelectedChildren):
2009         (khtml::RenderObject::hasDirtySelectionState):
2010         (khtml::RenderObject::setHasDirtySelectionState):
2011         (khtml::RenderObject::shouldPaintSelectionGaps):
2012         (khtml::RenderObject::SelectionInfo::SelectionInfo):
2013         * khtml/rendering/render_replaced.cpp:
2014         (RenderReplaced::RenderReplaced):
2015         (RenderReplaced::shouldPaint):
2016         (RenderReplaced::selectionRect):
2017         (RenderReplaced::setSelectionState):
2018         (RenderReplaced::selectionColor):
2019         (RenderWidget::paint):
2020         (RenderWidget::setSelectionState):
2021         * khtml/rendering/render_replaced.h:
2022         (khtml::RenderReplaced::canBeSelectionLeaf):
2023         (khtml::RenderReplaced::selectionState):
2024         * khtml/rendering/render_text.cpp:
2025         (InlineTextBox::checkVerticalPoint):
2026         (InlineTextBox::isSelected):
2027         (InlineTextBox::selectionState):
2028         (InlineTextBox::selectionRect):
2029         (InlineTextBox::paintSelection):
2030         (InlineTextBox::paintMarkedTextBackground):
2031         (RenderText::paint):
2032         (RenderText::setSelectionState):
2033         (RenderText::selectionRect):
2034         * khtml/rendering/render_text.h:
2035         (khtml::RenderText::canBeSelectionLeaf):
2036         * kwq/KWQPainter.h:
2037         * kwq/KWQPainter.mm:
2038         (QPainter::drawHighlightForText):
2039         * kwq/KWQPtrDict.h:
2040         (QPtrDictIterator::toFirst):
2041         * kwq/KWQRect.mm:
2042         (QRect::unite):
2043         * kwq/WebCoreTextRenderer.h:
2044         * kwq/WebCoreTextRendererFactory.mm:
2045         (WebCoreInitializeEmptyTextGeometry):
2046
2047 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2048
2049         Reviewed by Darin
2050         
2051         Use the new CSS properties I added with my previous check-in. Also makes
2052         some changes to caret positioning and drawing to make the proper editing
2053         end-of-line behavior work correctly.
2054
2055         * khtml/editing/selection.cpp:
2056         (khtml::Selection::layout): Caret drawing now takes affinity into account
2057         when deciding where to paint the caret (finally!).
2058         * khtml/editing/visible_position.cpp:
2059         (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
2060         to determine the result. Use a simpler test involving comparisons between
2061         downstream positions while iterating. This is cheaper to do and easier to understand.
2062         (khtml::VisiblePosition::nextVisiblePosition): Ditto.
2063         * khtml/rendering/bidi.cpp:
2064         (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
2065         text renderers and for non-text renderers. Return a null Qchar instead. Returning
2066         non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
2067         (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that 
2068         contain with more spaces than can fit on the end of a line.
2069         (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
2070         (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
2071         in code to check and use new CSS properties.
2072         * khtml/rendering/break_lines.cpp:
2073         (khtml::isBreakable): Consider a non-breaking space a breakable character based
2074         on setting of new -khtml-nbsp-mode property.
2075         * khtml/rendering/break_lines.h: Ditto.
2076         * khtml/rendering/render_block.h: Declare skipWhitespace function.
2077         * khtml/rendering/render_text.cpp: 
2078         (RenderText::caretRect): Do not draw the caret beyond the right edge of the
2079         window when in white-space normal mode.
2080
2081 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2082
2083         Reviewed by Darin
2084
2085         Fix for these bugs:
2086         
2087         In this patch, I add two new CSS properties and their associated behavior.
2088         This is to support end-of-line and word-wrapping features that match the 
2089         conventions of text editors.
2090
2091         There are also some other small changes here which begin to lay the groundwork
2092         for using these new properties to bring about the desired editing behavior.
2093
2094         * khtml/css/cssparser.cpp:
2095         (CSSParser::parseValue): Add support for new CSS properties.
2096         * khtml/css/cssproperties.c: Generated file.
2097         * khtml/css/cssproperties.h: Ditto.
2098         * khtml/css/cssproperties.in: Add new properties.
2099         * khtml/css/cssstyleselector.cpp:
2100         (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
2101         * khtml/css/cssvalues.c: Generated file.
2102         * khtml/css/cssvalues.h: Ditto.
2103         * khtml/css/cssvalues.in:  Add support for new CSS properties.
2104         * khtml/editing/visible_position.cpp:
2105         (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
2106         * khtml/editing/visible_position.h:
2107         * khtml/rendering/render_box.cpp:
2108         (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
2109         * khtml/rendering/render_replaced.cpp:
2110         (RenderWidget::detach): Zero out inlineBoxWrapper.
2111         * khtml/rendering/render_style.cpp:
2112         (StyleCSS3InheritedData):
2113         (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
2114         (RenderStyle::diff): Ditto.
2115         * khtml/rendering/render_style.h:
2116         (khtml::RenderStyle::nbspMode): Ditto.
2117         (khtml::RenderStyle::khtmlLineBreak): Ditto.
2118         (khtml::RenderStyle::setNBSPMode): Ditto.
2119         (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
2120         (khtml::RenderStyle::initialNBSPMode): Ditto.
2121         (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
2122
2123 2004-10-05  Darin Adler  <darin@apple.com>
2124
2125         Reviewed by John.
2126
2127         - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
2128
2129         * kwq/KWQTextField.mm:
2130         (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
2131         Wrote a new version of this method that truncates incoming strings rather than rejecting them
2132         out of hand.
2133
2134 2004-10-04  Darin Adler  <darin@apple.com>
2135
2136         Reviewed by Maciej.
2137
2138         - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
2139
2140         * khtml/html/htmlparser.cpp:
2141         (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
2142         (KHTMLParser::reset): Use doc() to make code easier to read.
2143         (KHTMLParser::setCurrent): Ditto.
2144         (KHTMLParser::parseToken): Ditto.
2145         (KHTMLParser::insertNode): Ditto.
2146         (KHTMLParser::getElement): Ditto.
2147         (KHTMLParser::popOneBlock): Ditto.
2148
2149         - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
2150
2151         * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
2152         * kwq/KWQKHTMLPart.mm:
2153         (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
2154         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2155         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2156         (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
2157         (KWQKHTMLPart::registerCommandForRedo): Ditto.
2158
2159         * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
2160         * kwq/WebCoreBridge.mm:
2161         (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
2162         (-[WebCoreBridge redoEditing:]): Ditto.
2163         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
2164         EditCommandPtr variable to make things slightly more terse.
2165         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
2166         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
2167         (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
2168
2169         - fix compile on Panther and other cleanup
2170
2171         * khtml/khtml_part.cpp: Removed unneeded include.
2172         * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
2173         * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
2174         (-[KWQEditCommand initWithEditCommand:]): Changed name.
2175         (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
2176         (-[KWQEditCommand finalize]): Ditto.
2177         (+[KWQEditCommand commandWithEditCommand:]): Changed name.
2178         (-[KWQEditCommand command]): Changed name.
2179
2180 2004-10-04  Darin Adler  <darin@apple.com>
2181
2182         Reviewed by John.
2183
2184         - did a more-robust version of the fix I just landed
2185
2186         * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
2187         * khtml/html/htmlparser.cpp:
2188         (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
2189         (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
2190
2191 2004-10-04  Darin Adler  <darin@apple.com>
2192
2193         Reviewed by John.
2194
2195         - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
2196
2197         * khtml/html/htmlparser.cpp:
2198         (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
2199         work well when current is 0, and there's no reason we need to reset the current block first.
2200         (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
2201         would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
2202         in a double-delete of the document, tokenizer, and parser.
2203
2204 2004-10-04  Darin Adler  <darin@apple.com>
2205
2206         Reviewed by Maciej.
2207
2208         - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
2209
2210         * khtml/khtmlview.cpp:
2211         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
2212         (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
2213         (KHTMLViewPrivate::reset): Clear the click node.
2214         (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
2215         reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
2216         the node we we are clicking on.
2217         (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
2218         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2219         old click node for a long time.
2220         (KHTMLView::invalidateClick): Clear the click node.
2221         (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
2222         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2223         old click node for a long time.
2224         (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
2225
2226 2004-10-04  Ken Kocienda  <kocienda@apple.com>
2227
2228         Reviewed by Hyatt
2229
2230         Fix for this bug:
2231         
2232         <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
2233
2234         * khtml/editing/visible_position.cpp:
2235         (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
2236         iteration. I have been wanting to make this change for a long time, but couldn't
2237         since other code relied on the leaf behavior. That is no longer true. Plus, the
2238         bug fix requires the new behavior.
2239         (khtml::VisiblePosition::nextPosition): Ditto.
2240         (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
2241         but we make a special case for the body element. This fixes the bug.
2242
2243 2004-10-04  Darin Adler  <darin@apple.com>
2244
2245         Reviewed by Ken.
2246
2247         - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
2248
2249         * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
2250         doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
2251         * kwq/KWQTextUtilities.cpp: Removed.
2252         * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
2253
2254         - fixed a problem that would show up using HTML editing under garbage collection
2255
2256         * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
2257         [super finalize].
2258
2259         - another small change
2260
2261         * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
2262
2263 2004-10-01  Darin Adler  <darin@apple.com>
2264
2265         Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
2266
2267         - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
2268
2269         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
2270         Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
2271         This is a short term fix for something that needs a better longer-term fix.
2272
2273         - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
2274
2275         * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
2276         case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
2277
2278 2004-10-01  Darin Adler  <darin@apple.com>
2279
2280         Reviewed by John.
2281
2282         - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
2283
2284         * khtml/html/html_baseimpl.cpp:
2285         (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
2286         (HTMLFrameElementImpl::isURLAllowed): Ditto.
2287         (HTMLFrameElementImpl::openURL): Ditto.
2288
2289 2004-10-01  Darin Adler  <darin@apple.com>
2290
2291         Reviewed by Maciej.
2292
2293         - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
2294
2295         I introduced a major regression where various JavaScript window properties would not be found when I
2296         fixed bug 3809600.
2297
2298         * khtml/ecma/kjs_window.h: Added hasProperty.
2299         * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
2300
2301 2004-09-30  Darin Adler  <darin@apple.com>
2302
2303         Reviewed by Maciej.
2304
2305         - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
2306
2307         Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
2308         are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
2309         to worry about it either.
2310
2311         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
2312         two parameters, rather than if there are more than one.
2313
2314         - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
2315
2316         * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
2317         a signal is only emitted for changes that are not explicitly requested by the caller.
2318
2319         - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
2320
2321         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
2322         not left floating if setStyle decides not to ref it.
2323
2324         - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
2325
2326         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
2327         the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
2328         to ref it.
2329
2330 2004-09-30  Richard Williamson   <rjw@apple.com>
2331
2332         Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
2333         
2334         Added nil check.
2335         
2336         * kwq/KWQKHTMLPart.mm:
2337         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2338
2339 2004-09-30  Chris Blumenberg  <cblu@apple.com>
2340         
2341         Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
2342
2343         Reviewed by hyatt.
2344
2345         * khtml/html/html_objectimpl.cpp:
2346         (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
2347         (HTMLObjectElementImpl::recalcStyle): ditto
2348
2349 2004-09-30  Darin Adler  <darin@apple.com>
2350
2351         - rolled out bad image change that caused performance regression
2352
2353         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
2354         Don't reference the new image before doing the assignment.
2355         This forced an unwanted.
2356
2357 2004-09-30  Ken Kocienda  <kocienda@apple.com>
2358
2359         Reviewed by me, coded by Darin
2360
2361         - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
2362
2363         * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
2364         was used as a distance threshold, but was a negative number. Now make it positive at the start
2365         of the function (and make a couple related changes).
2366
2367 2004-09-29  Richard Williamson   <rjw@apple.com>
2368
2369         Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
2370
2371         The fix has two parts, 1) make onblur and onfocus work for windows, 
2372         and 2), allow the dashboard to override WebKit's special key/non-key
2373         behaviors.
2374
2375         Reviewed by Chris.
2376
2377         * kwq/KWQKHTMLPart.mm:
2378         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
2379
2380 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2381
2382         Reviewed by Hyatt
2383         
2384         Fix for this bug:
2385         
2386         <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window, 
2387         it doesn't break and just runs off the right side
2388
2389         * khtml/css/css_computedstyle.cpp:
2390         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
2391         * khtml/css/cssparser.cpp:
2392         (CSSParser::parseValue): Ditto.
2393         * khtml/css/cssproperties.c: Generated file.
2394         * khtml/css/cssproperties.h: Ditto.
2395         * khtml/css/cssproperties.in: Add word-wrap property.
2396         * khtml/css/cssstyleselector.cpp:
2397         (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
2398         * khtml/css/cssvalues.c: Generated file.
2399         * khtml/css/cssvalues.h: Ditto.
2400         * khtml/css/cssvalues.in: Add break-word value.
2401         * khtml/rendering/bidi.cpp:
2402         (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
2403         * khtml/rendering/render_style.cpp:
2404         (StyleCSS3InheritedData): Add support for new wordWrap property.
2405         (StyleCSS3InheritedData::operator==): Ditto.
2406         (RenderStyle::diff): Ditto.
2407         * khtml/rendering/render_style.h:
2408         (khtml::RenderStyle::wordWrap): Ditto.
2409         (khtml::RenderStyle::setWordWrap): Ditto.
2410         (khtml::RenderStyle::initialWordWrap): Ditto.
2411
2412 2004-09-29  Maciej Stachowiak  <mjs@apple.com>
2413
2414         Reviewed by John.
2415
2416         - consolidated OS version checks into prefix header
2417
2418         * WebCorePrefix.h:
2419         * khtml/rendering/render_canvasimage.cpp:
2420         * kwq/KWQAccObject.mm:
2421         (-[KWQAccObject roleDescription]):
2422         (-[KWQAccObject accessibilityActionDescription:]):
2423         * kwq/KWQComboBox.mm:
2424         (QComboBox::QComboBox):
2425         * kwq/KWQFoundationExtras.h:
2426
2427 2004-09-29  David Hyatt  <hyatt@apple.com>
2428
2429         Make sure <br>s always get line boxes.  Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
2430         that follow <br>s.
2431         
2432         Reviewed by kocienda
2433
2434         * khtml/editing/visible_position.cpp:
2435         (khtml::VisiblePosition::isCandidate):
2436         * khtml/rendering/render_br.cpp:
2437         (RenderBR::RenderBR):
2438         (RenderBR::createInlineBox):
2439         (RenderBR::baselinePosition):
2440         (RenderBR::lineHeight):
2441         * khtml/rendering/render_br.h:
2442         * khtml/rendering/render_line.cpp:
2443         (khtml::InlineFlowBox::placeBoxesVertically):
2444         * khtml/rendering/render_line.h:
2445         (khtml::InlineBox::isText):
2446         (khtml::InlineFlowBox::addToLine):
2447         * khtml/rendering/render_text.cpp:
2448         (RenderText::detach):
2449         * khtml/rendering/render_text.h:
2450         (khtml::InlineTextBox:::InlineRunBox):
2451         (khtml::InlineTextBox::isInlineTextBox):
2452         (khtml::InlineTextBox::isText):
2453         (khtml::InlineTextBox::setIsText):
2454         * khtml/xml/dom_textimpl.cpp:
2455         (TextImpl::rendererIsNeeded):
2456         * kwq/KWQRenderTreeDebug.cpp:
2457         (operator<<):
2458
2459 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2460
2461         Reviewed by John
2462
2463         Fix for this bug:
2464         
2465         <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
2466
2467         * khtml/editing/selection.cpp:
2468         (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
2469         from a Selection. Return an empty Range when there is an exception.
2470
2471         Fix for this bug:
2472         
2473         <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of 
2474         visible area of view with arrow keys
2475
2476         * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
2477         Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
2478         (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
2479         (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
2480         (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
2481         (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
2482         (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
2483         is also calculated here.
2484         (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
2485         (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a 
2486         layout if needed.
2487         (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
2488         (khtml::Selection::paintCaret): Ditto.
2489         (khtml::Selection::validate): Ditto.
2490         * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and 
2491         expectedVisibleRect accessor.
2492         * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
2493         this is not only about making the caret visible anymore. Now it can reveal the varying
2494         end of the selection when scrolling with arrow keys.
2495         * kwq/WebCoreBridge.mm:
2496         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to 
2497         ensureSelectionVisible name change.
2498         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
2499         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
2500         (-[WebCoreBridge insertNewline]): Ditto
2501         (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
2502         (-[WebCoreBridge deleteKeyPressed]): Ditto
2503         (-[WebCoreBridge ensureSelectionVisible]): Ditto
2504
2505 2004-09-29  Ken Kocienda  <kocienda@apple.com>
2506
2507         Reviewed by Hyatt
2508         
2509         Fix for this bug:
2510         
2511         <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
2512         
2513         * kwq/KWQKHTMLPart.h:
2514         * kwq/KWQKHTMLPart.mm:
2515         (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
2516         and range selections correctly.
2517         * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
2518         * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit 
2519         method we use to do the centering, -[NSView scrollRectToVisible:],  does not alter 
2520         the view if the rectangle passed to it is already in view. When forceCentering is
2521         true, extra math is done to make scrollRectToVisible center the rectangle we want.
2522         (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to 
2523         _KWQ_scrollRectToVisible:forceCentering:
2524         (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
2525         (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
2526         (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
2527         math to implement the forceCentering effect.
2528         * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
2529         * kwq/KWQScrollView.mm:
2530         (QScrollView::ensureRectVisibleCentered): Ditto.
2531         * kwq/WebCoreBridge.h:
2532         * kwq/WebCoreBridge.mm:
2533         (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart. 
2534
2535 2004-09-28  Chris Blumenberg  <cblu@apple.com>
2536
2537         Fixed: WebArchives begin with "<#document/>"
2538
2539         Reviewed by hyatt.
2540
2541         * khtml/xml/dom_nodeimpl.cpp:
2542         (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
2543
2544 2004-09-28  Chris Blumenberg  <cblu@apple.com>
2545
2546         Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
2547         
2548         Reviewed by mjs.
2549
2550         * khtml/xml/dom2_rangeimpl.cpp:
2551         (DOM::RangeImpl::toHTML):
2552         * khtml/xml/dom_nodeimpl.cpp:
2553         (NodeImpl::recursive_toString):
2554         (NodeImpl::recursive_toHTML):
2555         * khtml/xml/dom_nodeimpl.h:
2556         * kwq/WebCoreBridge.mm:
2557         (-[WebCoreBridge markupStringFromNode:nodes:]):
2558
2559 2004-09-28  Darin Adler  <darin@apple.com>
2560
2561         Reviewed by Ken.
2562
2563         - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
2564
2565         * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
2566         * khtml/editing/htmlediting.cpp:
2567         (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
2568         (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
2569         of blowing away the selection.
2570         (khtml::EditCommand::unapply): Blow away the selection instead of marking mispellings.
2571         (khtml::EditCommand::reapply): Ditto.
2572         (khtml::ReplaceSelectionCommand::doApply): Removed incorrect code that does spell checking
2573         on inserted text; this doesn't match NSText behavior.
2574         (khtml::TypingCommand::markMisspellingsAfterTyping): Use markMisspellingsInAdjacentWords
2575         function for greater clarity on what this actually does.
2576
2577         * khtml/khtml_part.h: Replaced setSelection's "unmarkOldSelection" boolean parameter with a
2578         "keepTypingStyle" boolean parameter. Removed notifySelectionChanged.
2579         * khtml/khtml_part.cpp:
2580         (KHTMLPart::setSelection): Replaced the "unmarkOldSelection" boolean with a new "keepTypingStyle"
2581         boolean. This is a step on the way to simplifying how this works. Moved the code from the
2582         notifySelectionChanged function here, since there was no clear line between the two functions.
2583         (KHTMLPart::clearSelection): Call setSelection rather that having special case code here for
2584         the case of an empty selection.
2585         (KHTMLPart::appliedEditing): Remove the explicit "false" for "unmarkOldSelection".
2586         (KHTMLPart::unappliedEditing): Ditto.
2587         (KHTMLPart::reappliedEditing): Ditto.
2588
2589         * kwq/KWQKHTMLPart.h: Replaced markMisspellingsInSelection and updateSpellChecking with
2590         markMisspellings and markMisspellingsInAdjacentWords. Added parameters to respondToChangedSelection.
2591         * kwq/KWQKHTMLPart.mm:
2592         (KWQKHTMLPart::markMisspellingsInAdjacentWords): Added.
2593         (KWQKHTMLPart::markMisspellings): New name for markMisspellingsInSelection. Simplified logic a
2594         bit and made it the caller's responsibility to expand the selection passed in to word boundaries.
2595         (KWQKHTMLPart::respondToChangedSelection): Added parameter that identifies the old selection,
2596         and changed logic so it won't mark mispellings in a word if the selection still starts in that word.
2597
2598         - implemented empty-cells property in computed style
2599
2600         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2601         Added code for CSS_PROP_EMPTY_CELLS. I think the HTML converter in AppKit uses this.
2602
2603 2004-09-28  Chris Blumenberg  <cblu@apple.com>
2604
2605         Fixed n-squared issues with appending to KWQValueListImpl. This fixes the hang in 3794799.
2606
2607         Fixed by Darin, reviewed by me.
2608
2609         * khtml/xml/dom2_rangeimpl.cpp:
2610         (DOM::RangeImpl::toHTML): tweaks
2611         * kwq/KWQValueListImpl.mm:
2612         (KWQValueListImpl::KWQValueListPrivate::KWQValueListPrivate):
2613         (KWQValueListImpl::KWQValueListPrivate::copyList):
2614         (KWQValueListImpl::clear):
2615         (KWQValueListImpl::appendNode):
2616         (KWQValueListImpl::prependNode):
2617         (KWQValueListImpl::removeEqualNodes):
2618         (KWQValueListImpl::containsEqualNodes):
2619         (KWQValueListImpl::removeIterator):
2620         (KWQValueListImpl::lastNode):
2621         * kwq/WebCoreBridge.mm:
2622         (-[WebCoreBridge nodesFromList:]): use iterator, not at()
2623
2624 2004-09-28  Richard Williamson   <rjw@apple.com>
2625
2626         More dashboard region changes for John.
2627
2628         <rdar://problem/3817421> add getter for dashboard regions (debugging)
2629         
2630         <rdar://problem/3817417> NSScrollView need autoregions for dashboard
2631         
2632         <rdar://problem/3817388> should have short form form control regions
2633         
2634         <rdar://problem/3817477> visibility does not work with dashboard control regions
2635
2636         Reviewed by Hyatt.
2637
2638         * WebCore-combined.exp:
2639         * WebCore.exp:
2640         * khtml/css/cssparser.cpp:
2641         (skipCommaInDashboardRegion):
2642         (CSSParser::parseDashboardRegions):
2643         * khtml/khtmlview.cpp:
2644         (KHTMLView::updateDashboardRegions):
2645         * khtml/rendering/render_object.cpp:
2646         (RenderObject::setStyle):
2647         (RenderObject::addDashboardRegions):
2648         * khtml/xml/dom_docimpl.cpp:
2649         (DocumentImpl::DocumentImpl):
2650         (DocumentImpl::setDashboardRegions):
2651         * khtml/xml/dom_docimpl.h:
2652         (DOM::DocumentImpl::setDashboardRegionsDirty):
2653         (DOM::DocumentImpl::dashboardRegionsDirty):
2654         * kwq/KWQKHTMLPart.h:
2655         * kwq/KWQKHTMLPart.mm:
2656         (KWQKHTMLPart::paint):
2657         (KWQKHTMLPart::dashboardRegionsDictionary):
2658         (KWQKHTMLPart::dashboardRegionsChanged):
2659         * kwq/WebCoreBridge.h:
2660         * kwq/WebCoreBridge.mm:
2661         (-[WebCoreBridge dashboardRegions]):
2662         * kwq/WebDashboardRegion.h:
2663         * kwq/WebDashboardRegion.m:
2664         (-[WebDashboardRegion description]):
2665
2666 2004-09-28  John Sullivan  <sullivan@apple.com>
2667
2668         Reviewed by Chris.
2669
2670         - fixed <rdar://problem/3818558> REGRESSION: "Installed Plug-ins" is blank 
2671         because of <script type="application/x-javascript">
2672
2673         * khtml/html/htmltokenizer.cpp:
2674         (khtml::HTMLTokenizer::parseTag):
2675         add "application/x-javascript" to the list of legal scripting types. Mozilla
2676         accepts this, but WinIE doesn't.
2677         
2678         * layout-tests/fast/tokenizer/004.html:
2679         updated layout test to test some application/xxxx types
2680
2681 2004-09-27  David Hyatt  <hyatt@apple.com>
2682
2683         Reworked lists to work well with RTL text.  Specifically the following bugs have been fixed:
2684
2685         (1) All bullets use the same offset constant now (a padding of 7 pixels).  Before, images used 5 and others used 7.
2686         (2) Line height now works properly, so that list items with no content aren't squished (and missing the line descent).
2687         (3) Punctuation now works correctly with inside and outside style ordered lists in RTL.
2688         (4) RTL lists now properly apply padding and margin to the right side rather than the left.  This was done by adding
2689         -khtml-margin-start and -khtml-padding-start properties that are just mapped to left/right based off the direction.
2690         
2691         Reviewed by darin
2692
2693         * khtml/css/cssparser.cpp:
2694         (CSSParser::parseValue):
2695         * khtml/css/cssproperties.c:
2696         (hash_prop):
2697         (findProp):
2698         * khtml/css/cssproperties.h:
2699         * khtml/css/cssproperties.in:
2700         * khtml/css/cssstyleselector.cpp:
2701         (khtml::CSSStyleSelector::applyDeclarations):
2702         (khtml::CSSStyleSelector::applyProperty):
2703         * khtml/css/html4.css:
2704         * khtml/rendering/bidi.cpp:
2705         (khtml::BidiIterator::direction):
2706         * khtml/rendering/render_list.cpp:
2707         (RenderListItem::getAbsoluteRepaintRect):
2708         (RenderListMarker::paint):
2709         (RenderListMarker::calcMinMaxWidth):
2710         (RenderListMarker::lineHeight):
2711         (RenderListMarker::baselinePosition):
2712
2713 2004-09-28  Ken Kocienda  <kocienda@apple.com>
2714
2715         Reviewed by Darin
2716         
2717         Mark the VisiblePosition taking (Position &, EAffinity=DOWNSTREAM) explicit. Recently, when I added
2718         the EAffinity argument, I left this constructor implicit. Darin pointed out to me that this is
2719         undesirable since implicit use of the the constructor involved making the affinity choice, something
2720         which should be done explicitly.
2721
2722         * khtml/editing/selection.cpp:
2723         (khtml::Selection::modifyExtendingRightForward): Make explicit use of constructor mentioned above.
2724         (khtml::Selection::modifyMovingRightForward): Ditto.
2725         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2726         (khtml::Selection::modifyMovingLeftBackward): Ditto.
2727         (khtml::Selection::modify): Ditto.
2728         (khtml::Selection::validate): Ditto.
2729         * khtml/editing/visible_position.h: Make constructor taking (Position &, EAffinity) explicit.
2730         * khtml/editing/visible_units.cpp: Ditto.
2731         (khtml::previousWordBoundary): Make explicit use of constructor mentioned above.
2732         (khtml::nextWordBoundary): Ditto.
2733         (khtml::previousLinePosition): Ditto.
2734         (khtml::nextLinePosition): Ditto.
2735         * kwq/KWQKHTMLPart.mm: Ditto.
2736         (KWQKHTMLPart::findString): Ditto.
2737         (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
2738         (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
2739         (KWQKHTMLPart::updateSpellChecking): Ditto.
2740
2741 2004-09-28  Darin Adler  <darin@apple.com>
2742
2743         Reviewed by John.
2744
2745         - fixed a storage leak discovered by code inspection
2746
2747         * khtml/html/htmlparser.cpp: (KHTMLParser::~KHTMLParser): Call setCurrent(0) to deref
2748         the parser's current node in the rare case where it still has one.
2749
2750 2004-09-27  David Hyatt  <hyatt@apple.com>
2751
2752         Don't allow nested headers when only inlines are in between them.  Fixes a hang related to pathological nesting
2753         on magicmethodsonline.com.
2754         
2755         Reviewed by darin
2756
2757         * khtml/html/htmlparser.cpp:
2758         (KHTMLParser::parseToken):
2759         (KHTMLParser::processCloseTag):
2760         (KHTMLParser::isHeaderTag):
2761         (KHTMLParser::popNestedHeaderTag):
2762         * khtml/html/htmlparser.h:
2763
2764 2004-09-27  Kevin Decker  <kdecker@apple.com>
2765
2766         Reviewed by John.
2767
2768         * khtml/css/css_base.cpp:
2769         (CSSSelector::selectorText): changed another ATTR_CLASS case to properly return class selector names. 
2770
2771 2004-09-27  David Hyatt  <hyatt@apple.com>
2772
2773         Fix style sharing so that it doesn't share when it shouldn't.  Partially fixes 3671516, table cells don't update
2774         their color on macosx.apple.com.
2775
2776         Fix 3521639, iframe mispositioned on bidi page.  Make sure that when the width of a line exceeds the available line
2777         width that the spillage out of the block is determined by the direction of the block and not by the text-align value.
2778
2779         Partial fix for 3762962, make sure the image cells with specified widths but percentage heights don't just get a minwidth
2780         of 0.
2781
2782         Fix for 3533878, framesets that use percentages that add up to a value > 100% should normalize those percentages.
2783         
2784         Reviewed by john
2785
2786         * khtml/css/cssstyleselector.cpp:
2787         (khtml::CSSStyleSelector::locateCousinList):
2788         (khtml::CSSStyleSelector::elementsCanShareStyle):
2789         (khtml::CSSStyleSelector::locateSharedStyle):
2790         * khtml/css/cssstyleselector.h:
2791         * khtml/html/html_elementimpl.h:
2792         (DOM::HTMLNamedAttrMapImpl::hasMappedAttributes):
2793         (DOM::HTMLElementImpl::inlineStyleDecl):
2794         * khtml/rendering/bidi.cpp:
2795         (khtml::RenderBlock::computeHorizontalPositionsForLine):
2796         * khtml/rendering/render_frames.cpp:
2797         (RenderFrameSet::layout):
2798         * khtml/rendering/render_replaced.cpp:
2799         (RenderReplaced::calcMinMaxWidth):
2800         * khtml/xml/dom_elementimpl.h:
2801         (DOM::ElementImpl::inlineStyleDecl):
2802         (DOM::ElementImpl::hasMappedAttributes):
2803
2804 2004-09-27  Ken Kocienda  <kocienda@apple.com>
2805
2806         Reviewed by John
2807
2808         Removed closestRenderedPosition function from Position class and gave this work
2809         to VisiblePosition instead. However, in order to make the transfer possible,
2810         VisiblePosition needed upstream and downstream affinities added to its
2811         constructors. Also moved the EAffinity enum into its own file. Also moved it
2812         to the khtml namespace.
2813
2814         Updated several functions which used closestRenderedPosition to use VisiblePosition
2815         instead.
2816         
2817         Also deleted Position::equivalentShallowPosition. This was unused.
2818
2819         * ForwardingHeaders/editing/text_affinity.h: Added.
2820         * ForwardingHeaders/editing/visible_position.h: Added.
2821         * WebCore.pbproj/project.pbxproj: Added new files.
2822         * khtml/editing/selection.cpp:
2823         (khtml::Selection::validate): Use VisiblePosition instead of closestRenderedPosition.
2824         * khtml/editing/selection.h:
2825         * khtml/editing/text_affinity.h: Added.
2826         * khtml/editing/visible_position.cpp:
2827         (khtml::VisiblePosition::VisiblePosition):
2828         (khtml::VisiblePosition::initUpstream): New helper for finding upstream visible position.
2829         (khtml::VisiblePosition::initDownstream): Was old init function that unconditionally did
2830         downstream checks for visible position. Renamed to describe this more clearly.
2831         * khtml/editing/visible_position.h:
2832         * khtml/editing/visible_units.cpp:
2833         (khtml::previousWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2834         (khtml::nextWordBoundary): Use VisiblePosition instead of closestRenderedPosition.
2835         * khtml/xml/dom_docimpl.cpp:
2836         (DocumentImpl::updateSelection): Use VisiblePosition instead of closestRenderedPosition.
2837         * khtml/xml/dom_position.cpp:
2838         (DOM::Position::closestRenderedPosition): Removed.
2839         * khtml/xml/dom_position.h: Removed two functions mentioned above.
2840         * kwq/KWQKHTMLPart.mm:
2841         (KWQKHTMLPart::fontForSelection) Use VisiblePosition instead of closestRenderedPosition.:
2842         * kwq/WebCoreBridge.mm:
2843         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Use VisiblePosition instead of closestRenderedPosition.
2844         * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Updated expected results.
2845         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Ditto.
2846         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
2847         * layout-tests/editing/selection/move-by-character-004-expected.txt: Ditto.
2848
2849 2004-09-27  Ken Kocienda  <kocienda@apple.com>
2850
2851         Reviewed by Darin and Maciej
2852
2853         Removed EditCommand smart pointer wrappers from htmlediting.cpp/.h, save for the one
2854         at the root of the hierarchy, and this one has been renamed EditCommandPtr. Renamed
2855         each of the XXXCommandImpl classes, removing the Impl suffix from each, and rolled
2856         these into the htmlediting.cpp/.h files. The htmlediting_impl.cpp/.h files have
2857         been emptied and are being removed.
2858
2859         For the remainder of files, perform the mechanical changes necessary to make everything
2860         compile and run as before.
2861
2862         * WebCore.pbproj/project.pbxproj
2863         * khtml/editing/htmlediting.cpp
2864         * khtml/editing/htmlediting.h
2865         * khtml/editing/htmlediting_impl.cpp: Removed.
2866         * khtml/editing/htmlediting_impl.h: Removed.
2867         * khtml/editing/jsediting.cpp
2868         * khtml/khtml_part.cpp
2869         (KHTMLPart::openURL)
2870         (KHTMLPart::lastEditCommand)
2871         (KHTMLPart::appliedEditing)
2872         (KHTMLPart::unappliedEditing)
2873         (KHTMLPart::reappliedEditing)
2874         (KHTMLPart::applyStyle):
2875         * khtml/khtml_part.h
2876         * khtml/khtmlpart_p.h
2877         * kwq/KWQEditCommand.h
2878         * kwq/KWQEditCommand.mm
2879         (-[KWQEditCommand initWithEditCommandImpl:])
2880         (+[KWQEditCommand commandWithEditCommandImpl:])
2881         (-[KWQEditCommand impl])
2882         * kwq/KWQKHTMLPart.h
2883         * kwq/KWQKHTMLPart.mm
2884         (KWQKHTMLPart::registerCommandForUndo)
2885         (KWQKHTMLPart::registerCommandForRedo)
2886         * kwq/WebCoreBridge.mm
2887         (-[WebCoreBridge undoEditing:])
2888         (-[WebCoreBridge redoEditing:])
2889         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
2890         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:])
2891         (-[WebCoreBridge deleteSelectionWithSmartDelete:])
2892
2893 2004-09-26  Darin Adler  <darin@apple.com>
2894
2895         Reviewed by Maciej.
2896
2897         - fixed <rdar://problem/3816170> image.width/height not available from Image objects (works in Firefox)
2898
2899         * khtml/ecma/kjs_html.h: Added width and height.
2900         * khtml/ecma/kjs_html.cpp: (Image::getValueProperty): Added width and height.
2901         * khtml/ecma/kjs_html.lut.h: Regenerated.
2902
2903         - unrelated change; changed ordering of use count manipulation just in case we decide some day to do
2904           something when the use count hits 0
2905
2906         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap): Increment use count on new object before
2907         decrementing use count on old object.
2908
2909 2004-09-26  Darin Adler  <darin@apple.com>
2910
2911         Reviewed by Kevin.
2912
2913         - fixed <rdar://problem/3812771> document.implementation.hasFeature returns false for a lot of features we implement
2914
2915         * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::hasFeature): Added all the DOM features that we implemented
2916         as part of the HTML editing work.
2917
2918         * khtml/dom/dom_node.cpp: (Node::isSupported): Changed this to call DOMImplementationImpl::hasFeature to share
2919         code. Later this might need to be different per-node, but at the moment that does not seem to be so.
2920
2921         * khtml/ecma/kjs_dom.cpp:
2922         (DOMNodeProtoFunc::tryCall): Pass a null string if the parameter is omitted, undefined, or null. This is better than
2923         having a special case for the string "null" in the DOM implementation.
2924         (DOMDOMImplementationProtoFunc::tryCall): Ditto.
2925
2926         - fixed <rdar://problem/3814605> REGRESSION: fast/table/039 layout test is failing due to extra trailing whitespace in innerText        
2927
2928         * khtml/editing/visible_text.cpp: (khtml::TextIterator::advance): Check for the case where we are at the end of
2929         iteration, and don't call exitNode in that case. This prevents us from getting some unwanted trailing \n characters.
2930
2931         - fixed <rdar://problem/3813253> method cloneNode() does not clone dynamically-set style attributes correctly
2932
2933         * khtml/html/html_elementimpl.h: Added cloneNode override.
2934         * khtml/html/html_elementimpl.cpp:
2935         (HTMLElementImpl::cloneNode): Added. Copies m_inlineStyleDecl.
2936         (HTMLElementImpl::parseHTMLAttribute): Changed to use getInlineStyleDecl().
2937         (HTMLElementImpl::innerText): Changed to do the same thing with fewer lines of code.
2938         (HTMLElementImpl::outerText): Tweaked comment.
2939
2940         - other cleanup
2941
2942         * khtml/xml/dom_elementimpl.cpp:
2943         (ElementImpl::cloneNode): Removed an uneeded type cast.
2944         (XMLElementImpl::cloneNode): Ditto.
2945
2946 2004-09-24  Kevin Decker  <kdecker@apple.com>
2947
2948         Reviewed by Maciej.
2949
2950         <rdar://problem/3799334> DIG: Safari does not properly return style names [DigCSS.htm]
2951
2952         * khtml/css/css_base.cpp:
2953         (CSSSelector::selectorText): Properly returns Class Selector names.  
2954         Before we would get *[CLASS"foo"] instead of .foo
2955
2956 2004-09-24  Ken Kocienda  <kocienda@apple.com>
2957
2958         Reviewed by John
2959
2960         Fix for this bug:
2961         
2962         <rdar://problem/3814660> REGRESSION (8A200-8A259): Select All has no effect on livepage.apple.com
2963
2964         * khtml/xml/dom_docimpl.cpp:
2965         (DocumentImpl::updateSelection): Move the selection start and end to rendered positions
2966         before passing off to the RenderCanvas for drawing.
2967         * layout-tests/editing/selection/select-all-004-expected.txt: Added.
2968         * layout-tests/editing/selection/select-all-004.html: Added.
2969
2970 2004-09-24  John Sullivan  <sullivan@apple.com>
2971
2972         Reviewed by Maciej.
2973         
2974         - fixed <rdar://problem/3528339> Turn on full keyboard access shows 
2975         invisible <input> elements
2976
2977         * khtml/html/html_formimpl.cpp:
2978         (DOM::HTMLGenericFormElementImpl::isFocusable):
2979         reject elements that have zero width or height, even if they aren't hidden
2980
2981 2004-09-24  Maciej Stachowiak  <mjs@apple.com>
2982
2983         - fixed deployment build
2984
2985         Reviewed by Ken.
2986
2987         * khtml/dom/dom_string.cpp: put implementation of ascii() in #ifdef !NDEBUG
2988         to match prototype.
2989
2990 2004-09-24  David Hyatt  <hyatt@apple.com>
2991
2992         Fix for 3800316, test 37 for tables is failing on the layout tests.  Make sure we don't incorrectly match
2993         non-HTML elements with HTML tag selectors in CSS.
2994         
2995         Reviewed by rjw
2996
2997         * khtml/css/cssstyleselector.cpp:
2998         (khtml::CSSStyleSelector::checkOneSelector):
2999
3000 2004-09-23  David Hyatt  <hyatt@apple.com>
3001
3002         Fix for 3601920, CSS "tabs" not switching properly on zen garden design.  Improve the repainting to account
3003         for layer changes of z-index that necessitate an invalidation.
3004         
3005         Reviewed by kocienda
3006
3007         * khtml/rendering/render_object.cpp:
3008         (RenderObject::setStyle):
3009         * khtml/rendering/render_style.cpp:
3010         (RenderStyle::diff):
3011         * khtml/rendering/render_style.h:
3012         (khtml::RenderStyle::):
3013
3014 2004-09-24  Chris Blumenberg  <cblu@apple.com>
3015
3016         Made markup copying 5 times faster. Unfortunately, this still doesn't fix:
3017         <rdar://problem/3794799> Tiger8A252: copying a bunch o' text is so slow it seems like a hang
3018
3019         Reviewed by rjw.
3020
3021         * khtml/dom/dom_string.h:
3022         * khtml/xml/dom2_rangeimpl.cpp:
3023         (DOM::RangeImpl::toHTML): serialize the range by iterating through the range
3024         * khtml/xml/dom_nodeimpl.cpp:
3025         (NodeImpl::startMarkup): new, factored out from recursive_toString
3026         (NodeImpl::endMarkup): ditto
3027         (NodeImpl::recursive_toString): call factored out methods
3028         * khtml/xml/dom_nodeimpl.h:
3029
3030 === Safari-165 ===
3031
3032 2004-09-24  Ken Kocienda  <kocienda@apple.com>
3033
3034         Hyatt made an improvement in the render tree which caused the results
3035         to get a little thinner.
3036
3037         * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt
3038         * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt
3039
3040 2004-09-24  Ken Kocienda  <kocienda@apple.com>
3041
3042         Reviewed by Hyatt
3043         
3044         Fix for this bug:
3045         
3046         <rdar://problem/3812939> REGRESSION: move-between-blocks-no-001 editing layout test fails in DeleteSelectionCommandImpl
3047
3048         * khtml/rendering/render_block.cpp:
3049         (khtml::RenderBlock::removeChild): Hyatt said this regression was caused by a bad merge. 
3050         Found by code inspection.
3051
3052 2004-09-23  John Sullivan  <sullivan@apple.com>
3053
3054         Reviewed by Maciej.
3055         
3056         - fixed <rdar://problem/3551850> hang caused by interpreting bad javascript 
3057         guarded by a deliberately bogus "language" attribute (www.riibe.com)
3058
3059         * khtml/html/htmltokenizer.cpp:
3060         (khtml::HTMLTokenizer::parseTag):
3061         Check for language attribute of <script> tag in a way that matches WinIE.
3062         Previously we were far too permissive.
3063
3064 2004-09-23  David Hyatt  <hyatt@apple.com>
3065
3066         Fix for 3685234 and 3548444, the x-offset for frame borders was off by 1 pixel, causing mojibake to occur when
3067         repainting happened.
3068
3069         * khtml/rendering/render_canvas.cpp:
3070         (RenderCanvas::repaintViewRectangle):
3071
3072 2004-09-23  Richard Williamson   <rjw@apple.com>
3073
3074         Fixed <rdar://problem/3813271> dashboard-region-circle and dashboard-region-rectangle should be collapsed into dashboard-region
3075         Fixed <rdar://problem/3813289> dashboard regions need to correctly account for overflow/scrolling
3076
3077         Reviewed by Chris.
3078
3079         * khtml/css/css_valueimpl.cpp:
3080         (CSSPrimitiveValueImpl::cssText):
3081         * khtml/css/css_valueimpl.h:
3082         * khtml/css/cssparser.cpp:
3083         (CSSParser::parseValue):
3084         (skipCommaInDashboardRegion):
3085         (CSSParser::parseDashboardRegions):
3086         * khtml/khtmlview.cpp:
3087         (KHTMLView::layout):
3088         (KHTMLView::updateDashboardRegions):
3089         * khtml/khtmlview.h:
3090         * khtml/rendering/render_layer.cpp:
3091         (RenderLayer::scrollToOffset):
3092         * khtml/rendering/render_object.cpp:
3093         (RenderObject::addDashboardRegions):
3094         * kwq/KWQKHTMLPart.mm:
3095         (KWQKHTMLPart::dashboardRegionsChanged):
3096         * kwq/WebDashboardRegion.h:
3097         * kwq/WebDashboardRegion.m:
3098         (-[WebDashboardRegion initWithRect:clip:type:]):
3099         (-[WebDashboardRegion dashboardRegionClip]):
3100         (-[WebDashboardRegion description]):
3101
3102 2004-09-23  Ken Kocienda  <kocienda@apple.com>
3103
3104         Reviewed by Richard
3105
3106         * khtml/xml/dom_position.cpp:
3107         (DOM::Position::inRenderedContent): Make the "empty block" check the same as the one
3108         use in visible position. This fixes a recent regression which broke up and down
3109         arrowing between blocks with an empty block in between.
3110
3111 2004-09-23  Maciej Stachowiak  <mjs@apple.com>
3112
3113         Reviewed by Darin.
3114
3115         <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable
3116         
3117         * khtml/html/html_inlineimpl.cpp:
3118         (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow
3119         the normal focus rules so the link does not swallow focus when you arrow key
3120         or drag-select into it.
3121
3122 2004-09-23  Darin Adler  <darin@apple.com>
3123
3124         - added test for the DOM::Range bug fixed recently
3125
3126         * layout-tests/fast/dom/clone-contents-0-end-offset-expected.txt: Added.
3127         * layout-tests/fast/dom/clone-contents-0-end-offset.html: Added.
3128
3129 2004-09-23  David Hyatt  <hyatt@apple.com>
3130
3131         Fix for hitlist bug, crash when deleting.  
3132
3133         Also fix repaint bug when inlines are inside overflow:auto/scroll regions.
3134         
3135         Reviewed by kocienda
3136
3137         * khtml/editing/htmlediting_impl.cpp:
3138         (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
3139         (khtml::DeleteSelectionCommandImpl::doApply):
3140         * khtml/rendering/render_block.cpp:
3141         (khtml::RenderBlock::removeChild):
3142         * khtml/rendering/render_flow.cpp:
3143         (RenderFlow::getAbsoluteRepaintRect):
3144
3145 2004-09-23  John Sullivan  <sullivan@apple.com>
3146
3147         Reviewed by Ken.
3148
3149         - fixed <rdar://problem/3527840> reproducible crash at johnbrown.v32.qikker.com 
3150         (nil-deref in NodeImpl::dispatchEvent)
3151
3152         * khtml/xml/dom_nodeimpl.cpp:
3153         (NodeImpl::dispatchEvent):
3154         guard against document or document->document() being nil
3155
3156 2004-09-23  Darin Adler  <darin@apple.com>
3157
3158         Reviewed by Ken.
3159
3160         - added new VisibleRange class; not used yet
3161
3162         * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
3163         * khtml/editing/visible_range.cpp: Added.
3164         * khtml/editing/visible_range.h: Added.
3165
3166         - tweaks
3167
3168         * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
3169         Use switch statement instead of if statement so we get a warning if we ever add a new
3170         granularity.
3171
3172         * khtml/editing/selection.h: khtml, not DOM, namespace
3173         * khtml/editing/visible_position.h: Ditto.
3174
3175 2004-09-23  Darin Adler  <darin@apple.com>
3176
3177         Reviewed by Ken.
3178
3179         - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
3180
3181         * khtml/xml/dom_nodeimpl.cpp:
3182         (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
3183         (NodeImpl::dispatchGenericEvent): Ditto.
3184         (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
3185         (NodeImpl::dispatchMouseEvent): Ditto.
3186         (NodeImpl::dispatchUIEvent): Ditto.
3187
3188 2004-09-23  Darin Adler  <darin@apple.com>
3189
3190         Reviewed by Ken.
3191
3192         - fixed some minor mistakes discovered by code inspection
3193
3194         * khtml/khtml_part.cpp:
3195         (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
3196         Grabbing focus when we get the selection is also probably something that should be
3197         conditional, since you can use a WebView in a mode where it can have selection even
3198         when not first responder, ala NSTextView.
3199         (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
3200         Not sure if it's ever important to grab focus when making the caret visible, but by
3201         code inspection it seemed that was unlikely to do harm.
3202
3203 2004-09-23  Darin Adler  <darin@apple.com>
3204
3205         Reviewed by Ken.
3206
3207         - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
3208
3209         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3210         Added CSS_PROP_TABLE_LAYOUT case.
3211
3212 2004-09-23  Darin Adler  <darin@apple.com>
3213
3214         Reviewed by Ken.
3215
3216         - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
3217
3218         Reversing the order of scope caused us to get and set too many properties in the window
3219         object; in the case of this bug setting value ended up setting a window.value property
3220         instead of the value of the <input> element.
3221
3222         * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
3223         Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
3224         "need this to match IE behavior" comment in the file, which I believe is incorrect.
3225         * khtml/ecma/kjs_window.cpp: Ditto.
3226
3227 2004-09-23  Darin Adler  <darin@apple.com>
3228
3229         Reviewed by Ken.
3230
3231         - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
3232
3233         * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
3234         checks to prevent this function from crashing if offsets are greater than the
3235         number of child nodes. Added a special case for offset 0 in one case that has a loop
3236         that won't work correctly for that case.
3237
3238 2004-09-23  Darin Adler  <darin@apple.com>
3239
3240         Reviewed by Ken.
3241
3242         - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
3243
3244         This was mostly fixed by changes I made recently, but using the test case in the bug
3245         I discovered one regression I introduced and another problem that wasn't fixed yet.
3246         This change fixes both.
3247
3248         * kwq/KWQKHTMLPart.mm:
3249         (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
3250         in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
3251         which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
3252         different flavors of word boundary to expand to words we touch in both directions.
3253         (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
3254         the anomalies reported in the bug report go away.
3255
3256 2004-09-23  Darin Adler  <darin@apple.com>
3257
3258         Reviewed by Ken.
3259
3260         - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
3261
3262         Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
3263
3264         * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
3265
3266 2004-09-23  Darin Adler  <darin@apple.com>
3267
3268         - checked in a new file I forgot
3269
3270         * khtml/editing/text_granularity.h: Added.
3271
3272 2004-09-22  Darin Adler  <darin@apple.com>
3273
3274         - renamed
3275
3276             DOM::CaretPosition -> khtml::VisibleRange
3277             DOM::Selection     -> khtml::Selection
3278
3279         - moved all the functions in visible_units.h from DOM to khtml namespace
3280         - moved the one thing from Selection that KHTMLPart uses into its own header
3281
3282         * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
3283
3284         * ForwardingHeaders/editing/selection.h: Added.
3285         * WebCore-combined.exp: Regenerated.
3286         * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
3287
3288         * khtml/ecma/kjs_window.cpp: Update names and namespaces.
3289         * khtml/editing/htmlediting.cpp: Ditto.
3290         * khtml/editing/htmlediting.h: Ditto.
3291         * khtml/editing/htmlediting_impl.cpp: Ditto.
3292         * khtml/editing/htmlediting_impl.h: Ditto.
3293         * khtml/editing/jsediting.cpp: Ditto.
3294         * khtml/editing/selection.cpp: Ditto.
3295         * khtml/editing/selection.h: Ditto.
3296         * khtml/editing/visible_position.cpp: Ditto.
3297         * khtml/editing/visible_position.h: Ditto.
3298         * khtml/editing/visible_text.h: Ditto.
3299         * khtml/editing/visible_units.cpp: Ditto.
3300         * khtml/editing/visible_units.h: Ditto.
3301         * khtml/khtml_part.cpp: Ditto.
3302         * khtml/khtml_part.h: Ditto.
3303         * khtml/khtmlpart_p.h: Ditto.
3304         * khtml/rendering/render_block.cpp: Ditto.
3305         * khtml/xml/dom_docimpl.h: Ditto.
3306         * khtml/xml/dom_nodeimpl.cpp: Ditto.
3307         * kwq/KWQKHTMLPart.h: Ditto.
3308         * kwq/KWQKHTMLPart.mm: Ditto.
3309         * kwq/KWQRenderTreeDebug.cpp: Ditto.
3310         * kwq/WebCoreBridge.mm: Ditto.
3311
3312 2004-09-22  Darin Adler  <darin@apple.com>
3313
3314         * ForwardingHeaders/*: Use import instead of include.
3315
3316 2004-09-22  Darin Adler  <darin@apple.com>
3317
3318         - renamed these files:
3319
3320             misc/khtml_text_operations.h   -> editing/visible_text.h
3321             misc/khtml_text_operations.cpp -> editing/visible_text.cpp
3322             xml/dom_caretposition.cpp      -> editing/visible_position.cpp
3323             xml/dom_caretposition.h        -> editing/visible_position.h
3324             xml/dom_selection.cpp          -> editing/selection.cpp
3325             xml/dom_selection.h            -> editing/selection.h
3326
3327         - broke out the word/line/paragraph part of visible_position.h into visible_units.h
3328         - removed some unnecessary includes from some header files to reduce the number of
3329           files that trigger "building the world"
3330
3331         * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
3332
3333         * ForwardingHeaders/editing/jsediting.h: Added.
3334         * ForwardingHeaders/editing/visible_text.h: Added.
3335         * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
3336         * ForwardingHeaders/xml/dom_caretposition.h: Removed.
3337         * ForwardingHeaders/xml/dom_selection.h: Removed.
3338
3339         * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
3340         * khtml/editing/htmlediting.cpp: Ditto.
3341         * khtml/editing/htmlediting.h: Ditto.
3342         * khtml/editing/htmlediting_impl.cpp: Ditto.
3343         * khtml/editing/htmlediting_impl.h: Ditto.
3344         * khtml/editing/jsediting.cpp: Ditto.
3345         * khtml/editing/selection.cpp: Ditto.
3346         * khtml/editing/selection.h: Ditto.
3347         * khtml/editing/visible_position.cpp: Ditto.
3348         * khtml/editing/visible_position.h: Ditto.
3349         * khtml/editing/visible_text.cpp: Ditto.
3350         * khtml/editing/visible_text.h: Ditto.
3351         * khtml/editing/visible_units.cpp: Added.
3352         * khtml/editing/visible_units.h: Added.
3353         * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
3354         * khtml/khtml_part.cpp: Ditto.
3355         * khtml/khtml_part.h: Ditto.
3356         * khtml/khtmlpart_p.h: Ditto.
3357         * khtml/khtmlview.cpp: Ditto.
3358         * khtml/misc/khtml_text_operations.cpp: Removed.
3359         * khtml/misc/khtml_text_operations.h: Removed.
3360         * khtml/rendering/render_block.cpp: Updated or removed #include lines.
3361         * khtml/xml/dom2_rangeimpl.cpp: Ditto.
3362         * khtml/xml/dom_caretposition.cpp: Removed.
3363         * khtml/xml/dom_caretposition.h: Removed.
3364         * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
3365         * khtml/xml/dom_docimpl.h: Ditto.
3366         * khtml/xml/dom_elementimpl.cpp: Ditto.
3367         * khtml/xml/dom_nodeimpl.cpp: Ditto.
3368         * khtml/xml/dom_position.cpp: Ditto.
3369         * khtml/xml/dom_selection.cpp: Removed.
3370         * khtml/xml/dom_selection.h: Removed.
3371         * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
3372         * kwq/KWQKHTMLPart.h: Ditto.
3373         * kwq/KWQRenderTreeDebug.cpp: Ditto.
3374         * kwq/WebCoreBridge.mm: Ditto.
3375
3376 2004-09-22  Richard Williamson   <rjw@apple.com>
3377         
3378         Pass dashboard regions up to WebKit.
3379         
3380         Don't collect regions from RenderTexts.
3381
3382         Made more args and return types references to avoid
3383         copying value lists.
3384
3385         Reviewed by Hyatt.
3386
3387         * WebCore.pbproj/project.pbxproj:
3388         * khtml/khtmlview.cpp:
3389         (KHTMLView::layout):
3390         * khtml/rendering/render_object.cpp:
3391         (RenderObject::collectDashboardRegions):
3392         * khtml/xml/dom_docimpl.cpp:
3393         (DocumentImpl::dashboardRegions):
3394         (DocumentImpl::setDashboardRegions):
3395         * khtml/xml/dom_docimpl.h:
3396         * kwq/KWQKHTMLPart.h:
3397         * kwq/KWQKHTMLPart.mm:
3398         (KWQKHTMLPart::didFirstLayout):
3399         (KWQKHTMLPart::dashboardRegionsChanged):
3400         * kwq/WebCoreBridge.h:
3401         * kwq/WebDashboardRegion.h: Added.
3402         * kwq/WebDashboardRegion.m: Added.
3403         (-[WebDashboardRegion initWithRect:type:]):
3404         (-[WebDashboardRegion copyWithZone:]):
3405         (-[WebDashboardRegion dashboardRegionRect]):
3406         (-[WebDashboardRegion dashboardRegionType]):
3407         (-[WebDashboardRegion description]):
3408
3409 2004-09-22  Ken Kocienda  <kocienda@apple.com>
3410
3411         Reviewed by Hyatt
3412
3413         Fix for this hitlist bug:
3414         
3415         <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot
3416
3417         * khtml/xml/dom_caretposition.cpp:
3418         (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
3419         Also did a little clean up in this function.
3420         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results. 
3421         This test was actually failing and had bogus results checked in!
3422         * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.
3423
3424 2004-09-22  Chris Blumenberg  <cblu@apple.com>
3425
3426         Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag
3427
3428         Reviewed by john.
3429
3430         * khtml/editing/htmlediting.cpp:
3431         (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
3432         * khtml/editing/htmlediting.h:
3433         * khtml/editing/htmlediting_impl.cpp:
3434         (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
3435         (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
3436         (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
3437         * khtml/editing/htmlediting_impl.h:
3438         * kwq/WebCoreBridge.h:
3439         * kwq/WebCoreBridge.mm:
3440         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg
3441
3442 2004-09-22  Ken Kocienda  <kocienda@apple.com>
3443
3444         Reviewed by Hyatt
3445
3446         * khtml/css/css_computedstyle.cpp:
3447         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded 
3448         version of this function, one that takes a flag to determine whether to
3449         perform a document updateLayout() call before querying the style system.
3450         * khtml/css/css_computedstyle.h:
3451         (DOM::EUpdateLayout): Give a symbolic constant to true/false for the 
3452         purpose of the new call to getPropertyCSSValue.
3453         * khtml/editing/htmlediting_impl.cpp:
3454         (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
3455         getPropertyCSSValue.
3456         (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
3457         to updateLayout before doing style changes that now do not update styles
3458         themselves.
3459         (khtml::ApplyStyleCommandImpl::doApply): Ditto.
3460         (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
3461         getPropertyCSSValue.
3462         (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
3463         * khtml/editing/htmlediting_impl.h: Ditto.
3464
3465 2004-09-22  Ken Kocienda  <kocienda@apple.com>
3466
3467         Reviewed by Darin
3468
3469         * WebCore.pbproj/project.pbxproj: New files added.
3470         * khtml/khtml_part.cpp:
3471         (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
3472         (KHTMLPart::slotClearSelection): Merged old implementation from this function to
3473         clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
3474         we do not call it.
3475         * khtml/xml/dom_docimpl.cpp:
3476         (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
3477         clear the selection.
3478         * kwq/KWQWidget.mm:
3479         (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
3480         (QWidget::setFocus): Ditto.
3481         * kwq/WebCoreBridge.mm: 
3482         (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
3483         clearSelection.
3484         * kwq/WebCoreView.h: Added.
3485         * kwq/WebCoreView.m: Added.
3486         (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
3487         to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent 
3488         unwanted firstResponder switching.
3489         (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
3490         (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.
3491
3492 2004-09-21  Maciej Stachowiak  <mjs@apple.com>
3493
3494         Reviewed by Darin.
3495
3496         <rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com
3497
3498         The problem here is that residual style handling can cause an
3499         element associated with a misnested form to lose the association,
3500         because it can become detached and then reattached in this
3501         case. So we need to maintain the association.
3502         
3503         * khtml/html/html_formimpl.h: Added list of dormant elements to form,
3504         and dormant bit to generic form element.
3505         * khtml/html/html_formimpl.cpp:
3506         (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
3507         dormant elements too.
3508         (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
3509         in addition to adding to main list.
3510         (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
3511         (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
3512         main list, add to dormant list.
3513         (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
3514         dormant bit to false.
3515         (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
3516         dormant and has a form, re-register it and clear the dormant bit.
3517         (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
3518         a form, tell the form it is dormant and set the dormant bit.
3519
3520 2004-09-22  Chris Blumenberg  <cblu@apple.com>
3521
3522         Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word
3523
3524         Reviewed by kocienda.
3525
3526         * khtml/xml/dom_selection.cpp:
3527         (DOM::Selection::validate): if at the end of the document, expand to the left.
3528
3529 2004-09-22  Maciej Stachowiak  <mjs@apple.com>
3530
3531         Reviewed by Ken and John.
3532
3533         <rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
3534         
3535         * khtml/editing/htmlediting_impl.cpp:
3536         (khtml::CompositeEditCommandImpl::inputText): Add an optional 
3537         selectInsertedText parameter.
3538         (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
3539         select the text when inserting plain text, because it already knows all the right
3540         information to do so, and this function doesn't (sometimes text is inserted
3541         before the start of the old selection, not after!)
3542         * khtml/editing/htmlediting_impl.h:
3543
3544 2004-09-22  Richard Williamson   <rjw@apple.com>
3545
3546         More tweaks to dashboard regions.
3547
3548         Move dashboard regions list into css3NonInheritedData so it will be shared
3549         by all styles that don't modify the empty region list.
3550
3551         Make the initial value for dashboard region list a static to minimize allocations
3552         of empty lists.
3553
3554         Make marquee and flex style accessor functions const.
3555
3556         Reviewed by Hyatt.
3557
3558         * khtml/rendering/render_style.cpp:
3559         (RenderStyle::diff):
3560         * khtml/rendering/render_style.h:
3561         (khtml::RenderStyle::opacity):
3562         (khtml::RenderStyle::boxAlign):
3563         (khtml::RenderStyle::boxDirection):
3564         (khtml::RenderStyle::boxFlexGroup):
3565         (khtml::RenderStyle::boxOrdinalGroup):
3566         (khtml::RenderStyle::boxOrient):
3567         (khtml::RenderStyle::boxPack):
3568         (khtml::RenderStyle::marqueeIncrement):
3569         (khtml::RenderStyle::marqueeSpeed):
3570         (khtml::RenderStyle::marqueeLoopCount):
3571         (khtml::RenderStyle::marqueeBehavior):
3572         (khtml::RenderStyle::marqueeDirection):
3573         (khtml::RenderStyle::dashboardRegions):
3574         (khtml::RenderStyle::setDashboardRegions):
3575         (khtml::RenderStyle::setDashboardRegion):
3576         (khtml::RenderStyle::initialDashboardRegions):
3577
3578 2004-09-22  David Hyatt  <hyatt@apple.com>
3579
3580         Fix for 3802766, entire view redrawn in Blot while typing.  Don't needlessly create text nodes just to find
3581         out the font for the caret position.
3582         
3583         Reviewed by darin
3584
3585         * kwq/KWQKHTMLPart.mm:
3586         (KWQKHTMLPart::fontForSelection):
3587
3588 2004-09-21  Chris Blumenberg  <cblu@apple.com>
3589
3590         Fixed:
3591         <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
3592         <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace
3593
3594         Reviewed by darin.
3595
3596         * khtml/editing/htmlediting.cpp:
3597         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
3598         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
3599         * khtml/editing/htmlediting.h:
3600         * khtml/editing/htmlediting_impl.cpp:
3601         (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
3602         (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
3603         (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
3604         (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
3605         * khtml/editing/htmlediting_impl.h:
3606         * kwq/WebCoreBridge.h:
3607         * kwq/WebCoreBridge.mm:
3608         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
3609         (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
3610         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
3611         (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
3612         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter
3613
3614 2004-09-21  Richard Williamson   <rjw@apple.com>
3615
3616         More dashboard region work.
3617
3618         Added support for computed style and cssText for new region property.
3619         Added restriction on length types allowed in region functions.
3620         Added initial and inheritance support for -apple-dashboard-region.
3621
3622         Reviewed by Hyatt.
3623
3624         * khtml/css/css_computedstyle.cpp:
3625         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3626         * khtml/css/css_valueimpl.cpp:
3627         (CSSPrimitiveValueImpl::cssText):
3628         * khtml/css/cssparser.cpp:
3629         (CSSParser::parseDashboardRegions):
3630         * khtml/css/cssstyleselector.cpp:
3631         (khtml::CSSStyleSelector::applyProperty):
3632         * khtml/rendering/render_object.cpp:
3633         (RenderObject::addDashboardRegions):
3634         * khtml/rendering/render_style.cpp:
3635         (RenderStyle::diff):
3636         * khtml/rendering/render_style.h:
3637         (khtml::StyleDashboardRegion::operator==):
3638         (khtml::RenderStyle::dashboardRegions):
3639         (khtml::RenderStyle::setDashboardRegions):
3640         (khtml::RenderStyle::initialDashboardRegions):
3641
3642 2004-09-21  Darin Adler  <darin@apple.com>
3643
3644         Reviewed by Ken.
3645
3646         - fixed problem where our updateLayout call ignores pending stylesheets all the time
3647
3648         * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
3649         * khtml/xml/dom_docimpl.cpp:
3650         (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
3651         (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.
3652
3653         * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
3654         updateLayoutIgnorePendingStylesheets function.
3655         * khtml/ecma/kjs_html.cpp:
3656         (KJS::HTMLElement::getValueProperty): Ditto.
3657         (KJS::HTMLElement::putValue): Ditto.
3658         * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
3659         * khtml/ecma/kjs_window.cpp:
3660         (Window::updateLayout): Ditto.
3661         (Selection::get): Ditto.
3662         (SelectionFunc::tryCall): Ditto.
3663
3664         * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
3665         * khtml/html/html_imageimpl.cpp:
3666         (HTMLImageElementImpl::width): Respect new parameter.
3667         (HTMLImageElementImpl::height): Ditto.
3668
3669         - tweaks
3670
3671         * kwq/WebCoreBridge.mm:
3672         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
3673         explicit "true" parameter to setSelection.
3674         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.
3675
3676 2004-09-21  Darin Adler  <darin@apple.com>
3677
3678         Reviewed by Ken.
3679
3680         - fix crash when pasting text at the end of the document and then doing an undo
3681
3682         * khtml/editing/htmlediting_impl.cpp:
3683         (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
3684         the editing operation, and we'll tell setSelection not to unmark the old selection.
3685         Also call updateLayout before calling appliedEditing so DOM operations in the
3686         code responding to the selection change will work.
3687         (khtml::EditCommandImpl::unapply): Ditto.
3688         (khtml::EditCommandImpl::reapply): Ditto.
3689
3690         * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
3691         to unmark the old selection. We must pass false when editing, because the old
3692         selection might have now-invalid offsets inside it.
3693         * khtml/khtml_part.cpp:
3694         (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
3695         (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
3696         (KHTMLPart::unappliedEditing): Ditto.
3697         (KHTMLPart::reappliedEditing): Ditto.
3698
3699 2004-09-21  Richard Williamson   <rjw@apple.com>
3700
3701         Part 2 of the feature requested in
3702         <rdar://problem/3752791> Dashboard: Need a better solution for control regions
3703         
3704         This patch actually collections the regions and converts to absolute coordinates.
3705         Only remaining piece is to pass over the bridge and up the alley to WebKit
3706         UI delegate.
3707  
3708         Reviewed by Ken.
3709
3710         * khtml/css/css_valueimpl.h:
3711         (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
3712         * khtml/css/cssparser.cpp:
3713         (CSSParser::parseValue):
3714         (CSSParser::parseDashboardRegions):
3715         * khtml/css/cssproperties.c:
3716         * khtml/css/cssproperties.h:
3717         * khtml/css/cssproperties.in:
3718         * khtml/css/cssstyleselector.cpp:
3719         (khtml::CSSStyleSelector::applyProperty):
3720         * khtml/khtmlview.cpp:
3721         (KHTMLView::layout):
3722         * khtml/rendering/render_object.cpp:
3723         (RenderObject::computeDashboardRegions):
3724         (RenderObject::addDashboardRegions):
3725         (RenderObject::collectDashboardRegions):
3726         * khtml/rendering/render_object.h:
3727         (khtml::DashboardRegionValue::operator==):
3728         * khtml/rendering/render_style.cpp:
3729         * khtml/rendering/render_style.h:
3730         (khtml::StyleDashboardRegion::):
3731         (khtml::RenderStyle::dashboardRegions):
3732         (khtml::RenderStyle::setDashboardRegion):
3733         * khtml/xml/dom_docimpl.cpp:
3734         (DocumentImpl::DocumentImpl):
3735         (DocumentImpl::updateLayout):
3736         (DocumentImpl::acceptsEditingFocus):
3737         (DocumentImpl::dashboardRegions):
3738         (DocumentImpl::setDashboardRegions):
3739         * khtml/xml/dom_docimpl.h:
3740         (DOM::DocumentImpl::hasDashboardRegions):
3741         (DOM::DocumentImpl::setHasDashboardRegions):
3742
3743 2004-09-21  John Sullivan  <sullivan@apple.com>
3744
3745         Reviewed by Darin.
3746         
3747         - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135): 
3748         Option-tab doesn't always work as expected
3749
3750         * kwq/KWQKHTMLPart.mm:
3751         (KWQKHTMLPart::tabsToAllControls):
3752         reworked logic to match what we promise in the UI; this worked correctly
3753         before for regular tabbing, but not for option-tabbing.
3754
3755         * kwq/KWQButton.mm:
3756         (QButton::focusPolicy):
3757         check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
3758         
3759         * kwq/KWQComboBox.mm:
3760         (QComboBox::focusPolicy):
3761         ditto
3762         
3763         * kwq/KWQFileButton.mm:
3764         (KWQFileButton::focusPolicy):
3765         ditto
3766         
3767         * kwq/KWQListBox.mm:
3768         (QListBox::focusPolicy):
3769         ditto
3770
3771 2004-09-21  John Sullivan  <sullivan@apple.com>
3772
3773         * khtml/xml/dom_selection.cpp:
3774         (DOM::Selection::modify):
3775         initialize xPos to make compiler happy in deployment builds
3776
3777 2004-09-21  Darin Adler  <darin@apple.com>
3778
3779         Reviewed by Ken.
3780
3781         - some small mechanical improvements to the position and selection classes
3782
3783         * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
3784         * khtml/xml/dom_position.cpp:
3785         (DOM::Position::clear): Added.
3786         (DOM::startPosition): Added.
3787         (DOM::endPosition): Added.
3788
3789         * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
3790         removed node() and offset().
3791         * khtml/xml/dom_caretposition.cpp:
3792         (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
3793         (DOM::CaretPosition::isLastInBlock): Ditto.
3794         (DOM::CaretPosition::next): Ditto.
3795         (DOM::CaretPosition::previous): Ditto.
3796         (DOM::CaretPosition::debugPosition): Ditto.
3797         (DOM::CaretPosition::formatForDebugger): Ditto.
3798
3799         * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
3800         and all the assignXXX functions.
3801         * khtml/xml/dom_selection.cpp:
3802         (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
3803         (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
3804         (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
3805         (DOM::Selection::moveTo): Ditto.
3806         (DOM::Selection::setModifyBias): Ditto.
3807         (DOM::Selection::modifyExtendingRightForward): Ditto.
3808         (DOM::Selection::modifyMovingRightForward): Ditto.
3809         (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3810         (DOM::Selection::modifyMovingLeftBackward): Ditto.
3811         (DOM::Selection::modify): Ditto.
3812         (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
3813         (DOM::Selection::clear): Ditto.
3814         (DOM::Selection::setBase): Ditto.
3815         (DOM::Selection::setExtent): Ditto.
3816         (DOM::Selection::setBaseAndExtent): Ditto.
3817         (DOM::Selection::toRange): Ditto.
3818         (DOM::Selection::layoutCaret): Ditto.
3819         (DOM::Selection::needsCaretRepaint): Ditto.
3820         (DOM::Selection::validate): Ditto.
3821         (DOM::Selection::debugRenderer): Ditto.
3822         (DOM::Selection::debugPosition): Ditto.
3823         (DOM::Selection::end):
3824
3825         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.
3826
3827 2004-09-21  Chris Blumenberg  <cblu@apple.com>
3828
3829         Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)
3830
3831         Reviewed by john.
3832
3833         * khtml/rendering/render_frames.cpp:
3834         (RenderPartObject::updateWidget): when no MIME type is specified map from the WMP CLASSID to the WMP MIME type, look for the URL of the content in the URL PARAM tag
3835
3836 2004-09-20  Darin Adler  <darin@apple.com>
3837
3838         Reviewed by Maciej.
3839
3840         - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
3841         - changed CaretPosition to hold a Position instead of a node and offset
3842         - renamed isEmpty to isNull, etc.
3843
3844         * kwq/KWQKHTMLPart.mm:
3845         (KWQKHTMLPart::jumpToSelection): Updated for name changes.
3846         (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
3847         (KWQKHTMLPart::fontForSelection): Ditto.
3848         (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
3849         (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
3850         (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.
3851
3852         * khtml/xml/dom_position.h: Updated for name changes.
3853         * khtml/xml/dom_position.cpp:
3854         (DOM::Position::element): Change to not use a separate null check.
3855         (DOM::Position::computedStyle): Updated for name changes.
3856         (DOM::Position::previousCharacterPosition): Ditto.
3857         (DOM::Position::nextCharacterPosition): Ditto.
3858         (DOM::Position::equivalentRangeCompliantPosition): Ditto.
3859         (DOM::Position::equivalentShallowPosition): Ditto.
3860         (DOM::Position::equivalentDeepPosition): Ditto.
3861         (DOM::Position::closestRenderedPosition): Ditto.
3862         (DOM::Position::inRenderedContent): Ditto.
3863         (DOM::Position::inRenderedText): Ditto.
3864         (DOM::Position::isRenderedCharacter): Ditto.
3865         (DOM::Position::rendersInDifferentPosition): Ditto.
3866         (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
3867         (DOM::Position::isLastRenderedPositionOnLine): Ditto.
3868         (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
3869         (DOM::Position::leadingWhitespacePosition): Ditto.
3870         (DOM::Position::trailingWhitespacePosition): Ditto.
3871         (DOM::Position::debugPosition): Ditto.
3872         (DOM::Position::formatForDebugger): Ditto.
3873
3874         * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
3875         * khtml/xml/dom_caretposition.cpp:
3876         (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
3877         (DOM::CaretPosition::init): Set m_position directly.
3878         (DOM::CaretPosition::isLastInBlock): Updated for name changes.
3879         (DOM::CaretPosition::next): Set m_position directly.
3880         (DOM::CaretPosition::previous): Set m_position directly.
3881         (DOM::CaretPosition::previousCaretPosition): Updated for name changes.