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