Reviewed by Ken Kocienda.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-11-17  David Harrison  <harrison@apple.com>
2
3         Reviewed by Ken Kocienda.
4         
5         Make sure previousLineStart is non-null before calling compareBoundaryPoints.
6         Treat null case as meaning no post-move merge is needed.
7
8         * khtml/editing/htmlediting.cpp:
9         (khtml::DeleteSelectionCommand::initializePositionData):
10
11 2004-11-17  David Harrison  <harrison@apple.com>
12         
13         Added displayNode and displayTree methods for debugging.  Fixed comment typo in dispatchChildRemovalEvents.
14         * khtml/xml/dom_nodeimpl.cpp:
15         (NodeImpl::displayNode):
16         (NodeImpl::displayTree):
17         (NodeBaseImpl::dispatchChildRemovalEvents):
18         * khtml/xml/dom_nodeimpl.h:
19
20 2004-11-16  John Sullivan  <sullivan@apple.com>
21
22         Reviewed by Richard.
23         
24         - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
25
26         * khtml/khtml_part.cpp:
27         (editingStyle):
28         delete the list we created when we're done with it
29
30 2004-11-16  Ken Kocienda  <kocienda@apple.com>
31
32         Reviewed by John
33         
34         It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
35         Instead, I replaced this with a helper function that derefs DOM nodes stored in a 
36         QPtrList when the list goes out of scope.
37
38         * khtml/editing/htmlediting.cpp:
39         (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
40         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
41         (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
42         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):  
43         No longer set lists to autodelete.
44         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
45          Call new derefNodesInList helper.
46         * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
47         of one before, but now it does.
48
49 2004-11-15  David Harrison  <harrison@apple.com>
50
51         Reviewed by Chris and Darin.
52         
53         <rdar://problem/3880304> Non-linear performance hit for style changes
54
55         * khtml/xml/dom_nodeimpl.cpp:
56         (NodeImpl::traverseNextNode):
57         (NodeImpl::traverseNextSibling):
58         (NodeImpl::traversePreviousNodePostOrder):
59         Return 0 rather than traversing beyond stayWithin when this == stayWithin.
60         Add asserts that stayWithin is an ancestor of the returned node.
61
62 2004-11-15  Darin Adler  <darin@apple.com>
63
64         Reviewed by Ken.
65
66         - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
67
68         * khtml/css/css_computedstyle.cpp:
69         (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
70         since there's no guarantee it's already ref'd.
71         * khtml/css/css_valueimpl.cpp:
72         (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
73         (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
74         (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
75         (CSSStyleDeclarationImpl::merge): Ditto.
76         (CSSStyleDeclarationImpl::diff): Ditto.
77         * khtml/editing/htmlediting.cpp:
78         (khtml::StyleChange::currentlyHasStyle): Ditto.
79         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
80         * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
81         * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
82
83 2004-11-15  Darin Adler  <darin@apple.com>
84
85         Reviewed by Ken.
86
87         Use separate mutable style and computed style types as appropriate.
88         For now this should have no effect, but it prepares us for refactoring later.
89         Also remove some unnecessary "DOM::" prefixes and in one case factor out
90         some shared code.
91
92         * khtml/khtml_part.cpp:
93         (KHTMLPart::typingStyle):
94         (KHTMLPart::setTypingStyle):
95         (updateState):
96         (KHTMLPart::selectionHasStyle):
97         (KHTMLPart::selectionStartHasStyle):
98         (KHTMLPart::selectionComputedStyle):
99         * khtml/khtml_part.h:
100         * khtml/khtmlpart_p.h:
101
102         * khtml/css/css_base.h:
103         * khtml/css/css_ruleimpl.cpp:
104         (CSSStyleRuleImpl::setDeclaration):
105         * khtml/css/css_ruleimpl.h:
106         (DOM::CSSFontFaceRuleImpl::style):
107         (DOM::CSSPageRuleImpl::style):
108         (DOM::CSSStyleRuleImpl::style):
109         (DOM::CSSStyleRuleImpl::declaration):
110         * khtml/css/css_valueimpl.h:
111         (DOM::CSSPrimitiveValueImpl::):
112         * khtml/css/cssparser.cpp:
113         (CSSParser::parseValue):
114         (CSSParser::parseColor):
115         (CSSParser::parseDeclaration):
116         (CSSParser::createStyleDeclaration):
117         * khtml/css/cssparser.h:
118         * khtml/css/cssstyleselector.cpp:
119         (khtml::CSSStyleSelector::addMatchedDeclaration):
120         (khtml::CSSStyleSelector::matchRulesForList):
121         (khtml::CSSStyleSelector::styleForElement):
122         (khtml::CSSStyleSelector::applyDeclarations):
123         * khtml/css/cssstyleselector.h:
124         * khtml/css/parser.cpp:
125         * khtml/css/parser.y:
126         * khtml/dom/css_rule.h:
127         * khtml/dom/css_stylesheet.h:
128         * khtml/dom/css_value.h:
129         * khtml/dom/dom2_views.cpp:
130         * khtml/xml/dom2_viewsimpl.cpp:
131         (DOM::AbstractViewImpl::getComputedStyle):
132         * khtml/xml/dom_docimpl.cpp:
133         (DocumentImpl::importNode):
134         (DocumentImpl::setStyleSheet):
135         * khtml/xml/dom_docimpl.h:
136         * khtml/xml/dom_xmlimpl.cpp:
137         (DOM::ProcessingInstructionImpl::setStyleSheet):
138         * khtml/xml/dom_xmlimpl.h:
139
140         * khtml/dom/css_value.cpp:
141         (DOM::throwException): Added.
142         (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
143         The real thing is coming with the next change to refactor.
144         (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
145         (DOM::CSSPrimitiveValue::setStringValue): Ditto.
146
147 2004-11-15  Darin Adler  <darin@apple.com>
148
149         Reviewed by Ken.
150
151         - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
152
153         * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
154         dispatchSubtreeModifiedEvent, so it can be called in cases where only the
155         node's attributes changed without sending a misleading childrenChanged call,
156         but the childrenChanged call can happen at the exact right moment.
157         * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
158         (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
159         the boolean true is passed in.
160
161         * khtml/xml/dom_elementimpl.cpp:
162         (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
163         (NamedAttrMapImpl::removeAttribute): Ditto.
164
165 2004-11-15  John Sullivan  <sullivan@apple.com>
166
167         Reviewed by Ken.
168         
169         - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet, 
170         seen often in Mail and Blot
171
172         * khtml/css/css_valueimpl.cpp:
173         (CSSStyleDeclarationImpl::copyPropertiesInSet):
174         delete temporary list after we're done using it
175
176 2004-11-15  Richard Williamson   <rjw@apple.com>
177
178         Fixed leak (3879883) that John found.  Early return leaked
179         allocated instance.
180
181         Reviewed by John.
182
183         * khtml/css/css_computedstyle.cpp:
184         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
185
186 2004-11-15  Ken Kocienda  <kocienda@apple.com>
187
188         Reviewed by John
189
190         Fix for this bug:
191         
192         <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
193
194         Fixed a couple of object lifetime issues. The EditCommand class used to hold an
195         EditCommandPtr to its parent, but this caused a a reference cycle in composite 
196         commands as the children held a ref to their parent. Now, the parent variable
197         is a non-retained reference to an EditCommand *. It would be nice to have a 
198         weak reference to the parent or even override deref in composite commands (but I
199         can't since deref() is not virtual). However, this should be OK since any
200         dangling parent pointer is a sign of a bigger object lifetime problem that
201         would need to be addressed anyway.
202
203         * khtml/css/css_valueimpl.cpp:
204         (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a 
205         QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
206         just assigning the list variable passed in to the local list variable, or the list will be 
207         double-deleted.
208         * khtml/editing/htmlediting.cpp:
209         (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
210         (khtml::EditCommand::setEndingSelection): Ditto.
211         (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
212         Unrelated to the change, but saves some ref's and deref's.
213         (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
214         * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
215         EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
216         (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
217
218 2004-11-15  Maciej Stachowiak  <mjs@apple.com>
219
220         Reviewed by Kevin.
221
222         <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
223         
224         * khtml/xml/dom_nodeimpl.cpp:
225         (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
226         isLengthCacheValid.
227         (NodeListImpl::recursiveLength): Adjusted for rename.
228         (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
229         If the same offset is looked up again, just return it, otherwise, if looking up
230         a later offset, start at the last item and proceed from there.
231         (NodeListImpl::itemById): Apply the special document optimization to all
232         nodes that are either a document or in a document - just walk up to make
233         sure the node found by ID has the root node as an ancestor.
234         (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
235         * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
236
237 2004-11-15  John Sullivan  <sullivan@apple.com>
238
239         Reviewed by Ken.
240         
241         - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
242
243         * kwq/KWQKHTMLPart.mm:
244         (KWQKHTMLPart::documentFragmentWithText):
245         release mutable copy of string after we're done using it
246
247 2004-11-14  Kevin Decker  <kdecker@apple.com>
248
249         Reviewed by mjs.
250
251         fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
252
253         * khtml/html/html_elementimpl.cpp:
254         (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
255         (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
256
257 2004-11-13  Maciej Stachowiak  <mjs@apple.com>
258
259         Reviewed by Kevin.
260
261         <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
262
263         * khtml/dom/dom_node.cpp:
264         (NodeList::itemById): New method, just forward to impl.
265         * khtml/dom/dom_node.h: Prototype it.
266         * khtml/ecma/kjs_dom.cpp:
267         (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
268         let the NodeList do it. The NodeList might be able to do it more efficiently.
269         * khtml/xml/dom_nodeimpl.cpp:
270         (NodeListImpl::itemById): Optimize for the case where the NodeList
271         covers the whole document. In this case, just use getElementById,
272         then check that the element satisfies the list criteria.
273         (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
274         (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
275         * khtml/xml/dom_nodeimpl.h:
276
277 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
278
279         Reviewed by Gramps.
280
281         - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
282         sometimes using a huge bogus length value.
283         
284         * khtml/xml/dom_nodeimpl.cpp:
285         (NodeListImpl::NodeListImpl): Initialize isCacheValid.
286
287 2004-11-12  Darin Adler  <darin@apple.com>
288
289         Reviewed by Maciej.
290
291         - fixed an infinite loop in that last check-in
292
293         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
294         Added a ++i to the loop so it won't get stuck on the first element in the list.
295
296 2004-11-12  Maciej Stachowiak  <mjs@apple.com>
297
298         Reviewed by Kevin.
299
300         - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
301         
302         I fixed this by changing NodeLists to cache their length, but
303         invalidate it whenever there is a change in the DOM subtree at
304         which they are rooted. This makes NodeListImpl::recursiveLength()
305         drop completely off the profile, since we were repeatedly getting
306         a length for the same NodeList over and over.
307         
308         * khtml/xml/dom_nodeimpl.cpp:
309         (NodeImpl::NodeImpl):
310         (NodeImpl::~NodeImpl):
311         (NodeImpl::registerNodeList):
312         (NodeImpl::unregisterNodeList):
313         (NodeImpl::notifyLocalNodeListsSubtreeModified):
314         (NodeImpl::notifyNodeListsSubtreeModified):
315         (NodeImpl::dispatchSubtreeModifiedEvent):
316         (NodeListImpl::NodeListImpl):
317         (NodeListImpl::~NodeListImpl):
318         (NodeListImpl::recursiveLength):
319         (NodeListImpl::recursiveItem):
320         (NodeListImpl::rootNodeSubtreeModified):
321         (ChildNodeListImpl::ChildNodeListImpl):
322         (ChildNodeListImpl::length):
323         (ChildNodeListImpl::item):
324         (TagNodeListImpl::TagNodeListImpl):
325         (TagNodeListImpl::length):
326         (TagNodeListImpl::item):
327         (NameNodeListImpl::NameNodeListImpl):
328         (NameNodeListImpl::length):
329         (NameNodeListImpl::item):
330         * khtml/xml/dom_nodeimpl.h:
331
332 2004-11-12  Darin Adler  <darin@apple.com>
333
334         Reviewed by Maciej.
335
336         - various small cleanups
337
338         * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
339         * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
340
341         * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
342         * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
343         * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
344         * khtml/html/htmltokenizer.cpp:
345         (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
346         (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
347
348         * khtml/khtml_part.h: Removed docImpl function.
349         * khtml/khtml_part.cpp: Ditto.
350
351         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
352         the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
353
354         * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
355         * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
356         part of the change last time, which is why the build broke).
357         (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
358         (KWQKHTMLPart::setPolicyBaseURL): Ditto.
359         (KWQKHTMLPart::keyEvent): Ditto.
360         (KWQKHTMLPart::dispatchCPPEvent): Ditto.
361         (KWQKHTMLPart::bodyBackgroundColor): Ditto.
362
363 2004-11-12  Chris Blumenberg  <cblu@apple.com>
364
365         <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
366
367         Reviewed by rjw.
368
369         * kwq/KWQKHTMLPart.mm:
370         (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
371
372 === Safari-171 ===
373
374 2004-11-12  Darin Adler  <darin@apple.com>
375
376         Reviewed by Kevin.
377
378         - fixed a couple places that would not work for XML documents
379
380         * khtml/ecma/kjs_window.cpp:
381         (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
382         is present on the base class.
383         (WindowFunc::tryCall): More of the same.
384
385 2004-11-12  Darin Adler  <darin@apple.com>
386
387         - land versions of these files generated by the newer gperf
388
389         People building on Panther will continue to see these files modified.
390         A workaround would be to install the newer gperf on our Tiger build machines.
391
392         * khtml/css/cssproperties.c: Regenerated.
393         * khtml/css/cssvalues.c: Regenerated.
394         * khtml/html/doctypes.cpp: Regenerated.
395         * khtml/html/kentities.c: Regenerated.
396         * khtml/misc/htmlattrs.c: Regenerated.
397         * khtml/misc/htmltags.c: Regenerated.
398         * kwq/KWQColorData.c: Regenerated.
399
400 2004-11-11  Richard Williamson   <rjw@apple.com>
401         
402         Fix build horkage from previous checkin.
403                 
404         * kwq/KWQKHTMLPart.h:
405
406 2004-11-11  Darin Adler  <darin@apple.com>
407
408         Reviewed by John.
409
410         - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
411
412         * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
413
414         * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
415         * kwq/KWQKHTMLPart.mm:
416         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
417         method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
418         we started with the NSTextField as first responder, and then took focus away and gave it back, which
419         makes dragging text work again.
420         (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
421
422 2004-11-11  David Hyatt  <hyatt@apple.com>
423
424         Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
425         
426         Reviewed by vicki
427
428         * khtml/html/htmltokenizer.cpp:
429         (khtml::HTMLTokenizer::continueProcessing):
430
431 2004-11-11  Ken Kocienda  <kocienda@apple.com>
432
433         Reviewed by Maciej
434
435         * khtml/editing/htmlediting.cpp:
436         (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
437         of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
438         with the prevailing style for the VisiblePosition class.
439         * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files. 
440         * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
441         (khtml::visiblePositionsInDifferentBlocks): New helper method.
442         (khtml::isLastVisiblePositionInBlock): Ditto.
443         (khtml::isLastVisiblePositionInNode): Ditto.
444         * khtml/editing/visible_position.h: Add declarations for new functions.
445
446 2004-11-11  Ken Kocienda  <kocienda@apple.com>
447
448         Reviewed by Hyatt
449
450         * khtml/editing/htmlediting.cpp:
451         (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
452         (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
453         (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
454         (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
455         (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
456         * khtml/xml/dom2_rangeimpl.cpp:
457         (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
458         * khtml/xml/dom2_rangeimpl.h: Ditto.
459
460 2004-11-11  Ken Kocienda  <kocienda@apple.com>
461
462         Reviewed by Harrison
463
464         Some improvements to deleting when complete lines are selected.
465
466         * khtml/editing/htmlediting.cpp:
467         (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
468         the end of a selection is fully selected. Turn off block merging in this case.
469         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
470         whether a BR immediately followed a block. The old code could erroneously skip nodes.
471         (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
472         start block is selected. This new code will now delete this block in one call, rather
473         than iterating over each child.
474         * khtml/editing/visible_position.cpp:
475         (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
476         to do the work mentioned above in the comment for that function.
477         (khtml::isFirstVisiblePositionOnLine): Ditto.
478         (khtml::isLastVisiblePositionOnLine): Ditto.
479         * khtml/editing/visible_position.h: Add new functions.
480         * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
481         * layout-tests/editing/deleting/delete-line-001.html: Added.
482         * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
483         * layout-tests/editing/deleting/delete-line-002.html: Added.
484         * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
485         * layout-tests/editing/deleting/delete-line-003.html: Added.
486         * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
487         * layout-tests/editing/deleting/delete-line-004.html: Added.
488         * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
489         * layout-tests/editing/deleting/delete-line-005.html: Added.
490         * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
491         * layout-tests/editing/deleting/delete-line-006.html: Added.
492         * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
493         * layout-tests/editing/deleting/delete-line-007.html: Added.
494         * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
495         * layout-tests/editing/deleting/delete-line-008.html: Added.
496         * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
497         * layout-tests/editing/deleting/delete-line-009.html: Added.
498         * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
499         * layout-tests/editing/deleting/delete-line-010.html: Added.
500         * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
501         * layout-tests/editing/deleting/delete-line-011.html: Added.
502         * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
503         * layout-tests/editing/deleting/delete-line-012.html: Added.
504
505 2004-11-11  Ken Kocienda  <kocienda@apple.com>
506
507         Reviewed by Adele
508
509         * khtml/editing/htmlediting.cpp:
510         (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
511
512 2004-11-11  Ken Kocienda  <kocienda@apple.com>
513
514         Reviewed by John
515
516         Fix for these bugs:
517
518         <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
519         <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
520
521         * khtml/editing/selection.cpp:
522         (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
523         the next line position when necessary.
524         * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
525         * layout-tests/editing/selection/move-3875618-fix.html: Added.
526         * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
527         * layout-tests/editing/selection/move-3875641-fix.html: Added.
528
529 2004-11-11  Ken Kocienda  <kocienda@apple.com>
530
531         Reviewed by John
532
533         Improved some function names, at John's urging. No changes to the
534         functions themselves.
535         
536         canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
537         canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
538         performGeneralDelete() --> handleGeneralDelete()
539
540         * khtml/editing/htmlediting.cpp:
541         (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
542         (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
543         (khtml::DeleteSelectionCommand::handleGeneralDelete)
544         (khtml::DeleteSelectionCommand::doApply)
545         * khtml/editing/htmlediting.h
546
547 2004-11-11  Ken Kocienda  <kocienda@apple.com>
548
549         Reviewed by John
550         
551         Updated some layout test results that changed as a result of my last checking.
552         Added a new test that has been in my tree for a few days.
553
554         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
555         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
556         * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
557         * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
558
559 2004-11-11  Ken Kocienda  <kocienda@apple.com>
560
561         Reviewed by John
562
563         * khtml/editing/htmlediting.cpp:
564         (khtml::debugNode): New debugging helper.
565         (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
566         startPositionForDelete() and endPositionForDelete() functions. Just use the 
567         m_selectionToDelete object to determine start and end positions for the delete.
568         (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
569         function that creates a special case for deleting all the content in a root
570         editable element.
571         (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
572         function before BR special case and the general case delete functions.
573         * khtml/editing/htmlediting.h: Updated for changed functions.
574
575 2004-11-10  Kevin Decker  <kdecker@apple.com>
576
577         Reviewed by mjs.
578         
579         Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.  
580
581         * khtml/ecma/kjs_dom.cpp:
582         (DOMNodeList::tryGet): Got rid of an unnecessary node traversal. 
583
584 2004-11-10  Ken Kocienda  <kocienda@apple.com>
585
586         Reviewed by Chris
587
588         * khtml/editing/htmlediting.cpp:
589         (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
590         smart delete from the two functions below to here. There was an unnecessary double 
591         calculation of the leading and trailing whitespace positions. Also refined the trailing
592         case so it only acts when the leading position is null (which seems to match TextEdit in
593         my tests). Also removed some unnecessary copying of Position objects.
594         (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
595         from here.
596         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
597
598 2004-11-10  Ken Kocienda  <kocienda@apple.com>
599
600         Reviewed by Harrison
601
602         (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
603         make things more clear.
604         * khtml/editing/selection.cpp:
605         (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the 
606         resulting positions do not cross block boundaries. This was a bug and caused some
607         delete problems when whole blocks were selected. I will be addressing that issue
608         more fully in upcoming changes.
609
610 2004-11-10  Ken Kocienda  <kocienda@apple.com>
611
612         Reviewed by Harrison
613
614         Some cleanups and fixes in upstream and downstream functions. 
615         
616         Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement(). 
617         Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the 
618         block's enclosing block will be returned. 
619         
620         Remove code from upstream that confined the serach to block boundaries outside of
621         the code which runs in the StayInBlock case. This code was redundant, and caused
622         incorrect results to be returned in the DoNotStayInBlock case.
623         
624         In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
625         node, not the the this pointer's node.
626
627         * khtml/xml/dom_position.cpp:
628         (DOM::Position::upstream)
629         (DOM::Position::downstream)
630
631 2004-11-09  David Hyatt  <hyatt@apple.com>
632
633         Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
634         loading large local files.
635         
636         Reviewed by mjs
637
638         * khtml/html/htmltokenizer.cpp:
639         (khtml::HTMLTokenizer::HTMLTokenizer):
640         (khtml::HTMLTokenizer::reset):
641         (khtml::HTMLTokenizer::write):
642         (khtml::HTMLTokenizer::stopped):
643         (khtml::HTMLTokenizer::processingData):
644         (khtml::HTMLTokenizer::continueProcessing):
645         (khtml::HTMLTokenizer::timerEvent):
646         (khtml::HTMLTokenizer::allDataProcessed):
647         (khtml::HTMLTokenizer::end):
648         (khtml::HTMLTokenizer::finish):
649         (khtml::HTMLTokenizer::notifyFinished):
650         * khtml/html/htmltokenizer.h:
651         * khtml/khtml_part.cpp:
652         (KHTMLPart::slotFinished):
653         (KHTMLPart::end):
654         (KHTMLPart::stop):
655         * khtml/khtml_part.h:
656         (KHTMLPart::tokenizerProcessedData):
657         * khtml/khtmlview.cpp:
658         * khtml/xml/dom_docimpl.cpp:
659         * khtml/xml/xml_tokenizer.h:
660         (khtml::Tokenizer::stopped):
661         (khtml::Tokenizer::processingData):
662         * kwq/KWQDateTime.h:
663         * kwq/KWQDateTime.mm:
664         (QDateTime::secsTo):
665         (KWQUIEventTime::uiEventPending):
666         * kwq/KWQKHTMLPart.h:
667         * kwq/KWQKHTMLPart.mm:
668         (KWQKHTMLPart::tokenizerProcessedData):
669         * kwq/WebCoreBridge.h:
670         * kwq/WebCoreBridge.mm:
671         (-[WebCoreBridge stop]):
672         (-[WebCoreBridge numPendingOrLoadingRequests]):
673         (-[WebCoreBridge doneProcessingData]):
674
675 2004-11-09  David Harrison  <harrison@apple.com>
676
677         Reviewed by Ken Kocienda.
678
679                 <rdar://problem/3865837> Wrong text style after delete to start of document
680                 
681         * khtml/editing/htmlediting.cpp:
682         (khtml::DeleteSelectionCommand::saveTypingStyleState):
683         Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
684
685 2004-11-09  Richard Williamson   <rjw@apple.com>
686
687         Fixed <rdar://problem/3872440> NSTimer prematurely released.
688
689         Reviewed by Darin.
690
691         * kwq/KWQTimer.mm:
692         (QTimer::fire):
693         * kwq/KWQWidget.mm:
694         (QWidget::paint):
695
696 2004-11-09  Chris Blumenberg  <cblu@apple.com>
697
698         Reviewed by vicki.
699
700         * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
701
702 2004-11-08  David Harrison  <harrison@apple.com>
703
704         Reviewed by Ken Kocienda.
705
706                 <rdar://problem/3865854> Deleting first line deletes all lines
707                 
708         * khtml/editing/htmlediting.cpp:
709         (khtml::DeleteSelectionCommand::performGeneralDelete):
710         Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
711         of its ancestors, failed to end the loop that deletes all fully selected nodes.  Also,
712         fixed this code to clear m_trailingWhitespaceValid.  Also removed dead m_endingPosition
713         update because it is handled in calculateEndingPosition now.
714         * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
715         * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
716
717 2004-11-08  Ken Kocienda  <kocienda@apple.com>
718
719         Reviewed by Hyatt
720
721         * khtml/html/html_elementimpl.cpp:
722         (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
723         are added to the DOM.
724         * khtml/html/html_elementimpl.h: Ditto.
725         * khtml/html/htmlparser.cpp:
726         (KHTMLParser::KHTMLParser): Ditto.
727         (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
728         * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
729         * khtml/html/htmltokenizer.cpp:
730         (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
731         (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
732         There were a couple of indexing errors that resulted in the comment text containing part of the 
733         comment markers.
734         (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
735         * khtml/html/htmltokenizer.h:  Add flag to constructor so callers can request comment nodes.
736
737 2004-11-08  Chris Blumenberg  <cblu@apple.com>
738
739         Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
740
741         Reviewed by darin.
742
743         * WebCore.pbproj/project.pbxproj: stop unnecessary linking
744         * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
745         * kwq/KWQKHTMLPart.h: ditto
746
747 2004-11-08  Darin Adler  <darin@apple.com>
748
749         Reviewed by John.
750
751         - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
752
753         * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
754         that possibly deletes the QTimer.
755
756 2004-11-08  Chris Blumenberg  <cblu@apple.com>
757
758         Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
759
760         Reviewed by john.
761
762         * kwq/KWQTextField.mm:
763         (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
764         * kwq/WebCoreBridge.h:
765
766 2004-11-08  David Harrison  <harrison@apple.com>
767
768         Reviewed by Darin.
769         
770         Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
771
772         * khtml/editing/htmlediting.cpp:
773         (khtml::DeleteSelectionCommand::moveNodesAfterNode):
774         * khtml/xml/dom_nodeimpl.cpp:
775         (NodeImpl::enclosingInlineElement):
776         * khtml/xml/dom_nodeimpl.h:
777
778 2004-11-05  Chris Blumenberg  <cblu@apple.com>
779
780         Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
781
782         Reviewed by rjw.
783
784         * khtml/editing/htmlediting.cpp:
785         (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
786         * khtml/editing/visible_position.cpp:
787         (khtml::VisiblePosition::character): new, returns the character for the position
788         * khtml/editing/visible_position.h:
789         * kwq/KWQKHTMLPart.h:
790         * kwq/KWQKHTMLPart.mm:
791         (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
792         * kwq/WebCoreBridge.h:
793
794 === Safari-170 ===
795
796 2004-11-05  Adele Amchan  <adele@apple.com>
797
798         Reviewed by Darin
799
800         Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
801         and a workaround for displaying transparent backgrounds for textareas.
802
803         * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
804         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
805         * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class, 
806           on the contentView, and on the textView.
807
808 2004-11-04  David Hyatt  <hyatt@apple.com>
809
810         Fix for relpositioned inlines.  This was reviewed a long time ago, but I can't recall who reviewed it (either
811         darin or ken).
812         
813         Reviewed by darin or ken
814
815         * khtml/rendering/bidi.cpp:
816         (khtml::appendRunsForObject):
817         (khtml::RenderBlock::skipWhitespace):
818         (khtml::RenderBlock::findNextLineBreak):
819         * khtml/rendering/render_block.cpp:
820         (khtml::RenderBlock::lowestPosition):
821         (khtml::RenderBlock::rightmostPosition):
822         (khtml::RenderBlock::leftmostPosition):
823         * khtml/rendering/render_box.cpp:
824         (RenderBox::position):
825         * khtml/rendering/render_box.h:
826         (khtml::RenderBox::staticX):
827         (khtml::RenderBox::staticY):
828         * khtml/rendering/render_layer.cpp:
829         (RenderLayer::updateLayerPosition):
830         (RenderLayer::convertToLayerCoords):
831         * khtml/rendering/render_line.cpp:
832         (khtml::InlineFlowBox::placeBoxesHorizontally):
833         * khtml/rendering/render_object.h:
834         (khtml::RenderObject::staticX):
835         (khtml::RenderObject::staticY):
836
837         Finish turning on XSLT.  Make sure child stylesheets can load.
838         
839         * khtml/xsl/xslt_processorimpl.cpp:
840         (DOM::stylesheetLoadFunc):
841         (DOM::XSLTProcessorImpl::transformDocument):
842
843 2004-11-04  David Hyatt  <hyatt@apple.com>
844
845         Implement CSS3 support for multiple backgrounds.  Also fix a bug with background propagation so that it only
846         happens (from the <body> to the root) for HTML documents.  Fixed background-position to handle a mixture of
847         keyword and length values.
848
849         Reviewed by darin
850
851         * khtml/css/cssparser.cpp:
852         (CSSParser::parseValue):
853         (CSSParser::addBackgroundValue):
854         (CSSParser::parseBackgroundShorthand):
855         (CSSParser::parseBackgroundColor):
856         (CSSParser::parseBackgroundImage):
857         (CSSParser::parseBackgroundPositionXY):
858         (CSSParser::parseBackgroundPosition):
859         (CSSParser::parseBackgroundProperty):
860         (CSSParser::parseColorFromValue):
861         * khtml/css/cssparser.h:
862         * khtml/css/cssstyleselector.cpp:
863         (khtml::CSSStyleSelector::adjustRenderStyle):
864         (khtml::CSSStyleSelector::applyProperty):
865         (khtml::CSSStyleSelector::mapBackgroundAttachment):
866         (khtml::CSSStyleSelector::mapBackgroundImage):
867         (khtml::CSSStyleSelector::mapBackgroundRepeat):
868         (khtml::CSSStyleSelector::mapBackgroundXPosition):
869         (khtml::CSSStyleSelector::mapBackgroundYPosition):
870         * khtml/css/cssstyleselector.h:
871         * khtml/rendering/render_box.cpp:
872         (RenderBox::paintRootBoxDecorations):
873         (RenderBox::paintBoxDecorations):
874         (RenderBox::paintBackgrounds):
875         (RenderBox::paintBackground):
876         (RenderBox::paintBackgroundExtended):
877         * khtml/rendering/render_box.h:
878         * khtml/rendering/render_form.cpp:
879         (RenderFieldset::paintBoxDecorations):
880         * khtml/rendering/render_line.cpp:
881         (khtml::InlineFlowBox::paintBackgrounds):
882         (khtml::InlineFlowBox::paintBackground):
883         (khtml::InlineFlowBox::paintBackgroundAndBorder):
884         * khtml/rendering/render_line.h:
885         * khtml/rendering/render_object.cpp:
886         (RenderObject::setStyle):
887         (RenderObject::updateBackgroundImages):
888         (RenderObject::getVerticalPosition):
889         * khtml/rendering/render_object.h:
890         (khtml::RenderObject::paintBackgroundExtended):
891         * khtml/rendering/render_style.cpp:
892         (m_next):
893         (BackgroundLayer::BackgroundLayer):
894         (BackgroundLayer::~BackgroundLayer):
895         (BackgroundLayer::operator=):
896         (BackgroundLayer::operator==):
897         (BackgroundLayer::fillUnsetProperties):
898         (BackgroundLayer::cullEmptyLayers):
899         (StyleBackgroundData::StyleBackgroundData):
900         (StyleBackgroundData::operator==):
901         (RenderStyle::diff):
902         (RenderStyle::adjustBackgroundLayers):
903         * khtml/rendering/render_style.h:
904         (khtml::OutlineValue::operator==):
905         (khtml::OutlineValue::operator!=):
906         (khtml::BackgroundLayer::backgroundImage):
907         (khtml::BackgroundLayer::backgroundXPosition):
908         (khtml::BackgroundLayer::backgroundYPosition):
909         (khtml::BackgroundLayer::backgroundAttachment):
910         (khtml::BackgroundLayer::backgroundRepeat):
911         (khtml::BackgroundLayer::next):
912         (khtml::BackgroundLayer::isBackgroundImageSet):
913         (khtml::BackgroundLayer::isBackgroundXPositionSet):
914         (khtml::BackgroundLayer::isBackgroundYPositionSet):
915         (khtml::BackgroundLayer::isBackgroundAttachmentSet):
916         (khtml::BackgroundLayer::isBackgroundRepeatSet):
917         (khtml::BackgroundLayer::setBackgroundImage):
918         (khtml::BackgroundLayer::setBackgroundXPosition):
919         (khtml::BackgroundLayer::setBackgroundYPosition):
920         (khtml::BackgroundLayer::setBackgroundAttachment):
921         (khtml::BackgroundLayer::setBackgroundRepeat):
922         (khtml::BackgroundLayer::clearBackgroundImage):
923         (khtml::BackgroundLayer::clearBackgroundXPosition):
924         (khtml::BackgroundLayer::clearBackgroundYPosition):
925         (khtml::BackgroundLayer::clearBackgroundAttachment):
926         (khtml::BackgroundLayer::clearBackgroundRepeat):
927         (khtml::BackgroundLayer::setNext):
928         (khtml::BackgroundLayer::operator!=):
929         (khtml::BackgroundLayer::containsImage):
930         (khtml::BackgroundLayer::hasImage):
931         (khtml::BackgroundLayer::hasFixedImage):
932         (khtml::RenderStyle::setBitDefaults):
933         (khtml::RenderStyle::hasBackground):
934         (khtml::RenderStyle::hasFixedBackgroundImage):
935         (khtml::RenderStyle::outlineWidth):
936         (khtml::RenderStyle::outlineStyle):
937         (khtml::RenderStyle::outlineStyleIsAuto):
938         (khtml::RenderStyle::outlineColor):
939         (khtml::RenderStyle::backgroundColor):
940         (khtml::RenderStyle::backgroundImage):
941         (khtml::RenderStyle::backgroundRepeat):
942         (khtml::RenderStyle::backgroundAttachment):
943         (khtml::RenderStyle::backgroundXPosition):
944         (khtml::RenderStyle::backgroundYPosition):
945         (khtml::RenderStyle::accessBackgroundLayers):
946         (khtml::RenderStyle::backgroundLayers):
947         (khtml::RenderStyle::outlineOffset):
948         (khtml::RenderStyle::resetOutline):
949         (khtml::RenderStyle::setBackgroundColor):
950         (khtml::RenderStyle::setOutlineWidth):
951         (khtml::RenderStyle::setOutlineStyle):
952         (khtml::RenderStyle::setOutlineColor):
953         (khtml::RenderStyle::clearBackgroundLayers):
954         (khtml::RenderStyle::inheritBackgroundLayers):
955         (khtml::RenderStyle::setOutlineOffset):
956         * khtml/rendering/render_table.cpp:
957         (RenderTable::paintBoxDecorations):
958         (RenderTableCell::paintBoxDecorations):
959
960 2004-11-04  David Hyatt  <hyatt@apple.com>
961
962         Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
963         Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
964
965         Reviewed by darin
966
967         * kwq/KWQTextCodec.mm:
968         (KWQTextDecoder::convertLatin1):
969         (KWQTextDecoder::convertUTF16):
970         (KWQTextDecoder::convertUsingTEC):
971         (KWQTextDecoder::toUnicode):
972
973 2004-11-04  David Hyatt  <hyatt@apple.com>
974
975         Make sure line-height returns the correct value for normal.
976         
977         Reviewed by darin
978
979         * khtml/css/css_computedstyle.cpp:
980         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
981
982 2004-11-04  David Harrison  <harrison@apple.com>
983
984         Reviewed by Ken Kocienda.
985
986                 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
987                 
988         * khtml/editing/htmlediting.cpp:
989         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
990         to, but not including, the enclosingBlockFlowElement) rather than just the source element.
991         Fixed to insert after the destination subtree, rather than the destination element.  Handles
992         edge case of deleting back to the top of the tree, where there is nothing left to insert after.
993         * khtml/xml/dom_nodeimpl.cpp:
994         (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
995         * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
996         * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
997         * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
998
999 2004-11-03  Ken Kocienda  <kocienda@apple.com>
1000
1001         Reviewed by me
1002         
1003         More layout tests.
1004
1005         * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
1006         * layout-tests/editing/deleting/delete-br-008.html: Added.
1007         * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
1008         * layout-tests/editing/deleting/delete-br-009.html: Added.
1009         * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
1010         * layout-tests/editing/deleting/delete-br-010.html: Added.
1011
1012 2004-11-03  Maciej Stachowiak  <mjs@apple.com>
1013
1014         Fix by Yasuo Kida, reviewed by me.
1015
1016         <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
1017         
1018         * kwq/KWQKHTMLPart.mm:
1019         (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
1020         same as a nil range - setting an empty marked range should clear
1021         the marked range entirely.
1022
1023 2004-11-02  Maciej Stachowiak  <mjs@apple.com>
1024
1025         Reviewed by Dave Hyatt (when I originally coded it).
1026
1027         WebCore part of fix for:
1028
1029         <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
1030         
1031         * kwq/WebCoreBridge.h:
1032         * kwq/WebCoreBridge.mm:
1033         (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
1034         DOMRange, or if the range is split into multiple lines, the rect for the part on
1035         the first line only.
1036         
1037         * khtml/rendering/render_object.cpp:
1038         (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
1039         for the overrides below.
1040         * khtml/rendering/render_object.h:
1041         * khtml/rendering/render_box.cpp:
1042         (RenderBox::caretRect):
1043         * khtml/rendering/render_box.h:
1044         * khtml/rendering/render_br.cpp:
1045         (RenderBR::caretRect):
1046         * khtml/rendering/render_br.h:
1047         * khtml/rendering/render_flow.cpp:
1048         (RenderFlow::caretRect):
1049         * khtml/rendering/render_flow.h:
1050         * khtml/rendering/render_text.cpp:
1051         (RenderText::caretRect):
1052
1053 2004-11-02  Ken Kocienda  <kocienda@apple.com>
1054
1055         Reviewed by Hyatt
1056
1057         Implemented command to insert a block in response to typing a return key (even though
1058         I am not turning that on by default with this patch....that will come later). 
1059         
1060         This new command is called InsertParagraphSeparatorCommand.
1061         
1062         Reworked the command and function names associated with inserting content into a 
1063         document. Before this patch, there were inputXXX and insertXXX variants, with the
1064         former used for more high-level actions and the latter used for lower-level stuff.
1065         However, this was confusing as the AppKit uses insertXXX for everything. This resulted
1066         in an insertXXX command going through an inputXXX WebCore step and then finally to an
1067         insertXXX WebCore step. To make this less confusing, I have changes all the names to
1068         be insertXXX, and modified the lower-level operations so that it is clear what they do.
1069         
1070         * khtml/editing/htmlediting.cpp:
1071         (khtml::EditCommandPtr::isInsertTextCommand): Name change.
1072         (khtml::EditCommand::isInsertTextCommand): Ditto.
1073         (khtml::CompositeEditCommand::inputText): Ditto.
1074         (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
1075         (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
1076         (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
1077         (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
1078         (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
1079         (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
1080         (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
1081         (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
1082         (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
1083         (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
1084         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1085         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1086         (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
1087         (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
1088         (khtml::InsertIntoTextNode::doApply): Ditto.
1089         (khtml::InsertIntoTextNode::doUnapply): Ditto.
1090         (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
1091         (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
1092         (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
1093         (khtml::InsertLineBreakCommand::doApply):
1094         (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
1095         (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
1096         (khtml::InsertNodeBeforeCommand::doApply): Ditto.
1097         (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
1098         (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
1099         (khtml::InsertParagraphSeparatorCommand::doApply):
1100         (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1101         Class name change, was InsertNewlineCommandInQuotedContentCommand.
1102         (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
1103         (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
1104         (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1105         (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
1106         (khtml::InsertTextCommand::doApply): Ditto.
1107         (khtml::InsertTextCommand::deleteCharacter): Ditto.
1108         (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1109         (khtml::InsertTextCommand::input): Ditto.
1110         (khtml::InsertTextCommand::insertSpace): Ditto.
1111         (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
1112         (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
1113         (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
1114         (khtml::TypingCommand::insertParagraphSeparator): New function.
1115         (khtml::TypingCommand::doApply): Name changes, as above.
1116         (khtml::TypingCommand::insertText): Ditto.
1117         (khtml::TypingCommand::deleteKeyPressed): Ditto.
1118         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1119         * khtml/editing/htmlediting.h:
1120         (khtml::DeleteFromTextNodeCommand::node): Name change.
1121         (khtml::DeleteFromTextNodeCommand::offset): Ditto.
1122         (khtml::DeleteFromTextNodeCommand::count): Ditto.
1123         (khtml::InsertIntoTextNode::text): Ditto.
1124         (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
1125         (khtml::InsertNodeBeforeCommand::refChild): Ditto.
1126         (khtml::TypingCommand::): Ditto.
1127         * khtml/editing/jsediting.cpp: Name changes, as above.
1128         * kwq/WebCoreBridge.h:
1129         * kwq/WebCoreBridge.mm:
1130         (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
1131         (-[WebCoreBridge insertParagraphSeparator]): New function.
1132         (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
1133
1134 2004-11-01  Kevin Decker  <kdecker@apple.com>
1135
1136         Reviewed by rjw.
1137
1138         fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
1139         once and for all. 
1140
1141         * khtml/ecma/kjs_window.cpp:
1142         (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
1143
1144 2004-11-01  Darin Adler  <darin@apple.com>
1145
1146         Reviewed by Hyatt.
1147
1148         - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
1149
1150         * khtml/css/html4.css: Use color: initial for textarea and related ones.
1151
1152 2004-11-01  Ken Kocienda  <kocienda@apple.com>
1153
1154         Reviewed by John
1155
1156         Fix for this bug:
1157         
1158         <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
1159
1160         * khtml/css/css_computedstyle.cpp:
1161         (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the 
1162         implementation here into new copyPropertiesInSet helper. This now calls the
1163         generalized copyPropertiesInSet function with the arguments needed to make copying
1164         inheritable work.
1165         * khtml/css/css_computedstyle.h:
1166         * khtml/css/css_valueimpl.cpp:
1167         (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
1168         In order to do apply block properties, "regular" style declarations need to do style
1169         diffs as well.
1170         (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
1171         except that it uses a different set of properties that apply only to blocks.
1172         (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
1173         and copies out those properties listed in a pre-defined set.
1174         * khtml/css/css_valueimpl.h:
1175         * khtml/editing/htmlediting.cpp:
1176         (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
1177         block, factoring out some of the special case code that should now only run in the inline case.
1178         (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
1179         (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
1180         special handling for "legacy" HTML styles like <B> and <I>.
1181         (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
1182         style changes into different kinds. CSS specifies certain properties only apply to certain
1183         element types. This set of changes now recognizes two such separate cases: styles that apply
1184         to blocks, and styles that apply to inlines.
1185         (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
1186         (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
1187         (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
1188         with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
1189         done so that the function can be passed a portion of the styles being applied so that block styles
1190         and inline styles can be handled separately.
1191         (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1192         (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
1193         (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
1194         (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
1195         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
1196         * khtml/editing/htmlediting.h:
1197         (khtml::StyleChange::): Changed as described above.
1198         (khtml::StyleChange::usesLegacyStyles):
1199         (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
1200         it needs to layout, even though it has not changed position in the DOM. For instance, this is needed 
1201         when text align changes.
1202         * khtml/khtml_part.cpp:
1203         (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
1204         the passed-in argument.
1205         (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
1206         is a caret. Formerly, this just set typing style and made no visible changes to the document.
1207
1208         New tests.
1209
1210         * layout-tests/editing/editing.js: Added some glue to change text align.
1211         * layout-tests/editing/style/block-style-001-expected.txt: Added.
1212         * layout-tests/editing/style/block-style-001.html: Added.
1213         * layout-tests/editing/style/block-style-002-expected.txt: Added.
1214         * layout-tests/editing/style/block-style-002.html: Added.
1215         * layout-tests/editing/style/block-style-003-expected.txt: Added.
1216         * layout-tests/editing/style/block-style-003.html: Added.
1217
1218 === Safari-169 ===
1219
1220 2004-10-29  Darin Adler  <darin@apple.com>
1221
1222         Reviewed by Kevin.
1223
1224         - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
1225
1226         * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
1227         before advancing one character; before it did it backwards.
1228
1229 2004-10-29  Chris Blumenberg  <cblu@apple.com>
1230
1231         Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
1232
1233         Reviewed by kocienda, adele.
1234
1235         * khtml/rendering/render_frames.cpp:
1236         (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
1237
1238 2004-10-29  Darin Adler  <darin@apple.com>
1239
1240         Reviewed by Chris.
1241
1242         - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
1243
1244         * khtml/khtmlview.cpp:
1245         (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
1246         deleted before this function finishes running.
1247         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
1248         (KHTMLView::viewportMouseReleaseEvent): Ditto.
1249         (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
1250         is guaranteed to do ref/deref as needed.
1251
1252         * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
1253
1254 2004-10-28  Chris Blumenberg  <cblu@apple.com>
1255
1256         Enabled XSLT on Panther. See intrigue mail for compiling instructions.
1257
1258         Reviewed by darin.
1259
1260         * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
1261         * WebCorePrefix.h: always use XSLT
1262
1263 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1264
1265         Reviewed by Chris
1266
1267         Fix for these bugs:
1268         
1269         <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
1270         <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
1271         
1272         * khtml/editing/htmlediting.cpp:
1273         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members 
1274         to initialization list, zeroing them out.
1275         (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
1276         handle a delete of content in special cases where the only thing selected is a BR. This
1277         code path is much simpler than the newly-named performGeneralDelete, and detects when no
1278         content merging should be done between blocks. This aspect of the change fixes 3854848.
1279         One of the special cases added fixes 3803832.
1280         (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
1281         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
1282         like the other helpers in this class.
1283         (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
1284         (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
1285         * khtml/editing/htmlediting.h: Added new helper and changed an old one.
1286
1287 2004-10-28  Chris Blumenberg  <cblu@apple.com>
1288
1289         Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
1290
1291         Reviewed by darin.
1292
1293         * kwq/KWQKHTMLPart.mm:
1294         (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
1295
1296 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1297
1298         Reviewed by Harrison
1299
1300         Reorganization of delete command functionality so that doApply is not
1301         several hundred lines long. This is not a squeaky-clean cleanup, but
1302         it is a step in the right direction. No functionality changes.
1303
1304         * khtml/editing/htmlediting.cpp:
1305         (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
1306         (khtml::DeleteSelectionCommand::initializePositionData): New helper.
1307         (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
1308         (khtml::DeleteSelectionCommand::performDelete): Ditto.
1309         (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1310         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1311         (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
1312         (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
1313         (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
1314         (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
1315         * khtml/editing/htmlediting.h:
1316
1317 2004-10-28  Ken Kocienda  <kocienda@apple.com>
1318
1319         Reviewed by me
1320
1321         * khtml/editing/htmlediting.cpp:
1322         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
1323         new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
1324
1325 2004-10-27  Ken Kocienda  <kocienda@apple.com>
1326
1327         Reviewed by Chris
1328
1329         * khtml/editing/htmlediting.cpp:
1330         (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
1331         whether content not in the block containing the start of the selection is moved to that block
1332         after the selection is deleted.
1333         (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
1334         (khtml::DeleteSelectionCommand::doApply): Ditto.
1335         (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
1336         to handle the case of inserting a newline when in quoted content in Mail.
1337         (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
1338         (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
1339         (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
1340         (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
1341         (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
1342         (khtml::TypingCommand::doApply): Ditto.
1343         (khtml::TypingCommand::preservesTypingStyle): Ditto.
1344         * khtml/editing/htmlediting.h: Add new delclarations.
1345         (khtml::TypingCommand::): Ditto.
1346         * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
1347         * kwq/WebCoreBridge.mm:
1348         (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
1349
1350 2004-10-26  Chris Blumenberg  <cblu@apple.com>
1351
1352         Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
1353
1354         Reviewed by dave.
1355
1356         * khtml/ecma/kjs_dom.cpp:
1357         (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
1358         * khtml/ecma/kjs_dom.h:
1359         (KJS::DOMElement::):
1360         * khtml/ecma/kjs_dom.lut.h:
1361         (KJS::):
1362
1363 2004-10-26  David Hyatt  <hyatt@apple.com>
1364
1365         Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
1366         the previous line.
1367         
1368         Reviewed by kocienda
1369
1370         * khtml/rendering/bidi.cpp:
1371         (khtml::RenderBlock::layoutInlineChildren):
1372
1373 2004-10-26  David Hyatt  <hyatt@apple.com>
1374
1375         Convert selectionRect() from using a list to a dict and patch it to be like setSelection.  It was still trying
1376         to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
1377         
1378         Reviewed by kocienda
1379
1380         * khtml/rendering/render_canvas.cpp:
1381         (RenderCanvas::selectionRect):
1382         * khtml/rendering/render_object.h:
1383         (khtml::RenderObject::hasSelectedChildren):
1384
1385 2004-10-26  Ken Kocienda  <kocienda@apple.com>
1386
1387         Reviewed by Hyatt
1388         
1389         Fix for this bug::
1390         
1391         <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
1392
1393         * khtml/editing/htmlediting.cpp:
1394         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
1395         let the caller know if a placeholder was removed.
1396         (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
1397         removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
1398         some cases, the selection was still set on the removed BR, and this was the cause of the
1399         crash.
1400         * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
1401
1402 2004-10-26  Darin Adler  <darin@apple.com>
1403
1404         Reviewed by Chris.
1405
1406         - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
1407
1408         * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
1409
1410 2004-10-26  Ken Kocienda  <kocienda@apple.com>
1411
1412         Reviewed by John
1413
1414         * khtml/editing/htmlediting.cpp:
1415         (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
1416         with a zero-length string. That triggers an assert. Call deleteText instead, 
1417         using the same indices that are passed to replaceText.
1418         
1419         Cleaned up the asserts in these three functions below, making them
1420         more consistent. This is not needed for the fix, but I tripped over
1421         these in the course of debugging.
1422         
1423         (khtml::InsertTextCommand::InsertTextCommand):
1424         (khtml::InsertTextCommand::doApply):
1425         (khtml::InsertTextCommand::doUnapply):
1426
1427 2004-10-25  Adele Amchan <adele@apple.com>
1428
1429         Reviewed by Darin.
1430
1431         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
1432         * khtml/xml/dom_docimpl.h:
1433
1434 2004-10-25  Adele Amchan  <adele@apple.com>
1435
1436         Reviewed by me, code change by Darin.
1437
1438         * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
1439
1440 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1441
1442         Oops. These two test results changed with my last checkin, for the better.
1443
1444         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1445         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
1446
1447 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1448
1449         Reviewed by Chris
1450
1451         Fix for this bug:
1452         
1453         <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
1454
1455         * khtml/editing/htmlediting.cpp:
1456         (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
1457         expand the selection outwards when the selection is on the visible boundary of a root
1458         editable element. This fixes the bug. Note that this function also contains a little code
1459         I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
1460         (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1461         (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
1462         * khtml/editing/htmlediting.h: Declare new helpers.
1463         * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
1464         * layout-tests/editing/deleting/delete-select-all-001.html: Added.
1465         * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
1466         * layout-tests/editing/deleting/delete-select-all-002.html: Added.
1467         * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
1468         * layout-tests/editing/deleting/delete-select-all-003.html: Added.
1469
1470 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1471
1472         Added some more editing layout tests.
1473
1474         * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
1475         * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
1476         * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
1477         * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
1478         * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
1479         * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
1480         * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
1481         * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
1482         * layout-tests/editing/inserting/typing-003-expected.txt: Added.
1483         * layout-tests/editing/inserting/typing-003.html: Added.
1484
1485 2004-10-25  Ken Kocienda  <kocienda@apple.com>
1486
1487         Reviewed by John
1488
1489         * khtml/rendering/bidi.cpp:
1490         (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
1491             yesterday quite right: words that should have been placed on the next line were instead
1492         appearing on the line before, beyond the right margin. This was a one-word only error
1493         based on moving the line break object when it should have stayed put. Here is the rule:
1494         The line break object only moves to after the whitespace on the end of a line if that 
1495         whitespace caused line overflow when its width is added in.
1496
1497 2004-10-25  Adele Amchan  <adele@apple.com>
1498
1499         Reviewed by Darin.
1500  
1501         Fix for <rdar://problem/3619890> Feature request: designMode        
1502
1503         This change implements the designMode property of a document.  This is an IE property that is also supported by Mozilla.  
1504         This will enable more JS editing compatibility.
1505
1506         * khtml/ecma/kjs_html.cpp:
1507         (KJS::HTMLDocument::tryGet): added case for designMode
1508         (KJS::HTMLDocument::putValue): added case for designMode
1509         * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
1510         * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
1511         * khtml/xml/dom_docimpl.cpp:
1512         (DocumentImpl::DocumentImpl): initialize m_designMode member variable
1513         (DocumentImpl::setDesignMode): added function to assign m_designMode value
1514         (DocumentImpl::getDesignMode): return m_designMode value
1515         (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value. 
1516             Otherwise, it will just return the m_designMode value.
1517         (DocumentImpl::parentDocument):
1518         * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
1519         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
1520
1521 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1522
1523         Reviewed by Hyatt
1524
1525         Fix for this bug:
1526         
1527         <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
1528
1529         * khtml/editing/htmlediting.cpp:
1530         (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
1531         everything that could be affected.
1532         (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
1533         braces, making it act as a comma operator, with a zero value as the right value!!! This made
1534         an important check always fail!!! It turns out that we do not want the constant at all, since
1535         that constant is only needed when checking a computed style, not an inline style as is being
1536         done here.
1537         (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
1538         (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
1539         RangeImpl::compareBoundaryPoints to perform the required check.
1540         * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
1541
1542 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1543
1544         Reviewed by Hyatt
1545         
1546         Fix for this bugs:
1547         
1548         <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
1549         <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
1550     
1551         * khtml/rendering/bidi.cpp:
1552         (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
1553         it is when we are editing, add in the space of the current character when calculating the width
1554         of committed plus uncommitted characters. If this value exceeds the width of the line, move up
1555         the line break object and call skipWhitespace to move past the end of the whitespace.
1556
1557 === Safari-168 ===
1558
1559 2004-10-22  Ken Kocienda  <kocienda@apple.com>
1560
1561         * WebCore.pbproj/project.pbxproj:
1562          Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
1563
1564 2004-10-21  David Hyatt  <hyatt@apple.com>
1565
1566         Reviewed by darin
1567         
1568         Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
1569         
1570         <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
1571         <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
1572         
1573         * khtml/rendering/render_block.cpp:
1574         (khtml::getInlineRun):
1575         (khtml::RenderBlock::makeChildrenNonInline):
1576
1577 2004-10-21  David Hyatt  <hyatt@apple.com>
1578
1579         Fix for 3810389, crash because of continuation() craziness.  Revert back to the old behavior of
1580         making sure that all line boxes get deleted and recreated when inlines are split because of a block.
1581         
1582         Reviewed darin
1583
1584         * khtml/rendering/render_inline.cpp:
1585         (RenderInline::splitFlow):
1586
1587 2004-10-21  Ken Kocienda  <kocienda@apple.com>
1588
1589         Reviewed by Darin
1590         
1591         Significant improvement to the way that whitespace is handled during editing.
1592
1593         * khtml/editing/htmlediting.cpp:
1594         (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
1595         two being added with this name) that delete "insignificant" unrendered text.
1596         (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
1597         calculates the downstream position to use as the endpoint for the deletion, and
1598         then calls deleteInsignificantText with this start and end.
1599         (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
1600         (khtml::InputNewlineCommand::doApply): Ditto.
1601         (khtml::InputTextCommand::input): Ditto.
1602         * khtml/editing/htmlediting.h: Add new declarations.
1603         
1604         Modified layout test results:
1605         * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
1606         * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
1607         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
1608         * layout-tests/editing/deleting/delete-selection-001-expected.txt:
1609         * layout-tests/editing/deleting/delete-tab-001-expected.txt:
1610         * layout-tests/editing/deleting/delete-tab-004-expected.txt:
1611         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
1612         * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
1613         * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
1614         * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
1615         * layout-tests/editing/inserting/insert-br-001-expected.txt:
1616         * layout-tests/editing/inserting/insert-br-004-expected.txt:
1617         * layout-tests/editing/inserting/insert-br-005-expected.txt:
1618         * layout-tests/editing/inserting/insert-br-006-expected.txt:
1619         * layout-tests/editing/inserting/insert-tab-001-expected.txt:
1620         * layout-tests/editing/inserting/insert-tab-002-expected.txt:
1621         * layout-tests/editing/inserting/insert-tab-004-expected.txt:
1622         * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
1623         * layout-tests/editing/inserting/typing-001-expected.txt:
1624         * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
1625         * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
1626         * layout-tests/editing/style/typing-style-003-expected.txt:
1627         * layout-tests/editing/undo/redo-typing-001-expected.txt:
1628         * layout-tests/editing/undo/undo-typing-001-expected.txt:
1629
1630 2004-10-21  David Hyatt  <hyatt@apple.com>
1631
1632         Fix for 3847054, assertion failure in RenderText::layout() on news.com page.  Fix getInlineRun so that
1633         it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
1634         
1635         Reviewed by darin
1636
1637         * khtml/rendering/render_block.cpp:
1638         (khtml::getInlineRun):
1639
1640 2004-10-20  David Hyatt  <hyatt@apple.com>
1641
1642         Add better dumping of overflow information for scrolling regions.
1643
1644         Fix for 3726524, crash in updateLayerPosition.  Make sure anonymous elements properly remove themselves
1645         from the render tree so that layers and so forth are cleaned up.
1646         
1647         Reviewed by darin
1648
1649         * khtml/rendering/render_container.cpp:
1650         (RenderContainer::detach):
1651         * khtml/rendering/render_layer.h:
1652         (khtml::RenderLayer::scrollXOffset):
1653         (khtml::RenderLayer::scrollYOffset):
1654         * kwq/KWQRenderTreeDebug.cpp:
1655         (write):
1656
1657 2004-10-20  David Hyatt  <hyatt@apple.com>
1658
1659         Fix for 3791146, make sure all lines are checked when computing overflow.
1660         
1661         Reviewed by kocienda
1662
1663         * khtml/rendering/bidi.cpp:
1664         (khtml::RenderBlock::computeHorizontalPositionsForLine):
1665         (khtml::RenderBlock::layoutInlineChildren):
1666         (khtml::RenderBlock::findNextLineBreak):
1667         (khtml::RenderBlock::checkLinesForOverflow):
1668         * khtml/rendering/render_block.h:
1669
1670 2004-10-20  David Hyatt  <hyatt@apple.com>
1671
1672         Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
1673         
1674         Reviewed by kocienda
1675
1676         * khtml/rendering/break_lines.cpp:
1677         (khtml::isBreakable):
1678
1679 2004-10-20  Darin Adler  <darin@apple.com>
1680
1681         Reviewed by John.
1682
1683         - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
1684
1685         * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
1686         Create a palette with the background and foreground colors in it and set it on the widget.
1687
1688         * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
1689         with APPLE_CHANGES. Removed palette and palette-related function members.
1690         * khtml/rendering/render_style.cpp:
1691         (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
1692         (RenderStyle::diff): No palette to compare.
1693
1694         * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
1695         * kwq/KWQLineEdit.mm:
1696         (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
1697         (QLineEdit::text): Made const.
1698
1699         * kwq/KWQTextEdit.h: Added setPalette override.
1700         * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
1701         based on palette.
1702
1703         * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
1704         per color group, and only a single color group per palette.
1705         * kwq/KWQColorGroup.mm: Removed.
1706         * kwq/KWQPalette.mm: Removed.
1707         * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
1708
1709         * kwq/KWQApplication.h: Removed unused palette function.
1710         * kwq/KWQApplication.mm: Ditto.
1711
1712         * kwq/KWQWidget.h: Removed unsetPalette.
1713         * kwq/KWQWidget.mm: Ditto.
1714
1715         - fixed storage leak
1716
1717         * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
1718         Roll in storage leak fix from KDE guys.
1719
1720 2004-10-19  David Hyatt  <hyatt@apple.com>
1721
1722         Reviewed by kocienda
1723
1724         More cleanup of block layout.  Eliminates the separate step for tables that dont fit on a line with a float
1725         and consolidates it with clearing.
1726
1727         Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
1728         
1729         * khtml/rendering/render_block.cpp:
1730         (khtml::getInlineRun):
1731         (khtml::RenderBlock::layoutBlock):
1732         (khtml::RenderBlock::adjustFloatingBlock):
1733         (khtml::RenderBlock::collapseMargins):
1734         (khtml::RenderBlock::clearFloatsIfNeeded):
1735         (khtml::RenderBlock::estimateVerticalPosition):
1736         (khtml::RenderBlock::layoutBlockChildren):
1737         (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
1738         (khtml::RenderBlock::getClearDelta):
1739         (khtml::RenderBlock::calcBlockMinMaxWidth):
1740         * khtml/rendering/render_block.h:
1741         * khtml/rendering/render_frames.cpp:
1742         (RenderFrameSet::layout):
1743         * khtml/xml/dom_textimpl.cpp:
1744         (TextImpl::rendererIsNeeded):
1745
1746         Fix for 3841060, regression with * in frames.  Reviewed by kocienda.
1747         
1748         * layout-tests/fast/frames/002-expected.txt: Added.
1749         * layout-tests/fast/frames/002.html: Added.
1750
1751  2004-10-19  Darin Adler  <darin@apple.com>
1752
1753         Reviewed by Maciej.
1754
1755         - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
1756
1757         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
1758         scripts being loaded here. If the current code being run is the external script itself, then we don't want
1759         to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
1760         assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
1761         wrong since there can be a script loading in that case too. Layout tests check for both problems.
1762
1763         * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
1764         * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
1765         * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
1766
1767         * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
1768
1769 2004-10-18  Darin Adler  <darin@apple.com>
1770
1771         Reviewed by Dave Hyatt.
1772
1773         - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
1774
1775         * khtml/html/htmltokenizer.cpp:
1776         (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
1777         (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
1778         we only want to look at loadingExtScript if m_executingScript is 0.
1779
1780 2004-10-18  Ken Kocienda  <kocienda@apple.com>
1781
1782         Reviewed by Hyatt
1783
1784         Fix for this bug:
1785         
1786         <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
1787
1788         * khtml/css/css_valueimpl.cpp:
1789         (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
1790         Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the 
1791         lifecycle issues associated with creating a string to be returned in the ident case.
1792         * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
1793         * khtml/css/cssstyleselector.cpp:
1794         (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
1795
1796 2004-10-18  Chris Blumenberg  <cblu@apple.com>
1797
1798         Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
1799
1800         Reviewed by kocienda.
1801
1802         * khtml/rendering/render_frames.cpp:
1803         (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
1804
1805 2004-10-15  Chris Blumenberg  <cblu@apple.com>
1806
1807         Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
1808
1809         Reviewed by john.
1810
1811         * kwq/DOM-CSS.mm:
1812         (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
1813         * kwq/DOMPrivate.h:
1814
1815 2004-10-15  Ken Kocienda  <kocienda@apple.com>
1816
1817         Reviewed by Hyatt
1818
1819         * khtml/rendering/bidi.cpp:
1820         (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
1821         skipping after a clean line break, in addition to the cases already 
1822         checked for.
1823         * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
1824         * layout-tests/editing/inserting/insert-br-007.html: Added.
1825         * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
1826         * layout-tests/editing/inserting/insert-br-008.html: Added.
1827
1828 === Safari-167 ===
1829
1830 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1831
1832         Reviewed by John
1833
1834         Fix for this bug:
1835         
1836         <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
1837
1838         * khtml/editing/visible_position.cpp:
1839         (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
1840         position code to new-style VisiblePosition code. In retrospect, this code was misguided.
1841         Since we do a good job of insulating external code from the internal workings of 
1842         VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
1843         in the case of this bug, was doing harm. Simply removing this code makes the bug
1844         go away and does not cause any editing layout test regresssions.
1845
1846 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1847
1848         Reviewed by Hyatt
1849
1850         * khtml/rendering/bidi.cpp:
1851         (khtml::skipNonBreakingSpace): New helper.
1852         (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
1853         at the start of a block. This was preventing users from typing spaces in empty
1854         documents.
1855         * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
1856         * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
1857
1858 2004-10-14  Adele Amchan  <adele@apple.com>
1859
1860         Reviewed by Darin and Ken.
1861
1862         fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
1863
1864         This change shifts some code around so that the code that determines what typing style
1865         is in effect is called before deleteUnrenderedText is called.  Two asserts are also added
1866         to ensure that start and end nodes of the selection are in the document.
1867
1868         * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
1869
1870 2004-10-14  Adele Amchan  <adele@apple.com>
1871
1872         Reviewed by Ken
1873         
1874         This change makes these three functions virtual so that the work is being done in KWQHTMLPart 
1875         instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
1876
1877         * khtml/khtml_part.cpp:
1878         (KHTMLPart::shouldBeginEditing):
1879         (KHTMLPart::shouldEndEditing):
1880         (KHTMLPart::isContentEditable):
1881         * khtml/khtml_part.h:
1882         * kwq/KWQKHTMLPart.h:
1883
1884 2004-10-14  Ken Kocienda  <kocienda@apple.com>
1885
1886         Reviewed by John
1887
1888         Final fix for these bugs:
1889         
1890         <rdar://problem/3806306> HTML editing puts spaces at start of line
1891         <rdar://problem/3814252> HTML editing groups space with word causing wrapping
1892
1893         This change sets some new CSS properties that have been added to WebCore to 
1894         enable whitespace-handling and line-breaking features that make WebView work
1895         more like a text editor.
1896
1897         * khtml/css/cssstyleselector.cpp:
1898         (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties 
1899         based on property value.
1900         * khtml/html/html_elementimpl.cpp:
1901         (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties 
1902         based on attribute value.
1903         * khtml/khtml_part.cpp:
1904         (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
1905         body element.
1906         (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
1907         body element.
1908         (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
1909         (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
1910         * khtml/khtml_part.h: Add new declarations.
1911         * kwq/WebCoreBridge.h: Ditto.
1912         * kwq/WebCoreBridge.mm:
1913         (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
1914         (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
1915         (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
1916         (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
1917
1918 2004-10-14  John Sullivan  <sullivan@apple.com>
1919
1920         Reviewed by Ken.
1921         
1922         - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
1923
1924         * khtml/editing/htmlediting.cpp:
1925         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
1926         needed a nil check to handle empty document case
1927
1928 2004-10-13  Maciej Stachowiak  <mjs@apple.com>
1929
1930         Reviewed by Ken.
1931
1932         <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
1933         
1934         - I fixed this by turning off all colormatching for WebKit
1935         content. We might turn it back on later. For now, it's possible to
1936         turn it on temporarily by defining COLORMATCH_EVERYTHING.
1937         
1938         * WebCorePrefix.h:
1939         * khtml/ecma/kjs_html.cpp:
1940         (KJS::Context2DFunction::tryCall):
1941         (Context2D::colorRefFromValue):
1942         (Gradient::getShading):
1943         * khtml/rendering/render_canvasimage.cpp:
1944         (RenderCanvasImage::createDrawingContext):
1945         * kwq/KWQColor.mm:
1946         (QColor::getNSColor):
1947         * kwq/KWQPainter.h:
1948         * kwq/KWQPainter.mm:
1949         (CGColorFromNSColor):
1950         (QPainter::selectedTextBackgroundColor):
1951         (QPainter::rgbColorSpace):
1952         (QPainter::grayColorSpace):
1953         (QPainter::cmykColorSpace):
1954         * kwq/WebCoreGraphicsBridge.h:
1955         * kwq/WebCoreGraphicsBridge.m:
1956         (-[WebCoreGraphicsBridge createRGBColorSpace]):
1957         (-[WebCoreGraphicsBridge createGrayColorSpace]):
1958         (-[WebCoreGraphicsBridge createCMYKColorSpace]):
1959
1960 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1961
1962         Reviewed by Hyatt
1963
1964         * khtml/css/css_valueimpl.cpp:
1965         (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
1966         is non-null before appending.
1967
1968 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1969
1970         Update expected results for improved behavior as a result of fix to 3816768.
1971     
1972         * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
1973         * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1974         * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
1975
1976 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1977
1978         Reviewed by Richard
1979
1980         * khtml/css/css_computedstyle.cpp:
1981         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
1982         for getting -khtml-line-break and -khml-nbsp-mode.
1983
1984 2004-10-13  Ken Kocienda  <kocienda@apple.com>
1985
1986         Reviewed by John
1987
1988         Fix for this bug:
1989         
1990         <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly 
1991         moves caret out of block.
1992
1993         The issue here is that an empty block with no explicit height set by style collapses
1994         to zero height, and does so immediately after the last bit of content is removed from
1995         it (as a result of deleting text with the delete key for instance). Since zero-height
1996         blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
1997         
1998         The fix is to detect when a block has not been removed itself, but has had all its 
1999         contents removed. In this case, a BR element is placed in the block, one that is
2000         specially marked as a placeholder. Later, if the block ever receives content, this
2001         placeholder is removed.
2002
2003         * khtml/editing/htmlediting.cpp:
2004         (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
2005         (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
2006         (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
2007         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
2008         Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong 
2009         (it's very clear that we needs to be able to move more than just text nodes). This may expose
2010         bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
2011         made the test case in the bug work.
2012         (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
2013         removeBlockPlaceholderIfNeeded.
2014         (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
2015         (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
2016         * khtml/editing/htmlediting.h: Declare new functions.
2017
2018 2004-10-13  Richard Williamson   <rjw@apple.com>
2019
2020         Added support for -apple-dashboard-region:none.  And fixed
2021         a few computed style problems.
2022
2023         Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
2024         Reviewed by Hyatt.
2025
2026         * khtml/css/css_computedstyle.cpp:
2027         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2028         * khtml/css/css_valueimpl.cpp:
2029         (CSSPrimitiveValueImpl::cssText):
2030         * khtml/css/cssparser.cpp:
2031         (CSSParser::parseValue):
2032         (CSSParser::parseDashboardRegions):
2033         * khtml/css/cssstyleselector.cpp:
2034         (khtml::CSSStyleSelector::applyProperty):
2035         * khtml/rendering/render_style.cpp:
2036         (RenderStyle::noneDashboardRegions):
2037         * khtml/rendering/render_style.h:
2038         * kwq/KWQKHTMLPart.mm:
2039         (KWQKHTMLPart::dashboardRegionsDictionary):
2040
2041 2004-10-13  David Hyatt  <hyatt@apple.com>
2042
2043         Rework block layout to clean it up and simplify it (r=kocienda).  
2044
2045         Also fixing the style sharing bug (r=mjs).
2046         
2047         * khtml/rendering/render_block.cpp:
2048         (khtml::RenderBlock::MarginInfo::MarginInfo):
2049         (khtml::RenderBlock::layoutBlock):
2050         (khtml::RenderBlock::adjustPositionedBlock):
2051         (khtml::RenderBlock::adjustFloatingBlock):
2052         (khtml::RenderBlock::handleSpecialChild):
2053         (khtml::RenderBlock::handleFloatingOrPositionedChild):
2054         (khtml::RenderBlock::handleCompactChild):
2055         (khtml::RenderBlock::insertCompactIfNeeded):
2056         (khtml::RenderBlock::handleRunInChild):
2057         (khtml::RenderBlock::collapseMargins):
2058         (khtml::RenderBlock::clearFloatsIfNeeded):
2059         (khtml::RenderBlock::estimateVerticalPosition):
2060         (khtml::RenderBlock::determineHorizontalPosition):
2061         (khtml::RenderBlock::setCollapsedBottomMargin):
2062         (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
2063         (khtml::RenderBlock::handleBottomOfBlock):
2064         (khtml::RenderBlock::layoutBlockChildren):
2065         (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
2066         (khtml::RenderBlock::addOverHangingFloats):
2067         * khtml/rendering/render_block.h:
2068         (khtml::RenderBlock::maxTopMargin):
2069         (khtml::RenderBlock::maxBottomMargin):
2070         (khtml::RenderBlock::CompactInfo::compact):
2071         (khtml::RenderBlock::CompactInfo::block):
2072         (khtml::RenderBlock::CompactInfo::matches):
2073         (khtml::RenderBlock::CompactInfo::clear):
2074         (khtml::RenderBlock::CompactInfo::set):
2075         (khtml::RenderBlock::CompactInfo::CompactInfo):
2076         (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
2077         (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
2078         (khtml::RenderBlock::MarginInfo::clearMargin):
2079         (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
2080         (khtml::RenderBlock::MarginInfo::setTopQuirk):
2081         (khtml::RenderBlock::MarginInfo::setBottomQuirk):
2082         (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
2083         (khtml::RenderBlock::MarginInfo::setPosMargin):
2084         (khtml::RenderBlock::MarginInfo::setNegMargin):
2085         (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
2086         (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
2087         (khtml::RenderBlock::MarginInfo::setMargin):
2088         (khtml::RenderBlock::MarginInfo::atTopOfBlock):
2089         (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
2090         (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
2091         (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
2092         (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
2093         (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
2094         (khtml::RenderBlock::MarginInfo::quirkContainer):
2095         (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
2096         (khtml::RenderBlock::MarginInfo::topQuirk):
2097         (khtml::RenderBlock::MarginInfo::bottomQuirk):
2098         (khtml::RenderBlock::MarginInfo::posMargin):
2099         (khtml::RenderBlock::MarginInfo::negMargin):
2100         (khtml::RenderBlock::MarginInfo::margin):
2101         * khtml/rendering/render_box.cpp:
2102         (RenderBox::calcAbsoluteVertical):
2103         * khtml/rendering/render_box.h:
2104         (khtml::RenderBox::marginTop):
2105         (khtml::RenderBox::marginBottom):
2106         (khtml::RenderBox::marginLeft):
2107         (khtml::RenderBox::marginRight):
2108         * khtml/rendering/render_image.cpp:
2109         (RenderImage::setImage):
2110         * khtml/rendering/render_object.cpp:
2111         (RenderObject::sizesToMaxWidth):
2112         * khtml/rendering/render_object.h:
2113         (khtml::RenderObject::collapsedMarginTop):
2114         (khtml::RenderObject::collapsedMarginBottom):
2115         (khtml::RenderObject::maxTopMargin):
2116         (khtml::RenderObject::maxBottomMargin):
2117         (khtml::RenderObject::marginTop):
2118         (khtml::RenderObject::marginBottom):
2119         (khtml::RenderObject::marginLeft):
2120         (khtml::RenderObject::marginRight):
2121         * khtml/rendering/render_text.h:
2122         (khtml::RenderText::marginLeft):
2123         (khtml::RenderText::marginRight):
2124         * khtml/xml/dom_elementimpl.cpp:
2125         (ElementImpl::recalcStyle):
2126
2127 2004-10-12  Ken Kocienda  <kocienda@apple.com>
2128
2129         Reviewed by John
2130
2131         Fix for this bug:
2132         
2133         <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
2134
2135         * khtml/editing/selection.cpp:
2136         (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
2137         This will make it seem like the run ends on the next line.
2138
2139 2004-10-12  Ken Kocienda  <kocienda@apple.com>
2140
2141         Reviewed by Hyatt
2142
2143         Fix for this bug:
2144         
2145         <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
2146
2147         * khtml/editing/htmlediting.cpp:
2148         (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
2149         row, section, or column.
2150         (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
2151         of table structure when doing deletes, rather than deleting the structure elements themselves.
2152         (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
2153         of table structure. We may want to revisit this some day, but this seems like the best behavior
2154         to me now.
2155         (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
2156         where needed.
2157         * khtml/editing/htmlediting.h: Add declarations for new functions.
2158
2159 2004-10-12  Richard Williamson   <rjw@apple.com>
2160
2161         Fixed access to DOM object via WebScriptObject API.
2162         The execution context for DOM objects wasn't being found.       
2163         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
2164         Reviewed by Chris
2165
2166         Fixed <rdar://problem/3831063> regions use left offset instead of top offset
2167         Reviewed by John
2168
2169         * khtml/khtml_part.h:
2170         * khtml/rendering/render_object.cpp:
2171         (RenderObject::addDashboardRegions):
2172         * kwq/DOM.mm:
2173         (-[DOMNode isContentEditable]):
2174         (-[DOMNode KJS::Bindings::]):
2175         * kwq/KWQKHTMLPart.h:
2176         * kwq/KWQKHTMLPart.mm:
2177         (KWQKHTMLPart::executionContextForDOM):
2178
2179 2004-10-12  Ken Kocienda  <kocienda@apple.com>
2180
2181         Reviewed by Hyatt
2182
2183         Fix for this bug:
2184
2185         <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
2186     
2187         * kwq/KWQKHTMLPart.mm:
2188         (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
2189         insert our style-checking node is done with an appendChild rather than an insertBefore. Note 
2190         that this table-related problem was exposed by fixing Selection::layout(), which I did
2191         yesterday. This change simply improves things even more so that we do not crash in the
2192         scenario described in the bug.
2193
2194 2004-10-11  Ken Kocienda  <kocienda@apple.com>
2195
2196         Reviewed by John
2197
2198         This is a partial fix to this bug:
2199         
2200         <rdar://problem/3832886> increase quote level on new mail document leads to immediate 
2201         crash in caret painting code
2202         
2203         To eliminate the bad behavior for good, I have done some investigations in Mail code,
2204         and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
2205         blocks (like blockquote elements used for quoting) to documents without giving those 
2206         blocks some content (so they have a height).
2207
2208         I added some other crash protections below.
2209
2210         * khtml/editing/selection.cpp:
2211         (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
2212         the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
2213         a couple position-has-renderer assertion checks.
2214         * kwq/KWQKHTMLPart.mm:
2215         (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
2216         may not yield a position. This assertion is a holdover from before we had VisiblePosition.
2217         (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
2218         calls to helpers.
2219
2220 2004-10-11  Darin Adler  <darin@apple.com>
2221
2222         Reviewed by John.
2223
2224         - fixed <rdar://problem/3834230> empty table can result in division by 0
2225
2226         * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
2227         Added 0 check; rolled in from KDE.
2228
2229 2004-10-11  Darin Adler  <darin@apple.com>
2230
2231         Reviewed by John.
2232
2233         - fixed <rdar://problem/3818712> form checkbox value property is read only
2234
2235         The underlying problem was that we were storing two separate values for all
2236         form elements; one for the value property (JavaScript) and the other for the
2237         value attribute (DOM). This is a good idea for text input, but not for other types.
2238
2239         * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
2240         Added private storesValueSeparateFromAttribute function.
2241         * khtml/html/html_formimpl.cpp:
2242         (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
2243         if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
2244         (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
2245         switch so that we will get a warning if a type is left out.
2246         (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
2247         (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
2248         separately from the attribute. Otherwise, we just want to lave it alone
2249         (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
2250         on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
2251         (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
2252         supposed to be stored separate from the attribute.
2253         (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
2254         input elements, and false for the others.
2255
2256 2004-10-11  Darin Adler  <darin@apple.com>
2257
2258         Reviewed by John.
2259
2260         - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
2261
2262         * khtml/rendering/render_form.cpp:
2263         (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
2264         (RenderCheckBox::slotStateChanged): Added call to onChange.
2265
2266 2004-10-11  Ken Kocienda  <kocienda@apple.com>
2267
2268         Reviewed by Darin
2269
2270         Finish selection affinity implementation. This includes code to set the
2271         affinity correctly when clicking with the mouse, and clearing the
2272         affinity when altering the selection using any of the Selection object
2273         mutation functions.
2274
2275         Each instance of the positionForCoordinates, inlineBox and caretRect 
2276         functions have been changed to include an EAffinity argument to give results
2277         which take this bit into account.
2278
2279         * khtml/editing/selection.cpp:
2280         (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
2281         (khtml::Selection::modifyAffinity): New function to compute affinity based on
2282         modification constants.
2283         (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
2284         (khtml::Selection::modifyExtendingRightForward): Ditto.
2285         (khtml::Selection::modifyMovingRightForward): Ditto.
2286         (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2287         (khtml::Selection::modifyMovingLeftBackward): Ditto.
2288         (khtml::Selection::modify): Support saving, restoring, and then calculating new
2289         affinity value as needed. 
2290         (khtml::Selection::xPosForVerticalArrowNavigation):
2291         (khtml::Selection::clear): Reset affinity to UPSTREAM.
2292         (khtml::Selection::setBase): Ditto.
2293         (khtml::Selection::setExtent): Ditto.
2294         (khtml::Selection::setBaseAndExtent): Ditto.
2295         (khtml::Selection::layout): Pass affinity to caretRect().
2296         (khtml::Selection::validate): Pass along affinity parameter to new functions that
2297         require it.
2298         (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
2299         keep this code working with changes made in selectionForLine().
2300         (khtml::endOfLastRunAt): Ditto.
2301         (khtml::selectionForLine): Make this function work for all renderers, not just text
2302         renderers.
2303         * khtml/editing/selection.h:
2304         (khtml::operator==): Consider affinity in equality check.
2305         * khtml/editing/visible_units.cpp:
2306         (khtml::previousLinePosition): Pass affinity argument to function so it can take this 
2307         information into account while processing.
2308         (khtml::nextLinePosition): Ditto.
2309         (khtml::previousParagraphPosition): Ditto.
2310         (khtml::nextParagraphPosition): Ditto.
2311         * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
2312         * khtml/khtml_events.cpp:
2313         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2314         as this function is being removed.
2315         * khtml/khtml_part.cpp:
2316         (KHTMLPart::isPointInsideSelection): Ditto.
2317         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2318         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2319         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2320         call to positionForCoordinates, and set resulting affinity on the selection.
2321         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2322         NodeImpl::positionForCoordinates, as this function is being removed.
2323         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2324         * khtml/rendering/render_block.cpp:
2325         (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
2326         * khtml/rendering/render_block.h:
2327         * khtml/rendering/render_box.cpp:
2328         (RenderBox::caretRect): Ditto.
2329         * khtml/rendering/render_box.h:
2330         * khtml/rendering/render_br.cpp:
2331         (RenderBR::positionForCoordinates): Ditto.
2332         (RenderBR::caretRect): Ditto.
2333         (RenderBR::inlineBox): Ditto.
2334         * khtml/rendering/render_br.h:
2335         * khtml/rendering/render_container.cpp:
2336         (RenderContainer::positionForCoordinates): Ditto.
2337         * khtml/rendering/render_container.h:
2338         * khtml/rendering/render_flow.cpp:
2339         (RenderFlow::caretRect): Ditto.
2340         * khtml/rendering/render_flow.h:
2341         * khtml/rendering/render_inline.cpp:
2342         (RenderInline::positionForCoordinates): Ditto.
2343         * khtml/rendering/render_inline.h:
2344         * khtml/rendering/render_object.cpp:
2345         (RenderObject::caretRect): Ditto.
2346         (RenderObject::positionForCoordinates): Ditto.
2347         (RenderObject::inlineBox): Ditto.
2348         * khtml/rendering/render_object.h:
2349         * khtml/rendering/render_replaced.cpp:
2350         (RenderReplaced::positionForCoordinates): Ditto.
2351         * khtml/rendering/render_replaced.h:
2352         * khtml/rendering/render_text.cpp:
2353         (RenderText::positionForCoordinates): Ditto.
2354         (firstRendererOnNextLine): New helper used by caretRect().
2355         (RenderText::caretRect): Now takes an affinity argument.
2356         (RenderText::inlineBox): Ditto.
2357         * khtml/rendering/render_text.h:
2358         * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
2359         * khtml/xml/dom_nodeimpl.h: Ditto.
2360         * khtml/xml/dom_position.cpp:
2361         (DOM::Position::previousLinePosition): Now takes an affinity argument.
2362         (DOM::Position::nextLinePosition): Ditto.
2363         * khtml/xml/dom_position.h:
2364         * kwq/WebCoreBridge.h:
2365         * kwq/WebCoreBridge.mm:
2366         (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
2367         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
2368         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2369         NodeImpl::positionForCoordinates, as this function is being removed.
2370
2371 2004-10-11  Darin Adler  <darin@apple.com>
2372
2373         Reviewed by Ken.
2374
2375         - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
2376
2377         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
2378         Scroll to reveal the text area, don't scroll to reveal the text view itself.
2379         Scrolling the text view ended up putting it at the top left, regardless of
2380         where the insertion point is.
2381
2382 2004-10-11  Darin Adler  <darin@apple.com>
2383
2384         Reviewed by Ken.
2385
2386         - fixed <rdar://problem/3831546> More text is copied than is visually selected
2387
2388         The bug here is that upstream was moving a position too far.
2389
2390         * khtml/xml/dom_position.cpp:
2391         (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
2392         in for various checks. Also use local variables a bit more for slightly more efficiency.
2393         (DOM::Position::downstream): Ditto.
2394
2395 2004-10-11  Darin Adler  <darin@apple.com>
2396
2397         Reviewed by Ken.
2398
2399         - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
2400
2401         * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
2402         * khtml/xml/dom2_eventsimpl.cpp:
2403         (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
2404         (EventImpl::idToType): Changed to use table.
2405
2406 2004-10-10  John Sullivan  <sullivan@apple.com>
2407
2408         - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
2409
2410         (-[KWQAccObject accessibilityActionNames]):
2411         check for nil m_renderer
2412
2413 2004-10-09  Darin Adler  <darin@apple.com>
2414
2415         Reviewed by Kevin.
2416
2417         - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
2418
2419         * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
2420         I'm landing later, but it does no harm to add these now.
2421         * kwq/KWQTextArea.mm:
2422         (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
2423         determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
2424         where we don't want it to track the text view. This caused the bug. 
2425         (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
2426         (-[KWQTextArea setTextColor:]): Added.
2427         (-[KWQTextArea setBackgroundColor:]): Added.
2428
2429 2004-10-09  Darin Adler  <darin@apple.com>
2430
2431         Reviewed by Adele.
2432
2433         - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
2434
2435         The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
2436         This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
2437         "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
2438         call for <meta> redirect and not preventing tokenizing when that's in effect.
2439
2440         * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
2441         isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
2442         * khtml/khtml_part.cpp:
2443         (KHTMLPart::openURL): Updated for new constant name.
2444         (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
2445         does the special case for redirection during load; a <meta> refresh can never be one of those special
2446         redirects during a load because it redirects the frame itself, not another frame. Also tightened up
2447         the logic by always stopping the redirect timer even if we aren't restarting it.
2448         (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
2449         so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
2450         and renamed to locationChangeScheduledDuringLoad.
2451         (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
2452         returns true only for location changes and history navigation, not <meta> redirects.
2453         (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
2454         and got rid of a silly timer delay computation that always resulted in 0.
2455
2456         * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
2457         and also renamed one of the existing values.
2458
2459         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
2460         of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
2461
2462         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
2463         instead of calling scheduleRedirection with delay of 0.
2464         * khtml/ecma/kjs_window.cpp:
2465         (Window::put): Ditto.
2466         (WindowFunc::tryCall): Ditto.
2467         (Location::put): Ditto.
2468         (LocationFunc::tryCall): Ditto.
2469
2470 2004-10-09  Darin Adler  <darin@apple.com>
2471
2472         Reviewed by Kevin.
2473
2474         - fixed <rdar://problem/3658277> REGRESSION (1.1-1.2): form submission should either not simulate a click at all or use (0,0) the way Mozilla does
2475
2476         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
2477
2478 2004-10-09  Darin Adler  <darin@apple.com>
2479
2480         Reviewed by Kevin.
2481
2482         - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
2483
2484         * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
2485         makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
2486         a copy of the function in each file as an init routine for the framework.
2487
2488         * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
2489         globals; their constructors were showing up as init routines for the framework.
2490
2491         * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
2492         * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
2493         a normal function. When it was an inline function, the constructors for the per-file
2494         copies of the globals were showing up as init routines for the framework.
2495
2496 2004-10-09  Chris Blumenberg  <cblu@apple.com>
2497
2498         Fixed: 
2499         <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
2500         <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
2501         <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
2502
2503         Reviewed by hyatt, kocienda.
2504
2505         * khtml/rendering/render_layer.cpp:
2506         (RenderLayer::scroll): new
2507         * khtml/rendering/render_layer.h:
2508         * khtml/rendering/render_object.cpp:
2509         (RenderObject::scroll): new
2510         * khtml/rendering/render_object.h:
2511         * kwq/KWQKHTMLPart.h:
2512         * kwq/KWQKHTMLPart.mm:
2513         (KWQKHTMLPart::scrollOverflow): new
2514         (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
2515         (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
2516         * kwq/KWQScrollBar.h:
2517         * kwq/KWQScrollBar.mm:
2518         (QScrollBar::setValue): return a bool
2519         (QScrollBar::scrollbarHit): ditto
2520         (QScrollBar::scroll): new
2521         * kwq/WebCoreBridge.h:
2522         * kwq/WebCoreBridge.mm:
2523         (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
2524         (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
2525         (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
2526
2527 2004-10-06  David Hyatt  <hyatt@apple.com>
2528
2529         Back out style sharing perf fix.
2530         
2531         * khtml/css/cssstyleselector.cpp:
2532         (khtml::CSSStyleSelector::locateCousinList):
2533         (khtml::CSSStyleSelector::canShareStyleWithElement):
2534         (khtml::CSSStyleSelector::locateSharedStyle):
2535         * khtml/css/cssstyleselector.h:
2536         * khtml/html/html_elementimpl.h:
2537         (DOM::HTMLElementImpl::inlineStyleDecl):
2538         * khtml/xml/dom_elementimpl.cpp:
2539         (ElementImpl::recalcStyle):
2540         * khtml/xml/dom_elementimpl.h:
2541
2542 === Safari-166 ===
2543
2544 2004-10-05  David Hyatt  <hyatt@apple.com>
2545
2546         Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
2547
2548         * khtml/css/cssstyleselector.cpp:
2549         (khtml::CSSStyleSelector::locateCousinList):
2550         (khtml::CSSStyleSelector::elementsCanShareStyle):
2551         (khtml::CSSStyleSelector::locateSharedStyle):
2552         (khtml::CSSStyleSelector::styleForElement):
2553
2554 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2555
2556         Reviewed by Hyatt
2557
2558         * khtml/rendering/bidi.cpp:
2559         (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
2560         broke layout tests involving compacts.
2561
2562 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2563
2564         Reviewed by Darin
2565
2566         Finish selection affinity implementation. This includes code to set the
2567         affinity correctly when clicking with the mouse, and clearing the
2568         affinity when altering the selection using any of the Selection object
2569         mutation functions.
2570
2571         Each instance of the positionForCoordinates function in the render tree
2572         has been changed to include an EAffinity argument. It is now the job of this
2573         function to set the selection affinity.
2574
2575         * khtml/editing/selection.cpp:
2576         (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
2577         (khtml::Selection::modify): Ditto.
2578         (khtml::Selection::clear): Ditto.
2579         (khtml::Selection::setBase): Ditto.
2580         (khtml::Selection::setExtent): Ditto.
2581         (khtml::Selection::setBaseAndExtent): Ditto.
2582         * khtml/editing/selection.h:
2583         (khtml::operator==): Consider affinity in equality check.
2584         * khtml/khtml_events.cpp:
2585         (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2586         as this function is being removed.
2587         * khtml/khtml_part.cpp: 
2588         (KHTMLPart::isPointInsideSelection): Ditto.
2589         (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2590         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2591         (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2592         call to positionForCoordinates, and set resulting affinity on the selection.
2593         (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on 
2594         NodeImpl::positionForCoordinates, as this function is being removed.
2595         (KHTMLPart::khtmlMouseReleaseEvent):
2596         * khtml/rendering/render_block.cpp:
2597         (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
2598         * khtml/rendering/render_block.h:
2599         * khtml/rendering/render_br.cpp:
2600         (RenderBR::positionForCoordinates): Ditto.
2601         * khtml/rendering/render_br.h:
2602         * khtml/rendering/render_container.cpp:
2603         (RenderContainer::positionForCoordinates): Ditto.
2604         * khtml/rendering/render_container.h:
2605         * khtml/rendering/render_inline.cpp:
2606         (RenderInline::positionForCoordinates): Ditto.
2607         * khtml/rendering/render_inline.h:
2608         * khtml/rendering/render_object.cpp:
2609         (RenderObject::positionForCoordinates): Ditto.
2610         * khtml/rendering/render_object.h:
2611         * khtml/rendering/render_replaced.cpp:
2612         (RenderReplaced::positionForCoordinates): Ditto.
2613         * khtml/rendering/render_replaced.h:
2614         * khtml/rendering/render_text.cpp:
2615         (RenderText::positionForCoordinates): Ditto.
2616         * khtml/rendering/render_text.h:
2617         * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
2618         * khtml/xml/dom_nodeimpl.h: Ditto.
2619         * kwq/WebCoreBridge.mm:
2620         (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on 
2621         NodeImpl::positionForCoordinates, as this function is being removed.
2622
2623 2004-10-05  David Hyatt  <hyatt@apple.com>
2624
2625         Fix style sharing optimization to be fast again.  Go back to using pointer comparisons when looking for
2626         cousins to share.
2627         
2628         Reviewed by darin
2629
2630         * khtml/css/cssstyleselector.cpp:
2631         (khtml::CSSStyleSelector::locateCousinList):
2632         * khtml/rendering/render_object.cpp:
2633         (RenderObject::setStyleInternal):
2634         * khtml/rendering/render_object.h:
2635         * khtml/xml/dom_elementimpl.cpp:
2636         (ElementImpl::recalcStyle):
2637
2638 2004-10-05  David Hyatt  <hyatt@apple.com>
2639
2640         Fix lists so that they properly participate in line layout as though they are text (when text bullets are
2641         used) and as images (when image bullets are used).
2642         
2643         Reviewed by kocienda
2644
2645         * khtml/rendering/render_list.cpp:
2646         (RenderListMarker::createInlineBox):
2647         * khtml/rendering/render_list.h:
2648         (khtml::ListMarkerBox:::InlineBox):
2649         (khtml::ListMarkerBox::isText):
2650
2651 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2652
2653         Reviewed by Darin
2654
2655         Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
2656         we want is downstreamDeepEquivalent, as the deepEquivalent function returns
2657         an upstream position.
2658
2659         * khtml/editing/selection.cpp:
2660         (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
2661         UPSTREAM uses deepEquivalent.
2662         * khtml/editing/visible_position.cpp:
2663         (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing 
2664         upstreamDeepEquivalent.
2665         * khtml/editing/visible_position.h
2666
2667 2004-10-05  David Hyatt  <hyatt@apple.com>
2668
2669         New selection gap-filling architecture.  Makes the gap-filling much more like NSTextView and puts the responsibility
2670         for gap-filling in the block.  Fixes numerous bugs with selection drawing including bidi issues, incorrect old
2671         horizontal gap filling, and selection performance issues.
2672         
2673         Reviewed by kocienda
2674
2675         * khtml/html/html_imageimpl.cpp:
2676         (HTMLImageLoader::notifyFinished):
2677         * khtml/misc/khtmllayout.h:
2678         (khtml::GapRects::left):
2679         (khtml::GapRects::center):
2680         (khtml::GapRects::right):
2681         (khtml::GapRects::uniteLeft):
2682         (khtml::GapRects::uniteCenter):
2683         (khtml::GapRects::uniteRight):
2684         (khtml::GapRects::unite):
2685         (khtml::GapRects::operator QRect):
2686         (khtml::GapRects::operator==):
2687         (khtml::GapRects::operator!=):
2688         * khtml/rendering/font.cpp:
2689         (Font::drawHighlightForText):
2690         * khtml/rendering/font.h:
2691         * khtml/rendering/render_block.cpp:
2692         (khtml:::RenderFlow):
2693         (khtml::RenderBlock::removeChild):
2694         (khtml::RenderBlock::paintObject):
2695         (khtml::RenderBlock::paintEllipsisBoxes):
2696         (khtml::RenderBlock::setSelectionState):
2697         (khtml::RenderBlock::shouldPaintSelectionGaps):
2698         (khtml::RenderBlock::isSelectionRoot):
2699         (khtml::RenderBlock::selectionGapRects):
2700         (khtml::RenderBlock::paintSelection):
2701         (khtml::RenderBlock::fillSelectionGaps):
2702         (khtml::RenderBlock::fillInlineSelectionGaps):
2703         (khtml::RenderBlock::fillBlockSelectionGaps):
2704         (khtml::RenderBlock::fillHorizontalSelectionGap):
2705         (khtml::RenderBlock::fillVerticalSelectionGap):
2706         (khtml::RenderBlock::fillLeftSelectionGap):
2707         (khtml::RenderBlock::fillRightSelectionGap):
2708         (khtml::RenderBlock::getHorizontalSelectionGapInfo):
2709         (khtml::RenderBlock::leftSelectionOffset):
2710         (khtml::RenderBlock::rightSelectionOffset):
2711         * khtml/rendering/render_block.h:
2712         (khtml::RenderBlock::hasSelectedChildren):
2713         (khtml::RenderBlock::selectionState):
2714         (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
2715         (khtml::RenderBlock::BlockSelectionInfo::rects):
2716         (khtml::RenderBlock::BlockSelectionInfo::state):
2717         (khtml::RenderBlock::BlockSelectionInfo::block):
2718         (khtml::RenderBlock::selectionRect):
2719         * khtml/rendering/render_box.cpp:
2720         (RenderBox::position):
2721         * khtml/rendering/render_br.cpp:
2722         (RenderBR::inlineBox):
2723         * khtml/rendering/render_br.h:
2724         (khtml::RenderBR::selectionRect):
2725         (khtml::RenderBR::paint):
2726         * khtml/rendering/render_canvas.cpp:
2727         (RenderCanvas::selectionRect):
2728         (RenderCanvas::setSelection):
2729         * khtml/rendering/render_canvasimage.cpp:
2730         (RenderCanvasImage::paint):
2731         * khtml/rendering/render_image.cpp:
2732         (RenderImage::paint):
2733         * khtml/rendering/render_image.h:
2734         * khtml/rendering/render_line.cpp:
2735         (khtml::InlineBox::nextLeafChild):
2736         (khtml::InlineBox::prevLeafChild):
2737         (khtml::InlineBox::selectionState):
2738         (khtml::InlineFlowBox::addToLine):
2739         (khtml::InlineFlowBox::firstLeafChild):
2740         (khtml::InlineFlowBox::lastLeafChild):
2741         (khtml::InlineFlowBox::firstLeafChildAfterBox):
2742         (khtml::InlineFlowBox::lastLeafChildBeforeBox):
2743         (khtml::InlineFlowBox::selectionState):
2744         (khtml::RootInlineBox::fillLineSelectionGap):
2745         (khtml::RootInlineBox::setHasSelectedChildren):
2746         (khtml::RootInlineBox::selectionState):
2747         (khtml::RootInlineBox::firstSelectedBox):
2748         (khtml::RootInlineBox::lastSelectedBox):
2749         (khtml::RootInlineBox::selectionTop):
2750         (khtml::RootInlineBox::block):
2751         * khtml/rendering/render_line.h:
2752         (khtml::RootInlineBox::RootInlineBox):
2753         (khtml::RootInlineBox::hasSelectedChildren):
2754         (khtml::RootInlineBox::selectionHeight):
2755         * khtml/rendering/render_object.cpp:
2756         (RenderObject::selectionColor):
2757         * khtml/rendering/render_object.h:
2758         (khtml::RenderObject::):
2759         (khtml::RenderObject::selectionState):
2760         (khtml::RenderObject::setSelectionState):
2761         (khtml::RenderObject::selectionRect):
2762         (khtml::RenderObject::canBeSelectionLeaf):
2763         (khtml::RenderObject::hasSelectedChildren):
2764         (khtml::RenderObject::hasDirtySelectionState):
2765         (khtml::RenderObject::setHasDirtySelectionState):
2766         (khtml::RenderObject::shouldPaintSelectionGaps):
2767         (khtml::RenderObject::SelectionInfo::SelectionInfo):
2768         * khtml/rendering/render_replaced.cpp:
2769         (RenderReplaced::RenderReplaced):
2770         (RenderReplaced::shouldPaint):
2771         (RenderReplaced::selectionRect):
2772         (RenderReplaced::setSelectionState):
2773         (RenderReplaced::selectionColor):
2774         (RenderWidget::paint):
2775         (RenderWidget::setSelectionState):
2776         * khtml/rendering/render_replaced.h:
2777         (khtml::RenderReplaced::canBeSelectionLeaf):
2778         (khtml::RenderReplaced::selectionState):
2779         * khtml/rendering/render_text.cpp:
2780         (InlineTextBox::checkVerticalPoint):
2781         (InlineTextBox::isSelected):
2782         (InlineTextBox::selectionState):
2783         (InlineTextBox::selectionRect):
2784         (InlineTextBox::paintSelection):
2785         (InlineTextBox::paintMarkedTextBackground):
2786         (RenderText::paint):
2787         (RenderText::setSelectionState):
2788         (RenderText::selectionRect):
2789         * khtml/rendering/render_text.h:
2790         (khtml::RenderText::canBeSelectionLeaf):
2791         * kwq/KWQPainter.h:
2792         * kwq/KWQPainter.mm:
2793         (QPainter::drawHighlightForText):
2794         * kwq/KWQPtrDict.h:
2795         (QPtrDictIterator::toFirst):
2796         * kwq/KWQRect.mm:
2797         (QRect::unite):
2798         * kwq/WebCoreTextRenderer.h:
2799         * kwq/WebCoreTextRendererFactory.mm:
2800         (WebCoreInitializeEmptyTextGeometry):
2801
2802 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2803
2804         Reviewed by Darin
2805         
2806         Use the new CSS properties I added with my previous check-in. Also makes
2807         some changes to caret positioning and drawing to make the proper editing
2808         end-of-line behavior work correctly.
2809
2810         * khtml/editing/selection.cpp:
2811         (khtml::Selection::layout): Caret drawing now takes affinity into account
2812         when deciding where to paint the caret (finally!).
2813         * khtml/editing/visible_position.cpp:
2814         (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
2815         to determine the result. Use a simpler test involving comparisons between
2816         downstream positions while iterating. This is cheaper to do and easier to understand.
2817         (khtml::VisiblePosition::nextVisiblePosition): Ditto.
2818         * khtml/rendering/bidi.cpp:
2819         (khtml::BidiIterator::current): Do not return non-breaking spaces for empty
2820         text renderers and for non-text renderers. Return a null Qchar instead. Returning
2821         non-breaking spaces was causing errors when the new -khtml-nbsp-mode was set to "space".
2822         (khtml::RenderBlock::computeHorizontalPositionsForLine): Shrink line boxes that 
2823         contain with more spaces than can fit on the end of a line.
2824         (khtml::RenderBlock::skipWhitespace): Factor this out from findNextLineBreak.
2825         (khtml::RenderBlock::findNextLineBreak): Use new skipWhitespace function. Add
2826         in code to check and use new CSS properties.
2827         * khtml/rendering/break_lines.cpp:
2828         (khtml::isBreakable): Consider a non-breaking space a breakable character based
2829         on setting of new -khtml-nbsp-mode property.
2830         * khtml/rendering/break_lines.h: Ditto.
2831         * khtml/rendering/render_block.h: Declare skipWhitespace function.
2832         * khtml/rendering/render_text.cpp: 
2833         (RenderText::caretRect): Do not draw the caret beyond the right edge of the
2834         window when in white-space normal mode.
2835
2836 2004-10-05  Ken Kocienda  <kocienda@apple.com>
2837
2838         Reviewed by Darin
2839
2840         Fix for these bugs:
2841         
2842         In this patch, I add two new CSS properties and their associated behavior.
2843         This is to support end-of-line and word-wrapping features that match the 
2844         conventions of text editors.
2845
2846         There are also some other small changes here which begin to lay the groundwork
2847         for using these new properties to bring about the desired editing behavior.
2848
2849         * khtml/css/cssparser.cpp:
2850         (CSSParser::parseValue): Add support for new CSS properties.
2851         * khtml/css/cssproperties.c: Generated file.
2852         * khtml/css/cssproperties.h: Ditto.
2853         * khtml/css/cssproperties.in: Add new properties.
2854         * khtml/css/cssstyleselector.cpp:
2855         (khtml::CSSStyleSelector::applyProperty): Add support for new CSS properties.
2856         * khtml/css/cssvalues.c: Generated file.
2857         * khtml/css/cssvalues.h: Ditto.
2858         * khtml/css/cssvalues.in:  Add support for new CSS properties.
2859         * khtml/editing/visible_position.cpp:
2860         (khtml::VisiblePosition::upstreamDeepEquivalent): Added new helper.
2861         * khtml/editing/visible_position.h:
2862         * khtml/rendering/render_box.cpp:
2863         (RenderBox::deleteLineBoxWrapper): Zero out inlineBoxWrapper.
2864         * khtml/rendering/render_replaced.cpp:
2865         (RenderWidget::detach): Zero out inlineBoxWrapper.
2866         * khtml/rendering/render_style.cpp:
2867         (StyleCSS3InheritedData):
2868         (StyleCSS3InheritedData::operator==): Add support for new CSS properties.
2869         (RenderStyle::diff): Ditto.
2870         * khtml/rendering/render_style.h:
2871         (khtml::RenderStyle::nbspMode): Ditto.
2872         (khtml::RenderStyle::khtmlLineBreak): Ditto.
2873         (khtml::RenderStyle::setNBSPMode): Ditto.
2874         (khtml::RenderStyle::setKHTMLLineBreak): Ditto.
2875         (khtml::RenderStyle::initialNBSPMode): Ditto.
2876         (khtml::RenderStyle::initialKHTMLLineBreak): Ditto.
2877
2878 2004-10-05  Darin Adler  <darin@apple.com>
2879
2880         Reviewed by John.
2881
2882         - fixed <rdar://problem/3673150> Pasting string from clipboard that is longer than input box will accept fails rather than truncating
2883
2884         * kwq/KWQTextField.mm:
2885         (-[KWQTextFieldFormatter isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:]):
2886         Wrote a new version of this method that truncates incoming strings rather than rejecting them
2887         out of hand.
2888
2889 2004-10-04  Darin Adler  <darin@apple.com>
2890
2891         Reviewed by Maciej.
2892
2893         - fixed <rdar://problem/3826343> crash in KHTMLParser::setCurrent parsing document fragment (happens in Calendar widget)
2894
2895         * khtml/html/htmlparser.cpp:
2896         (KHTMLParser::KHTMLParser): Initialized currentIsReferenced to false (fixes bug).
2897         (KHTMLParser::reset): Use doc() to make code easier to read.
2898         (KHTMLParser::setCurrent): Ditto.
2899         (KHTMLParser::parseToken): Ditto.
2900         (KHTMLParser::insertNode): Ditto.
2901         (KHTMLParser::getElement): Ditto.
2902         (KHTMLParser::popOneBlock): Ditto.
2903
2904         - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window
2905
2906         * kwq/KWQKHTMLPart.h: Added fontAttributesForSelectionStart.
2907         * kwq/KWQKHTMLPart.mm:
2908         (KWQKHTMLPart::styleForSelectionStart): Factored out most of fontForSelection.
2909         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2910         (KWQKHTMLPart::fontAttributesForSelectionStart): Added.
2911         (KWQKHTMLPart::registerCommandForUndo): Updated for name change (see below).
2912         (KWQKHTMLPart::registerCommandForRedo): Ditto.
2913
2914         * kwq/WebCoreBridge.h: Added fontAttributesForSelectionStart.
2915         * kwq/WebCoreBridge.mm:
2916         (-[WebCoreBridge undoEditing:]): Updated for name change (see below).
2917         (-[WebCoreBridge redoEditing:]): Ditto.
2918         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Got rid of named temporary
2919         EditCommandPtr variable to make things slightly more terse.
2920         (-[WebCoreBridge moveSelectionToDragCaret:smartMove:]): Ditto.
2921         (-[WebCoreBridge deleteSelectionWithSmartDelete:]): Ditto.
2922         (-[WebCoreBridge fontAttributesForSelectionStart]): Added.
2923
2924         - fix compile on Panther and other cleanup
2925
2926         * khtml/khtml_part.cpp: Removed unneeded include.
2927         * kwq/KWQEditCommand.h: Got rid of use of "impl" when referring to EditCommand pointers.
2928         * kwq/KWQEditCommand.mm: Added include so we compile on Panther.
2929         (-[KWQEditCommand initWithEditCommand:]): Changed name.
2930         (-[KWQEditCommand dealloc]): Updated for m_impl change to m_command.
2931         (-[KWQEditCommand finalize]): Ditto.
2932         (+[KWQEditCommand commandWithEditCommand:]): Changed name.
2933         (-[KWQEditCommand command]): Changed name.
2934
2935 2004-10-04  Darin Adler  <darin@apple.com>
2936
2937         Reviewed by John.
2938
2939         - did a more-robust version of the fix I just landed
2940
2941         * khtml/html/htmlparser.h: Added currentIsReferenced boolean.
2942         * khtml/html/htmlparser.cpp:
2943         (KHTMLParser::KHTMLParser): Initializes currentIsReferenced.
2944         (KHTMLParser::setCurrent): Changed to respect and set currentIsReferenced.
2945
2946 2004-10-04  Darin Adler  <darin@apple.com>
2947
2948         Reviewed by John.
2949
2950         - fixed <rdar://problem/3824393> REGRESSION (165-TOT): Crash in KHTMLParser::popOneBlock closing window (bose.com)
2951
2952         * khtml/html/htmlparser.cpp:
2953         (KHTMLParser::~KHTMLParser): Move call to setCurrent(0) after the call to freeBlock, since freeBlock doesn't
2954         work well when current is 0, and there's no reason we need to reset the current block first.
2955         (KHTMLParser::setCurrent): Don't ever hold a reference to the document. This prevents a situation where there
2956         would be a reference cycle. In the test case from the bug above, this cycle actually happened and resulted
2957         in a double-delete of the document, tokenizer, and parser.
2958
2959 2004-10-04  Darin Adler  <darin@apple.com>
2960
2961         Reviewed by Maciej.
2962
2963         - fixed <rdar://problem/3825429> onclick handler called when mouse down on another element (affects Dashboard Movies widget, test case enclosed)
2964
2965         * khtml/khtmlview.cpp:
2966         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize the click node to 0.
2967         (KHTMLViewPrivate::~KHTMLViewPrivate): Deref the click node.
2968         (KHTMLViewPrivate::reset): Clear the click node.
2969         (KHTMLView::viewportMousePressEvent): Call invalidateClick when we pass the event to a subframe to
2970         reduce the chance that we'll hold on to an old click node for a long time. Set the click node to
2971         the node we we are clicking on.
2972         (KHTMLView::viewportMouseDoubleClickEvent): Only send a click even if the node is the same one from
2973         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2974         old click node for a long time.
2975         (KHTMLView::invalidateClick): Clear the click node.
2976         (KHTMLView::viewportMouseReleaseEvent): Only send a click even if the node is the same one from
2977         the original click. Call invalidateClick when done to reduce the chance that we'll hold on to an
2978         old click node for a long time.
2979         (KHTMLView::keyPressEvent): Remove code that sets the originalNode field, which is never used.
2980
2981 2004-10-04  Ken Kocienda  <kocienda@apple.com>
2982
2983         Reviewed by Hyatt
2984
2985         Fix for this bug:
2986         
2987         <rdar://problem/3825289> REGRESSION (Mail): Crash in fontForSelection in empty window
2988
2989         * khtml/editing/visible_position.cpp:
2990         (khtml::VisiblePosition::previousPosition): Switch to node iteration instead "leaf"
2991         iteration. I have been wanting to make this change for a long time, but couldn't
2992         since other code relied on the leaf behavior. That is no longer true. Plus, the
2993         bug fix requires the new behavior.
2994         (khtml::VisiblePosition::nextPosition): Ditto.
2995         (khtml::VisiblePosition::isCandidate): Empty blocks needed a height to be a candidate,
2996         but we make a special case for the body element. This fixes the bug.
2997
2998 2004-10-04  Darin Adler  <darin@apple.com>
2999
3000         Reviewed by Ken.
3001
3002         - fixed <rdar://problem/3800667> REGRESSION (Mail): double-clicking multiple spaces only selects two spaces
3003
3004         * kwq/KWQTextUtilities.mm: (KWQFindWordBoundary): Moved here from the .cpp file. Changed to use the
3005         doubleClickAtIndex: method from NSAttributedString rather than using Unicode Utilities.
3006         * kwq/KWQTextUtilities.cpp: Removed.
3007         * WebCore.pbproj/project.pbxproj: Removed KWQTextUtilities.cpp.
3008
3009         - fixed a problem that would show up using HTML editing under garbage collection
3010
3011         * kwq/KWQEditCommand.mm: (-[KWQEditCommand finalize]): Fixed a [super dealloc] that should have been a
3012         [super finalize].
3013
3014         - another small change
3015
3016         * khtml/editing/visible_units.cpp: (khtml::nextWordBoundary): Tweaked a comment.
3017
3018 2004-10-01  Darin Adler  <darin@apple.com>
3019
3020         Reviewed by Ken (or arguably done by Ken, reviewed by Darin).
3021
3022         - fixed <rdar://problem/3823828> REGRESSION (Mail): Clicking past end of any line puts insertion point at beginning of next line
3023
3024         * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::VisiblePosition):
3025         Check for an offset of 0 and a <br> and use UPSTREAM affinity in that case.
3026         This is a short term fix for something that needs a better longer-term fix.
3027
3028         - fixed <rdar://problem/3823816> REGRESSION (Mail): double-clicking first word on line also selects previous empty line
3029
3030         * khtml/editing/visible_units.cpp: (khtml::previousWordBoundary): Added a special
3031         case for <br>. While I'm not sure why this regressed, I'm sure this fix is good.
3032
3033 2004-10-01  Darin Adler  <darin@apple.com>
3034
3035         Reviewed by John.
3036
3037         - fixed <rdar://problem/3782117> CrashTracer: ..722 crashes at com.apple.WebCore: DOM::HTMLBodyElementImpl::insertedIntoDocument + 0x2c (AOL website)
3038
3039         * khtml/html/html_baseimpl.cpp:
3040         (HTMLBodyElementImpl::insertedIntoDocument): Check for nil document case.
3041         (HTMLFrameElementImpl::isURLAllowed): Ditto.
3042         (HTMLFrameElementImpl::openURL): Ditto.
3043
3044 2004-10-01  Darin Adler  <darin@apple.com>
3045
3046         Reviewed by Maciej.
3047
3048         - fixed <rdar://problem/3822218> REGRESSION (164-165): images don't update on rollover on directv.com page
3049
3050         I introduced a major regression where various JavaScript window properties would not be found when I
3051         fixed bug 3809600.
3052
3053         * khtml/ecma/kjs_window.h: Added hasProperty.
3054         * khtml/ecma/kjs_window.cpp: (Window::hasProperty): Return true in all the cases where get returns something.
3055
3056 2004-09-30  Darin Adler  <darin@apple.com>
3057
3058         Reviewed by Maciej.
3059
3060         - fixed <rdar://problem/3461499> JavaScript function document.open() is buggy with 2nd argument "replace"
3061
3062         Experiments with Firefox indicate that document.open() should not be treated as window.open() unless there
3063         are more than two parameters. Also, Firefox does not implement the "replace" behavior, so we don't have
3064         to worry about it either.
3065
3066         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): Only forward to window if there are more than
3067         two parameters, rather than if there are more than one.
3068
3069         - fixed <rdar://problem/3672933> oninput is firing at page load time for <input type=range>
3070
3071         * kwq/KWQSlider.mm: (QSlider::setValue): Don't emit a signal here. This follows the usual pattern, where
3072         a signal is only emitted for changes that are not explicitly requested by the caller.
3073
3074         - fixed <rdar://problem/3821167> leaks of something allocated by recalcStyle after loading altavista page from cvs-base
3075
3076         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Ref and deref the style we allocate so it's
3077         not left floating if setStyle decides not to ref it.
3078
3079         - fixed <rdar://problem/3821172> leak of HTML attribute string after loading the ESPN page from cvs-base
3080
3081         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseHTMLAttribute): Use the DOMString version of
3082         the lower() operation so we don't end up leaving a DOMStringImpl * floating if AtomicString decides not
3083         to ref it.
3084
3085 2004-09-30  Richard Williamson   <rjw@apple.com>
3086
3087         Fixed <rdar://problem/3822330> REGRESSION: crash on launch when homepage is set to about:blank
3088         
3089         Added nil check.
3090         
3091         * kwq/KWQKHTMLPart.mm:
3092         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
3093
3094 2004-09-30  Chris Blumenberg  <cblu@apple.com>
3095         
3096         Fixed: <rdar://problem/3792822> Safari is calling the Cocoa QuickTime plugin twice for the OBJECT and EMBED tags
3097
3098         Reviewed by hyatt.
3099
3100         * khtml/html/html_objectimpl.cpp:
3101         (HTMLObjectElementImpl::attach): call dispatchHTMLEvent after updateWidget instead of every time this method is called
3102         (HTMLObjectElementImpl::recalcStyle): ditto
3103
3104 2004-09-30  Darin Adler  <darin@apple.com>
3105
3106         - rolled out bad image change that caused performance regression
3107
3108         * khtml/rendering/render_image.cpp: (RenderImage::setPixmap):
3109         Don't reference the new image before doing the assignment.
3110         This forced an unwanted.
3111
3112 2004-09-30  Ken Kocienda  <kocienda@apple.com>
3113
3114         Reviewed by me, coded by Darin
3115
3116         - fixed <rdar://problem/3818305> REGRESSION (Mail): Shift + page up has no effect; should modify selection
3117
3118         * khtml/editing/selection.cpp: (khtml::Selection::modify): Fix problem where vertical distance
3119         was used as a distance threshold, but was a negative number. Now make it positive at the start
3120         of the function (and make a couple related changes).
3121
3122 2004-09-29  Richard Williamson   <rjw@apple.com>
3123
3124         Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object
3125
3126         The fix has two parts, 1) make onblur and onfocus work for windows, 
3127         and 2), allow the dashboard to override WebKit's special key/non-key
3128         behaviors.
3129
3130         Reviewed by Chris.
3131
3132         * kwq/KWQKHTMLPart.mm:
3133         (KWQKHTMLPart::setDisplaysWithFocusAttributes):
3134
3135 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3136
3137         Reviewed by Hyatt
3138         
3139         Fix for this bug:
3140         
3141         <rdar://problem/3705894> REGRESSION (Mail): if a single word is wider than the window, 
3142         it doesn't break and just runs off the right side
3143
3144         * khtml/css/css_computedstyle.cpp:
3145         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support for CSS_PROP_WORD_WRAP.
3146         * khtml/css/cssparser.cpp:
3147         (CSSParser::parseValue): Ditto.
3148         * khtml/css/cssproperties.c: Generated file.
3149         * khtml/css/cssproperties.h: Ditto.
3150         * khtml/css/cssproperties.in: Add word-wrap property.
3151         * khtml/css/cssstyleselector.cpp:
3152         (khtml::CSSStyleSelector::applyProperty): Add support for CSS_PROP_WORD_WRAP.
3153         * khtml/css/cssvalues.c: Generated file.
3154         * khtml/css/cssvalues.h: Ditto.
3155         * khtml/css/cssvalues.in: Add break-word value.
3156         * khtml/rendering/bidi.cpp:
3157         (khtml::RenderBlock::findNextLineBreak): Add code to implement new word wrapping feature.
3158         * khtml/rendering/render_style.cpp:
3159         (StyleCSS3InheritedData): Add support for new wordWrap property.
3160         (StyleCSS3InheritedData::operator==): Ditto.
3161         (RenderStyle::diff): Ditto.
3162         * khtml/rendering/render_style.h:
3163         (khtml::RenderStyle::wordWrap): Ditto.
3164         (khtml::RenderStyle::setWordWrap): Ditto.
3165         (khtml::RenderStyle::initialWordWrap): Ditto.
3166
3167 2004-09-29  Maciej Stachowiak  <mjs@apple.com>
3168
3169         Reviewed by John.
3170
3171         - consolidated OS version checks into prefix header
3172
3173         * WebCorePrefix.h:
3174         * khtml/rendering/render_canvasimage.cpp:
3175         * kwq/KWQAccObject.mm:
3176         (-[KWQAccObject roleDescription]):
3177         (-[KWQAccObject accessibilityActionDescription:]):
3178         * kwq/KWQComboBox.mm:
3179         (QComboBox::QComboBox):
3180         * kwq/KWQFoundationExtras.h:
3181
3182 2004-09-29  David Hyatt  <hyatt@apple.com>
3183
3184         Make sure <br>s always get line boxes.  Also prevent the creation of RenderTexts for whitespace normal/nowrap nodes
3185         that follow <br>s.
3186         
3187         Reviewed by kocienda
3188
3189         * khtml/editing/visible_position.cpp:
3190         (khtml::VisiblePosition::isCandidate):
3191         * khtml/rendering/render_br.cpp:
3192         (RenderBR::RenderBR):
3193         (RenderBR::createInlineBox):
3194         (RenderBR::baselinePosition):
3195         (RenderBR::lineHeight):
3196         * khtml/rendering/render_br.h:
3197         * khtml/rendering/render_line.cpp:
3198         (khtml::InlineFlowBox::placeBoxesVertically):
3199         * khtml/rendering/render_line.h:
3200         (khtml::InlineBox::isText):
3201         (khtml::InlineFlowBox::addToLine):
3202         * khtml/rendering/render_text.cpp:
3203         (RenderText::detach):
3204         * khtml/rendering/render_text.h:
3205         (khtml::InlineTextBox:::InlineRunBox):
3206         (khtml::InlineTextBox::isInlineTextBox):
3207         (khtml::InlineTextBox::isText):
3208         (khtml::InlineTextBox::setIsText):
3209         * khtml/xml/dom_textimpl.cpp:
3210         (TextImpl::rendererIsNeeded):
3211         * kwq/KWQRenderTreeDebug.cpp:
3212         (operator<<):
3213
3214 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3215
3216         Reviewed by John
3217
3218         Fix for this bug:
3219         
3220         <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom
3221
3222         * khtml/editing/selection.cpp:
3223         (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
3224         from a Selection. Return an empty Range when there is an exception.
3225
3226         Fix for this bug:
3227         
3228         <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of 
3229         visible area of view with arrow keys
3230
3231         * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
3232         Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
3233         (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
3234         (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
3235         (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
3236         (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
3237         (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
3238         is also calculated here.
3239         (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
3240         (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a 
3241         layout if needed.
3242         (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
3243         (khtml::Selection::paintCaret): Ditto.
3244         (khtml::Selection::validate): Ditto.
3245         * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and 
3246         expectedVisibleRect accessor.
3247         * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
3248         this is not only about making the caret visible anymore. Now it can reveal the varying
3249         end of the selection when scrolling with arrow keys.
3250         * kwq/WebCoreBridge.mm:
3251         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to 
3252         ensureSelectionVisible name change.
3253         (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
3254         (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
3255         (-[WebCoreBridge insertNewline]): Ditto
3256         (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
3257         (-[WebCoreBridge deleteKeyPressed]): Ditto
3258         (-[WebCoreBridge ensureSelectionVisible]): Ditto
3259
3260 2004-09-29  Ken Kocienda  <kocienda@apple.com>
3261
3262         Reviewed by Hyatt
3263         
3264         Fix for this bug:
3265         
3266         <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly
3267         
3268         * kwq/KWQKHTMLPart.h:
3269         * kwq/KWQKHTMLPart.mm:
3270         (KWQKHTMLPart::centerSelectionInVisibleArea): New function. Handles both caret
3271         and range selections correctly.
3272         * kwq/KWQNSViewExtras.h: Add forceCentering boolean to some methods in this file.
3273         * kwq/KWQNSViewExtras.m: Ditto. This addition has been done since the AppKit 
3274         method we use to do the centering, -[NSView scrollRectToVisible:],  does not alter 
3275         the view if the rectangle passed to it is already in view. When forceCentering is
3276         true, extra math is done to make scrollRectToVisible center the rectangle we want.
3277         (-[NSView _KWQ_scrollFrameToVisible]): Pass NO for forceCentering in call through to 
3278         _KWQ_scrollRectToVisible:forceCentering:
3279         (-[NSView _KWQ_scrollRectToVisible:forceCentering:]): Add forceCentering argument.
3280         (-[NSView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto.
3281         (-[NSClipView _KWQ_scrollRectToVisible:inView:forceCentering:]): Ditto. Do extra
3282         math to implement the forceCentering effect.
3283         * kwq/KWQScrollView.h: Add forceCentering default argument to ensureRectVisibleCentered.
3284         * kwq/KWQScrollView.mm:
3285         (QScrollView::ensureRectVisibleCentered): Ditto.
3286         * kwq/WebCoreBridge.h:
3287         * kwq/WebCoreBridge.mm:
3288         (-[WebCoreBridge centerSelectionInVisibleArea]): New function. Call through to KWQKHTMLPart. 
3289
3290 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3291
3292         Fixed: WebArchives begin with "<#document/>"
3293
3294         Reviewed by hyatt.
3295
3296         * khtml/xml/dom_nodeimpl.cpp:
3297         (NodeImpl::startMarkup): don't return markup if this is a document node, forgot this when factoring this method out from toHTML
3298
3299 2004-09-28  Chris Blumenberg  <cblu@apple.com>
3300
3301         Removed range parameter from recursive_toHTML and friends since that code path is no longer used.
3302         
3303         Reviewed by mjs.
3304
3305         * khtml/xml/dom2_rangeimpl.cpp:
3306         (DOM::RangeImpl::toHTML):
3307         * khtml/xml/dom_nodeimpl.cpp:
3308         (NodeImpl::recursive_toString):
3309         (NodeImpl::recursive_toHTML):
3310         * khtml/xml/dom_nodeimpl.h:
3311         * kwq/WebCoreBridge.mm:
3312         (-[WebCoreBridge markupStringFromNode:nodes:]):
3313
3314 2004-09-28  Darin Adler  <darin@apple.com>
3315
3316         Reviewed by Ken.
3317
3318         - improve spell checking so it doesn't unmark and remark as you move the cursor with the arrow
3319
3320         * khtml/editing/htmlediting.h: Remove obsolete markMisspellingsInSelection private function.
3321         * khtml/editing/htmlediting.cpp:
3322         (khtml::EditCommand::EditCommand): Blow away the selection when starting an edit command.
3323         (khtml::EditCommand::apply): Remove code to mark misspellings because that's now done as part
3324         of blowing away the selection.