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