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