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