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