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