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