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