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