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