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