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