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