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