Reviewed by Ken.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-09-23  Darin Adler  <darin@apple.com>
2
3         Reviewed by Ken.
4
5         - added new VisibleRange class; not used yet
6
7         * WebCore.pbproj/project.pbxproj: Added visible_range.h and visible_range.cpp.
8         * khtml/editing/visible_range.cpp: Added.
9         * khtml/editing/visible_range.h: Added.
10
11         - tweaks
12
13         * kwq/WebCoreBridge.mm: (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):
14         Use switch statement instead of if statement so we get a warning if we ever add a new
15         granularity.
16
17         * khtml/editing/selection.h: khtml, not DOM, namespace
18         * khtml/editing/visible_position.h: Ditto.
19
20 2004-09-23  Darin Adler  <darin@apple.com>
21
22         Reviewed by Ken.
23
24         - fixed <rdar://problem/3812758> 8S266: attaching mutation events to an editable div crashes Safari
25
26         * khtml/xml/dom_nodeimpl.cpp:
27         (NodeImpl::dispatchEvent): Added ref/deref so this works if passed a "floating" event object.
28         (NodeImpl::dispatchGenericEvent): Ditto.
29         (NodeImpl::dispatchHTMLEvent): Removed unneeded ref/deref now that dispatchEvent takes care of it.
30         (NodeImpl::dispatchMouseEvent): Ditto.
31         (NodeImpl::dispatchUIEvent): Ditto.
32
33 2004-09-23  Darin Adler  <darin@apple.com>
34
35         Reviewed by Ken.
36
37         - fixed some minor mistakes discovered by code inspection
38
39         * khtml/khtml_part.cpp:
40         (KHTMLPart::setSelection): Changed to not grab focus if clearing the selection.
41         Grabbing focus when we get the selection is also probably something that should be
42         conditional, since you can use a WebView in a mode where it can have selection even
43         when not first responder, ala NSTextView.
44         (KHTMLPart::setCaretVisible): Changed to not grab focus if making the caret invisible.
45         Not sure if it's ever important to grab focus when making the caret visible, but by
46         code inspection it seemed that was unlikely to do harm.
47
48 2004-09-23  Darin Adler  <darin@apple.com>
49
50         Reviewed by Ken.
51
52         - fixed <rdar://problem/3790595> "ERROR: unimplemented propertyID: 97" logged to console when copying selection (table-layout)
53
54         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
55         Added CSS_PROP_TABLE_LAYOUT case.
56
57 2004-09-23  Darin Adler  <darin@apple.com>
58
59         Reviewed by Ken.
60
61         - fixed <rdar://problem/3809600> REGRESSION: text in search field doesn't disappear when clicked at developer.apple.com
62
63         Reversing the order of scope caused us to get and set too many properties in the window
64         object; in the case of this bug setting value ended up setting a window.value property
65         instead of the value of the <input> element.
66
67         * khtml/ecma/kjs_window.h: Removed bogus hasProperty function that always returns true.
68         Testing shows that MacIE and Gecko match our behavior when we remove this, despite the
69         "need this to match IE behavior" comment in the file, which I believe is incorrect.
70         * khtml/ecma/kjs_window.cpp: Ditto.
71
72 2004-09-23  Darin Adler  <darin@apple.com>
73
74         Reviewed by Ken.
75
76         - fixed <rdar://problem/3812471> -[DOMRange cloneContents] clones too much in some cases where endOffset is 0
77
78         * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Added some nil
79         checks to prevent this function from crashing if offsets are greater than the
80         number of child nodes. Added a special case for offset 0 in one case that has a loop
81         that won't work correctly for that case.
82
83 2004-09-23  Darin Adler  <darin@apple.com>
84
85         Reviewed by Ken.
86
87         - fixed <rdar://problem/3811890> when selecting and moving the caret, some words aren't spell-checked (test case included)
88
89         This was mostly fixed by changes I made recently, but using the test case in the bug
90         I discovered one regression I introduced and another problem that wasn't fixed yet.
91         This change fixes both.
92
93         * kwq/KWQKHTMLPart.mm:
94         (KWQKHTMLPart::markMisspellingsInSelection): Removed unneeded inRenderedContent() check. It was returning false
95         in cases involving a <br> at the end of line, and the check isn't all that helpful now that we use VisiblePosition,
96         which takes care of that sort of thing for you. Changed code to determine the range to check to use the two
97         different flavors of word boundary to expand to words we touch in both directions.
98         (KWQKHTMLPart::updateSpellChecking): Changed to use the same logic about word boundaries. By being consistent,
99         the anomalies reported in the bug report go away.
100
101 2004-09-23  Darin Adler  <darin@apple.com>
102
103         Reviewed by Ken.
104
105         - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick
106
107         Since we are doing a bit less "defers callbacks" work, when testing I ran into this code path.
108
109         * khtml/xml/dom2_eventsimpl.cpp: (MouseEventImpl::computeLayerPos): Check for document without renderer.
110
111 2004-09-23  Darin Adler  <darin@apple.com>
112
113         - checked in a new file I forgot
114
115         * khtml/editing/text_granularity.h: Added.
116
117 2004-09-22  Darin Adler  <darin@apple.com>
118
119         - renamed
120
121             DOM::CaretPosition -> khtml::VisibleRange
122             DOM::Selection     -> khtml::Selection
123
124         - moved all the functions in visible_units.h from DOM to khtml namespace
125         - moved the one thing from Selection that KHTMLPart uses into its own header
126
127         * WebCore.pbproj/project.pbxproj: Added text_granularity.h.
128
129         * ForwardingHeaders/editing/selection.h: Added.
130         * WebCore-combined.exp: Regenerated.
131         * WebCore-tests.exp: Updated symbol for DOM::Selection debugging.
132
133         * khtml/ecma/kjs_window.cpp: Update names and namespaces.
134         * khtml/editing/htmlediting.cpp: Ditto.
135         * khtml/editing/htmlediting.h: Ditto.
136         * khtml/editing/htmlediting_impl.cpp: Ditto.
137         * khtml/editing/htmlediting_impl.h: Ditto.
138         * khtml/editing/jsediting.cpp: Ditto.
139         * khtml/editing/selection.cpp: Ditto.
140         * khtml/editing/selection.h: Ditto.
141         * khtml/editing/visible_position.cpp: Ditto.
142         * khtml/editing/visible_position.h: Ditto.
143         * khtml/editing/visible_text.h: Ditto.
144         * khtml/editing/visible_units.cpp: Ditto.
145         * khtml/editing/visible_units.h: Ditto.
146         * khtml/khtml_part.cpp: Ditto.
147         * khtml/khtml_part.h: Ditto.
148         * khtml/khtmlpart_p.h: Ditto.
149         * khtml/rendering/render_block.cpp: Ditto.
150         * khtml/xml/dom_docimpl.h: Ditto.
151         * khtml/xml/dom_nodeimpl.cpp: Ditto.
152         * kwq/KWQKHTMLPart.h: Ditto.
153         * kwq/KWQKHTMLPart.mm: Ditto.
154         * kwq/KWQRenderTreeDebug.cpp: Ditto.
155         * kwq/WebCoreBridge.mm: Ditto.
156
157 2004-09-22  Darin Adler  <darin@apple.com>
158
159         * ForwardingHeaders/*: Use import instead of include.
160
161 2004-09-22  Darin Adler  <darin@apple.com>
162
163         - renamed these files:
164
165             misc/khtml_text_operations.h   -> editing/visible_text.h
166             misc/khtml_text_operations.cpp -> editing/visible_text.cpp
167             xml/dom_caretposition.cpp      -> editing/visible_position.cpp
168             xml/dom_caretposition.h        -> editing/visible_position.h
169             xml/dom_selection.cpp          -> editing/selection.cpp
170             xml/dom_selection.h            -> editing/selection.h
171
172         - broke out the word/line/paragraph part of visible_position.h into visible_units.h
173         - removed some unnecessary includes from some header files to reduce the number of
174           files that trigger "building the world"
175
176         * WebCore.pbproj/project.pbxproj: Added the files under new names, removed the old ones.
177
178         * ForwardingHeaders/editing/jsediting.h: Added.
179         * ForwardingHeaders/editing/visible_text.h: Added.
180         * ForwardingHeaders/misc/khtml_text_operations.h: Removed.
181         * ForwardingHeaders/xml/dom_caretposition.h: Removed.
182         * ForwardingHeaders/xml/dom_selection.h: Removed.
183
184         * khtml/ecma/kjs_window.cpp: Updated or removed #include lines.
185         * khtml/editing/htmlediting.cpp: Ditto.
186         * khtml/editing/htmlediting.h: Ditto.
187         * khtml/editing/htmlediting_impl.cpp: Ditto.
188         * khtml/editing/htmlediting_impl.h: Ditto.
189         * khtml/editing/jsediting.cpp: Ditto.
190         * khtml/editing/selection.cpp: Ditto.
191         * khtml/editing/selection.h: Ditto.
192         * khtml/editing/visible_position.cpp: Ditto.
193         * khtml/editing/visible_position.h: Ditto.
194         * khtml/editing/visible_text.cpp: Ditto.
195         * khtml/editing/visible_text.h: Ditto.
196         * khtml/editing/visible_units.cpp: Added.
197         * khtml/editing/visible_units.h: Added.
198         * khtml/html/html_elementimpl.cpp: Updated or removed #include lines.
199         * khtml/khtml_part.cpp: Ditto.
200         * khtml/khtml_part.h: Ditto.
201         * khtml/khtmlpart_p.h: Ditto.
202         * khtml/khtmlview.cpp: Ditto.
203         * khtml/misc/khtml_text_operations.cpp: Removed.
204         * khtml/misc/khtml_text_operations.h: Removed.
205         * khtml/rendering/render_block.cpp: Updated or removed #include lines.
206         * khtml/xml/dom2_rangeimpl.cpp: Ditto.
207         * khtml/xml/dom_caretposition.cpp: Removed.
208         * khtml/xml/dom_caretposition.h: Removed.
209         * khtml/xml/dom_docimpl.cpp: Updated or removed #include lines.
210         * khtml/xml/dom_docimpl.h: Ditto.
211         * khtml/xml/dom_elementimpl.cpp: Ditto.
212         * khtml/xml/dom_nodeimpl.cpp: Ditto.
213         * khtml/xml/dom_position.cpp: Ditto.
214         * khtml/xml/dom_selection.cpp: Removed.
215         * khtml/xml/dom_selection.h: Removed.
216         * kwq/KWQKHTMLPart.mm: Updated or removed #include lines.
217         * kwq/KWQKHTMLPart.h: Ditto.
218         * kwq/KWQRenderTreeDebug.cpp: Ditto.
219         * kwq/WebCoreBridge.mm: Ditto.
220
221 2004-09-22  Richard Williamson   <rjw@apple.com>
222         
223         Pass dashboard regions up to WebKit.
224         
225         Don't collect regions from RenderTexts.
226
227         Made more args and return types references to avoid
228         copying value lists.
229
230         Reviewed by Hyatt.
231
232         * WebCore.pbproj/project.pbxproj:
233         * khtml/khtmlview.cpp:
234         (KHTMLView::layout):
235         * khtml/rendering/render_object.cpp:
236         (RenderObject::collectDashboardRegions):
237         * khtml/xml/dom_docimpl.cpp:
238         (DocumentImpl::dashboardRegions):
239         (DocumentImpl::setDashboardRegions):
240         * khtml/xml/dom_docimpl.h:
241         * kwq/KWQKHTMLPart.h:
242         * kwq/KWQKHTMLPart.mm:
243         (KWQKHTMLPart::didFirstLayout):
244         (KWQKHTMLPart::dashboardRegionsChanged):
245         * kwq/WebCoreBridge.h:
246         * kwq/WebDashboardRegion.h: Added.
247         * kwq/WebDashboardRegion.m: Added.
248         (-[WebDashboardRegion initWithRect:type:]):
249         (-[WebDashboardRegion copyWithZone:]):
250         (-[WebDashboardRegion dashboardRegionRect]):
251         (-[WebDashboardRegion dashboardRegionType]):
252         (-[WebDashboardRegion description]):
253
254 2004-09-22  Ken Kocienda  <kocienda@apple.com>
255
256         Reviewed by Hyatt
257
258         Fix for this hitlist bug:
259         
260         <rdar://problem/3805486> REGRESSION (Mail): Empty block elements can cause the caret to get "stuck" in one spot
261
262         * khtml/xml/dom_caretposition.cpp:
263         (DOM::CaretPosition::isCandidate): You can no longer caret into empty blocks with no height.
264         Also did a little clean up in this function.
265         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Regenerated expected results. 
266         This test was actually failing and had bogus results checked in!
267         * layout-tests/editing/selection/select-all-003-expected.txt: Regenerated expected results.
268
269 2004-09-22  Chris Blumenberg  <cblu@apple.com>
270
271         Fixed: <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag
272
273         Reviewed by john.
274
275         * khtml/editing/htmlediting.cpp:
276         (khtml::MoveSelectionCommand::MoveSelectionCommand): take smartMove arg
277         * khtml/editing/htmlediting.h:
278         * khtml/editing/htmlediting_impl.cpp:
279         (khtml::CompositeEditCommandImpl::deleteSelection): take smartDelete arg
280         (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): take smartMove arg
281         (khtml::MoveSelectionCommandImpl::doApply): pass smartMove for smartDelete and smartReplace
282         * khtml/editing/htmlediting_impl.h:
283         * kwq/WebCoreBridge.h:
284         * kwq/WebCoreBridge.mm:
285         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): take smartMove arg
286
287 2004-09-22  Ken Kocienda  <kocienda@apple.com>
288
289         Reviewed by Hyatt
290
291         * khtml/css/css_computedstyle.cpp:
292         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): New overloaded 
293         version of this function, one that takes a flag to determine whether to
294         perform a document updateLayout() call before querying the style system.
295         * khtml/css/css_computedstyle.h:
296         (DOM::EUpdateLayout): Give a symbolic constant to true/false for the 
297         purpose of the new call to getPropertyCSSValue.
298         * khtml/editing/htmlediting_impl.cpp:
299         (khtml::StyleChange::currentlyHasStyle): Pass DoNotUpdateLayout to call to
300         getPropertyCSSValue.
301         (khtml::CompositeEditCommandImpl::applyTypingStyle): Add in top-level calls
302         to updateLayout before doing style changes that now do not update styles
303         themselves.
304         (khtml::ApplyStyleCommandImpl::doApply): Ditto.
305         (khtml::ApplyStyleCommandImpl::removeCSSStyle): Pass DoNotUpdateLayout to call to
306         getPropertyCSSValue.
307         (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Remove this dead code.
308         * khtml/editing/htmlediting_impl.h: Ditto.
309
310 2004-09-22  Ken Kocienda  <kocienda@apple.com>
311
312         Reviewed by Darin
313
314         * WebCore.pbproj/project.pbxproj: New files added.
315         * khtml/khtml_part.cpp:
316         (KHTMLPart::clearSelection): No longer calls setFocusIfNeeded.
317         (KHTMLPart::slotClearSelection): Merged old implementation from this function to
318         clearSelection. Now just calls clearSelection. Also put in !APPLE_CHANGES since
319         we do not call it.
320         * khtml/xml/dom_docimpl.cpp:
321         (DocumentImpl::setFocusNode): Add some code to determine when setting the focus should
322         clear the selection.
323         * kwq/KWQWidget.mm:
324         (QWidget::hasFocus): Call _webcore_effectiveFirstResponder to get view to check for focus.
325         (QWidget::setFocus): Ditto.
326         * kwq/WebCoreBridge.mm: 
327         (-[WebCoreBridge deselectText]): Called slotClearSelection and should have been. Now calls
328         clearSelection.
329         * kwq/WebCoreView.h: Added.
330         * kwq/WebCoreView.m: Added.
331         (-[NSView _webcore_effectiveFirstResponder]): New method to yield the correct responder
332         to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent 
333         unwanted firstResponder switching.
334         (-[NSClipView _webcore_effectiveFirstResponder]): Ditto.
335         (-[NSScrollView _webcore_effectiveFirstResponder]): Ditto.
336
337 2004-09-21  Maciej Stachowiak  <mjs@apple.com>
338
339         Reviewed by Darin.
340
341         <rdar://problem/3805137> REGRESSION: Cannot search on pricetool.com
342
343         The problem here is that residual style handling can cause an
344         element associated with a misnested form to lose the association,
345         because it can become detached and then reattached in this
346         case. So we need to maintain the association.
347         
348         * khtml/html/html_formimpl.h: Added list of dormant elements to form,
349         and dormant bit to generic form element.
350         * khtml/html/html_formimpl.cpp:
351         (DOM::HTMLFormElementImpl::~HTMLFormElementImpl): Clear m_form field for
352         dormant elements too.
353         (DOM::HTMLFormElementImpl::registerFormElement): Remove from dormant list
354         in addition to adding to main list.
355         (DOM::HTMLFormElementImpl::removeFormElement): Remove from both lists.
356         (DOM::HTMLFormElementImpl::makeFormElementDormant): New method, remove from
357         main list, add to dormant list.
358         (DOM::HTMLGenericFormElementImpl::HTMLGenericFormElementImpl): Initialize
359         dormant bit to false.
360         (DOM::HTMLGenericFormElementImpl::insertedIntoDocument): If the element is
361         dormant and has a form, re-register it and clear the dormant bit.
362         (DOM::HTMLGenericFormElementImpl::removedFromDocument): If the document has
363         a form, tell the form it is dormant and set the dormant bit.
364
365 2004-09-22  Chris Blumenberg  <cblu@apple.com>
366
367         Fixed: <rdar://problem/3811187> REGRESSION (Mail): Control-click past end of document does not spell check last word
368
369         Reviewed by kocienda.
370
371         * khtml/xml/dom_selection.cpp:
372         (DOM::Selection::validate): if at the end of the document, expand to the left.
373
374 2004-09-22  Maciej Stachowiak  <mjs@apple.com>
375
376         Reviewed by Ken and John.
377
378         <rdar://problem/3759228> REGRESSION (Mail): stray characters when entering text via input method right after newline
379         
380         * khtml/editing/htmlediting_impl.cpp:
381         (khtml::CompositeEditCommandImpl::inputText): Add an optional 
382         selectInsertedText parameter.
383         (khtml::ReplaceSelectionCommandImpl::doApply): Let the inputText operation
384         select the text when inserting plain text, because it already knows all the right
385         information to do so, and this function doesn't (sometimes text is inserted
386         before the start of the old selection, not after!)
387         * khtml/editing/htmlediting_impl.h:
388
389 2004-09-22  Richard Williamson   <rjw@apple.com>
390
391         More tweaks to dashboard regions.
392
393         Move dashboard regions list into css3NonInheritedData so it will be shared
394         by all styles that don't modify the empty region list.
395
396         Make the initial value for dashboard region list a static to minimize allocations
397         of empty lists.
398
399         Make marquee and flex style accessor functions const.
400
401         Reviewed by Hyatt.
402
403         * khtml/rendering/render_style.cpp:
404         (RenderStyle::diff):
405         * khtml/rendering/render_style.h:
406         (khtml::RenderStyle::opacity):
407         (khtml::RenderStyle::boxAlign):
408         (khtml::RenderStyle::boxDirection):
409         (khtml::RenderStyle::boxFlexGroup):
410         (khtml::RenderStyle::boxOrdinalGroup):
411         (khtml::RenderStyle::boxOrient):
412         (khtml::RenderStyle::boxPack):
413         (khtml::RenderStyle::marqueeIncrement):
414         (khtml::RenderStyle::marqueeSpeed):
415         (khtml::RenderStyle::marqueeLoopCount):
416         (khtml::RenderStyle::marqueeBehavior):
417         (khtml::RenderStyle::marqueeDirection):
418         (khtml::RenderStyle::dashboardRegions):
419         (khtml::RenderStyle::setDashboardRegions):
420         (khtml::RenderStyle::setDashboardRegion):
421         (khtml::RenderStyle::initialDashboardRegions):
422
423 2004-09-22  David Hyatt  <hyatt@apple.com>
424
425         Fix for 3802766, entire view redrawn in Blot while typing.  Don't needlessly create text nodes just to find
426         out the font for the caret position.
427         
428         Reviewed by darin
429
430         * kwq/KWQKHTMLPart.mm:
431         (KWQKHTMLPart::fontForSelection):
432
433 2004-09-21  Chris Blumenberg  <cblu@apple.com>
434
435         Fixed:
436         <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste
437         <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace
438
439         Reviewed by darin.
440
441         * khtml/editing/htmlediting.cpp:
442         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): take smartDelete parameter
443         (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take smartReplace parameter
444         * khtml/editing/htmlediting.h:
445         * khtml/editing/htmlediting_impl.cpp:
446         (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): take smartDelete parameter
447         (khtml::DeleteSelectionCommandImpl::doApply): delete whitespace before and after selection if necessary
448         (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): take smartReplace parameter
449         (khtml::ReplaceSelectionCommandImpl::doApply): add whitespace before and after the replacement if necessary
450         * khtml/editing/htmlediting_impl.h:
451         * kwq/WebCoreBridge.h:
452         * kwq/WebCoreBridge.mm:
453         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): take smartReplace parameter
454         (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): ditto
455         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): ditto
456         (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): ditto
457         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): take smartDelete parameter
458
459 2004-09-21  Richard Williamson   <rjw@apple.com>
460
461         More dashboard region work.
462
463         Added support for computed style and cssText for new region property.
464         Added restriction on length types allowed in region functions.
465         Added initial and inheritance support for -apple-dashboard-region.
466
467         Reviewed by Hyatt.
468
469         * khtml/css/css_computedstyle.cpp:
470         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
471         * khtml/css/css_valueimpl.cpp:
472         (CSSPrimitiveValueImpl::cssText):
473         * khtml/css/cssparser.cpp:
474         (CSSParser::parseDashboardRegions):
475         * khtml/css/cssstyleselector.cpp:
476         (khtml::CSSStyleSelector::applyProperty):
477         * khtml/rendering/render_object.cpp:
478         (RenderObject::addDashboardRegions):
479         * khtml/rendering/render_style.cpp:
480         (RenderStyle::diff):
481         * khtml/rendering/render_style.h:
482         (khtml::StyleDashboardRegion::operator==):
483         (khtml::RenderStyle::dashboardRegions):
484         (khtml::RenderStyle::setDashboardRegions):
485         (khtml::RenderStyle::initialDashboardRegions):
486
487 2004-09-21  Darin Adler  <darin@apple.com>
488
489         Reviewed by Ken.
490
491         - fixed problem where our updateLayout call ignores pending stylesheets all the time
492
493         * khtml/xml/dom_docimpl.h: Added updateLayoutIgnorePendingStylesheets.
494         * khtml/xml/dom_docimpl.cpp:
495         (DocumentImpl::updateLayout): Took out the "ignore pending stylesheets" business here.
496         (DocumentImpl::updateLayoutIgnorePendingStylesheets): Put it in here.
497
498         * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Call the new
499         updateLayoutIgnorePendingStylesheets function.
500         * khtml/ecma/kjs_html.cpp:
501         (KJS::HTMLElement::getValueProperty): Ditto.
502         (KJS::HTMLElement::putValue): Ditto.
503         * khtml/ecma/kjs_views.cpp: (DOMAbstractViewFunc::tryCall): Ditto.
504         * khtml/ecma/kjs_window.cpp:
505         (Window::updateLayout): Ditto.
506         (Selection::get): Ditto.
507         (SelectionFunc::tryCall): Ditto.
508
509         * khtml/html/html_imageimpl.h: Add ignorePendingStylesheets boolean parameter.
510         * khtml/html/html_imageimpl.cpp:
511         (HTMLImageElementImpl::width): Respect new parameter.
512         (HTMLImageElementImpl::height): Ditto.
513
514         - tweaks
515
516         * kwq/WebCoreBridge.mm:
517         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Removed unneeded
518         explicit "true" parameter to setSelection.
519         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto.
520
521 2004-09-21  Darin Adler  <darin@apple.com>
522
523         Reviewed by Ken.
524
525         - fix crash when pasting text at the end of the document and then doing an undo
526
527         * khtml/editing/htmlediting_impl.cpp:
528         (khtml::EditCommandImpl::apply): Call markMisspellingsInSelection before doing
529         the editing operation, and we'll tell setSelection not to unmark the old selection.
530         Also call updateLayout before calling appliedEditing so DOM operations in the
531         code responding to the selection change will work.
532         (khtml::EditCommandImpl::unapply): Ditto.
533         (khtml::EditCommandImpl::reapply): Ditto.
534
535         * khtml/khtml_part.h: Added a third parameter to setSelection to tell it whether
536         to unmark the old selection. We must pass false when editing, because the old
537         selection might have now-invalid offsets inside it.
538         * khtml/khtml_part.cpp:
539         (KHTMLPart::setSelection): Add unmarkOldSelection parameter, and respect it.
540         (KHTMLPart::appliedEditing): Pass false for unmarkOldSelection.
541         (KHTMLPart::unappliedEditing): Ditto.
542         (KHTMLPart::reappliedEditing): Ditto.
543
544 2004-09-21  Richard Williamson   <rjw@apple.com>
545
546         Part 2 of the feature requested in
547         <rdar://problem/3752791> Dashboard: Need a better solution for control regions
548         
549         This patch actually collections the regions and converts to absolute coordinates.
550         Only remaining piece is to pass over the bridge and up the alley to WebKit
551         UI delegate.
552  
553         Reviewed by Ken.
554
555         * khtml/css/css_valueimpl.h:
556         (DOM::CSSPrimitiveValueImpl::getDashboardRegionValue):
557         * khtml/css/cssparser.cpp:
558         (CSSParser::parseValue):
559         (CSSParser::parseDashboardRegions):
560         * khtml/css/cssproperties.c:
561         * khtml/css/cssproperties.h:
562         * khtml/css/cssproperties.in:
563         * khtml/css/cssstyleselector.cpp:
564         (khtml::CSSStyleSelector::applyProperty):
565         * khtml/khtmlview.cpp:
566         (KHTMLView::layout):
567         * khtml/rendering/render_object.cpp:
568         (RenderObject::computeDashboardRegions):
569         (RenderObject::addDashboardRegions):
570         (RenderObject::collectDashboardRegions):
571         * khtml/rendering/render_object.h:
572         (khtml::DashboardRegionValue::operator==):
573         * khtml/rendering/render_style.cpp:
574         * khtml/rendering/render_style.h:
575         (khtml::StyleDashboardRegion::):
576         (khtml::RenderStyle::dashboardRegions):
577         (khtml::RenderStyle::setDashboardRegion):
578         * khtml/xml/dom_docimpl.cpp:
579         (DocumentImpl::DocumentImpl):
580         (DocumentImpl::updateLayout):
581         (DocumentImpl::acceptsEditingFocus):
582         (DocumentImpl::dashboardRegions):
583         (DocumentImpl::setDashboardRegions):
584         * khtml/xml/dom_docimpl.h:
585         (DOM::DocumentImpl::hasDashboardRegions):
586         (DOM::DocumentImpl::setHasDashboardRegions):
587
588 2004-09-21  John Sullivan  <sullivan@apple.com>
589
590         Reviewed by Darin.
591         
592         - WebCore part of fix for <rdar://problem/3618274> REGRESSION (125-135): 
593         Option-tab doesn't always work as expected
594
595         * kwq/KWQKHTMLPart.mm:
596         (KWQKHTMLPart::tabsToAllControls):
597         reworked logic to match what we promise in the UI; this worked correctly
598         before for regular tabbing, but not for option-tabbing.
599
600         * kwq/KWQButton.mm:
601         (QButton::focusPolicy):
602         check tabsToAllControls() rather than just WebCoreKeyboardAccessFull
603         
604         * kwq/KWQComboBox.mm:
605         (QComboBox::focusPolicy):
606         ditto
607         
608         * kwq/KWQFileButton.mm:
609         (KWQFileButton::focusPolicy):
610         ditto
611         
612         * kwq/KWQListBox.mm:
613         (QListBox::focusPolicy):
614         ditto
615
616 2004-09-21  John Sullivan  <sullivan@apple.com>
617
618         * khtml/xml/dom_selection.cpp:
619         (DOM::Selection::modify):
620         initialize xPos to make compiler happy in deployment builds
621
622 2004-09-21  Darin Adler  <darin@apple.com>
623
624         Reviewed by Ken.
625
626         - some small mechanical improvements to the position and selection classes
627
628         * khtml/xml/dom_position.h: Added clear(), startPosition(), and endPosition().
629         * khtml/xml/dom_position.cpp:
630         (DOM::Position::clear): Added.
631         (DOM::startPosition): Added.
632         (DOM::endPosition): Added.
633
634         * khtml/xml/dom_caretposition.h: Changed m_position to m_deepPosition. Added clear(),
635         removed node() and offset().
636         * khtml/xml/dom_caretposition.cpp:
637         (DOM::CaretPosition::init): Updated for name change of m_position to m_deepPosition.
638         (DOM::CaretPosition::isLastInBlock): Ditto.
639         (DOM::CaretPosition::next): Ditto.
640         (DOM::CaretPosition::previous): Ditto.
641         (DOM::CaretPosition::debugPosition): Ditto.
642         (DOM::CaretPosition::formatForDebugger): Ditto.
643
644         * khtml/xml/dom_selection.h: Remove setStart, setEnd, setStartAndEnd, rangeStart, rangeEnd,
645         and all the assignXXX functions.
646         * khtml/xml/dom_selection.cpp:
647         (DOM::Selection::Selection): Wean from assign functions, get and set data members directly.
648         (DOM::Selection::init): Don't clear base, extent, start, and end, since they have constructors.
649         (DOM::Selection::operator=): Wean from assign functions, get and set data members directly.
650         (DOM::Selection::moveTo): Ditto.
651         (DOM::Selection::setModifyBias): Ditto.
652         (DOM::Selection::modifyExtendingRightForward): Ditto.
653         (DOM::Selection::modifyMovingRightForward): Ditto.
654         (DOM::Selection::modifyExtendingLeftBackward): Ditto.
655         (DOM::Selection::modifyMovingLeftBackward): Ditto.
656         (DOM::Selection::modify): Ditto.
657         (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
658         (DOM::Selection::clear): Ditto.
659         (DOM::Selection::setBase): Ditto.
660         (DOM::Selection::setExtent): Ditto.
661         (DOM::Selection::setBaseAndExtent): Ditto.
662         (DOM::Selection::toRange): Ditto.
663         (DOM::Selection::layoutCaret): Ditto.
664         (DOM::Selection::needsCaretRepaint): Ditto.
665         (DOM::Selection::validate): Ditto.
666         (DOM::Selection::debugRenderer): Ditto.
667         (DOM::Selection::debugPosition): Ditto.
668         (DOM::Selection::end):
669
670         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::advanceToNextMisspelling): Tweaked whitespace.
671
672 2004-09-21  Chris Blumenberg  <cblu@apple.com>
673
674         Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com)
675
676         Reviewed by john.
677
678         * khtml/rendering/render_frames.cpp:
679         (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
680
681 2004-09-20  Darin Adler  <darin@apple.com>
682
683         Reviewed by Maciej.
684
685         - fixed regression from my recent check-in where misspelled words do not get unmarked when moving the caret
686         - changed CaretPosition to hold a Position instead of a node and offset
687         - renamed isEmpty to isNull, etc.
688
689         * kwq/KWQKHTMLPart.mm:
690         (KWQKHTMLPart::jumpToSelection): Updated for name changes.
691         (KWQKHTMLPart::advanceToNextMisspelling): Ditto.
692         (KWQKHTMLPart::fontForSelection): Ditto.
693         (KWQKHTMLPart::setDisplaysWithFocusAttributes): Ditto.
694         (KWQKHTMLPart::markMisspellingsInSelection): Ditto.
695         (KWQKHTMLPart::updateSpellChecking): Fixed bug by using LeftWordIfOnBoundary.
696
697         * khtml/xml/dom_position.h: Updated for name changes.
698         * khtml/xml/dom_position.cpp:
699         (DOM::Position::element): Change to not use a separate null check.
700         (DOM::Position::computedStyle): Updated for name changes.
701         (DOM::Position::previousCharacterPosition): Ditto.
702         (DOM::Position::nextCharacterPosition): Ditto.
703         (DOM::Position::equivalentRangeCompliantPosition): Ditto.
704         (DOM::Position::equivalentShallowPosition): Ditto.
705         (DOM::Position::equivalentDeepPosition): Ditto.
706         (DOM::Position::closestRenderedPosition): Ditto.
707         (DOM::Position::inRenderedContent): Ditto.
708         (DOM::Position::inRenderedText): Ditto.
709         (DOM::Position::isRenderedCharacter): Ditto.
710         (DOM::Position::rendersInDifferentPosition): Ditto.
711         (DOM::Position::isFirstRenderedPositionOnLine): Ditto.
712         (DOM::Position::isLastRenderedPositionOnLine): Ditto.
713         (DOM::Position::inFirstEditableInRootEditableElement): Ditto.
714         (DOM::Position::leadingWhitespacePosition): Ditto.
715         (DOM::Position::trailingWhitespacePosition): Ditto.
716         (DOM::Position::debugPosition): Ditto.
717         (DOM::Position::formatForDebugger): Ditto.
718
719         * khtml/xml/dom_caretposition.h: Change to use m_position, and change names.
720         * khtml/xml/dom_caretposition.cpp:
721         (DOM::CaretPosition::CaretPosition): Remove code to set up m_node.
722         (DOM::CaretPosition::init): Set m_position directly.
723         (DOM::CaretPosition::isLastInBlock): Updated for name changes.
724         (DOM::CaretPosition::next): Set m_position directly.
725         (DOM::CaretPosition::previous): Set m_position directly.
726         (DOM::CaretPosition::previousCaretPosition): Updated for name changes.
727         (DOM::CaretPosition::nextCaretPosition): Ditto.
728         (DOM::CaretPosition::previousPosition): Ditto.
729         (DOM::CaretPosition::nextPosition): Ditto.
730         (DOM::CaretPosition::atStart): Ditto.
731         (DOM::CaretPosition::atEnd): Ditto.
732         (DOM::CaretPosition::isCandidate): Ditto.
733         (DOM::CaretPosition::debugPosition): Ditto.
734         (DOM::CaretPosition::formatForDebugger): Ditto.
735         (DOM::startOfWord): Ditto.
736         (DOM::endOfWord): Ditto.
737         (DOM::previousParagraphPosition): Ditto.
738         (DOM::nextParagraphPosition): Ditto.
739
740         * khtml/xml/dom_selection.h: Updated names. Added isCaret and isRange.
741         * khtml/xml/dom_selection.cpp:
742         (DOM::Selection::modifyMovingRightForward): Updated for name changes.
743         (DOM::Selection::modifyMovingLeftBackward): Ditto.
744         (DOM::Selection::modify): Ditto.
745         (DOM::Selection::expandUsingGranularity): Ditto.
746         (DOM::Selection::xPosForVerticalArrowNavigation): Ditto.
747         (DOM::Selection::toRange): Ditto.
748         (DOM::Selection::layoutCaret): Ditto.
749         (DOM::Selection::needsCaretRepaint): Ditto.
750         (DOM::Selection::validate): Ditto.
751         (DOM::startOfFirstRunAt): Ditto.
752         (DOM::endOfLastRunAt): Ditto.
753         (DOM::selectionForLine): Ditto.
754         (DOM::Selection::formatForDebugger): Ditto.
755
756         * khtml/ecma/kjs_window.cpp:
757         (Selection::get): Updated for name changes.
758         (Selection::toString): Ditto.
759         * khtml/editing/htmlediting_impl.cpp:
760         (khtml::debugPosition): Ditto.
761         (khtml::StyleChange::init): Ditto.
762         (khtml::StyleChange::currentlyHasStyle): Ditto.
763         (khtml::CompositeEditCommandImpl::deleteSelection): Ditto.
764         (khtml::CompositeEditCommandImpl::deleteUnrenderedText): Ditto.
765         (khtml::ApplyStyleCommandImpl::doApply): Ditto.
766         (khtml::DeleteSelectionCommandImpl::doApply): Ditto.
767         (khtml::InputNewlineCommandImpl::doApply): Ditto.
768         (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
769         (khtml::InputTextCommandImpl::input): Ditto.
770         (khtml::ReplaceSelectionCommandImpl::doApply): Ditto.
771         (khtml::MoveSelectionCommandImpl::doApply): Ditto.
772         (khtml::TypingCommandImpl::doApply): Ditto.
773         (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Ditto.
774         (khtml::TypingCommandImpl::issueCommandForDeleteKey): Ditto.
775         * khtml/editing/jsediting.cpp:
776         (enabledAnySelection): Ditto.
777         (enabledRangeSelection): Ditto.
778         * khtml/khtml_part.cpp:
779         (KHTMLPart::hasSelection): Ditto.
780         (KHTMLPart::setFocusNodeIfNeeded): Ditto.
781         (KHTMLPart::selectionLayoutChanged): Ditto.
782         (KHTMLPart::timerEvent): Ditto.
783         (KHTMLPart::isPointInsideSelection): Ditto.
784         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
785         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
786         (KHTMLPart::handleMousePressEventSingleClick): Ditto.
787         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
788         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
789         (KHTMLPart::selectionHasStyle): Ditto.
790         (KHTMLPart::selectionComputedStyle): Ditto.
791         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateSelection): Ditto.
792         * khtml/xml/dom_positioniterator.cpp:
793         (DOM::PositionIterator::peekPrevious): Ditto.
794         (DOM::PositionIterator::peekNext): Ditto.
795         (DOM::PositionIterator::atStart): Ditto.
796         (DOM::PositionIterator::atEnd): Ditto.
797         * khtml/xml/dom_positioniterator.h:
798         (DOM::PositionIterator::isEmpty): Ditto.
799         * kwq/KWQRenderTreeDebug.cpp:
800         (writeSelection): Ditto.
801         * kwq/WebCoreBridge.mm:
802         (-[WebCoreBridge editableDOMRangeForPoint:]): Ditto.
803         (-[WebCoreBridge deleteSelection]): Ditto.
804         (-[WebCoreBridge ensureCaretVisible]): Ditto.
805         (-[WebCoreBridge rangeOfCharactersAroundCaret]): Ditto.
806
807 2004-09-20  Darin Adler  <darin@apple.com>
808
809         Reviewed by Maciej.
810
811         - fixed <rdar://problem/3808073> find is broken
812
813         * khtml/misc/khtml_text_operations.h: Add m_pastEndNode and change name of m_endNode to
814         m_endContainer to more accurately reflect its purpose.
815         * khtml/misc/khtml_text_operations.cpp:
816         (khtml::TextIterator::TextIterator): Use pastEnd() for end of iteration, and change to
817         handle bad ranges better: just return an empty iterator instead of raising an exception.
818         (khtml::TextIterator::advance): Change to use m_pastEndNode to detect the end of iteration.
819         (khtml::TextIterator::handleTextNode): Update for name change.
820         (khtml::TextIterator::handleTextBox): Ditto.
821         (khtml::TextIterator::range): Handle case where m_endContainer is nil.
822
823         * khtml/xml/dom2_rangeimpl.cpp:
824         (DOM::RangeImpl::surroundContents): Use offsetInCharacters.
825         (DOM::RangeImpl::startNode): Added check for nil start container and use offsetInCharacters.
826         (DOM::RangeImpl::pastEndNode): Ditto.
827
828 2004-09-20  Chris Blumenberg  <cblu@apple.com>
829
830         Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message
831
832         Reviewed by kocienda.
833
834         * khtml/khtml_part.cpp:
835         (KHTMLPart::setSelection): setFocusNodeIfNeeded now works on the current selection so call setFocusNodeIfNeeded after setting the selection
836         (KHTMLPart::clearSelection): don't call setFocusNodeIfNeeded with the current selection
837         (KHTMLPart::setCaretVisible): ditto
838         (KHTMLPart::setFocusNodeIfNeeded): do nothing if the part isn't focused, work with the current selection
839         * khtml/khtml_part.h:
840         * khtml/khtmlpart_p.h:
841         (KHTMLPartPrivate::KHTMLPartPrivate): added m_isFocused
842         * kwq/KWQKHTMLPart.h:
843         * kwq/KWQKHTMLPart.mm:
844         (KWQKHTMLPart::KWQKHTMLPart): removed _displaysWithFocusAttributes this is replaced by m_isFocused
845         (KWQKHTMLPart::setSelectionFromNone): new, code factored out from setDisplaysWithFocusAttributes
846         (KWQKHTMLPart::setDisplaysWithFocusAttributes): call setSelectionFromNone
847         (KWQKHTMLPart::displaysWithFocusAttributes): now returns m_isFocused
848         * kwq/WebCoreBridge.h:
849         * kwq/WebCoreBridge.mm:
850         (-[WebCoreBridge setSelectionFromNone]): new
851
852 2004-09-20  Darin Adler  <darin@apple.com>
853
854         Reviewed by Dave.
855
856         - fixed nil-deref happening often in Mail when I delete
857
858         * khtml/rendering/render_br.cpp: (RenderBR::selectionRect): Check for nil lastLeafChild.
859         Dave may want to figure out why it's nil and do a different fix later.
860
861 2004-09-20  Maciej Stachowiak  <mjs@apple.com>
862
863         Reviewed by Richard.
864
865         <rdar://problem/3672101> HANG: typing into login field at dws-direkt.deutsche-bank.de (infinite recursion)
866         
867         * khtml/xml/dom_docimpl.cpp:
868         (DocumentImpl::defaultEventHandler): Copy the list of handlers
869         before firing any of them, in case a handler affects the list of
870         event handlers.
871
872 2004-09-20  Chris Blumenberg  <cblu@apple.com>
873
874         Fixed:
875         <rdar://problem/3429921> obey PARAM tags inside of OBJECT tags when necessary
876         <rdar://problem/3515685> Object tag in Java 1.4.1 / Safari doesn't recognize params
877
878         Reviewed by darin.
879
880         * khtml/khtml_part.cpp:
881         (KHTMLPart::requestFrame): take 2 parameter arrays rather than 1 which will have to be parsed
882         (KHTMLPart::requestObject): ditto
883         * khtml/khtml_part.h:
884         * khtml/khtmlpart_p.h:
885         * khtml/rendering/render_frames.cpp:
886         (RenderPartObject::updateWidget): use PARAM tags when there is no EMBED specified
887         * kwq/KWQKHTMLPart.h:
888         * kwq/KWQKHTMLPart.mm:
889         (KWQKHTMLPart::createPart): call renamed bridge method
890         * kwq/KWQKJavaAppletWidget.mm:
891         (KJavaAppletWidget::KJavaAppletWidget): ditto
892         * kwq/KWQStringList.h:
893         * kwq/KWQStringList.mm:
894         (QStringList::getNSArray): return a const array
895         * kwq/WebCoreBridge.h:
896         * kwq/WebCoreBridge.mm:
897         (-[WebCoreBridge URLWithAttributeString:]): renamed to match API
898
899 2004-09-20  Darin Adler  <darin@apple.com>
900
901         Reviewed by Ken.
902
903         - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
904         - fixed <rdar://problem/3735055> REGRESSION (Mail): WebCore double click rules treat style change as a boundary
905         - fixed <rdar://problem/3789939> REGRESSION (Mail): double-clicking on border whitespace selects space plus word before/after
906         - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word
907         - fixed <rdar://problem/3806604> REGRESSION (164): Triple-click sometimes selects extra characters
908         - fixed <rdar://problem/3806996> REGRESSION (125-162): Triple-click in <pre> tagged text behaves oddly (leuf.net)
909
910         * khtml/xml/dom_caretposition.h: Added a lot of new functions. Removed implicit conversion operator
911         that converts from CaretPosition to Position.
912         * khtml/xml/dom_caretposition.cpp:
913         (DOM::CaretPosition::CaretPosition): Change to call deepEquivalent so it works without the implicit
914         Position conversion operator.
915         (DOM::CaretPosition::operator=): Ditto.
916         (DOM::CaretPosition::next): Ditto.
917         (DOM::CaretPosition::previous): Ditto.
918         (DOM::CaretPosition::setPosition): Added an assertion.
919         (DOM::start): Added.
920         (DOM::end): Added.
921         (DOM::setStart): Added.
922         (DOM::setEnd): Added.
923         (DOM::previousWordBoundary): Added.
924         (DOM::nextWordBoundary): Added.
925         (DOM::startWordBoundary): Added.
926         (DOM::startOfWord): Added.
927         (DOM::endWordBoundary): Added.
928         (DOM::endOfWord): Added.
929         (DOM::previousWordPositionBoundary): Added.
930         (DOM::previousWordPosition): Added.
931         (DOM::nextWordPositionBoundary): Added.
932         (DOM::nextWordPosition): Added.
933         (DOM::previousLinePosition): Added.
934         (DOM::nextLinePosition): Added.
935         (DOM::startOfParagraph): Changed function name.
936         (DOM::endOfParagraph): Changed function name. Fixed code in includeLineBreak to work around
937         the CaretPosition constructor issue for <br>, pass the right parameter for the block flow case,
938         and handle <pre> properly.
939         (DOM::inSameParagraph): Added.
940         (DOM::previousParagraphPosition): Added.
941         (DOM::nextParagraphPosition): Added.
942
943         * khtml/xml/dom_position.h: Removed a number of functions no longer used; also made some private.
944         * khtml/xml/dom_position.cpp: Removed a number of functions no longer used.
945
946         * khtml/xml/dom_selection.h: Replaced DOCUMENT with DOCUMENT_BOUNDARY. Added overloads of lots
947         of functions that take CaretPosition directly. Added overload of modify that takes a parameter
948         for vertical distance to help implement pageDown: and friends. Replaced getRepaintRect with
949         two new functions named caretRect and caretRepaintRect. Removed nodeIsBeforeNode.
950         * khtml/xml/dom_selection.cpp:
951         (DOM::Selection::Selection): Added constructor that takes two CaretPosition objects.
952         (DOM::Selection::setModifyBias): Added. Helper function.
953         (DOM::Selection::modifyExtendingRightForward): Don't set modify bias, since that's now the caller's
954         responsibility. Reimplement WORD and LINE in terms of new CaretPosition functions. Implement PARAGRAPH
955         and change PARAGRAPH_BOUNDARY to use CaretPosition function by its new name.
956         (DOM::Selection::modifyMovingRightForward): Ditto.
957         (DOM::Selection::modifyExtendingLeftBackward): Ditto.
958         (DOM::Selection::modifyMovingLeftBackward): Ditto.
959         (DOM::Selection::modify): Call setModifyBias, and use a switch statement instead of if.
960         (DOM::caretY): Added. Helper for the new modify function that implements moving a pixel distance,
961         used by pageDown: and friends.
962         (DOM::Selection::modify): Added.
963         (DOM::Selection::toRange): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
964         (DOM::Selection::caretRect): Added. Replaces getRepaintRect, but does not add slop.
965         (DOM::Selection::caretRepaintRect): Added. Replaces getRepaintRect; still adds slop.
966         (DOM::Selection::needsCaretRepaint): Call caretRepaintRect.
967         (DOM::Selection::validate): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
968         Reimplement WORD to use new CaretPosition functions; this fixes the double-clicking problems.
969         Change paragraph calls to use new names.
970
971         * ForwardingHeaders/dom/dom_position.h: Removed. This was in the wrong location.
972         * khtml/editing/htmlediting.cpp: Fixed include that said "dom/dom_position.h".
973         * khtml/editing/htmlediting_impl.cpp: Fixed include that said "dom/dom_position.h".
974         (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Rewrote this to use the new CaretPosition
975         functions instead of the old Position functions.
976
977         * khtml/misc/helper.h: Added const to character pointer parameter. Also put invertedColor inside
978         an !APPLE_CHANGES since it doesn't do us any good.
979         * khtml/misc/helper.cpp:
980         (khtml::findWordBoundary): Added const to character pointer parameter.
981         (khtml::nextWordFromIndex): Ditto.
982
983         * kwq/KWQTextUtilities.h: Change parameters to const.
984         * kwq/KWQTextUtilities.cpp: (KWQFindWordBoundary): Change parameter to const.
985         * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): Change parameter to const.
986
987         * khtml/css/cssstyleselector.cpp: Disable code that uses invertedColor when APPLE_CHANGES, since it
988         won't work for us.
989
990         * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Added checks for selection end
991         so we can set the selection end to nodes that are not leaf nodes and it will still work. Also took
992         out bogus firstChild/lastChild loops for the same reason.
993
994         * kwq/KWQKHTMLPart.h: Add "start before selection" flag to advanceToNextMisspelling.
995         Needed to fix bug with spell checking.
996         * kwq/KWQKHTMLPart.mm:
997         (KWQKHTMLPart::findString): Changed to use CaretPosition.
998         (KWQKHTMLPart::advanceToNextMisspelling): Added code to handle "start before selection" flag
999         and changed to use CaretPosition and new helper functions.
1000         (KWQKHTMLPart::markMisspellingsInSelection): More changes to use CaretPosition.
1001         (KWQKHTMLPart::updateSpellChecking): Ditto.
1002
1003         * kwq/WebCoreBridge.h: Replaced WebSelectByDocument with WebSelectToDocumentBoundary.
1004         Added advanceToNextMisspellingStartingJustBeforeSelection,
1005         rangeByAlteringCurrentSelection:verticalDistance:, and
1006         alterCurrentSelection:verticalDistance:.
1007
1008         * kwq/WebCoreBridge.mm:
1009         (-[WebCoreBridge advanceToNextMisspellingStartingJustBeforeSelection]): Added.
1010         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Added case for selecting by
1011         paragraph to save X position.
1012         (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]): Added.
1013         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Added.
1014         (-[WebCoreBridge ensureCaretVisible]): Call caretRect instead of getRepaintRect.
1015
1016 2004-09-20  Darin Adler  <darin@apple.com>
1017
1018         Reviewed by Ken.
1019
1020         - cleaned up DOM::RangeImpl a little so compareBoundaryPoints can be used outside the class
1021
1022         * khtml/xml/dom2_rangeimpl.h: Added const to many of the member functions and made the
1023         compareBoundaryPoints that works on parameters be a const member function.
1024         * khtml/xml/dom2_rangeimpl.cpp:
1025         (DOM::RangeImpl::commonAncestorContainer): Added const.
1026         (DOM::RangeImpl::compareBoundaryPoints): Added const.
1027         (DOM::RangeImpl::boundaryPointsValid): Added const, and wrote cleaner version.
1028         (DOM::RangeImpl::insertNode): Simplified by calling containedByReadOnly.
1029         (DOM::RangeImpl::toString): Added const.
1030         (DOM::RangeImpl::toHTML): Added const.
1031         (DOM::RangeImpl::createContextualFragment): Added const.
1032         (DOM::RangeImpl::cloneRange): Added const.
1033         (DOM::RangeImpl::surroundContents): Simplified by calling containedByReadOnly.
1034
1035 2004-09-20  Darin Adler  <darin@apple.com>
1036
1037         Reviewed by Ken.
1038
1039         - fixed <rdar://problem/3806990> REGRESSION (125-162): Crash on Select All at http://leuf.net/cgi/wikidn?PerlConvertEolScript
1040
1041         * khtml/rendering/render_replaced.cpp: (RenderWidget::setSelectionState): Added nil check for the
1042         widget.
1043
1044 2004-09-20  Darin Adler  <darin@apple.com>
1045
1046         Reviewed by Ken.
1047
1048         - fixed <rdar://problem/3773740> calling addEventListener on a frame that hasn't loaded yet crashes
1049
1050         * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Add nil checks for the document.
1051         The nil check prevents the crash but there's still a bug here; I filed 3807059 about that.
1052
1053 2004-09-20  Darin Adler  <darin@apple.com>
1054
1055         Reviewed by Ken.
1056
1057         - fixed problem where up and down arrow keys are not preserving X position
1058
1059         * khtml/khtml_part.cpp:
1060         (KHTMLPart::selectionLayoutChanged): Moved code to clear m_xPosForVerticalArrowNavigation out of here.
1061         (KHTMLPart::notifySelectionChanged): Moved it into here.
1062
1063 2004-09-18  Darin Adler  <darin@apple.com>
1064
1065         Reviewed by Maciej.
1066
1067         - fixed <rdar://problem/3805627> -[DOMRange _text] sometimes includes all text to the end of the document for certain ranges
1068
1069         * khtml/misc/khtml_text_operations.cpp: (khtml::TextIterator::advance):
1070         Correctly handle the case when we are already on m_endNode. The concept here is that
1071         m_endNode is a node you must never "leave" when iterating.
1072
1073 === Safari-164 ===
1074
1075 2004-09-17  Ken Kocienda  <kocienda@apple.com>
1076
1077         * layout-tests/editing/selection/unrendered-004-expected.txt: Updated expected results.
1078
1079 2004-09-17  Ken Kocienda  <kocienda@apple.com>
1080
1081         Reviewed by Darin
1082
1083         Fix for this bug:
1084         
1085         <rdar://problem/3780245> REGRESSION (Mail): some lines are skipped when doing arrow navigation
1086
1087         * khtml/xml/dom_position.cpp:
1088         (DOM::Position::previousLinePosition): One-line fix. Make sure that BRs at the end of blocks
1089         are not skipped.
1090
1091 2004-09-17  Ken Kocienda  <kocienda@apple.com>
1092
1093         Reviewed by Darin
1094
1095         Fix for this bug:
1096         
1097         <rdar://problem/3805594> REGRESSION (Mail): Second return key stroke does not work when first was in blockquote
1098
1099         * khtml/xml/dom_selection.cpp:
1100         (DOM::Selection::toRange): Code to convert caret positions moved the position upstream
1101         before making a range-compliant position, but erroneously would allow the position
1102         to cross blocks. Now it will no longer do so.
1103
1104 2004-09-16  Richard Williamson   <rjw@apple.com>
1105
1106         Part 1 of the feature requested in
1107         <rdar://problem/3752791> Dashboard: Need a better solution for control regions
1108
1109         This patch implements the CSS parsing necessary for dashboard regions.  
1110         Here's an example of the syntax we support:
1111
1112         <style>
1113         #aDiv {
1114             -apple-dashboard-region:
1115                 dashboard-region-circle(control 0 0 80 0)
1116                 dashboard-region-rectangle(control,20,0,20,0)
1117                 dashboard-region-circle(control 80 0 0 0); 
1118         }
1119         </style>
1120
1121
1122         Part 2 will determine the appropriate regions.
1123
1124         Reviewed by Chris.
1125
1126         * khtml/css/css_valueimpl.cpp:
1127         (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
1128         * khtml/css/css_valueimpl.h:
1129         (DOM::CSSPrimitiveValueImpl::):
1130         (DOM::DashboardRegionImpl::DashboardRegionImpl):
1131         (DOM::DashboardRegionImpl::~DashboardRegionImpl):
1132         (DOM::DashboardRegionImpl::setNext):
1133         (DOM::DashboardRegionImpl::setLabel):
1134         * khtml/css/cssparser.cpp:
1135         (CSSParser::parseValue):
1136         (CSSParser::parseContent):
1137         (skipCommaInDashboardRegion):
1138         (CSSParser::parseDashboardRegions):
1139         * khtml/css/cssparser.h:
1140         * khtml/css/cssproperties.c:
1141         (hash_prop):
1142         (findProp):
1143         * khtml/css/cssproperties.h:
1144         * khtml/css/cssproperties.in:
1145         * khtml/dom/css_value.h:
1146         (DOM::CSSPrimitiveValue::):
1147
1148 2004-09-16  Darin Adler  <darin@apple.com>
1149
1150         - fixed caret-drawing regression from my last patch
1151
1152         * khtml/xml/dom_selection.cpp:
1153         (DOM::Selection::xPosForVerticalArrowNavigation): Pass false, meaning "vertical line caret"
1154         rather than true meaning "big box for overtyping".
1155         (DOM::Selection::layoutCaret): Ditto.
1156
1157 2004-09-16  Darin Adler  <darin@apple.com>
1158
1159         Reviewed by Ken.
1160
1161         - fixed <rdar://problem/3803280> crash in selectAll on page with no contents
1162
1163         * khtml/khtml_part.cpp: (KHTMLPart::selectAll): Handle case of 0 for documentElement().
1164         * khtml/xml/dom_position.cpp:
1165         (DOM::Position::previousWordPosition): Ditto.
1166         (DOM::Position::nextWordPosition): Ditto.
1167
1168         - cleaned up caret code
1169         - changed DOM::Selection to use CaretPosition more
1170
1171         * khtml/rendering/render_box.cpp: (RenderBox::caretRect): Change to use empty rectangles
1172         instead of an X value of -1 to mean no rectangle.
1173         * khtml/rendering/render_image.cpp: (RenderImage::selectionRect): Take advantage of the
1174         fixed QRect constructor.
1175         * khtml/rendering/render_object.cpp: (RenderObject::caretRect): Change to use empty
1176         rectangle instead of an X value of -1 to mean no rectangle.
1177         * khtml/rendering/render_text.cpp: (RenderText::caretRect): Cleaned up, and changed to use
1178         an empty rectangle instead of an X value of -1 to mean no rectangle.
1179
1180         * khtml/xml/dom_caretposition.h: Made conversion from Position to CaretPosition something you
1181         can do implicitly, since it's an unambiguous conversion. Conversion in the other direction
1182         needs to be done explicitly. Moved EIncludeLineBreak here, and added startParagraphBoundary
1183         and endParagraphBoundary functions.
1184         * khtml/xml/dom_caretposition.cpp:
1185         (DOM::startParagraphBoundary): Added. Replaces, and made from, member function of DOM::Position.
1186         (DOM::endParagraphBoundary): Ditto.
1187
1188         * khtml/xml/dom_position.h: Removed EIncludeLineBreak and startParagraphBoundary and
1189         endParagraphBoundary.
1190         * khtml/xml/dom_position.cpp: Removed startParagraphBoundary and endParagraphBoundary.
1191
1192         * khtml/xml/dom_selection.h: Use CaretPosition instead of Position in a few places.
1193         Use a QRect for the caret rect. Change nodeIsBeforeNode to be a static member function.
1194         * khtml/xml/dom_selection.cpp:
1195         (DOM::Selection::Selection): Change caret to store QRect instead of 3 separate fields.
1196         (DOM::Selection::init): Ditto.
1197         (DOM::Selection::operator=): Ditto.
1198         (DOM::Selection::modifyExtendingRightForward): Change to use CaretPosition instead of Position.
1199         Check for 0.
1200         (DOM::Selection::modifyMovingRightForward): Ditto. Check for 0.
1201         (DOM::Selection::modifyExtendingLeftBackward): Ditto.
1202         (DOM::Selection::modifyMovingLeftBackward): Ditto.
1203         (DOM::Selection::modify): Ditto.
1204         (DOM::Selection::layoutCaret): Change to use a QRect for the caret rect, and use an empty
1205         one to mean no rectangle.
1206         (DOM::Selection::getRepaintRect): Ditto.
1207         (DOM::Selection::paintCaret): Ditto.
1208         (DOM::Selection::validate): Change to use CaretPosition instead of Position. Also fixed
1209         PARAGRAPH_BOUNDARY, which was broken and doing the same thing as PARAGRAPH before, but
1210         it's not really used so that didn't matter. Check for 0.
1211         (DOM::Selection::nodeIsBeforeNode): Tightened up a bit and added some FIXMEs. This function
1212         has a number of problems and should probably be discarded in favor of the DOMStringImpl
1213         method that does the same thing.
1214
1215 2004-09-16  Ken Kocienda  <kocienda@apple.com>
1216
1217         Reviewed by Hyatt
1218         
1219         Fix for this bug:
1220         
1221         <rdar://problem/3787168> REGRESSION (Mail): Deleting text from the beginning of a quoted range removes the quoting from the rest
1222
1223         * khtml/editing/htmlediting_impl.cpp:
1224         (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Only move the text nodes (and their siblings) when
1225         doing this move between blocks. This serves to mimic NSText behavior very well.
1226
1227 2004-09-15  Darin Adler  <darin@apple.com>
1228
1229         - fixed Panther build
1230
1231         * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityActionDescription:]): Fixed backwards
1232         check in #if that was compiling the code on Panther only rather than Tiger only.
1233
1234 2004-09-15  Darin Adler  <darin@apple.com>
1235
1236         Reviewed by John.
1237
1238         - fixed lockFocus exception I observed; perhaps not a real issue in the field due to exception blocking
1239
1240         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::imageFromRect): Put most of the function inside a
1241         big if statement to avoid the exception we get from lockFocus otherwise.
1242
1243 2004-09-15  Darin Adler  <darin@apple.com>
1244
1245         Reviewed by Dave.
1246
1247         - fixed <rdar://problem/3786467> REGRESSION (Mail): Reproducible crash replying to an HTML message when your preference is for plain text composing.
1248
1249         * khtml/rendering/render_block.h: Remove removeChildrenFromLineBoxes.
1250         * khtml/rendering/render_block.cpp: (khtml::RenderBlock::removeChild): Remove calls
1251         to removeChildrenFromLineBoxes which was the old way of working around this.
1252         * khtml/rendering/render_flow.cpp: (RenderFlow::detach): Add comments and code to handle
1253         removing children from line boxes we are about to delete.
1254
1255 2004-09-15  Richard Williamson   <rjw@apple.com>
1256
1257         Fixed <rdar://problem/3781561> REGRESSION (Mail): typing in Mail became suddenly really sluggish (substitute font code)
1258
1259         A DocumentMarker may begin before the InLineBox that includes
1260         it.  Ensure that we correctly handle that case.  The paintMarker()
1261         method and code that calls it could do with some cleanup to
1262         make it clearer how all the cases are handled, i.e. marker
1263         within box, or intersecting beginning or end of box.
1264
1265         Reviewed by Darin.
1266
1267         * khtml/rendering/render_text.cpp:
1268         (InlineTextBox::paintMarker):  Minimal change to ensure that we
1269         handle the case of marker starting before box.
1270
1271 2004-09-15  Darin Adler  <darin@apple.com>
1272
1273         Reviewed by John.
1274
1275         - get rid of some of the localizable strings in here; we still have to figure out
1276           how we're going to localize the last few role descriptions
1277
1278         * kwq/KWQAccObject.mm:
1279         (-[KWQAccObject roleDescription]): Use NSAccessibilityRoleDescription for most
1280         descriptions instead of a hard-coded string (inside the UI_STRING placeholder).
1281         (-[KWQAccObject accessibilityActionDescription:]): Same thing, with NSAccessibilityActionDescription.
1282
1283 2004-09-15  Darin Adler  <darin@apple.com>
1284
1285         Reviewed by John.
1286
1287         - did some QRect-related changes to facilitate later bug fixing
1288
1289         * kwq/KWQPainter.h: Added fillRect overload that takes QRect to match the real Qt one.
1290         * kwq/KWQPainter.mm: (QPainter::fillRect): Added overload that takes QRect.
1291
1292         * kwq/KWQRect.mm: (QRect::QRect): Change default constructed QRect to have a width and
1293         height of 0 rather than 1. Contrary to what we believed earlier, this is what Qt does.
1294
1295 2004-09-15  Darin Adler  <darin@apple.com>
1296
1297         Reviewed by John.
1298
1299         - fixed <rdar://problem/3799512> REGRESSION (Mail): caret flashes 1 pixel too far to the left
1300
1301         * khtml/rendering/render_text.cpp: (RenderText::caretRect): Added one to the horizontal position
1302         of the caret rect.
1303
1304 2004-09-15  Ken Kocienda  <kocienda@apple.com>
1305
1306         Reviewed by Hyatt
1307
1308         * khtml/editing/htmlediting_impl.cpp:
1309         (khtml::DeleteSelectionCommandImpl::doApply): The whitespace fixup code
1310         that makes sure proper whitespace renders after deletion was getting confused
1311         in cases where the deletion merged blocks. Basically, I needed to move some
1312         whitespace fixup code so it runs before deleting in the case where blocks
1313         need to be merged. It used to run after, and was getting confused by
1314         whitespace left over at the ends of the block after the deletion.
1315         * layout-tests/editing/deleting/delete-block-merge-contents-012-expected.txt: Added.
1316         * layout-tests/editing/deleting/delete-block-merge-contents-012.html: Added.
1317         * layout-tests/editing/deleting/delete-block-merge-contents-013-expected.txt: Added.
1318         * layout-tests/editing/deleting/delete-block-merge-contents-013.html: Added.
1319         * layout-tests/editing/deleting/delete-block-merge-contents-014-expected.txt: Added.
1320         * layout-tests/editing/deleting/delete-block-merge-contents-014.html: Added.
1321         * layout-tests/editing/deleting/delete-block-merge-contents-015-expected.txt: Added.
1322         * layout-tests/editing/deleting/delete-block-merge-contents-015.html: Added.
1323         * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt: Added.
1324         * layout-tests/editing/deleting/delete-block-merge-contents-016.html: Added.
1325         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt: Added.
1326         * layout-tests/editing/deleting/delete-block-merge-contents-017.html: Added.
1327
1328 2004-09-15  Ken Kocienda  <kocienda@apple.com>
1329
1330         Reviewed by Hyatt
1331
1332         * khtml/editing/htmlediting_impl.cpp:
1333         (khtml::DeleteSelectionCommandImpl::moveNodesAfterNode): Renamed from moveNodesToBlock.
1334         Just some simplification and cleanup in this function.
1335         (khtml::DeleteSelectionCommandImpl::doApply): Remove a hunk of start-of-block code I thought
1336         I was going to get around to improving and refining. However, I no longer need this case.
1337         * khtml/editing/htmlediting_impl.h: Function name change.
1338
1339 2004-09-14  Darin Adler  <darin@apple.com>
1340
1341         Reviewed by Maciej.
1342
1343         - added method for fix to <rdar://problem/3788894> REGRESSION (Mail): ctrl-t emacs key binding does not work (transpose)
1344
1345         * kwq/WebCoreBridge.h: Added rangeOfCharactersAroundCaret.
1346         * kwq/WebCoreBridge.mm: (-[WebCoreBridge rangeOfCharactersAroundCaret]): Added.
1347
1348         * khtml/xml/dom_caretposition.h: Added range function to make a Range from two CaretPosition objects.
1349         * khtml/xml/dom_caretposition.cpp:
1350         (DOM::CaretPosition::rangeCompliantEquivalent): Fixed a bug in this that caused it to screw up
1351         ranges in text nodes. Also changed it to use offset 0 as Ken and I discussed.
1352         (DOM::range): Added.
1353
1354         * kwq/DOM.mm: (-[DOMRange description]): Added.
1355
1356 2004-09-14  Darin Adler  <darin@apple.com>
1357
1358         Reviewed by John.
1359
1360         - fixed <rdar://problem/3786986> REGRESSION: TEXTAREAs have extra wide right margins where the scrollbars used to be
1361
1362         * kwq/KWQTextArea.mm:
1363         (-[KWQTextArea _updateTextViewWidth]): Renamed from _frameSizeChanged. Now uses the width of
1364         the size from the contentSize method rather than trying to compute a size.
1365         (-[KWQTextArea initWithFrame:]): Call method by new name.
1366         (-[KWQTextArea tile]): Override this instead of setFrame: to adjust the size as the size of
1367         the text area changes.
1368
1369 2004-09-14  Chris Blumenberg  <cblu@apple.com>
1370
1371         Backed out my changes to these files. They were not meant to be checked. (I'm having a bad CVS day)
1372
1373         * kwq/WebCoreBridge.h:
1374         * kwq/WebCoreBridge.mm:
1375         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:]):
1376         (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:]):
1377         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:]):
1378         (-[WebCoreBridge replaceSelectionWithText:selectReplacement:]):
1379
1380 2004-09-14  David Hyatt  <hyatt@apple.com>
1381
1382         Fix the crash in the layout tests caused by my recent selection changes.  Simply eliminate the buggy
1383         selection border setting code and let isSelectionBorder be implemented in terms of the SelectionState.
1384         
1385         Reviewed by kocienda
1386
1387         * khtml/rendering/render_canvas.cpp:
1388         (RenderCanvas::setSelection):
1389         * khtml/rendering/render_object.cpp:
1390         (RenderObject::RenderObject):
1391         (RenderObject::container):
1392         (RenderObject::isSelectionBorder):
1393         * khtml/rendering/render_object.h:
1394         (khtml::RenderObject::minMaxKnown):
1395         (khtml::RenderObject::setReplaced):
1396
1397 2004-09-14  Chris Blumenberg  <cblu@apple.com>
1398
1399         Fixed: <rdar://problem/3778680> REGRESSION: plug-in content sometimes doesn't show up
1400
1401         Reviewed by dave.
1402
1403         * khtml/html/html_objectimpl.cpp:
1404         (HTMLObjectElementImpl::parseHTMLAttribute): set needWidgetUpdate to true only if there is a renderer
1405         (HTMLObjectElementImpl::attach): if needWidgetUpdate is true, call updateWidget
1406
1407 2004-09-14  Maciej Stachowiak  <mjs@apple.com>
1408
1409         Reviewed by Darin.
1410
1411         - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1412         - updated escape/encodeURI layout test to match our new, more
1413         compatible behavior.
1414
1415         * layout-tests/fast/js/global/encode-URI-test.html:
1416
1417 2004-09-14  Ken Kocienda  <kocienda@apple.com>
1418
1419         Reviewed by Richard
1420
1421         Fix for this bug:
1422         
1423         <rdar://problem/3800834> REGRESSION (Mail): Can't delete backwards past quoted text using HTML editing
1424
1425         * khtml/editing/htmlediting_impl.cpp:
1426         (khtml::TypingCommandImpl::issueCommandForDeleteKey): Use CaretPosition class to get superior
1427         smarts about the selection to delete in the "start of block" case. This fixes the bug.
1428         While I was in the neighborhood, I cleaned up this function a bit.
1429         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Added.
1430         * layout-tests/editing/deleting/delete-3800834-fix.html: Added.
1431
1432 2004-09-14  Ken Kocienda  <kocienda@apple.com>
1433
1434         * khtml/css/parser.cpp: Did not regenerate this file from parser.y before last checkin.
1435
1436 2004-09-14  Chris Blumenberg  <cblu@apple.com>
1437
1438         Fixed typos in last check-in.
1439
1440         * khtml/khtml_part.cpp:
1441         (KHTMLPart::selectClosestWordFromMouseEvent):
1442         (KHTMLPart::handleMousePressEventDoubleClick):
1443         * khtml/khtml_part.h:
1444         * kwq/KWQKHTMLPart.mm:
1445         (KWQKHTMLPart::sendContextMenuEvent):
1446
1447 2004-09-09  David Hyatt  <hyatt@apple.com>
1448
1449         Fix for 3667862, regression where dragging of selection became really slow.  This patch completely rewrites
1450         selection painting and drawing so that the enclosing rect is much more snug.  The containing block rect is no
1451         longer used at all.
1452         
1453         Reviewed by kocienda
1454
1455         * khtml/rendering/render_canvas.cpp:
1456         (RenderCanvas::selectionRect):
1457         (getSelectionInfo):
1458         (RenderCanvas::setSelection):
1459         (RenderCanvas::clearSelection):
1460         * khtml/rendering/render_canvas.h:
1461         * khtml/rendering/render_container.cpp:
1462         (RenderContainer::removeChildNode):
1463         * khtml/rendering/render_image.cpp:
1464         (RenderImage::selectionRect):
1465         (RenderImage::selectionTintColor):
1466         (RenderImage::paint):
1467         * khtml/rendering/render_image.h:
1468         * khtml/rendering/render_object.cpp:
1469         (RenderObject::selectionStartEnd):
1470         * khtml/rendering/render_object.h:
1471         (khtml::RenderObject::selectionRect):
1472         (khtml::RenderObject::SelectionInfo::object):
1473         (khtml::RenderObject::SelectionInfo::rect):
1474         (khtml::RenderObject::SelectionInfo::state):
1475         (khtml::RenderObject::SelectionInfo::SelectionInfo):
1476         (khtml::RenderObject::SelectionInfo::m_state):
1477         * khtml/rendering/render_text.cpp:
1478         (InlineTextBox::textObject):
1479         (InlineTextBox::selectionRect):
1480         (InlineTextBox::paintSelection):
1481         (RenderText::getAbsoluteRepaintRect):
1482         (RenderText::selectionRect):
1483         * khtml/rendering/render_text.h:
1484         * kwq/KWQPainter.mm:
1485         (getBlendedColorComponent):
1486         (QPainter::selectedTextBackgroundColor):
1487
1488 2004-09-14  Ken Kocienda  <kocienda@apple.com>
1489
1490         Reviewed by Hyatt
1491
1492         Fix for this bug:
1493         
1494         <rdar://problem/3794376> vertical formatting lines that show quote level are missing
1495
1496         Rolling out change Dave made to fix 3787686. It turns out that we do not want this
1497         change, as it does not appear to have any effect on the bug. In addition, it caused
1498         the regression in quote bar behavior.
1499
1500         * khtml/css/parser.cp
1501         * khtml/css/parser.y
1502
1503 2004-09-14  Chris Blumenberg  <cblu@apple.com>
1504
1505         Fixed: Control-click shouldn't cause deselect when clicking selection.
1506
1507         Reviewed by rjw.
1508
1509         * kwq/KWQKHTMLPart.mm:
1510         (KWQKHTMLPart::sendContextMenuEvent): don't attempt to select the closest word when the selection is clicked
1511
1512 2004-09-14  Chris Blumenberg  <cblu@apple.com>
1513
1514         Fixed badness that my last patch caused. Because there was a conflict, my last patch added stuff that darin had just removed.
1515
1516         Reviewed by darin.
1517
1518         * kwq/KWQKHTMLPart.mm:
1519         (KWQKHTMLPart::sendContextMenuEvent): don't call deref on the view
1520
1521 2004-09-14  Chris Blumenberg  <cblu@apple.com>
1522
1523         Fixed: <rdar://problem/3783595> REGRESSION (Mail): control-click does not select closest word
1524
1525         Reviewed by kocienda.
1526
1527         * khtml/khtml_part.cpp:
1528         (KHTMLPart::selectionGranularity): new getter, need this for an upcoming patch
1529         (KHTMLPart::selectClosetWordFromMouseEvent): new, factored from handleMousePressEventDoubleClick
1530         (KHTMLPart::handleMousePressEventDoubleClick): call selectClosetWordFromMouseEvent
1531         * khtml/khtml_part.h:
1532         * kwq/KWQKHTMLPart.mm:
1533         (KWQKHTMLPart::sendContextMenuEvent): call selectClosetWordFromMouseEvent if nothing swallows the event
1534
1535 2004-09-14  Ken Kocienda  <kocienda@apple.com>
1536
1537         Reviewed by John
1538
1539         Fix for this bug:
1540         
1541         <rdar://problem/3800346> Inserting newline in BR after block not working
1542
1543         * khtml/editing/htmlediting_impl.cpp:
1544         (khtml::InputNewlineCommandImpl::doApply): The code to insert the "extra" BR at the end
1545         of blocks (hack done to make BRs show up when they appear at the ends of blocks) did not
1546         cover this one quirky case where the insertion point can be placed in a BR at the end of 
1547         a block that does actually render. Now the input newline code can handle this addtional
1548         case.
1549         * layout-tests/editing/selection/insert-3800346-fix-expected.txt: Added.
1550         * layout-tests/editing/selection/insert-3800346-fix.html: Added.
1551
1552 2004-09-14  Darin Adler  <darin@apple.com>
1553
1554         Reviewed by Ken.
1555
1556         - fixed <rdar://problem/3479392> REGRESSION (Mail): select all does not select all at some pages
1557
1558         * khtml/xml/dom_caretposition.cpp: (DOM::CaretPosition::deepEquivalent):
1559         Use caretMaxOffset instead of maxOffset when descending to the last node.
1560         Also change around the function a bit.
1561
1562 2004-09-13  Darin Adler  <darin@apple.com>
1563
1564         Reviewed by Maciej.
1565
1566         - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari (Oracle Portal)
1567
1568         This is a more complete fix, but it requires the previous attempt at a fix for this same
1569         bug below, because this is only the "don't destroy the KHTMLPart" portion; other fixes are
1570         still needed to survive shutdown of the part.
1571
1572         * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::interpreter): Call the new keepAlive method.
1573         This is called whenever we're about to use an interpreter to run some JavaScript, and
1574         it's JavaScript that might destroy the part, hence the interpreter.
1575
1576         * khtml/khtml_part.h: Added keepAlive() and slotEndLifeSupport() member functions.
1577         * khtml/khtmlpart_p.h: Added m_lifeSupportTimer.
1578         * khtml/khtml_part.cpp:
1579         (KHTMLPart::init): Connects m_lifeSupportTimer to slotEndLifeSupport.
1580         (KHTMLPart::write): Removed old attempt to work around this issue.
1581         (KHTMLPart::end): Ditto.
1582         (KHTMLPart::keepAlive): Added. References the part, then sets up a one-shot timer.
1583         (KHTMLPart::slotEndLifeSupport): Added. Stops the timer and then removes the reference
1584         from the part, possibly destroying it.
1585
1586         * kwq/KWQSlot.mm:
1587         (KWQSlot::KWQSlot): Added the new slot to the list of slots.
1588         (KWQSlot::call): Ditto.
1589
1590         * kwq/KWQKHTMLPart.mm:
1591         (KWQKHTMLPart::sendResizeEvent): Removed an old attempt to work around this same issue.
1592         (KWQKHTMLPart::mouseDown): Ditto.
1593         (KWQKHTMLPart::mouseDragged): Ditto.
1594         (KWQKHTMLPart::mouseUp): Ditto.
1595         (KWQKHTMLPart::mouseMoved): Ditto.
1596         (KWQKHTMLPart::sendContextMenuEvent): Ditto.
1597
1598 2004-09-13  Darin Adler  <darin@apple.com>
1599
1600         Reviewed by Maciej.
1601
1602         - fixed regression caused by change earlier today
1603
1604         * khtml/xml/dom_selection.cpp: (DOM::Selection::modifyExtendingRightForward):
1605         Use CaretPosition for CHARACTER, not WORD.
1606
1607 2004-09-13  Darin Adler  <darin@apple.com>
1608
1609         Reviewed by Kevin.
1610
1611         - fixed <rdar://problem/3798453> DIG failure: getting variable with same name as DOM element attribute gets attribute value instead
1612
1613         * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): When adding current target and
1614         other event handler scope, put it below the existing scope chain. This ensures that things
1615         found in the function's scope will come before the event handler, as in other browsers.
1616
1617 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1618
1619         Reviewed by Darin
1620         
1621         Fix for this bug:
1622         
1623         <rdar://problem/3798346> REGRESSION (125-162): crash pushing down arrow key on KLM.com site
1624
1625         * khtml/xml/dom_position.cpp:
1626         (DOM::Position::nextLinePosition): This function was being called in a case where it was not expected
1627         until we traced the code. It has to do with some deeper issues associated with handling arrow keys, 
1628         resulting in the editing arrow-down code running in a case where we are not editing. I discussed this 
1629         with Darin, and we decided to handle the broader issues at a later date. The fix I am checking in
1630         here to fix the bug is merely avoiding a null-deref.
1631
1632 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1633
1634         Reviewed by John
1635
1636         Fix for this bug:
1637         
1638         <rdar://problem/3784840> REGRESSION (Mail): Text is inserted in the wrong place after changing typing style
1639
1640         * khtml/editing/htmlediting_impl.cpp:
1641         (khtml::InputTextCommandImpl::prepareForTextInsertion): Code to handle typing style did not
1642         check to see if the reference node used for the DOM node insertion operation was a block.
1643         If it is, then the new node containing the new editing style now is inserted at the start of the block,
1644         instead of after it.
1645
1646 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1647
1648         Added a couple new layout tests to cover recent changes.
1649
1650         * layout-tests/editing/editing.js: Added some new functions to do by-word selection movement.
1651         * layout-tests/editing/selection/move-backwords-by-word-001-expected.txt: Added.
1652         * layout-tests/editing/selection/move-backwords-by-word-001.html: Added.
1653         * layout-tests/editing/selection/selection-3748164-fix-expected.txt: Added.
1654         * layout-tests/editing/selection/selection-3748164-fix.html: Added.
1655
1656 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1657
1658         Reviewed by John
1659
1660         Fix for this bug:
1661         
1662         <rdar://problem/3765519> REGRESSION (Mail): word movement goes too far upstream at start of line
1663         
1664         * khtml/xml/dom_position.cpp:
1665         (DOM::Position::previousWordPosition): Use downstream position here when making final placement of caret. 
1666
1667 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1668
1669         Reviewed by Darin
1670
1671         Various editing improvements, many focused on the improvements made possible by the
1672         new CaretPosition class.
1673         
1674         Includes fixes for these bugs:
1675         
1676         <rdar://problem/3748164> REGRESSION (Mail): Arrow navigation in typical mail message can result in stuck caret
1677         <rdar://problem/3782062> REGRESSION (Mail): option-delete can delete almost all of a message when it has trouble finding a word
1678         <rdar://problem/3790456> triple click does not select entire paragraph (folklore.org)
1679
1680         * WebCore.pbproj/project.pbxproj: Added CaretPosition class files.
1681         * khtml/dom/dom2_range.h:
1682         (DOM::offsetInCharacters): Moved this helper here from khtml_text_operations.cpp. This
1683         function helps to determine how to interpret the offsets used in DOM Ranges.
1684         * khtml/editing/htmlediting_impl.cpp:
1685         (khtml::InputNewlineCommandImpl::doApply): Use CaretPosition class to make "end-of-block" determination.
1686         Also, fix a caret placement glitch in "case 1" in the code: Place the caret in the node after the inserted
1687         BR. This makes it show up in the right place.
1688         * khtml/khtml_part.cpp:
1689         (KHTMLPart::handleMousePressEventDoubleClick): Don't limit double-click and triple-click handling only to text nodes.
1690         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1691         (KHTMLPart::selectAll): Use CaretPosition class to implement improved selectAll.
1692         * khtml/misc/khtml_text_operations.cpp:
1693         (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Make a fix to the initial state setting of
1694         m_handledChildren. This is true if the offset into the end node is 0, meaning that we do not want to descend
1695         into its children at all.
1696         * khtml/xml/dom_caretposition.cpp: Added.
1697         * khtml/xml/dom_caretposition.h: Added.
1698         * khtml/xml/dom_nodeimpl.cpp:
1699         (NodeImpl::traverseNextNode): Fix bugs with the stayWithin implementation. We could miss nodes we want to test
1700         due to an erroneous check of stayWithin when no such check is needed.
1701         (NodeImpl::traverseNextSibling): Ditto.
1702         (NodeImpl::traversePreviousNodePostOrder): Ditto.
1703         * khtml/xml/dom_position.cpp:
1704         (DOM::Position::Position): Remove spurious semi-colon.
1705         (DOM::Position::upstream): Move incoming Position to its equivalentDeepPosition. This is part of the transition
1706         that will make this code work better with increased use of CaretPosition.
1707         (DOM::Position::downstream): Ditto.
1708         (DOM::Position::atStartOfContainingEditableBlock): Removed. Dead code; was not being called.
1709         (DOM::Position::atStartOfRootEditableElement): Removed. Dead code; was not being called.
1710         (DOM::Position::isLastRenderedPositionInEditableBlock): Removed. Replaced with calls to CaretPosition class.
1711         (DOM::Position::inLastEditableInRootEditableElement): Removed. Dead code; was not being called.
1712         (DOM::Position::inFirstEditableInRootEditableElement): Removed. Was only being called by other code that has been removed.
1713         * khtml/xml/dom_position.h:
1714         * khtml/xml/dom_selection.cpp:
1715         (DOM::Selection::modifyExtendingRightForward): Moved implementation of CHARACTER case to use CaretPosition class instead
1716         of Position class helpers.
1717         (DOM::Selection::modifyMovingRightForward): Ditto.
1718         (DOM::Selection::modifyExtendingLeftBackward): Ditto.
1719         (DOM::Selection::modifyMovingLeftBackward): Ditto.
1720         (DOM::Selection::validate): Made simplifications in code that used to call a concoction of Position class helpers to
1721         do the right thing. Now calls CaretPosition equivalents.
1722
1723 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1724
1725         This test was broken. The result is that it was not testing what it was supposed to 
1726         be testing. I fixed the test and updated the expected results.
1727
1728         * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt
1729         * layout-tests/editing/selection/move-between-blocks-no-001.html
1730
1731 2004-09-13  Ken Kocienda  <kocienda@apple.com>
1732
1733         Reviewed by John
1734
1735         Fix for these bugs:
1736         
1737         <rdar://problem/3784835> REGRESSION (Mail): crash in DOM::ElementImpl::tagName inside delete text command code while editing a Mail message
1738         <rdar://problem/3788015> REGRESSION (Mail): Crash deleting before a blockquote
1739         <rdar://problem/3796366> REGRESSION (Mail): Crash Mail by deleting the right line from pasted HTML
1740
1741         * khtml/editing/htmlediting_impl.cpp:
1742         (khtml::DeleteSelectionCommandImpl::doApply): All of these bugs are due to the same problem. When I
1743         made the delete command run even when the text is a caret (to make block merges work right when the
1744         caret is at the start of a block), I failed to handle one case when there might be no text to 
1745         delete. This resulted in a call to the DeleteTextCommand with a zero-length deletion request.
1746         This is not supported. Now, I have added an additional test in this one place in the code that
1747         was causing all these failures.
1748
1749 2004-09-12  Darin Adler  <darin@apple.com>
1750
1751         Reviewed by Maciej.
1752
1753         - fixed <rdar://problem/3797758> REGRESSION (155-156): Cannot tab between input fields at switchboard.com
1754
1755         * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Use setFocus() instead of calling makeFirstResponder
1756         directly since it handles the case where the field editor has focus.
1757
1758 2004-09-12  Darin Adler  <darin@apple.com>
1759
1760         Reviewed by Maciej.
1761
1762         - fixed <rdar://problem/3792082> zero character codes in UTF-16 input cause crash
1763
1764         * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUTF16): Fixed code that was using the wrong variable
1765         to decrement the input length, causing buffer overrun.
1766
1767 2004-09-12  Darin Adler  <darin@apple.com>
1768
1769         Reviewed by Maciej.
1770
1771         - fixed <rdar://problem/3798240> computed style error log messages seen with numbers in the range 74-77
1772
1773         * khtml/css/css_computedstyle.cpp: (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1774         Added implementations for CSS_PROP__KHTML_MARQUEE_INCREMENT, CSS_PROP_MAX_HEIGHT, CSS_PROP_MAX_WIDTH,
1775         CSS_PROP_MIN_HEIGHT, CSS_PROP_MIN_WIDTH, and CSS_PROP_VISIBILITY.
1776
1777 2004-09-12  Darin Adler  <darin@apple.com>
1778
1779         * layout-tests/css1/text_properties/text-transform-expected.txt: Removed unused test result.
1780
1781 2004-09-11  Maciej Stachowiak  <mjs@apple.com>
1782
1783         Reviewed by Darin.
1784
1785         <rdar://problem/3787208> can't log in to SAP SDN site (JS parse error)
1786
1787         * kwq/KWQKURL.mm:
1788         (KURL::decode_string): Check for find result >= 0 instead of >0,
1789         to handle case of first character in a string being encoded.
1790
1791 2004-09-09  Chris Blumenberg  <cblu@apple.com>
1792
1793         Support for: <rdar://problem/3795485> debug menu item to enable RSS animation on first layout
1794
1795         Reviewed by rjw.
1796
1797         * khtml/khtml_part.h:
1798         (KHTMLPart::didFirstLayout): new
1799         * khtml/khtmlview.cpp:
1800         (KHTMLView::layout): call didFirstLayout
1801         * kwq/KWQKHTMLPart.h:
1802         * kwq/KWQKHTMLPart.mm:
1803         (KWQKHTMLPart::didFirstLayout): new
1804         * kwq/WebCoreBridge.h:
1805
1806 === Safari-163 ===
1807
1808 2004-09-09  Maciej Stachowiak  <mjs@apple.com>
1809
1810         - roll out the last change, it appears to cause a performance regression
1811
1812         * khtml/rendering/render_box.cpp:
1813         (RenderBox::caretRect):
1814         * khtml/rendering/render_box.h:
1815         * khtml/rendering/render_br.cpp:
1816         (RenderBR::caretRect):
1817         * khtml/rendering/render_br.h:
1818         * khtml/rendering/render_flow.cpp:
1819         (RenderFlow::caretRect):
1820         * khtml/rendering/render_flow.h:
1821         * khtml/rendering/render_object.cpp:
1822         (RenderObject::caretRect):
1823         * khtml/rendering/render_object.h:
1824         * khtml/rendering/render_text.cpp:
1825         (RenderText::caretRect):
1826         * khtml/rendering/render_text.h:
1827         * kwq/WebCoreBridge.h:
1828         * kwq/WebCoreBridge.mm:
1829
1830 2004-09-08  Maciej Stachowiak  <mjs@apple.com>
1831
1832         Reviewed by Dave.
1833
1834         WebCore part of fix for:
1835         
1836         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
1837         
1838         * kwq/WebCoreBridge.h:
1839         * kwq/WebCoreBridge.mm:
1840         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
1841         DOMRange, or if the range is split into multiple lines, the rect for the part on
1842         the first line only.
1843         
1844         * khtml/rendering/render_object.cpp:
1845         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
1846         for the overrides below.
1847         * khtml/rendering/render_object.h:
1848         * khtml/rendering/render_box.cpp:
1849         (RenderBox::caretRect):
1850         * khtml/rendering/render_box.h:
1851         * khtml/rendering/render_br.cpp:
1852         (RenderBR::caretRect):
1853         * khtml/rendering/render_br.h:
1854         * khtml/rendering/render_flow.cpp:
1855         (RenderFlow::caretRect):
1856         * khtml/rendering/render_flow.h:
1857         * khtml/rendering/render_text.cpp:
1858         (RenderText::caretRect):
1859
1860 2004-09-06  Darin Adler  <darin@apple.com>
1861
1862         Reviewed by Ken.
1863
1864         - fixed <rdar://problem/3790526> mark-related methods not implemented (needed for people with them in their key bindings files)
1865
1866         * khtml/khtml_part.h: Added mark and setMark.
1867         * khtml/khtmlpart_p.h: Added m_mark.
1868         * khtml/khtml_part.cpp:
1869         (KHTMLPart::mark): Added.
1870         (KHTMLPart::setMark): Added.
1871
1872         * kwq/KWQKHTMLPart.h: Change name of markedRange to markedTextRange to decrease
1873         the change it will be confused with the mark.
1874         * kwq/KWQKHTMLPart.mm:
1875         (KWQKHTMLPart::clear): Update for name change.
1876         (KWQKHTMLPart::markedTextRange): Ditto.
1877         (KWQKHTMLPart::setMarkedTextRange): Ditto.
1878
1879         * khtml/rendering/render_text.cpp: (RenderText::paint): Update for name change.
1880
1881         * kwq/WebCoreBridge.h: Remove setSelectionFrom, selectionStart, selectionStartOffset,
1882         selectionEnd, selectionEndOffset, and clearMarkedDOMRange. Renamed setMarkedDOMRange
1883         to setMarkedTextDOMRange and markedDOMRange to markedTextDOMRange. Added setMarkDOMRange
1884         and markDOMRange for the Emacs "mark".
1885         * kwq/WebCoreBridge.mm:
1886         (-[WebCoreBridge setMarkDOMRange:]): Added.
1887         (-[WebCoreBridge markDOMRange]): Added.
1888         (-[WebCoreBridge setMarkedTextDOMRange:]): Renamed.
1889         (-[WebCoreBridge markedTextDOMRange]): Renamed.
1890
1891         * khtml/xml/dom_selection.cpp: (DOM::Selection::validate): Make paragraph positions
1892         canonical by using deep rendered positions. Maybe someday this won't be an ad hoc
1893         decision any more.
1894
1895         * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::removeChildren): Use ref and deref
1896         rather than the unconventional check for 0 refCount. This makes us a bit more
1897         robust against a node going away partway through the removal process.
1898
1899         * WebCore.pbproj/project.pbxproj: Update MACOSX_DEPLOYMENT_TARGET to 10.3.
1900
1901 2004-09-08  Maciej Stachowiak  <mjs@apple.com>
1902
1903         - fixed deployment build problems noticed by Grant
1904
1905         * khtml/rendering/render_flow.cpp:
1906         (RenderFlow::caretRect):
1907         * khtml/rendering/render_text.cpp:
1908         (RenderText::caretRect):
1909
1910 2004-09-08  David Hyatt  <hyatt@apple.com>
1911
1912         Fix XML so that elements with no namespace never make HTML elements (when their names coincidentally match).
1913         
1914         Reviewed by rjw
1915
1916         * khtml/xml/dom_docimpl.cpp:
1917         (DocumentImpl::createElementNS):
1918
1919 2004-09-07  Maciej Stachowiak  <mjs@apple.com>
1920
1921         Reviewed by John.
1922
1923         - renamed caretPos to caretRect and made it return a QRect instead
1924         of taking four out parameters by reference.
1925         
1926         * khtml/rendering/render_box.cpp:
1927         (RenderBox::caretRect):
1928         * khtml/rendering/render_box.h:
1929         * khtml/rendering/render_br.cpp:
1930         (RenderBR::caretRect):
1931         * khtml/rendering/render_br.h:
1932         * khtml/rendering/render_flow.cpp:
1933         (RenderFlow::caretRect):
1934         * khtml/rendering/render_flow.h:
1935         * khtml/rendering/render_object.cpp:
1936         (RenderObject::caretRect):
1937         * khtml/rendering/render_object.h:
1938         * khtml/rendering/render_text.cpp:
1939         (RenderText::caretRect):
1940         * khtml/rendering/render_text.h:
1941         * khtml/xml/dom_selection.cpp:
1942         (DOM::Selection::xPosForVerticalArrowNavigation):
1943         (DOM::Selection::layoutCaret):
1944         * kwq/WebCoreBridge.mm:
1945         (-[WebCoreBridge caretRectAtNode:offset:]):
1946
1947 2004-09-07  Maciej Stachowiak  <mjs@apple.com>
1948
1949         Reviewed by Kevin.
1950
1951         <rdar://problem/3759209> REGRESSION (Mail): assertion failure when all of marked text deleted at start of document
1952         
1953         * kwq/KWQKHTMLPart.mm:
1954         (KWQKHTMLPart::setMarkedRange): Allow any empty range, even if
1955         it's not in a text node, since in this case it won't matter and
1956         weird things can happen when all marked text is removed, there
1957         might not be any text nodes.
1958
1959 2004-09-07  David Hyatt  <hyatt@apple.com>
1960
1961         Initial text-decoration CSS3 work for editing.  Just gets the properties and values parsed.
1962         
1963         Reviewed by darin
1964
1965         * khtml/css/css_computedstyle.cpp:
1966         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1967         * khtml/css/cssparser.cpp:
1968         (CSSParser::parseValue):
1969         * khtml/css/cssproperties.c:
1970         (hash_prop):
1971         (findProp):
1972         * khtml/css/cssproperties.h:
1973         * khtml/css/cssproperties.in:
1974         * khtml/css/cssstyleselector.cpp:
1975         (khtml::CSSStyleSelector::adjustRenderStyle):
1976         * khtml/css/cssvalues.c:
1977         (hash_val):
1978         (findValue):
1979         * khtml/css/cssvalues.h:
1980         * khtml/css/cssvalues.in:
1981
1982 2004-09-06  Maciej Stachowiak  <mjs@apple.com>
1983
1984         Reviewed by Darin and Ken.
1985
1986         <rdar://problem/3655568> window.open fails when URL contains trailing space
1987
1988         * kwq/KWQKURL.mm:
1989         (KURL::KURL): Strip trailing and leading space when resolving relative URLs in all
1990         cases, instead of just leading in the non-absolute case as before.
1991
1992         - refactored KURL constructor to put more work in separate
1993         functions and also to change static methods to static functions,
1994         to avoid having to change the header when only changing helper
1995         functions that do not affect the KURL API (since KURL.h is widely
1996         included).
1997         
1998         * kwq/KWQKURL.mm:
1999         (encodeHostname):
2000         (findHostnamesInMailToURL):
2001         (findHostnameInHierarchicalURL):
2002         (encodeHostnames):
2003         (encodeRelativeString):
2004         (substituteBackslashes):
2005         * kwq/KWQKURL.h:
2006
2007         - add missing include of qvaluelist.h
2008
2009         * khtml/ecma/kjs_dom.h:
2010
2011 2004-09-06  Darin Adler  <darin@apple.com>
2012
2013         Reviewed by John.
2014
2015         - fixed <rdar://problem/3512066> REGRESSION (Mail): Select All highlights only part of the content, though all is copied
2016         - fixed <rdar://problem/3157025> REGRESSION (Mail): Should select paragraph instead of line on triple-click
2017         - fixed <rdar://problem/3735048> REGRESSION (Mail): HTML editing must select newline on triple click
2018         - fixed <rdar://problem/3788872> REGRESSION (Mail): ctrl-a emacs key binding does not work (move to start of paragraph)
2019         - fixed <rdar://problem/3788881> REGRESSION (Mail): ctrl-e emacs key binding does not work (move to end of paragraph)
2020         - fixed <rdar://problem/3789931> REGRESSION (Mail): typing style lost when you backspace
2021         - added code to select inserted text to help WebKit implement yankAndSelect:
2022         - did some clean-up on editing commands code
2023         
2024         * khtml/khtml_part.cpp:
2025         (KHTMLPart::handleMousePressEventTripleClick): Expand to a paragraph, not a line.
2026         (KHTMLPart::selectAll): Remove a lot of unneeded code and just expand to document using Selection.
2027         (KHTMLPart::selectionHasStyle): Remove check that limited us to only HTML elements, and add
2028         a check for nil. Together, these two changes fix a few cases I ran into during testing.
2029
2030         * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Fix test that was checking if
2031         the old selection spanned multiple objects when it really should have checked whether the new
2032         new selection spans multiple objects. This caused the select all redraw bug.
2033
2034         * khtml/editing/htmlediting.h: Fixed indenting. Remove command IDs, replacing them with a couple
2035         of specific type checking methods, and SharedCommandImpl, using EditCommandImpl directly instead.
2036         Got rid of virtual functions, since the command objects have no data members other than the ones
2037         inherited from SharedPtr. Removed explicit copy constructors and destructors. Removed unneeded
2038         empty constructors. Removed inline directives that were having no effect. Added some boolean
2039         selectInsertedText parameter to some commands. Made almost all member functions const, because
2040         the const here applies to the command object which is a smart pointer, not the pointed-to
2041         command implementation object.
2042         * khtml/editing/htmlediting.cpp:
2043         (khtml::EditCommand::EditCommand): Changed since SharedPtr is now a pointer to EditCommandImpl.
2044         (khtml::EditCommand::operator=): Added. By defining this explicitly, we don't need the class
2045         that we are pointing to defined in the header, which lets us get rid of SharedCommandImpl.
2046         (khtml::EditCommand::isInputTextCommand): Added.
2047         (khtml::EditCommand::isTypingCommand): Added.
2048         (khtml::EditCommand::setParent): Updated since EditCommandImpl.setParent takes an impl pointer now.
2049         (khtml::EditCommand::handle): Removed, since it's identical to get().
2050         (khtml::InputTextCommand::input): Added selectInsertedText parameter.
2051         (khtml::TypingCommand::TypingCommand): Ditto.
2052         (khtml::TypingCommand::insertText): Ditto.
2053         (khtml::TypingCommand::isOpenForMoreTypingCommand): Use isTypingCommand instead of commandID.
2054         (khtml::TypingCommand::closeTyping): Change parameter type to const reference.
2055
2056         * khtml/editing/htmlediting_impl.h: Made StyleChange functions be const member functions.
2057         Changed parent() and setParent() to take and return EditCommandImpl pointers and be inlined.
2058         Added virtual isInputTextCommand, isTypingCommand, and preservesTypingStyle functions.
2059         Removed commandID functions and unneeded explicit destructors. Removed unneeded doApply
2060         function declaration in CompositeEditCommandImpl. Changed type of applyTypingStyle to return
2061         a node, not necessarily an element. Removed private execute function from InputTextCommandImpl.
2062         Added selectInsertedText to InputTextCommandImpl's input function and TypingCommandImpl's constructor
2063         and insertText function.
2064         * khtml/editing/htmlediting_impl.cpp:
2065         (khtml::StyleChange::StyleChange): Don't bother initializing the booleans since init handles that.
2066         (khtml::StyleChange::init): Added code to strip whitespace, and tweaked how the function does its job.
2067         (khtml::StyleChange::currentlyHasStyle): Added a check for null value, which can happen for properties
2068         where we don't have computed style implemented yet.
2069         (khtml::EditCommandImpl::EditCommandImpl): Updated since there is no SharedCommandImpl any more.
2070         (khtml::EditCommandImpl::apply): Call new preservesTypingStyle function rather than checking
2071         the command ID. This preserves typing style when deleting with the keyboard.
2072         (khtml::EditCommandImpl::setStartingSelection): Changed since parent is now a EditCommandImpl.
2073         Also rewrote to use for loop so it's simpler-looking.
2074         (khtml::EditCommandImpl::setEndingSelection): Ditto.
2075         (khtml::EditCommandImpl::setTypingStyle): Ditto.
2076         (khtml::EditCommandImpl::preservesTypingStyle): Added. Returns false.
2077         (khtml::EditCommandImpl::isInputTextCommand): Added. Returns false.
2078         (khtml::EditCommandImpl::isTypingCommand): Added. Returns false.
2079         (khtml::CompositeEditCommandImpl::applyTypingStyle): Changed this function to return a node rather
2080         than an element. Also change it so it returns the child as-is if the style change has nothing in it.
2081         (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl): Removed unneeded null checks.
2082         (khtml::DeleteSelectionCommandImpl::preservesTypingStyle): Added. Returns true.
2083         (khtml::DeleteTextCommandImpl::~DeleteTextCommandImpl): Removed unneeded null checks.
2084         (khtml::InputTextCommandImpl::input): Renamed execute function to input and got rid of the additional
2085         level of indirection, since it was the only caller. Added selectInsertedText parameter and changed
2086         the code so it will respect it.
2087         (khtml::InputTextCommandImpl::isInputTextCommand): Added. Returns true.
2088         (khtml::InsertNodeBeforeCommandImpl::~InsertNodeBeforeCommandImpl): Removed unneeded null checks.
2089         (khtml::JoinTextNodesCommandImpl::~JoinTextNodesCommandImpl): Ditto.
2090         (khtml::MoveSelectionCommandImpl::MoveSelectionCommandImpl): Hold a reference to the fragment
2091         while the command exists.
2092         (khtml::MoveSelectionCommandImpl::~MoveSelectionCommandImpl): Release the fragment.
2093         (khtml::RemoveNodeCommandImpl::~RemoveNodeCommandImpl): Remove unneeded null checks.
2094         (khtml::RemoveNodeCommandImpl::doUnapply): Take advantage of defined behavior of insertBefore when
2095         the node to insert before is 0 (means the same thing as appendChild).
2096         (khtml::RemoveNodePreservingChildrenCommandImpl::~RemoveNodePreservingChildrenCommandImpl):
2097         Remove unneeded null check.
2098         (khtml::ReplaceSelectionCommandImpl::ReplaceSelectionCommandImpl): Hold a reference to the fragment
2099         while the command exists.
2100         (khtml::ReplaceSelectionCommandImpl::~ReplaceSelectionCommandImpl): Release the fragment.
2101         (khtml::SetNodeAttributeCommandImpl::~SetNodeAttributeCommandImpl): Remove unneeded null check.
2102         (khtml::SplitTextNodeCommandImpl::~SplitTextNodeCommandImpl): Remove unneeded null check.
2103         (khtml::TypingCommandImpl::TypingCommandImpl): Added selectInsertedText parameter.
2104         (khtml::TypingCommandImpl::doApply): Pass along selectInsertedText parameter.
2105         (khtml::TypingCommandImpl::insertText): Ditto.
2106         (khtml::TypingCommandImpl::preservesTypingStyle): Added. Returns true for DeleteKey.
2107         (khtml::TypingCommandImpl::isTypingCommand): Added. Returns true.
2108
2109         * khtml/editing/jsediting.cpp: Add a cut at implementing the underline command. May not work
2110         perfectly yet because text-decoration is not inherited the way, say, font-weight is.
2111
2112         * khtml/xml/dom_selection.h: Removed some unneeded friend declarations for comparison operators
2113         that use only public members. Added PARAGRAPH_BOUNDARY.
2114         * khtml/xml/dom_selection.cpp:
2115         (DOM::Selection::modifyExtendingRightForward): Implemented paragraph boundary case, simplified line
2116         boundary case (by changing parameter types and function names, not the algorithm), and made
2117         paragraph case fall into line case for now.
2118         (DOM::Selection::modifyMovingRightForward): Ditto.
2119         (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2120         (DOM::Selection::modifyMovingLeftBackward): Ditto.
2121         (DOM::Selection::validate): Implemented paragraph case and paragraph boundary case, simplified the
2122         line case as above and also fixed the document case.
2123         (DOM::startOfFirstRunAt): Changed to use DOM::Position instead of node
2124         offset pairs. Also renamed and got rid of separate bool to indicate "not found".
2125         (DOM::endOfLastRunAt): Ditto.
2126         (DOM::selectionForLine): Ditto.
2127
2128         * khtml/xml/dom_position.h: Added startParagraphBoundary and endParagraphBoundary.
2129         Also used enums instead of bools in a couple of places. Removed some unneeded friend
2130         declarations for comparison operators that use only public members.
2131         * khtml/xml/dom_position.cpp:
2132         (DOM::Position::Position): Coding style tweak.
2133         (DOM::Position::startParagraphBoundary): Added.
2134         (DOM::Position::endParagraphBoundary): Added.
2135         (DOM::Position::upstream): Use enum parameter instead of bool.
2136         (DOM::Position::downstream): Ditto.
2137         (DOM::Position::rendersOnSameLine): Removed unused function. Noticed some backwards logic
2138         here, and removed it rather than fixing it.
2139
2140         * khtml/xml/dom_nodeimpl.h: Added traversePreviousNodePostOrder.
2141         * khtml/xml/dom_nodeimpl.cpp:
2142         (NodeImpl::traversePreviousNodePostOrder): Added. For some uses, this function is more analogous
2143         to traverseNextNode in reverse than traversePreviousNode, which does a backwards pre-order traversal.
2144
2145         * kwq/WebCoreBridge.h: Replaced fontForCurrentPosition method with fontForSelection:, added
2146         selectInsertedText parameter to insertText method, and added selectionStartHasStyle: method.
2147         Add WebSelectToParagraphBoundary.
2148         * kwq/WebCoreBridge.mm:
2149         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Added workaround for bug where isRenderedContent
2150         returns false for <br> elements at the ends of lines.
2151         (-[WebCoreBridge insertText:selectInsertedText:]): Added selectInsertedText parameter, passing it
2152         along to TypingCommand::insertText.
2153         (-[WebCoreBridge selectionStartHasStyle:]): Added. Calls code in the part that does the real work.
2154         (-[WebCoreBridge fontForSelection:]): Ditto.
2155
2156         * kwq/KWQKHTMLPart.h: Renamed fontForCurrentPosition to fontForSelection, and added a feature
2157         where it tells us whether there are multiple fonts in the selection or not.
2158         * kwq/KWQKHTMLPart.mm:
2159         (KWQKHTMLPart::fontForSelection): Rewrote this to be a bit simpler, and added code to detect
2160         whether there are multiple fonts in the selection.
2161         (KWQKHTMLPart::didTellBridgeAboutLoad): Use a global character rather than a bad pointer here.
2162         Better not to rely on undefined behavior.
2163         (KWQKHTMLPart::documentFragmentWithText): Use lowercase HTML. I believe this works better when
2164         the document is XML, and we should probably visit all callers and change them.
2165         (KWQKHTMLPart::registerCommandForUndo): Call get() instead of handle().
2166         (KWQKHTMLPart::registerCommandForRedo): Call get() instead of handle().
2167
2168         * khtml/misc/shared.h: Added a private, non-implemented copy constructor and assignment
2169         operator to Shared<> and TreeShared<> to prevent copying reference counts by accident.
2170         * khtml/rendering/render_style.h: Get rid of Shared<BorderData>, since it's not used that way.
2171         This makes BorderData smaller, and allows it to compile with the change to Shared<>.
2172         * khtml/xml/dom_docimpl.h: Remove unneeded copy constructor on DocumentFragmentImpl,
2173         which ran afoul of the change to Shared<> and was unused.
2174         * khtml/xml/dom_docimpl.cpp: Ditto.
2175         * khtml/xml/dom_stringimpl.cpp:
2176         (DOM::DOMStringImpl::empty): Changed code around so it doesn't run afoul of the change to
2177         Shared<>. The old code was copying a DOMStringImpl.
2178         (DOM::DOMStringImpl::ascii): Added code to null-terminate the string buffer.
2179
2180 2004-09-06  Darin Adler  <darin@apple.com>
2181
2182         Reviewed by John.
2183
2184         - improved computed style code and implemented text-decoration and text-shadow (needed for, e.g., underline)
2185
2186         * khtml/css/css_computedstyle.cpp:
2187         Added CSS_PROP_TEXT_DECORATION to the InheritableProperties array for now even though it's
2188         not inheritable. This makes underline work in some cases for typing style. We may decide to
2189         take it back out again after further consideration.
2190         (DOM::valueForLength): Use IDs in primitive values rather than strings.
2191         (DOM::valueForBorderStyle): Ditto, also renamed this.
2192         (DOM::valueForTextAlign): More of the same.
2193         (DOM::valueForShadow): Added this function.
2194         (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue): More IDs in primitive values.
2195         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Changed all the cases to use
2196         IDs instead of strings in primitive values. Also put the style in a local variable for
2197         better code size and smaller source code too. Added implementation for CSS_PROP_TEXT_DECORATION
2198         and CSS_PROP_TEXT_SHADOW.
2199
2200         * khtml/css/css_valueimpl.cpp:
2201         (CSSValueListImpl::cssText): Put commas between list elements.
2202         (CSSPrimitiveValueImpl::cssText): Fixed some messed up indenting and removed an unneeded
2203         default case that would just prevent a warning if we ever have an unhandled enum value.
2204
2205 2004-09-06  Darin Adler  <darin@apple.com>
2206
2207         Reviewed by John.
2208
2209         - did some clean-up on form data code
2210
2211         * khtml/misc/formdata.h: Added more public functions as suggested by Chris when he reviewed
2212         this class.
2213         * khtml/misc/formdata.cpp: (khtml::FormData::appendFile): Added. Will be needed soon.
2214         * kwq/KWQFormData.mm: (arrayFromFormData): Use new cleaned-up FormData API.
2215
2216 2004-09-06  Darin Adler  <darin@apple.com>
2217
2218         Reviewed by John.
2219
2220         * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration description]): Use cssText in the description
2221         so it's easier to see in the debugger.
2222
2223 2004-09-06  Darin Adler  <darin@apple.com>
2224
2225         Reviewed by John.
2226
2227         * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::send): Remove uneeded QCString copy.
2228
2229 2004-09-04  Richard Williamson   <rjw@apple.com>
2230
2231         Fix build problem on panther.
2232
2233         * khtml/ecma/kjs_html.cpp:
2234         * khtml/rendering/render_canvasimage.h:
2235
2236 2004-09-03  David Hyatt  <hyatt@apple.com>
2237
2238         Simple tweak to background-attachment.  Don't apply the slow repaint flag until after the whole style has been
2239         resolved, since while cascading someone may set the attachment to fixed but later override with scroll.
2240
2241         * khtml/css/cssstyleselector.cpp:
2242         (khtml::CSSStyleSelector::adjustRenderStyle):
2243         (khtml::CSSStyleSelector::applyProperty):
2244
2245 2004-09-03  Richard Williamson   <rjw@apple.com>
2246
2247         Fixed <rdar://problem/3781001>: redirection of URL via resource load delegate does not correctly set base URL for subsequent loads
2248
2249         Ensure that stylesheets have the correct URL when request
2250         is redirected.
2251
2252         Reviewed by Maciej.
2253
2254         * khtml/misc/loader.cpp:
2255         (CachedCSSStyleSheet::checkNotify):
2256         * kwq/KWQLoader.h:
2257         * kwq/KWQLoader.mm:
2258         (KWQIsResponseURLEqualToURL):
2259         (KWQResponseURL):
2260
2261         * khtml/ecma/kjs_html.cpp:
2262         (KJS::Context2DFunction::tryCall):
2263         Compare parameter count with == instead of <=.
2264
2265 2004-09-03  David Hyatt  <hyatt@apple.com>
2266
2267         Fix for 3779083, deleting large amount of text is really slow.  Don't use NodeLists in editing remove commands.
2268         
2269         Reviewed by darin
2270
2271         * khtml/editing/htmlediting_impl.cpp:
2272         (khtml::RemoveNodeCommandImpl::RemoveNodeCommandImpl):
2273         (khtml::RemoveNodePreservingChildrenCommandImpl::doApply):
2274
2275 2004-09-03  Darin Adler  <darin@apple.com>
2276
2277         Reviewed by John.
2278
2279         - fixed <rdar://problem/3714501> REGRESSION (125.8-8A162): Chinese words display as garbage in search results (www.sz.net.cn)
2280
2281         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Resolve URL using the document method
2282         that passes the codec rather than calling the KURL constructor directly.
2283
2284 2004-09-03  Chris Blumenberg  <cblu@apple.com>
2285
2286         Fixed: <rdar://problem/3788409> can't create or clone an embed element
2287
2288         Reviewed by rjw.
2289
2290         * khtml/html/htmlparser.cpp: added fixme about sharing code
2291         * khtml/xml/dom_docimpl.cpp: ditto
2292         (DocumentImpl::createHTMLElement): create and return a HTMLEmbedElementImpl
2293
2294 2004-09-03  Darin Adler  <darin@apple.com>
2295
2296         Reviewed by Chris.
2297
2298         - fixed <rdar://problem/3410112> filename with non-ASCII name for <input type=file> should be sent in the page's encoding
2299
2300         * khtml/html/html_formimpl.cpp: (DOM::HTMLFormElementImpl::formData):
2301         Encode filename using the codec rather than doing the &# dance. It turns out that Mozilla
2302         only does the &# thing under certain circumstances that are not important. Always encoding
2303         the filename is almost certainly better behavior, and will fix many serious problems for
2304         Japanese and Korean users and websites.
2305
2306 2004-09-03  Richard Williamson   <rjw@apple.com>
2307
2308         Made drawImage() in <canvas> compliant with whatwg spec.
2309         
2310         Reviewed by John.
2311
2312         * khtml/ecma/kjs_html.cpp:
2313         (KJS::Context2DFunction::tryCall):
2314         * khtml/html/html_imageimpl.h:
2315         (DOM::HTMLImageElementImpl::pixmap):
2316
2317 2004-09-03  David Hyatt  <hyatt@apple.com>
2318
2319         Fix for 3787686, CSS parser should do case-sensitive matching of ids and attributes only in strict mode
2320         (and not whenever you have an HTML document).
2321         
2322         Reviewed by john
2323
2324         * khtml/css/parser.cpp:
2325         * khtml/css/parser.y:
2326
2327 === Safari-162 ===
2328
2329 2004-09-03  Darin Adler  <darin@apple.com>
2330
2331         Reviewed by John.
2332
2333         - <rdar://problem/3788040> REGRESSION: text that i type into a textarea disappears when i tab out of the textarea
2334
2335         * kwq/KWQTextArea.mm: (-[KWQTextArea textDidChange:]): Bring back an unconditional version of
2336         this method. Earlier, we deleted this method, but we should have instead removed the check.
2337
2338 2004-09-02  David Hyatt  <hyatt@apple.com>
2339
2340         Swap RenderBox and RenderContainer.  Make leaf RenderObjects actually derive off of RenderBox instead.
2341         
2342         Reviewed by kocienda
2343
2344         * khtml/rendering/render_block.cpp:
2345         (khtml::RenderBlock::addChildToFlow):
2346         * khtml/rendering/render_box.cpp:
2347         (RenderBox::RenderBox):
2348         (RenderBox::detach):
2349         * khtml/rendering/render_box.h:
2350         * khtml/rendering/render_container.cpp:
2351         (RenderContainer::RenderContainer):
2352         (RenderContainer::detach):
2353         * khtml/rendering/render_container.h:
2354         * khtml/rendering/render_flow.cpp:
2355         (RenderFlow::detach):
2356         (RenderFlow::dirtyLineBoxes):
2357         (RenderFlow::createInlineBox):
2358         (RenderFlow::getAbsoluteRepaintRect):
2359         (RenderFlow::lowestPosition):
2360         (RenderFlow::rightmostPosition):
2361         (RenderFlow::leftmostPosition):
2362         (RenderFlow::caretPos):
2363         * khtml/rendering/render_flow.h:
2364         (khtml::RenderFlow::RenderFlow):
2365         * khtml/rendering/render_frames.cpp:
2366         (RenderFrameSet::RenderFrameSet):
2367         (RenderFrameSet::nodeAtPoint):
2368         (RenderFrameSet::dump):
2369         * khtml/rendering/render_frames.h:
2370         * khtml/rendering/render_inline.cpp:
2371         (RenderInline::addChildToFlow):
2372         * khtml/rendering/render_replaced.cpp:
2373         * khtml/rendering/render_replaced.h:
2374         (khtml::RenderReplaced::setIntrinsicHeight):
2375         * khtml/rendering/render_table.cpp:
2376         (RenderTableSection::RenderTableSection):
2377         (RenderTableSection::detach):
2378         (RenderTableSection::setStyle):
2379         * khtml/rendering/render_table.h:
2380
2381 2004-09-02  Ken Kocienda  <kocienda@apple.com>
2382
2383         * khtml/editing/htmlediting_impl.h: Fix some inconsistent use of whitespace. No code change.
2384
2385 2004-09-02  Ken Kocienda  <kocienda@apple.com>
2386
2387         Reviewed by Hyatt
2388
2389         Fix for this bug:
2390         
2391         <rdar://problem/3786848> REGRESSION (Mail): Typing styles and font panel updates broken
2392
2393         * khtml/xml/dom_position.cpp:
2394         (DOM::Position::inRenderedContent): Check for inlines that can have kids is wrong.
2395         I busted this the other day when making the PositionIterator class iterate over
2396         all nodes and not just leaves of the DOM tree.
2397         
2398         Update all the following functions. These use the PositionIterator class, but still 
2399         only want to consider leaf nodes.
2400         
2401         (DOM::Position::isFirstRenderedPositionOnLine)
2402         (DOM::Position::isLastRenderedPositionOnLine)
2403         (DOM::Position::isLastRenderedPositionInEditableBlock)
2404         (DOM::Position::inFirstEditableInRootEditableElement)
2405         (DOM::Position::inLastEditableInRootEditableElement)
2406         (DOM::Position::inFirstEditableInContainingEditableBlock)
2407         (DOM::Position::inLastEditableInContainingEditableBlock)
2408
2409 2004-09-02  Richard Williamson   <rjw@apple.com>
2410
2411         Support for patterns in <canvas>
2412
2413         Reviewed by Hyatt.
2414
2415         * khtml/ecma/kjs_html.cpp:
2416         (KJS::Context2DFunction::tryCall):
2417         (Context2D::putValue):
2418         (drawPattern):
2419         (ImagePattern::ImagePattern):
2420         (ImagePattern::~ImagePattern):
2421         * khtml/ecma/kjs_html.h:
2422         (KJS::ImagePattern::getPattern):
2423         (KJS::ImagePattern::pixmap):
2424         * kwq/KWQPixmap.h:
2425         * kwq/KWQPixmap.mm:
2426         (QPixmap::imageRef):
2427         * kwq/WebCoreImageRenderer.h:
2428
2429 2004-09-01  David Hyatt  <hyatt@apple.com>
2430
2431         Fix for 3769409, a regression from 10.3.4 to 10.3.5 involving <colgroup>s in malformed HTML.
2432         
2433         Reviewed by mjs
2434
2435         * khtml/html/htmlparser.cpp:
2436         (KHTMLParser::insertNode):
2437
2438 2004-09-01  David Hyatt  <hyatt@apple.com>
2439
2440         Fix for the <colgroup> crasher.  Make sure adding to an anonymous box just returns immediately. Also eliminate
2441         all the redundant setPos -500000 calls, since we don't need those at all.
2442         
2443         Reviewed by john
2444
2445         * khtml/rendering/render_block.cpp:
2446         (khtml::RenderBlock::addChildToFlow):
2447         (khtml::RenderBlock::makeChildrenNonInline):
2448         * khtml/rendering/render_inline.cpp:
2449         (RenderInline::splitFlow):
2450
2451 2004-09-02  Ken Kocienda  <kocienda@apple.com>
2452
2453         Reviewed by John
2454
2455         Fix for these bugs:
2456         
2457         <rdar://problem/3729219> REGRESSION (Mail): Caret placement and navigation not working correctly at yahoo.com
2458         <rdar://problem/3758606> REGRESSION (Mail): Deletions across DIV elements is broken
2459         <rdar://problem/3784810> REGRESSION (Mail): delete at beginning of line instead deletes to the end of the document (simple reduced test)
2460
2461         I made some very big improvements to the code which handles deletions of selections
2462         which span more than one block.
2463
2464         * khtml/editing/htmlediting_impl.cpp:
2465         (khtml::CompositeEditCommandImpl::deleteUnrenderedText): An new, overloaded version of this
2466         function which works on a NodeImpl. The code in this function fell out of some refactoring
2467         I did in the function with the same name which takes a Position as an argument.
2468         (khtml::DeleteSelectionCommandImpl::moveNodesToBlock): New function. This new logic provides
2469         the smarts to fix the bugs listed above and greatly improves the code to perform deleting 
2470         selections which span more than one block.
2471         (khtml::DeleteSelectionCommandImpl::doApply): Several changes. Constrain downstream positions
2472         so that they stay in the current block. This was a mistake before I think. Add code to detect
2473         when the insertion point is a caret at the start of a block. This is a special-case of a
2474         cross-block selection. Change the end-of-deletion-fixup case to operate on the downstreamEnd
2475         position of the selection rather than the upstream. This is more logical. Refine the block 
2476         merge logic to handle more cases, like dealing with whitespace. 
2477         * khtml/editing/htmlediting_impl.h: Associated header file changes.
2478         * khtml/xml/dom_nodeimpl.cpp: 
2479         (NodeImpl::rootEditableElement): Add code to clamp the return value to the body element.
2480         * khtml/xml/dom_selection.cpp:
2481         (DOM::Selection::validate): Make selection canonicalizations stay in the current block.
2482         * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt:
2483         * layout-tests/editing/deleting/delete-block-merge-contents-001.html:
2484         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: Added.
2485         * layout-tests/editing/deleting/delete-block-merge-contents-002.html: Added.
2486         * layout-tests/editing/deleting/delete-block-merge-contents-003-expected.txt: Added.
2487         * layout-tests/editing/deleting/delete-block-merge-contents-003.html: Added.
2488         * layout-tests/editing/deleting/delete-block-merge-contents-004-expected.txt: Added.
2489         * layout-tests/editing/deleting/delete-block-merge-contents-004.html: Added.
2490         * layout-tests/editing/deleting/delete-block-merge-contents-005-expected.txt: Added.
2491         * layout-tests/editing/deleting/delete-block-merge-contents-005.html: Added.
2492         * layout-tests/editing/deleting/delete-block-merge-contents-006-expected.txt: Added.
2493         * layout-tests/editing/deleting/delete-block-merge-contents-006.html: Added.
2494         * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Added.
2495         * layout-tests/editing/deleting/delete-block-merge-contents-007.html: Added.
2496         * layout-tests/editing/deleting/delete-block-merge-contents-008-expected.txt: Added.
2497         * layout-tests/editing/deleting/delete-block-merge-contents-008.html: Added.
2498         * layout-tests/editing/deleting/delete-block-merge-contents-009-expected.txt: Added.
2499         * layout-tests/editing/deleting/delete-block-merge-contents-009.html: Added.
2500         * layout-tests/editing/deleting/delete-block-merge-contents-010-expected.txt: Added.
2501         * layout-tests/editing/deleting/delete-block-merge-contents-010.html: Added.
2502         * layout-tests/editing/deleting/delete-block-merge-contents-011-expected.txt: Added.
2503         * layout-tests/editing/deleting/delete-block-merge-contents-011.html: Added.
2504         * layout-tests/editing/inserting/insert-3654864-fix-expected.txt: Updated with new results.
2505         * layout-tests/editing/inserting/insert-3654864-fix.html: Updated test to deal better with
2506         improved select all behavior.
2507         * layout-tests/editing/selection/select-all-003-expected.txt: Updated with new results.
2508
2509 2004-09-01  Richard Williamson   <rjw@apple.com>
2510
2511         Fixed panther build glitch.
2512
2513         Reviewed by Ken.
2514
2515         * khtml/ecma/kjs_html.cpp:
2516
2517 2004-09-01  Richard Williamson   <rjw@apple.com>
2518
2519         Finished implementation of gradient support in <canvas>.
2520
2521         Reviewed by John.
2522
2523         * khtml/ecma/kjs_html.cpp:
2524         (KJS::HTMLElementFunction::tryCall):
2525         (isGradient):
2526         (isImagePattern):
2527         (KJS::Context2DFunction::tryCall):
2528         (Context2D::putValue):
2529         (Context2D::Context2D):
2530         (KJS::GradientFunction::tryCall):
2531         (gradientCallback):
2532         (Gradient::commonInit):
2533         (Gradient::Gradient):
2534         (Gradient::~Gradient):
2535         (Gradient::getShading):
2536         (Gradient::addColorStop):
2537         (sortStops):
2538         (Gradient::colorStops):
2539         * khtml/ecma/kjs_html.h:
2540         (KJS::ColorStop::ColorStop):
2541         * khtml/ecma/kjs_html.lut.h:
2542         (KJS::):
2543
2544 2004-09-01  David Hyatt  <hyatt@apple.com>
2545
2546         Fix for 3784686, hidden links still active.  Make sure text nodes exclude themselves from nodeAtPoint checks
2547         when hidden.
2548         
2549         * khtml/rendering/render_text.cpp:
2550         (RenderText::nodeAtPoint):
2551
2552 2004-08-31  David Hyatt  <hyatt@apple.com>
2553
2554         Fixes for 3761411 and 3782201.  This patch makes two changes to percentage heights.  First it makes sure that
2555         replaced elements always flex inside a cell (unlike blocks and tables, which do so only sometimes under bizarre
2556         conditions that are still being guessed at by me).  The second fix is a recognition that empty tables do not
2557         actually honor their heights, and so it is a mistake to try to flex them.
2558         
2559         Reviewed by mjs
2560
2561         * khtml/rendering/render_table.cpp:
2562         (RenderTableSection::layoutRows):
2563         * khtml/rendering/render_table.h:
2564         (khtml::RenderTable::hasSections):
2565
2566 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2567
2568         Reviewed by Hyatt
2569     
2570         Fix for this bug:
2571         
2572         <rdar://problem/3781572> can't paste text in replied message view
2573
2574         * khtml/xml/dom2_rangeimpl.cpp:
2575         (DOM::RangeImpl::toHTML): Copying text placed in an anonymous block was failing
2576         since the code in here depending on the text node's containing block having an
2577         element, which it won't. In fact, using containing block is wrong anyway, since
2578         positioned elements can have containing blocks far from where they live in the
2579         tree. This "move up to block check" should use the more DOM-wise enclosingBlockFlowElement()
2580         in NodeImpl.
2581
2582 2004-08-30  David Hyatt  <hyatt@apple.com>
2583
2584         Fix for 3742585, sony dhtml menus wrong size.  The percentage table height algorithm was wrong.  This patch
2585         unifies the table percentage height algorithm with the block percentage height algorithm and fixes bugs in
2586         both.
2587         
2588         Reviewed by john
2589
2590         * khtml/rendering/render_box.cpp:
2591         (RenderBox::calcPercentageHeight):
2592         * khtml/rendering/render_table.cpp:
2593         (RenderTable::layout):
2594
2595 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2596
2597         Added more editing layout tests.
2598
2599         * layout-tests/editing/deleting/delete-tab-001-expected.txt: Added.
2600         * layout-tests/editing/deleting/delete-tab-001.html: Added.
2601         * layout-tests/editing/deleting/delete-tab-002-expected.txt: Added.
2602         * layout-tests/editing/deleting/delete-tab-002.html: Added.
2603         * layout-tests/editing/deleting/delete-tab-003-expected.txt: Added.
2604         * layout-tests/editing/deleting/delete-tab-003.html: Added.
2605         * layout-tests/editing/deleting/delete-tab-004-expected.txt: Added.
2606         * layout-tests/editing/deleting/delete-tab-004.html: Added.
2607         * layout-tests/editing/editing.js: Fixed a little bug in one of the "delayed" commands.
2608         * layout-tests/editing/inserting/insert-tab-001-expected.txt: Added.
2609         * layout-tests/editing/inserting/insert-tab-001.html: Added.
2610         * layout-tests/editing/inserting/insert-tab-002-expected.txt: Added.
2611         * layout-tests/editing/inserting/insert-tab-002.html: Added.
2612         * layout-tests/editing/inserting/insert-tab-003-expected.txt: Added.
2613         * layout-tests/editing/inserting/insert-tab-003.html: Added.
2614         * layout-tests/editing/inserting/insert-tab-004-expected.txt: Added.
2615         * layout-tests/editing/inserting/insert-tab-004.html: Added.
2616
2617 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2618
2619         Reviewed by John
2620
2621         Fix for this bug:
2622         
2623         <rdar://problem/3782521> Typing newline at start of block does not work
2624
2625         * khtml/editing/htmlediting_impl.cpp:
2626         (khtml::InputNewlineCommandImpl::doApply): Change handling of case to insert
2627         newline at the start of a block.
2628         * layout-tests/editing/inserting/insert-br-006-expected.txt: Updated layout test with
2629         new results.
2630
2631 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2632
2633         Checked in incorrect results for these tests. There are the right ones.
2634
2635         * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
2636         * layout-tests/editing/selection/move-by-line-001-expected.txt
2637
2638 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2639
2640         Added more editing layout tests.
2641
2642         * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
2643         * layout-tests/editing/deleting/collapse-whitespace-3587601-fix.html: Added.
2644         * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt: Added.
2645         * layout-tests/editing/deleting/delete-block-merge-contents-001.html: Added.
2646         * layout-tests/editing/editing.js: Added some more navigation commands.
2647         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
2648         * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
2649         * layout-tests/editing/selection/move-by-line-001-expected.txt: Added.
2650         * layout-tests/editing/selection/move-by-line-001.html: Added.
2651         * layout-tests/editing/style/typing-style-003-expected.txt: Added.
2652         * layout-tests/editing/style/typing-style-003.html: Added.
2653
2654 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2655
2656         Added more editing layout tests. Renamed some others.
2657
2658         * layout-tests/editing/inserting/insert-br-001-expected.txt: Added.
2659         * layout-tests/editing/inserting/insert-br-001.html: Added.
2660         * layout-tests/editing/inserting/insert-br-002-expected.txt: Added.
2661         * layout-tests/editing/inserting/insert-br-002.html: Added.
2662         * layout-tests/editing/inserting/insert-br-003-expected.txt: Added.
2663         * layout-tests/editing/inserting/insert-br-003.html: Added.
2664         * layout-tests/editing/inserting/insert-br-004-expected.txt: Added.
2665         * layout-tests/editing/inserting/insert-br-004.html: Added.
2666         * layout-tests/editing/inserting/insert-br-005-expected.txt: Added.
2667         * layout-tests/editing/inserting/insert-br-005.html: Added.
2668         * layout-tests/editing/inserting/insert-br-006-expected.txt: Added.
2669         * layout-tests/editing/inserting/insert-br-006.html: Added.
2670         * layout-tests/editing/inserting/insert-br-case1-expected.txt: Removed.
2671         * layout-tests/editing/inserting/insert-br-case1.html: Removed.
2672         * layout-tests/editing/inserting/insert-br-case2-expected.txt: Removed.
2673         * layout-tests/editing/inserting/insert-br-case2.html: Removed.
2674         * layout-tests/editing/inserting/insert-br-case3-expected.txt: Removed.
2675         * layout-tests/editing/inserting/insert-br-case3.html: Removed.
2676         * layout-tests/editing/inserting/insert-br-case6-expected.txt: Removed.
2677         * layout-tests/editing/inserting/insert-br-case6.html: Removed.
2678         * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt: Added.
2679         * layout-tests/editing/inserting/insert-text-with-newlines.html: Added.
2680
2681 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2682
2683         * layout-tests/editing/editing.js: Modified typeCharacterCommand so it can accept a character
2684         as an argument.
2685
2686 2004-08-31  Ken Kocienda  <kocienda@apple.com>
2687
2688         Reviewed by Hyatt
2689
2690         Fix for these bugs:
2691
2692         <rdar://problem/3777629> REGRESSION (Mail): can't delete blank lines in quoted text in HTML mail replies
2693         <rdar://problem/3780309> REGRESSION (Mail): can't delete past an empty span in a particular test case
2694         <rdar://problem/3780315> REGRESSION (Mail): right arrow works incorrectly in a particular test case with an empty span
2695         <rdar://problem/3780320> REGRESSION (Mail): left arrow works incorrectly in a particular test case with an empty span
2696         <rdar://problem/3780336> REGRESSION (Mail): down arrow fails in a reduction of a Mail reply test case (seems to be inside a span)
2697
2698         * khtml/xml/dom_position.cpp:
2699         (DOM::Position::upstream): If this position's node is a block, use it for the StayInBlock case, not the block's
2700         enclosing block.
2701         (DOM::Position::downstream): Ditto.
2702         (DOM::Position::inRenderedContent): Refine the case for non-text nodes. This was erroneously returning true
2703         for any empty element (like <span></span>).
2704         * khtml/xml/dom_positioniterator.cpp: Change the following four functions to consider all nodes, not just
2705         leaves of the DOM tree. This is a step towards making this iteration less cranky and unpredictable, and
2706         was necessary to do now to keep the inRenderedContent() change above from breaking editign layout tests.
2707         (DOM::PositionIterator::peekPrevious)
2708         (DOM::PositionIterator::peekNext)
2709         (DOM::PositionIterator::atStart)
2710         (DOM::PositionIterator::atEnd)
2711         * kwq/KWQKHTMLPart.mm:
2712         (KWQKHTMLPart::fontForCurrentPosition): Check that the position being checked is an element and that the
2713         element is in rendered content. I ran across some null-check failures while I was coding this fix, and
2714         the additions seem prudent.
2715         
2716         Updated these layout tests with new results.
2717         
2718         * layout-tests/editing/deleting/delete-3608430-fix-expected.txt:
2719         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2720         * layout-tests/editing/deleting/delete-block-contents-001-expected.txt:
2721         * layout-tests/editing/deleting/delete-block-contents-002-expected.txt:
2722         * layout-tests/editing/deleting/delete-block-contents-003-expected.txt:
2723         * layout-tests/editing/deleting/delete-image-004-expected.txt:
2724         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
2725         * layout-tests/editing/editing.js:
2726         * layout-tests/editing/execCommand/boldSelection-expected.txt:
2727         * layout-tests/editing/execCommand/italicizeByCharacter-expected.txt:
2728         * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt:
2729         * layout-tests/editing/execCommand/print-expected.txt:
2730         * layout-tests/editing/execCommand/selectAll-expected.txt:
2731         * layout-tests/editing/selection/extend-by-character-002-expected.txt:
2732         * layout-tests/editing/selection/extend-by-character-004-expected.txt:
2733         * layout-tests/editing/selection/extend-by-character-005-expected.txt:
2734         * layout-tests/editing/selection/extend-by-character-006-expected.txt:
2735         * layout-tests/editing/selection/select-all-001-expected.txt:
2736         * layout-tests/editing/selection/select-all-002-expected.txt:
2737         * layout-tests/editing/selection/select-all-003-expected.txt:
2738
2739 2004-08-30  Darin Adler  <darin@apple.com>
2740
2741         Reviewed by John.
2742
2743         - fixed <rdar://problem/3637519> REGRESSION (125-128): unrepro crash in QListBox::sizeForNumberOfLines at istweb.apple.com
2744
2745         * kwq/KWQListBox.h: Added a clearCachedTextRenderers function.
2746         * kwq/KWQListBox.mm:
2747         (itemTextRenderer): Change to use globals that are outside the function, and added retain calls.
2748         (groupLabelTextRenderer): Ditto.
2749         (QListBox::clearCachedTextRenderers): Release global text renderers and nil out the globals.
2750
2751         * kwq/WebCoreBridge.h: Removed updateAllViews; not needed any more.
2752         * kwq/WebCoreBridge.mm: Ditto.
2753
2754         * kwq/WebCoreTextRendererFactory.h: Added a clearCaches method.
2755         * kwq/WebCoreTextRendererFactory.mm:
2756         (-[WebCoreTextRendererFactory clearCaches]): Added. Tells all the views to repaint after clearing the cached
2757         text renderers from KWQListBox. To be more elegant, we could generalize the KWQListBox trick, but for now why bother?
2758
2759         * kwq/WebCoreTextRendererFactory.m: Removed. I needed to put some C++ code in here, so changed the extension to .mm.
2760         * WebCore.pbproj/project.pbxproj: Removed WebCoreTextRendererFactory.m, and added WebCoreTextRendererFactory.mm.
2761
2762 2004-08-30  Darin Adler  <darin@apple.com>
2763
2764         Reviewed by John.
2765
2766         - fixed <rdar://problem/3528538> can paste a Return character into the Search field at amazon.com, other browsers won't
2767
2768         * kwq/KWQTextField.mm: (-[KWQTextFieldController controlTextDidChange:]):
2769         Truncate text before the first line break.
2770
2771 2004-08-30  Darin Adler  <darin@apple.com>
2772
2773         * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC):
2774         Added some more assertions I used to track down what looks like a TEC bug.
2775
2776 2004-08-30  Darin Adler  <darin@apple.com>
2777
2778         Reviewed by Ken.
2779
2780         - fixed <rdar://problem/3779122> No accesskey support on LABEL element
2781
2782         * khtml/html/html_formimpl.h: Change type of m_currValue to DOMString. Should have been done
2783         as part of my form data check-in, but harmless to do now. Add accessKeyAction function for
2784         HTMLLabelElementImpl.
2785         * khtml/html/html_formimpl.cpp:
2786         (DOM::HTMLButtonElementImpl::parseHTMLAttribute): Remove conversion of DOMString to QString
2787         for m_currValue.
2788         (DOM::HTMLLabelElementImpl::formElement): If there's no "for" attribute, search children for
2789         the first control.
2790         (DOM::HTMLLabelElementImpl::accessKeyAction): Forward the accesskey action to the formElement.
2791
2792 2004-08-30  Darin Adler  <darin@apple.com>
2793
2794         Reviewed by Dave.
2795
2796         - fixed <rdar://problem/3303968> final newline character omitted from <textarea> when parsing a new page
2797
2798         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::processListing): Handle newline pending
2799         cases as well as space and tab pending spaces at the end of this function. This seems right for
2800         both scripts and text areas; it's not clear why omittiing the LF is ever needed. Tested by running
2801         all the layout tests; no regressions.
2802
2803         - fixed <rdar://problem/3552736> word wrapped text fields that blur/focus when you type move the insertion point strangely (vtext.com)
2804
2805         * khtml/rendering/render_form.cpp: (RenderTextArea::updateFromElement): Call text() instead of
2806         calling widget->text() directly. This prevents this function from running in cases where the
2807         text didn't really change for text areas in wrap mode.
2808
2809 2004-08-30  Darin Adler  <darin@apple.com>
2810
2811         Reviewed by Dave.
2812
2813         - got rid of ERROR message when running layout tests by implementing text-transform in computed style
2814
2815         * khtml/css/css_computedstyle.cpp:
2816         (DOM::numberAsString): Added. Helper that returns "1" rather then "1.0" for integer values.
2817         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Fixed use of tabs instead of
2818         spaces. Fixed switch statements so they don't use default so we get errors if we leave
2819         a case out. Changed callers to use numberAsString instead of QString::number. Added implementation
2820         of CSS_PROP_TEXT_TRANSFORM. Added code to prevent falling through to next property when no item
2821         in a switch statement matches.
2822
2823 2004-08-30  Darin Adler  <darin@apple.com>
2824
2825         Reviewed by Chris.
2826
2827         - did work to prepare for uploading files incrementally when submitting forms
2828
2829         * khtml/misc/formdata.h: Added. Class for holding form data inside WebCore.
2830         * khtml/misc/formdata.cpp: Added.
2831
2832         * khtml/html/html_formimpl.h: Added the FormDataList type, changed the formData function parameters
2833         and made it private, renamed the encoding method to appendFormData and changed the parameters around.
2834         * khtml/html/html_formimpl.cpp:
2835         (DOM::FormDataList): Added. Class that replaces the old use of QValueList<QCString> for form data.
2836         Later we'll change it to accomodate filenames too.
2837         (DOM::HTMLFormElementImpl::formData): Changed code to use FormDataList intsead of the old encodingList.
2838         Also changed to return the "OK" result as the function result and put the form data into something
2839         passed as an "out" parameter; the old way was the other way around.
2840         (DOM::HTMLFormElementImpl::submit): Change to use FormData rather than a QByteArray when getting the
2841         form data to submit.
2842         (DOM::HTMLButtonElementImpl::appendFormData): Rename from encoding, and use the new appendData function
2843         instead of the old way of doing += to put data on the list.
2844         (DOM::HTMLInputElementImpl::appendFormData): Ditto.
2845         (DOM::HTMLSelectElementImpl::appendFormData): Ditto.
2846         (DOM::HTMLKeygenElementImpl::appendFormData): Ditto.
2847         (DOM::HTMLTextAreaElementImpl::appendFormData): Ditto.
2848         (DOM::FormDataList::FormDataList): Added.
2849         (DOM::FormDataList::appendString): Added.
2850         (DOM::FormDataList::begin): Added.
2851         (DOM::FormDataList::end): Added.
2852
2853         * khtml/khtml_part.h: Changed the type of the submitForm parameter to FormData instead of QByteArray.
2854         * khtml/khtmlpart_p.h: Changed the type of the submitFormData data member to FormData instead of QByteArray.
2855         * khtml/khtml_part.cpp: (KHTMLPart::submitForm): Called the new flattenToString function in all the
2856         code that handles mailto forms. Called the new flatten function in the non-Apple code path.
2857
2858         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Pass NSArray for form data instead of NSData.
2859
2860         * kwq/KWQKJob.h: Use FormData instead of QByteArray. A couple other small cleanups.
2861         * kwq/KWQKJobClasses.h: Ditto.
2862         * kwq/KWQKJobClasses.mm:
2863         (KIO::TransferJobPrivate::TransferJobPrivate): Ditto.
2864         (KIO::TransferJob::TransferJob): Ditto.
2865         (KIO::TransferJob::postData): Ditto.
2866         * kwq/KWQKPartsBrowserExtension.h: Ditto.
2867         * kwq/KWQLoader.mm:
2868         (KWQServeRequest): Ditto.
2869         (KWQServeSynchronousRequest): Ditto.
2870
2871         * kwq/KWQFormData.h: Added. A function to convert KHTML form data into an NSArray for communication
2872         with the WebKit side.
2873         * kwq/KWQFormData.mm: Added.
2874
2875         * kwq/WebCoreBridge.h: Pass NSArray instead of NSData for form data.
2876
2877         * kwq/KWQArrayImpl.h: Added a detach member function. The old version would do unnecessary work when
2878         detach was called on an array that had exactly one reference.
2879         * kwq/KWQArrayImpl.mm: (KWQArrayImpl::detach): Added.
2880         * kwq/KWQMemArray.h: (QMemArray::detach): Call through to KWQArrayImpl.
2881
2882         * kwq/KWQValueList.h:
2883         (QValueList::first): Added overload for non-const.
2884         (QValueList::last): Ditto.
2885
2886         * ForwardingHeaders/misc/formdata.h: Added.
2887         * WebCore.pbproj/project.pbxproj: Added formdata.h, formdata.cpp, KWQFormData.h, and KWQFormData.cpp.
2888
2889         * WebCore-tests.exp: Updated for changes to QValueList, and re-sorted.
2890         * WebCore-combined.exp: Regenerated.
2891
2892 2004-08-30  Darin Adler  <darin@apple.com>
2893
2894         Reviewed by Ken.
2895
2896         - improved multiple submit logic in preparation for making command-click on a form
2897           button load a form in another frame
2898
2899         * kwq/KWQKHTMLPart.h: Added const to a bunch of member functions for cleanup.
2900         Added prepareForUserAction member function.
2901         * kwq/KWQKHTMLPart.mm:
2902         (KWQKHTMLPart::submitForm): Simplified logic and removed special case for "http" and "https".
2903         (KWQKHTMLPart::renderer): Added const.
2904         (KWQKHTMLPart::keyEvent): Added call to prepareForUserAction.
2905         (KWQKHTMLPart::lastEventIsMouseUp): Added const.
2906         (KWQKHTMLPart::eventMayStartDrag): Added const.
2907         (KWQKHTMLPart::mouseDown): Added call to prepareForUserAction.
2908         (KWQKHTMLPart::overrideMediaType): Added const.
2909         (KWQKHTMLPart::canGoBackOrForward): Added const.
2910         (KWQKHTMLPart::prepareForUserAction): Added. Clears _submittedFormURL.
2911         * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityPerformAction:]): Added call to prepareForUserAction.
2912
2913 2004-08-30  Ken Kocienda  <kocienda@apple.com>
2914
2915         Reviewed by John
2916
2917         Fix for this bug:
2918
2919         <rdar://problem/3762231> REGRESSION (Mail): tab key inserts a single space
2920
2921         * khtml/editing/htmlediting_impl.cpp:
2922         (khtml::isTab): New helper. Checks a DOMString to see if it is one character and
2923         that character is a tab.
2924         (khtml::InputTextCommandImpl::execute): Trap tabs before handling insertion of
2925         other kinds of whitespace. Treat a tab like four spaces. Rearrange the code to
2926         update the ending position after the text insertion to cover the new tab case
2927         where the amount of advance is not the same as the number of character in the
2928         passed-in DOMString (i.e. tabs expand to four characters).
2929         
2930 2004-08-27  Ken Kocienda  <kocienda@apple.com>
2931
2932         Reviewed by Chris
2933
2934         Fix for this bug:
2935         
2936         <rdar://problem/3779706> plain text on pasteboard loses indentation when pasted into Blot
2937
2938         * kwq/KWQKHTMLPart.h:
2939         * kwq/KWQKHTMLPart.mm:
2940         (KWQKHTMLPart::documentFragmentWithText): New function that takes over the code from
2941         KWQKHTMLPart and improves it to handle converting tabs and spaces for suitable
2942         display in HTML.
2943         * kwq/WebCoreBridge.mm:
2944         (-[WebCoreBridge documentFragmentWithText:]): Move smarts from here to KWQKHTMLPart.
2945
2946 2004-08-27  Maciej Stachowiak  <mjs@apple.com>
2947
2948         Reviewed by John.
2949
2950         <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website
2951
2952         Because we will stop parsing when there is a pending redirection,
2953         avoid setting one if no navigation would actually take place
2954         because the number of steps is out of range.
2955         
2956         * khtml/khtml_part.cpp:
2957         (KHTMLPart::scheduleHistoryNavigation):
2958         * kwq/KWQKHTMLPart.h:
2959         * kwq/KWQKHTMLPart.mm:
2960         (KWQKHTMLPart::canGoBackOrForward):
2961         * kwq/KWQKPartsBrowserInterface.h:
2962         * kwq/WebCoreBridge.h:
2963
2964 2004-08-27  Maciej Stachowiak  <mjs@apple.com>
2965
2966         Reviewed by Chris.
2967
2968         - fixed <rdar://problem/3778043> REGRESSION: innerHTML is broken, breaks automated iBench testing
2969         - also fixed outerHTML, which would spill over past the node for whch it was supposed to get HTML
2970         
2971         * khtml/html/html_elementimpl.cpp:
2972         (HTMLElementImpl::outerHTML):
2973         * khtml/xml/dom2_rangeimpl.cpp:
2974         (DOM::RangeImpl::toHTML):
2975         * khtml/xml/dom_nodeimpl.cpp:
2976         (NodeImpl::toHTML):
2977         (NodeImpl::recursive_toString):
2978         (NodeImpl::recursive_toHTML):
2979         * khtml/xml/dom_nodeimpl.h:
2980         * kwq/WebCoreBridge.mm:
2981         (-[WebCoreBridge markupStringFromNode:nodes:]):
2982
2983         - added new layout tests to cover the problems I fixed
2984         
2985         * layout-tests/fast/innerHTML/001-expected.txt: Added.
2986         * layout-tests/fast/innerHTML/001.html: Added.
2987         * layout-tests/fast/innerHTML/002-expected.txt: Added.
2988         * layout-tests/fast/innerHTML/002.html: Added.
2989         * layout-tests/fast/innerHTML/003-expected.txt: Added.
2990         * layout-tests/fast/innerHTML/003.html: Added.
2991
2992 2004-08-27  David Hyatt  <hyatt@apple.com>
2993
2994         Fix for 3739239, getComputedStyle of top not being implemented broke a site that checked for it.
2995         
2996         Reviewed by kocienda
2997
2998         * khtml/css/css_computedstyle.cpp:
2999         (DOM::valueForLength):
3000         (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue):
3001         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3002         * khtml/css/css_computedstyle.h:
3003
3004 2004-08-27  John Sullivan  <sullivan@apple.com>
3005
3006         Reviewed by Ken.
3007         
3008         Tweaked option-tab handling to match good suggestion from Tim Omernick of OmniWeb
3009
3010         * kwq/KWQTextArea.mm:
3011         removed override of textDidChange:
3012         (-[KWQTextAreaTextView keyDown:]):
3013         moved option-tab handling that was in textDidChange to here. Rearranged existing code
3014         a little for clarity.
3015
3016 2004-08-27  Adele Amchan  <adele@apple.com>
3017
3018         Reviewed by Darin.
3019
3020         Fix for:
3021         <rdar://problem/3689949> Provide contentWindow access on an iframe
3022
3023         * khtml/ecma/kjs_html.cpp:
3024         (KJS::HTMLElement::getValueProperty): added cases for contentWindow for frames and iframes
3025         * khtml/ecma/kjs_html.h: added contentWindow to the list of properties for frames and iframes
3026         * khtml/ecma/kjs_html.lut.h: regenerated file
3027         * khtml/html/html_baseimpl.cpp:
3028         (HTMLFrameElementImpl::contentPart): factored out old contentDocument code to return KHTMLPart for frame
3029         (HTMLFrameElementImpl::contentDocument): now just gets the contentDocument from contentPart
3030         * khtml/html/html_baseimpl.h: added declaration for contentPart
3031
3032 === Safari-161 ===
3033
3034 2004-08-27  Ken Kocienda  <kocienda@apple.com>
3035
3036         Reviewed by Darin
3037
3038         Fix for this bug:
3039         
3040         <rdar://problem/3778059> Odd behaviour when editing between blockquote elements
3041
3042         * khtml/editing/htmlediting_impl.cpp:
3043         (khtml::CompositeEditCommandImpl::deleteUnrenderedText): This function should not move
3044         the selection out of the current block, ever. This is exactly what the bug reported.
3045         What was I thinking? Now, the code looks at the passed-in position and then the equivalent
3046         upstream and downstream positions to see if the selection can be placed there after the
3047         delete, and settles on the block containing the passed-in position as a fallback.
3048         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
3049         * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
3050
3051 2004-08-26  Richard Williamson   <rjw@apple.com>
3052
3053         Boiler plate for canvas gradients and patterns.
3054
3055         Reviewed by John.
3056
3057         * khtml/ecma/kjs_html.cpp:
3058         (KJS::Context2DFunction::tryCall):
3059         (Context2D::tryPut):
3060         (Context2D::~Context2D):
3061         (KJS::GradientFunction::tryCall):
3062         (Gradient::Gradient):
3063         (Gradient::tryGet):
3064         (Gradient::getValueProperty):
3065         (Gradient::tryPut):
3066         (Gradient::putValue):
3067         (Gradient::~Gradient):
3068         (ImagePattern::ImagePattern):
3069         (ImagePattern::tryGet):
3070         (ImagePattern::getValueProperty):
3071         (ImagePattern::tryPut):
3072         (ImagePattern::putValue):
3073         (ImagePattern::~ImagePattern):
3074         * khtml/ecma/kjs_html.h:
3075         (KJS::Gradient::toBoolean):
3076         (KJS::Gradient::classInfo):
3077         (KJS::Gradient::):
3078         (KJS::ImagePattern::toBoolean):
3079         (KJS::ImagePattern::classInfo):
3080         (KJS::ImagePattern::):
3081         * khtml/ecma/kjs_html.lut.h:
3082         (KJS::):
3083
3084 2004-08-26  Ken Kocienda  <kocienda@apple.com>
3085
3086         Reviewed by John
3087
3088         Fix for this bug:
3089         
3090         <rdar://problem/3777899> REGRESSION (Mail): only first of several misspelled words separated by 
3091         carriage returns is marked
3092
3093         * khtml/editing/htmlediting_impl.cpp:
3094         (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Give the spellchecker a slightly larger 
3095         selection to work with while typing. This should preclude bugs of this type.
3096
3097 2004-08-26  Ken Kocienda  <kocienda@apple.com>
3098
3099         Reviewed by Chris
3100         
3101         Fix for this bug:
3102         
3103         <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
3104
3105         * khtml/rendering/render_box.cpp:
3106         (RenderBox::caretPos): Always use the font height for calculating the caret height in 
3107         non-replaced elements (like blocks), rather than the height of the box.
3108
3109 2004-08-26  Ken Kocienda  <kocienda@apple.com>
3110
3111         Silly me. Forgot to add this file before.
3112
3113         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: Added.
3114
3115 2004-08-26  David Hyatt  <hyatt@apple.com>
3116
3117         Fix for 3777172, crash from nested colgroup.  Don't allow nested table sections or col groups.
3118         
3119         Reviewed by darin
3120
3121         * khtml/html/htmlparser.cpp:
3122         (KHTMLParser::insertNode):
3123
3124 2004-08-26  Ken Kocienda  <kocienda@apple.com>
3125
3126         Reviewed by Hyatt
3127
3128         Fix for this bug:
3129         
3130         <rdar://problem/3775316> document sprouts an extra newline character at the end
3131
3132         * khtml/editing/htmlediting_impl.cpp:
3133         (khtml::InputNewlineCommandImpl::doApply): There was in insufficient check
3134         in the code which adds extra BR elements at the ends of blocks, which we do 
3135         to work around the fact that BR elements, when they are the last element in a
3136         block, do not render. Now the code sees whether there already is one of these
3137         extra BR's in the document and won't add and "extra" extra. 
3138         * layout-tests/editing/inserting/insert-3775316-fix.html: Added.
3139
3140 2004-08-26  David Hyatt  <hyatt@apple.com>
3141
3142         Fix for 3710721 and 3504114, crashes because of bad ownership model for list markers.
3143         
3144         Reviewed by mjs
3145
3146         * khtml/rendering/render_container.cpp:
3147         (RenderContainer::detach):
3148         * khtml/rendering/render_list.cpp:
3149         (RenderListItem::setStyle):
3150         (RenderListItem::detach):
3151         (RenderListItem::updateMarkerLocation):
3152         * khtml/rendering/render_list.h:
3153
3154 2004-08-26  Ken Kocienda  <kocienda@apple.com>
3155
3156         Reviewed by John
3157
3158         * khtml/editing/htmlediting_impl.cpp:
3159         (khtml::ApplyStyleCommandImpl::doApply): Remove the StayInBlock modifier from the
3160         call to upstream when passing the start position to removeStyle(). This makes the
3161         start position sufficiently upstream so that all relevant style tags are removed.
3162         (khtml::ApplyStyleCommandImpl::removeStyle): Pass the start position to nodeFullySelected.
3163         (khtml::ApplyStyleCommandImpl::nodeFullySelected): Change interface so start position
3164         for calculation is passed in, rather than recalculating it every time.
3165         * khtml/editing/htmlediting_impl.h: nodeFullySelected interface change.
3166         * khtml/xml/dom_position.h: Add a comment about the working of upstream() and
3167         downstream().
3168
3169 2004-08-26  Ken Kocienda  <kocienda@apple.com>
3170
3171         Fix garbled contenteditable attribute. I must have checked
3172         this in with a typo.
3173
3174         * layout-tests/editing/deleting/delete-3775172-fix.html
3175
3176 2004-08-25  Kevin Decker  <kdecker@apple.com>
3177
3178         Reviewed by John and Maciej.
3179
3180         - Fixes SAP bug <rdar://problem/3751295> Personalize link at the
3181         top gives an error in the pop-up window. 
3182
3183         * khtml/ecma/kjs_window.cpp:
3184         (WindowFunc::tryCall): Passes a referrer to KHTMLPart::begin() 
3185
3186 2004-08-25  Richard Williamson   <rjw@apple.com>
3187
3188         Updated to <canvas> API to match the spec.  (Still need
3189         to implement gradients and patterns.)
3190
3191         Reviewed by Ken.
3192
3193         * khtml/ecma/kjs_html.cpp:
3194         (KJS::Context2DFunction::tryCall):
3195         (Context2D::getValueProperty):
3196         (Context2D::drawingContext):
3197         (Context2D::colorRefFromValue):
3198         (Context2D::colorFromValue):
3199         (Context2D::setShadow):
3200         (Context2D::putValue):
3201         (Context2D::save):
3202         (Context2D::restore):
3203         (Context2D::Context2D):
3204         * khtml/ecma/kjs_html.h:
3205         (KJS::Context2D::):
3206         * khtml/ecma/kjs_html.lut.h:
3207         (KJS::):
3208
3209 2004-08-25  Ken Kocienda  <kocienda@apple.com>
3210
3211         * layout-tests/editing/deleting/delete-3775172-fix.html: Wrong version of test checked in
3212         a moment ago.
3213
3214 2004-08-25  Ken Kocienda  <kocienda@apple.com>
3215
3216         Added test case for <rdar://problem/3775172> Blot crashes after typing one character then deleting it
3217
3218         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Added.
3219         * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
3220
3221 2004-08-25  Ken Kocienda  <kocienda@apple.com>
3222
3223         * layout-tests/editing/style/style-3690704-fix-expected.txt: Fewer styling spans added
3224         on this test as a result of the previously-checked-in fix.
3225
3226 2004-08-25  Ken Kocienda  <kocienda@apple.com>
3227
3228         Reviewed by John
3229
3230         Fix for this bug:
3231         
3232         <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style
3233
3234         * khtml/editing/htmlediting_impl.cpp:
3235         (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
3236         now in the iteration when attempting to find nodes that can be styled together with one span.
3237         * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
3238         bug fix.
3239
3240 2004-08-25  Ken Kocienda  <kocienda@apple.com>
3241
3242         Reviewed by John
3243
3244         Fix for this bug:
3245         
3246         <rdar://problem/3775172> Blot crashes after typing one character then deleting it
3247
3248         * khtml/css/css_computedstyle.cpp:
3249         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Bail early if the element
3250         being queried does not have a renderer or that renderer does not have a style. Prevents
3251         a crash in the cases that it does not.
3252         * khtml/editing/htmlediting_impl.cpp:
3253         (khtml::DeleteSelectionCommandImpl::doApply): Add one more case to deleting when the
3254         start and end nodes are different. If the downstream end node is the last node in the
3255         block, then it may need to be deleted completely. Before this patch, the code
3256         erroneously assumed that any deletion in this node had to be trimming of a text node.
3257         This was asserted, and the description in 3775172 shows a simple case where this assertion
3258         does not hold. The additional case and associated checks now make it all better.
3259         * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
3260
3261 2004-08-25  David Hyatt  <hyatt@apple.com>
3262
3263         Fix for 3365086, large tables crash Safari.  Make sure to use ints rather than shorts for row and column
3264         counts.  Also fix a pathological array resize scenario for tables as rows are added.
3265         
3266         Reviewed by darin
3267
3268         * khtml/rendering/render_table.cpp:
3269         (RenderTable::splitColumn):
3270         (RenderTable::appendColumn):
3271         (RenderTableSection::RenderTableSection):
3272         (RenderTableSection::ensureRows):
3273         (RenderTableSection::setCellWidths):
3274         (RenderTableSection::calcRowHeight):
3275         (RenderTableSection::layoutRows):
3276         (RenderTableSection::paint):
3277         (RenderTableSection::recalcCells):
3278         (RenderTableSection::clearGrid):
3279         * khtml/rendering/render_table.h:
3280         (khtml::RenderTableSection::numRows):
3281
3282 2004-08-25  David Hyatt  <hyatt@apple.com>
3283
3284         To save memory in the common case, move the margin***Collapse variables into the CSS3 struct instead of
3285         bloating the surround struct.
3286         
3287         * khtml/rendering/render_style.cpp:
3288         (StyleSurroundData::StyleSurroundData):
3289         (StyleSurroundData::operator==):
3290         (marginBottomCollapse):
3291         (StyleCSS3NonInheritedData::operator==):
3292         (RenderStyle::diff):
3293         * khtml/rendering/render_style.h:
3294         (khtml::RenderStyle::marginTopCollapse):
3295         (khtml::RenderStyle::marginBottomCollapse):
3296         (khtml::RenderStyle::setMarginTopCollapse):
3297         (khtml::RenderStyle::setMarginBottomCollapse):
3298
3299 2004-08-25  David Hyatt  <hyatt@apple.com>
3300
3301         Fix the "extra space in TypePad blogs" Emerson problem by adding the ability to collapse away margins.
3302         Also added support for explicitly preventing margin collapsing.
3303         
3304         Reviewed by mjs
3305
3306         * khtml/css/cssparser.cpp:
3307         (CSSParser::parseValue):
3308         * khtml/css/cssproperties.c:
3309         (hash_prop):
3310         (findProp):
3311         * khtml/css/cssproperties.h:
3312         * khtml/css/cssproperties.in:
3313         * khtml/css/cssstyleselector.cpp:
3314         (khtml::CSSStyleSelector::applyProperty):
3315         * khtml/css/cssvalues.c:
3316         (hash_val):
3317         (findValue):
3318         * khtml/css/cssvalues.h:
3319         * khtml/css/cssvalues.in:
3320         * khtml/rendering/render_block.cpp:
3321         (khtml::RenderBlock::isSelfCollapsingBlock):
3322         (khtml::RenderBlock::layoutBlockChildren):
3323         * khtml/rendering/render_style.cpp:
3324         (StyleSurroundData::StyleSurroundData):