1 2004-11-21 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
7 * khtml/html/html_miscimpl.cpp:
8 (HTMLCollectionImpl::calcLength):
9 (HTMLCollectionImpl::getItem):
10 (HTMLCollectionImpl::item):
11 (HTMLCollectionImpl::nextItem):
12 (HTMLCollectionImpl::getNamedItem):
13 (HTMLCollectionImpl::namedItem):
14 (HTMLCollectionImpl::nextNamedItemInternal):
15 (HTMLFormCollectionImpl::nextNamedItemInternal):
17 2004-11-19 Maciej Stachowiak <mjs@apple.com>
21 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
22 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
23 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
25 Many optimizations to HTMLFormCollection. Iterating it should not
26 be N^2 any more, though finding items by name could still be.
28 * khtml/html/html_formimpl.cpp:
29 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
30 (DOM::HTMLFormElementImpl::length):
31 (DOM::HTMLFormElementImpl::submitClick):
32 (DOM::HTMLFormElementImpl::formData):
33 (DOM::HTMLFormElementImpl::submit):
34 (DOM::HTMLFormElementImpl::reset):
35 (DOM::HTMLFormElementImpl::radioClicked):
36 (DOM::appendToVector):
37 (DOM::removeFromVector):
38 (DOM::HTMLFormElementImpl::registerFormElement):
39 (DOM::HTMLFormElementImpl::removeFormElement):
40 (DOM::HTMLFormElementImpl::makeFormElementDormant):
41 (DOM::HTMLFormElementImpl::registerImgElement):
42 (DOM::HTMLFormElementImpl::removeImgElement):
43 * khtml/html/html_formimpl.h:
44 * khtml/html/html_miscimpl.cpp:
45 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
46 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
47 (HTMLFormCollectionImpl::resetCollectionInfo):
48 (HTMLFormCollectionImpl::calcLength):
49 (HTMLFormCollectionImpl::item):
50 (HTMLFormCollectionImpl::getNamedItem):
51 (HTMLFormCollectionImpl::getNamedFormItem):
52 (HTMLFormCollectionImpl::firstItem):
53 (HTMLFormCollectionImpl::nextItem):
54 * khtml/html/html_miscimpl.h:
55 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
56 * khtml/xml/dom_elementimpl.cpp:
57 (ElementImpl::setAttribute):
58 (ElementImpl::setAttributeMap):
60 (QPtrVector::findRef):
61 * kwq/KWQVectorImpl.h:
62 * kwq/KWQVectorImpl.mm:
63 (KWQVectorImpl::findRef):
64 * kwq/WebCoreBridge.mm:
65 (-[WebCoreBridge elementWithName:inForm:]):
66 (-[WebCoreBridge controlsInForm:]):
68 2004-11-19 David Harrison <harrison@apple.com>
70 Reviewed by Ken and Darin.
72 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
74 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
75 for the existing style, but in this case (hitting cmd-B with caret at top of
76 file) there is nothing upstream. Changed this to use the VisiblePosition
77 deepEquivalent instead.
79 * khtml/khtml_part.cpp:
80 (KHTMLPart::computeAndSetTypingStyle):
84 2004-11-19 Maciej Stachowiak <mjs@apple.com>
88 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
90 * khtml/xml/dom_docimpl.cpp:
91 (DocumentImpl::close): Don't fire the onload handler if there is a
92 redirect pending. This is a very long-standing bug that was masked
93 by our previously incorrect redirect logic. It used to be that an
94 older redirect would always win. Recently we changed things so
95 that a newer redirect would win, but a script that causes a
96 redirect would stop parsing once complete (so if there are two
97 redirects in the same script, the latter wins). However, we should
98 have also prevented onload in this case. Testing with other
99 browsers shows that onload handlers do not run at all when there
100 is a pending redirect.
102 2004-11-19 Ken Kocienda <kocienda@apple.com>
106 Fix some object lifetime issues in these two commands. This fixes some crashes
107 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
109 * khtml/editing/htmlediting.cpp:
110 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
111 in the ancestor list. They are not ref'ed when put on list. D'uh.
112 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
113 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
114 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
116 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
118 2004-11-19 Ken Kocienda <kocienda@apple.com>
124 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
126 * khtml/khtml_part.cpp:
127 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
128 declaration given the current selection, and then sets the minimum necessary style as the typing
130 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
131 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
133 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
134 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
135 * kwq/WebCoreBridge.mm:
136 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
137 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
139 2004-11-18 David Harrison <harrison@apple.com>
143 Back out Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered by Mail.app.
144 Filed <rdar://problem/3886832> against Mail.app.
147 (-[DOMCSSStyleDeclaration setProperty:::]):
149 2004-11-18 Chris Blumenberg <cblu@apple.com>
151 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
155 * kwq/KWQKHTMLPart.mm:
156 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
158 2004-11-18 Maciej Stachowiak <mjs@apple.com>
162 - fix recursive item traversal, use traverseNextNode() instead of
163 the buggy hand-rolled traversal.
165 * khtml/xml/dom_nodeimpl.cpp:
166 (NodeListImpl::recursiveItem):
168 2004-11-17 Darin Adler <darin@apple.com>
172 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
174 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
175 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
177 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
178 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
179 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
180 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
181 an entire category of leaks we have been fixing one by one recently
182 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
183 stale RenderObject pointer, although I never saw it do that in practice
184 - implemented the length and item methods for computed styles
185 - implemented querying additional properties in computed styles (29 more)
187 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
188 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
189 take a mutable style.
190 * khtml/khtml_part.cpp:
191 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
192 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
193 a computed style; also change some types to mutable style.
194 (updateState): Update iteration of CSSProperty objects in a style declaration to use
195 the new valuesIterator interface.
196 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
197 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
198 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
199 including accomodating the exception code that setCssText has now.
200 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
201 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
202 the style attributes really was a change, although it's not an important optimization it's
205 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
206 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
207 calling it were already removing the old property explicitly, so the code in here to remove
208 the property again was redundant.
210 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
211 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
212 * khtml/css/css_computedstyle.cpp:
213 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
214 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
215 Before we had no guarantee the object would outlast us.
216 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
217 exception to NO_MODIFICATION_ALLOWED_ERR.
218 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
219 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
220 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
221 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
222 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
223 page-break-inside, position, unicode-bidi, widows, z-index.
224 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
225 exception to NO_MODIFICATION_ALLOWED_ERR.
226 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
227 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
228 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
229 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
230 CSSMutableStyleDeclarationImpl.
231 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
232 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
234 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
235 now a separate class rather than a typedef.
236 * khtml/css/cssparser.h: Ditto.
238 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
239 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
240 Removed a bunch of redundant stuff from other classes in this file too.
241 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
242 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
243 (DOM::CSSProperty::operator=): Added.
244 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
246 * khtml/css/css_valueimpl.cpp:
247 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
248 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
249 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
250 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
251 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
252 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
253 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
254 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
255 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
256 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
257 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
258 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
259 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
260 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
261 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
262 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
263 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
264 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
265 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
266 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
267 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
268 no styles in the list. Update to use QValueList.
269 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
270 parameter and set it.
271 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
272 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
273 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
274 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
275 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
276 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
278 * khtml/css/cssparser.cpp:
279 (CSSParser::parseValue): Changed to use addParsedProperties.
280 (CSSParser::parseDeclaration): Ditto.
281 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
283 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
284 * khtml/css/cssproperties.c: Regenerated.
285 * khtml/css/cssproperties.h: Regenerated.
287 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
288 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
290 * khtml/dom/css_value.cpp:
291 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
292 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
293 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
294 first doing getPropertyCSSValue and then doing cssText.
295 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
296 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
297 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
298 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
299 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
300 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
301 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
303 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
304 * khtml/dom/dom_node.cpp: Ditto.
306 * khtml/editing/htmlediting.h: Change some types to mutable style.
307 * khtml/editing/htmlediting.cpp:
308 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
309 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
310 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
311 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
312 (khtml::EditCommand::setTypingStyle): Ditto.
313 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
314 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
315 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
316 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
317 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
318 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
319 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
320 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
321 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
322 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
323 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
324 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
325 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
327 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
328 * khtml/html/html_baseimpl.h: Change type to mutable style.
329 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
331 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
332 class as a base class, and change types to mutable style as needed.
333 * khtml/html/html_elementimpl.cpp:
334 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
335 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
336 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
337 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
338 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
339 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
341 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
344 * khtml/html/html_tableimpl.h: Change types to mutable style.
345 * khtml/html/html_tableimpl.cpp:
346 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
347 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
348 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
350 * khtml/html/htmlparser.cpp:
351 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
352 than using an explicit delete to make the node go away, and is required for compatibility with the
353 changes to the NodeImpl functions.
354 (KHTMLParser::insertNode): Ditto.
355 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
356 the NodeImpl functions.
358 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
359 now that there's no need to make the property list explictly.
362 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
363 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
364 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
366 * khtml/xml/dom_nodeimpl.cpp:
367 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
368 function succeeded or not for ownership purposes.
369 (NodeImpl::replaceChild): Ditto.
370 (NodeImpl::appendChild): Ditto.
371 (NodeBaseImpl::insertBefore): Ditto.
372 (NodeBaseImpl::replaceChild): Ditto.
373 (NodeBaseImpl::appendChild): Ditto.
374 (NodeBaseImpl::addChild): Ditto.
376 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
377 * WebCore-combined.exp: Regenerated.
379 2004-11-18 Maciej Stachowiak <mjs@apple.com>
381 still even more build fixing
383 * khtml/html/html_miscimpl.cpp:
384 (HTMLCollectionImpl::resetCollectionInfo):
386 2004-11-18 Maciej Stachowiak <mjs@apple.com>
390 * khtml/html/html_miscimpl.cpp:
391 (HTMLCollectionImpl::resetCollectionInfo):
393 2004-11-18 Maciej Stachowiak <mjs@apple.com>
397 * khtml/html/html_miscimpl.h:
398 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
400 2004-11-18 Maciej Stachowiak <mjs@apple.com>
404 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
406 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
407 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
409 This is also a start on fixing 5 other bugs, but those need additional work to make
410 HTMLFormCollection fast.
412 * khtml/html/html_documentimpl.h:
413 (DOM::HTMLDocumentImpl::collectionInfo):
414 * khtml/html/html_formimpl.cpp:
415 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
416 (DOM::HTMLFormElementImpl::isURLAttribute):
417 (DOM::HTMLFormElementImpl::registerImgElement):
418 (DOM::HTMLFormElementImpl::removeImgElement):
419 * khtml/html/html_formimpl.h:
420 * khtml/html/html_imageimpl.cpp:
421 (HTMLImageElementImpl::HTMLImageElementImpl):
422 (HTMLImageElementImpl::~HTMLImageElementImpl):
423 * khtml/html/html_imageimpl.h:
424 * khtml/html/html_miscimpl.cpp:
425 (HTMLCollectionImpl::HTMLCollectionImpl):
426 (HTMLCollectionImpl::~HTMLCollectionImpl):
427 (HTMLCollectionImpl::updateCollectionInfo):
428 (HTMLCollectionImpl::length):
429 (HTMLCollectionImpl::item):
430 (HTMLCollectionImpl::firstItem):
431 (HTMLCollectionImpl::nextItem):
432 (HTMLCollectionImpl::namedItem):
433 (HTMLCollectionImpl::nextNamedItemInternal):
434 (HTMLFormCollectionImpl::getNamedFormItem):
435 * khtml/html/html_miscimpl.h:
436 (DOM::HTMLCollectionImpl::):
437 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
438 * khtml/html/htmlparser.cpp:
439 (KHTMLParser::getElement):
440 * khtml/xml/dom_docimpl.cpp:
441 (DocumentImpl::DocumentImpl):
442 * khtml/xml/dom_docimpl.h:
443 (DOM::DocumentImpl::incDOMTreeVersion):
444 (DOM::DocumentImpl::domTreeVersion):
445 * khtml/xml/dom_nodeimpl.cpp:
449 2004-11-18 Kevin Decker <kdecker@apple.com>
453 fixed: <rdar://problem/3841842> getPropertyID expensive
456 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
458 2004-11-17 David Hyatt <hyatt@apple.com>
460 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
461 and subsequently backed out).
465 * khtml/html/html_baseimpl.cpp:
466 (HTMLBodyElementImpl::insertedIntoDocument):
467 * khtml/html/htmltokenizer.cpp:
468 (khtml::HTMLTokenizer::reset):
469 (khtml::HTMLTokenizer::scriptHandler):
470 (khtml::HTMLTokenizer::scriptExecution):
471 (khtml::HTMLTokenizer::write):
472 (khtml::HTMLTokenizer::continueProcessing):
473 (khtml::HTMLTokenizer::timerEvent):
474 (khtml::HTMLTokenizer::notifyFinished):
475 * khtml/html/htmltokenizer.h:
476 * khtml/khtmlview.cpp:
477 (KHTMLViewPrivate::KHTMLViewPrivate):
478 (KHTMLViewPrivate::reset):
481 (KHTMLView::timerEvent):
482 (KHTMLView::scheduleRelayout):
483 (KHTMLView::layoutPending):
484 (KHTMLView::haveDelayedLayoutScheduled):
485 (KHTMLView::unscheduleRelayout):
487 * khtml/xml/dom_docimpl.cpp:
488 (DocumentImpl::DocumentImpl):
489 (DocumentImpl::close):
490 (DocumentImpl::setParsing):
491 (DocumentImpl::shouldScheduleLayout):
492 (DocumentImpl::minimumLayoutDelay):
493 (DocumentImpl::write):
494 (DocumentImpl::finishParsing):
495 (DocumentImpl::stylesheetLoaded):
496 (DocumentImpl::updateStyleSelector):
497 * khtml/xml/dom_docimpl.h:
498 (DOM::DocumentImpl::parsing):
499 * kwq/KWQDateTime.mm:
500 (KWQUIEventTime::uiEventPending):
502 2004-11-17 David Harrison <harrison@apple.com>
504 Reviewed by Ken Kocienda.
506 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
507 Treat null case as meaning no post-move merge is needed.
509 * khtml/editing/htmlediting.cpp:
510 (khtml::DeleteSelectionCommand::initializePositionData):
512 2004-11-17 David Harrison <harrison@apple.com>
514 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
515 * khtml/xml/dom_nodeimpl.cpp:
516 (NodeImpl::displayNode):
517 (NodeImpl::displayTree):
518 (NodeBaseImpl::dispatchChildRemovalEvents):
519 * khtml/xml/dom_nodeimpl.h:
521 2004-11-16 John Sullivan <sullivan@apple.com>
525 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
527 * khtml/khtml_part.cpp:
529 delete the list we created when we're done with it
531 2004-11-16 Ken Kocienda <kocienda@apple.com>
535 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
536 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
537 QPtrList when the list goes out of scope.
539 * khtml/editing/htmlediting.cpp:
540 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
541 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
542 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
543 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
544 No longer set lists to autodelete.
545 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
546 Call new derefNodesInList helper.
547 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
548 of one before, but now it does.
550 2004-11-15 David Harrison <harrison@apple.com>
552 Reviewed by Chris and Darin.
554 <rdar://problem/3880304> Non-linear performance hit for style changes
556 * khtml/xml/dom_nodeimpl.cpp:
557 (NodeImpl::traverseNextNode):
558 (NodeImpl::traverseNextSibling):
559 (NodeImpl::traversePreviousNodePostOrder):
560 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
561 Add asserts that stayWithin is an ancestor of the returned node.
563 2004-11-15 Darin Adler <darin@apple.com>
567 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
569 * khtml/css/css_computedstyle.cpp:
570 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
571 since there's no guarantee it's already ref'd.
572 * khtml/css/css_valueimpl.cpp:
573 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
574 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
575 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
576 (CSSStyleDeclarationImpl::merge): Ditto.
577 (CSSStyleDeclarationImpl::diff): Ditto.
578 * khtml/editing/htmlediting.cpp:
579 (khtml::StyleChange::currentlyHasStyle): Ditto.
580 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
581 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
582 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
584 2004-11-15 Darin Adler <darin@apple.com>
588 Use separate mutable style and computed style types as appropriate.
589 For now this should have no effect, but it prepares us for refactoring later.
590 Also remove some unnecessary "DOM::" prefixes and in one case factor out
593 * khtml/khtml_part.cpp:
594 (KHTMLPart::typingStyle):
595 (KHTMLPart::setTypingStyle):
597 (KHTMLPart::selectionHasStyle):
598 (KHTMLPart::selectionStartHasStyle):
599 (KHTMLPart::selectionComputedStyle):
600 * khtml/khtml_part.h:
601 * khtml/khtmlpart_p.h:
603 * khtml/css/css_base.h:
604 * khtml/css/css_ruleimpl.cpp:
605 (CSSStyleRuleImpl::setDeclaration):
606 * khtml/css/css_ruleimpl.h:
607 (DOM::CSSFontFaceRuleImpl::style):
608 (DOM::CSSPageRuleImpl::style):
609 (DOM::CSSStyleRuleImpl::style):
610 (DOM::CSSStyleRuleImpl::declaration):
611 * khtml/css/css_valueimpl.h:
612 (DOM::CSSPrimitiveValueImpl::):
613 * khtml/css/cssparser.cpp:
614 (CSSParser::parseValue):
615 (CSSParser::parseColor):
616 (CSSParser::parseDeclaration):
617 (CSSParser::createStyleDeclaration):
618 * khtml/css/cssparser.h:
619 * khtml/css/cssstyleselector.cpp:
620 (khtml::CSSStyleSelector::addMatchedDeclaration):
621 (khtml::CSSStyleSelector::matchRulesForList):
622 (khtml::CSSStyleSelector::styleForElement):
623 (khtml::CSSStyleSelector::applyDeclarations):
624 * khtml/css/cssstyleselector.h:
625 * khtml/css/parser.cpp:
626 * khtml/css/parser.y:
627 * khtml/dom/css_rule.h:
628 * khtml/dom/css_stylesheet.h:
629 * khtml/dom/css_value.h:
630 * khtml/dom/dom2_views.cpp:
631 * khtml/xml/dom2_viewsimpl.cpp:
632 (DOM::AbstractViewImpl::getComputedStyle):
633 * khtml/xml/dom_docimpl.cpp:
634 (DocumentImpl::importNode):
635 (DocumentImpl::setStyleSheet):
636 * khtml/xml/dom_docimpl.h:
637 * khtml/xml/dom_xmlimpl.cpp:
638 (DOM::ProcessingInstructionImpl::setStyleSheet):
639 * khtml/xml/dom_xmlimpl.h:
641 * khtml/dom/css_value.cpp:
642 (DOM::throwException): Added.
643 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
644 The real thing is coming with the next change to refactor.
645 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
646 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
648 2004-11-15 Darin Adler <darin@apple.com>
652 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
654 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
655 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
656 node's attributes changed without sending a misleading childrenChanged call,
657 but the childrenChanged call can happen at the exact right moment.
658 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
659 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
660 the boolean true is passed in.
662 * khtml/xml/dom_elementimpl.cpp:
663 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
664 (NamedAttrMapImpl::removeAttribute): Ditto.
666 2004-11-15 John Sullivan <sullivan@apple.com>
670 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
671 seen often in Mail and Blot
673 * khtml/css/css_valueimpl.cpp:
674 (CSSStyleDeclarationImpl::copyPropertiesInSet):
675 delete temporary list after we're done using it
677 2004-11-15 Richard Williamson <rjw@apple.com>
679 Fixed leak (3879883) that John found. Early return leaked
684 * khtml/css/css_computedstyle.cpp:
685 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
687 2004-11-15 Ken Kocienda <kocienda@apple.com>
693 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
695 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
696 EditCommandPtr to its parent, but this caused a a reference cycle in composite
697 commands as the children held a ref to their parent. Now, the parent variable
698 is a non-retained reference to an EditCommand *. It would be nice to have a
699 weak reference to the parent or even override deref in composite commands (but I
700 can't since deref() is not virtual). However, this should be OK since any
701 dangling parent pointer is a sign of a bigger object lifetime problem that
702 would need to be addressed anyway.
704 * khtml/css/css_valueimpl.cpp:
705 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
706 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
707 just assigning the list variable passed in to the local list variable, or the list will be
709 * khtml/editing/htmlediting.cpp:
710 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
711 (khtml::EditCommand::setEndingSelection): Ditto.
712 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
713 Unrelated to the change, but saves some ref's and deref's.
714 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
715 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
716 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
717 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
719 2004-11-15 Maciej Stachowiak <mjs@apple.com>
723 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
725 * khtml/xml/dom_nodeimpl.cpp:
726 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
728 (NodeListImpl::recursiveLength): Adjusted for rename.
729 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
730 If the same offset is looked up again, just return it, otherwise, if looking up
731 a later offset, start at the last item and proceed from there.
732 (NodeListImpl::itemById): Apply the special document optimization to all
733 nodes that are either a document or in a document - just walk up to make
734 sure the node found by ID has the root node as an ancestor.
735 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
736 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
738 2004-11-15 John Sullivan <sullivan@apple.com>
742 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
744 * kwq/KWQKHTMLPart.mm:
745 (KWQKHTMLPart::documentFragmentWithText):
746 release mutable copy of string after we're done using it
748 2004-11-14 Kevin Decker <kdecker@apple.com>
752 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
754 * khtml/html/html_elementimpl.cpp:
755 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
756 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
758 2004-11-13 Maciej Stachowiak <mjs@apple.com>
762 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
764 * khtml/dom/dom_node.cpp:
765 (NodeList::itemById): New method, just forward to impl.
766 * khtml/dom/dom_node.h: Prototype it.
767 * khtml/ecma/kjs_dom.cpp:
768 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
769 let the NodeList do it. The NodeList might be able to do it more efficiently.
770 * khtml/xml/dom_nodeimpl.cpp:
771 (NodeListImpl::itemById): Optimize for the case where the NodeList
772 covers the whole document. In this case, just use getElementById,
773 then check that the element satisfies the list criteria.
774 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
775 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
776 * khtml/xml/dom_nodeimpl.h:
778 2004-11-12 Maciej Stachowiak <mjs@apple.com>
782 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
783 sometimes using a huge bogus length value.
785 * khtml/xml/dom_nodeimpl.cpp:
786 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
788 2004-11-12 Darin Adler <darin@apple.com>
792 - fixed an infinite loop in that last check-in
794 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
795 Added a ++i to the loop so it won't get stuck on the first element in the list.
797 2004-11-12 Maciej Stachowiak <mjs@apple.com>
801 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
803 I fixed this by changing NodeLists to cache their length, but
804 invalidate it whenever there is a change in the DOM subtree at
805 which they are rooted. This makes NodeListImpl::recursiveLength()
806 drop completely off the profile, since we were repeatedly getting
807 a length for the same NodeList over and over.
809 * khtml/xml/dom_nodeimpl.cpp:
810 (NodeImpl::NodeImpl):
811 (NodeImpl::~NodeImpl):
812 (NodeImpl::registerNodeList):
813 (NodeImpl::unregisterNodeList):
814 (NodeImpl::notifyLocalNodeListsSubtreeModified):
815 (NodeImpl::notifyNodeListsSubtreeModified):
816 (NodeImpl::dispatchSubtreeModifiedEvent):
817 (NodeListImpl::NodeListImpl):
818 (NodeListImpl::~NodeListImpl):
819 (NodeListImpl::recursiveLength):
820 (NodeListImpl::recursiveItem):
821 (NodeListImpl::rootNodeSubtreeModified):
822 (ChildNodeListImpl::ChildNodeListImpl):
823 (ChildNodeListImpl::length):
824 (ChildNodeListImpl::item):
825 (TagNodeListImpl::TagNodeListImpl):
826 (TagNodeListImpl::length):
827 (TagNodeListImpl::item):
828 (NameNodeListImpl::NameNodeListImpl):
829 (NameNodeListImpl::length):
830 (NameNodeListImpl::item):
831 * khtml/xml/dom_nodeimpl.h:
833 2004-11-12 Darin Adler <darin@apple.com>
837 - various small cleanups
839 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
840 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
842 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
843 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
844 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
845 * khtml/html/htmltokenizer.cpp:
846 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
847 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
849 * khtml/khtml_part.h: Removed docImpl function.
850 * khtml/khtml_part.cpp: Ditto.
852 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
853 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
855 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
856 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
857 part of the change last time, which is why the build broke).
858 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
859 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
860 (KWQKHTMLPart::keyEvent): Ditto.
861 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
862 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
864 2004-11-12 Chris Blumenberg <cblu@apple.com>
866 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
870 * kwq/KWQKHTMLPart.mm:
871 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
875 2004-11-12 Darin Adler <darin@apple.com>
879 - fixed a couple places that would not work for XML documents
881 * khtml/ecma/kjs_window.cpp:
882 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
883 is present on the base class.
884 (WindowFunc::tryCall): More of the same.
886 2004-11-12 Darin Adler <darin@apple.com>
888 - land versions of these files generated by the newer gperf
890 People building on Panther will continue to see these files modified.
891 A workaround would be to install the newer gperf on our Tiger build machines.
893 * khtml/css/cssproperties.c: Regenerated.
894 * khtml/css/cssvalues.c: Regenerated.
895 * khtml/html/doctypes.cpp: Regenerated.
896 * khtml/html/kentities.c: Regenerated.
897 * khtml/misc/htmlattrs.c: Regenerated.
898 * khtml/misc/htmltags.c: Regenerated.
899 * kwq/KWQColorData.c: Regenerated.
901 2004-11-11 Richard Williamson <rjw@apple.com>
903 Fix build horkage from previous checkin.
905 * kwq/KWQKHTMLPart.h:
907 2004-11-11 Darin Adler <darin@apple.com>
911 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
913 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
915 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
916 * kwq/KWQKHTMLPart.mm:
917 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
918 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
919 we started with the NSTextField as first responder, and then took focus away and gave it back, which
920 makes dragging text work again.
921 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
923 2004-11-11 David Hyatt <hyatt@apple.com>
925 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
929 * khtml/html/htmltokenizer.cpp:
930 (khtml::HTMLTokenizer::continueProcessing):
932 2004-11-11 Ken Kocienda <kocienda@apple.com>
936 * khtml/editing/htmlediting.cpp:
937 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
938 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
939 with the prevailing style for the VisiblePosition class.
940 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
941 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
942 (khtml::visiblePositionsInDifferentBlocks): New helper method.
943 (khtml::isLastVisiblePositionInBlock): Ditto.
944 (khtml::isLastVisiblePositionInNode): Ditto.
945 * khtml/editing/visible_position.h: Add declarations for new functions.
947 2004-11-11 Ken Kocienda <kocienda@apple.com>
951 * khtml/editing/htmlediting.cpp:
952 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
953 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
954 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
955 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
956 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
957 * khtml/xml/dom2_rangeimpl.cpp:
958 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
959 * khtml/xml/dom2_rangeimpl.h: Ditto.
961 2004-11-11 Ken Kocienda <kocienda@apple.com>
965 Some improvements to deleting when complete lines are selected.
967 * khtml/editing/htmlediting.cpp:
968 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
969 the end of a selection is fully selected. Turn off block merging in this case.
970 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
971 whether a BR immediately followed a block. The old code could erroneously skip nodes.
972 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
973 start block is selected. This new code will now delete this block in one call, rather
974 than iterating over each child.
975 * khtml/editing/visible_position.cpp:
976 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
977 to do the work mentioned above in the comment for that function.
978 (khtml::isFirstVisiblePositionOnLine): Ditto.
979 (khtml::isLastVisiblePositionOnLine): Ditto.
980 * khtml/editing/visible_position.h: Add new functions.
981 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
982 * layout-tests/editing/deleting/delete-line-001.html: Added.
983 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
984 * layout-tests/editing/deleting/delete-line-002.html: Added.
985 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
986 * layout-tests/editing/deleting/delete-line-003.html: Added.
987 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
988 * layout-tests/editing/deleting/delete-line-004.html: Added.
989 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
990 * layout-tests/editing/deleting/delete-line-005.html: Added.
991 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
992 * layout-tests/editing/deleting/delete-line-006.html: Added.
993 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
994 * layout-tests/editing/deleting/delete-line-007.html: Added.
995 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
996 * layout-tests/editing/deleting/delete-line-008.html: Added.
997 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
998 * layout-tests/editing/deleting/delete-line-009.html: Added.
999 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
1000 * layout-tests/editing/deleting/delete-line-010.html: Added.
1001 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
1002 * layout-tests/editing/deleting/delete-line-011.html: Added.
1003 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
1004 * layout-tests/editing/deleting/delete-line-012.html: Added.
1006 2004-11-11 Ken Kocienda <kocienda@apple.com>
1010 * khtml/editing/htmlediting.cpp:
1011 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
1013 2004-11-11 Ken Kocienda <kocienda@apple.com>
1019 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
1020 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
1022 * khtml/editing/selection.cpp:
1023 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
1024 the next line position when necessary.
1025 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
1026 * layout-tests/editing/selection/move-3875618-fix.html: Added.
1027 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
1028 * layout-tests/editing/selection/move-3875641-fix.html: Added.
1030 2004-11-11 Ken Kocienda <kocienda@apple.com>
1034 Improved some function names, at John's urging. No changes to the
1035 functions themselves.
1037 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
1038 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
1039 performGeneralDelete() --> handleGeneralDelete()
1041 * khtml/editing/htmlediting.cpp:
1042 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
1043 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
1044 (khtml::DeleteSelectionCommand::handleGeneralDelete)
1045 (khtml::DeleteSelectionCommand::doApply)
1046 * khtml/editing/htmlediting.h
1048 2004-11-11 Ken Kocienda <kocienda@apple.com>
1052 Updated some layout test results that changed as a result of my last checking.
1053 Added a new test that has been in my tree for a few days.
1055 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
1056 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
1057 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
1058 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
1060 2004-11-11 Ken Kocienda <kocienda@apple.com>
1064 * khtml/editing/htmlediting.cpp:
1065 (khtml::debugNode): New debugging helper.
1066 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
1067 startPositionForDelete() and endPositionForDelete() functions. Just use the
1068 m_selectionToDelete object to determine start and end positions for the delete.
1069 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
1070 function that creates a special case for deleting all the content in a root
1072 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
1073 function before BR special case and the general case delete functions.
1074 * khtml/editing/htmlediting.h: Updated for changed functions.
1076 2004-11-10 Kevin Decker <kdecker@apple.com>
1080 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
1082 * khtml/ecma/kjs_dom.cpp:
1083 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
1085 2004-11-10 Ken Kocienda <kocienda@apple.com>
1089 * khtml/editing/htmlediting.cpp:
1090 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
1091 smart delete from the two functions below to here. There was an unnecessary double
1092 calculation of the leading and trailing whitespace positions. Also refined the trailing
1093 case so it only acts when the leading position is null (which seems to match TextEdit in
1094 my tests). Also removed some unnecessary copying of Position objects.
1095 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
1097 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1099 2004-11-10 Ken Kocienda <kocienda@apple.com>
1101 Reviewed by Harrison
1103 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
1104 make things more clear.
1105 * khtml/editing/selection.cpp:
1106 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
1107 resulting positions do not cross block boundaries. This was a bug and caused some
1108 delete problems when whole blocks were selected. I will be addressing that issue
1109 more fully in upcoming changes.
1111 2004-11-10 Ken Kocienda <kocienda@apple.com>
1113 Reviewed by Harrison
1115 Some cleanups and fixes in upstream and downstream functions.
1117 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
1118 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
1119 block's enclosing block will be returned.
1121 Remove code from upstream that confined the serach to block boundaries outside of
1122 the code which runs in the StayInBlock case. This code was redundant, and caused
1123 incorrect results to be returned in the DoNotStayInBlock case.
1125 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
1126 node, not the the this pointer's node.
1128 * khtml/xml/dom_position.cpp:
1129 (DOM::Position::upstream)
1130 (DOM::Position::downstream)
1132 2004-11-09 David Hyatt <hyatt@apple.com>
1134 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
1135 loading large local files.
1139 * khtml/html/htmltokenizer.cpp:
1140 (khtml::HTMLTokenizer::HTMLTokenizer):
1141 (khtml::HTMLTokenizer::reset):
1142 (khtml::HTMLTokenizer::write):
1143 (khtml::HTMLTokenizer::stopped):
1144 (khtml::HTMLTokenizer::processingData):
1145 (khtml::HTMLTokenizer::continueProcessing):
1146 (khtml::HTMLTokenizer::timerEvent):
1147 (khtml::HTMLTokenizer::allDataProcessed):
1148 (khtml::HTMLTokenizer::end):
1149 (khtml::HTMLTokenizer::finish):
1150 (khtml::HTMLTokenizer::notifyFinished):
1151 * khtml/html/htmltokenizer.h:
1152 * khtml/khtml_part.cpp:
1153 (KHTMLPart::slotFinished):
1156 * khtml/khtml_part.h:
1157 (KHTMLPart::tokenizerProcessedData):
1158 * khtml/khtmlview.cpp:
1159 * khtml/xml/dom_docimpl.cpp:
1160 * khtml/xml/xml_tokenizer.h:
1161 (khtml::Tokenizer::stopped):
1162 (khtml::Tokenizer::processingData):
1163 * kwq/KWQDateTime.h:
1164 * kwq/KWQDateTime.mm:
1165 (QDateTime::secsTo):
1166 (KWQUIEventTime::uiEventPending):
1167 * kwq/KWQKHTMLPart.h:
1168 * kwq/KWQKHTMLPart.mm:
1169 (KWQKHTMLPart::tokenizerProcessedData):
1170 * kwq/WebCoreBridge.h:
1171 * kwq/WebCoreBridge.mm:
1172 (-[WebCoreBridge stop]):
1173 (-[WebCoreBridge numPendingOrLoadingRequests]):
1174 (-[WebCoreBridge doneProcessingData]):
1176 2004-11-09 David Harrison <harrison@apple.com>
1178 Reviewed by Ken Kocienda.
1180 <rdar://problem/3865837> Wrong text style after delete to start of document
1182 * khtml/editing/htmlediting.cpp:
1183 (khtml::DeleteSelectionCommand::saveTypingStyleState):
1184 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
1186 2004-11-09 Richard Williamson <rjw@apple.com>
1188 Fixed <rdar://problem/3872440> NSTimer prematurely released.
1197 2004-11-09 Chris Blumenberg <cblu@apple.com>
1201 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
1203 2004-11-08 David Harrison <harrison@apple.com>
1205 Reviewed by Ken Kocienda.
1207 <rdar://problem/3865854> Deleting first line deletes all lines
1209 * khtml/editing/htmlediting.cpp:
1210 (khtml::DeleteSelectionCommand::performGeneralDelete):
1211 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
1212 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
1213 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
1214 update because it is handled in calculateEndingPosition now.
1215 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
1216 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
1218 2004-11-08 Ken Kocienda <kocienda@apple.com>
1222 * khtml/html/html_elementimpl.cpp:
1223 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
1224 are added to the DOM.
1225 * khtml/html/html_elementimpl.h: Ditto.
1226 * khtml/html/htmlparser.cpp:
1227 (KHTMLParser::KHTMLParser): Ditto.
1228 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
1229 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
1230 * khtml/html/htmltokenizer.cpp:
1231 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
1232 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
1233 There were a couple of indexing errors that resulted in the comment text containing part of the
1235 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
1236 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
1238 2004-11-08 Chris Blumenberg <cblu@apple.com>
1240 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
1244 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
1245 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
1246 * kwq/KWQKHTMLPart.h: ditto
1248 2004-11-08 Darin Adler <darin@apple.com>
1252 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
1254 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
1255 that possibly deletes the QTimer.
1257 2004-11-08 Chris Blumenberg <cblu@apple.com>
1259 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
1263 * kwq/KWQTextField.mm:
1264 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
1265 * kwq/WebCoreBridge.h:
1267 2004-11-08 David Harrison <harrison@apple.com>
1271 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
1273 * khtml/editing/htmlediting.cpp:
1274 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
1275 * khtml/xml/dom_nodeimpl.cpp:
1276 (NodeImpl::enclosingInlineElement):
1277 * khtml/xml/dom_nodeimpl.h:
1279 2004-11-05 Chris Blumenberg <cblu@apple.com>
1281 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
1285 * khtml/editing/htmlediting.cpp:
1286 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
1287 * khtml/editing/visible_position.cpp:
1288 (khtml::VisiblePosition::character): new, returns the character for the position
1289 * khtml/editing/visible_position.h:
1290 * kwq/KWQKHTMLPart.h:
1291 * kwq/KWQKHTMLPart.mm:
1292 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
1293 * kwq/WebCoreBridge.h:
1297 2004-11-05 Adele Amchan <adele@apple.com>
1301 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
1302 and a workaround for displaying transparent backgrounds for textareas.
1304 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
1305 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
1306 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
1307 on the contentView, and on the textView.
1309 2004-11-04 David Hyatt <hyatt@apple.com>
1311 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
1314 Reviewed by darin or ken
1316 * khtml/rendering/bidi.cpp:
1317 (khtml::appendRunsForObject):
1318 (khtml::RenderBlock::skipWhitespace):
1319 (khtml::RenderBlock::findNextLineBreak):
1320 * khtml/rendering/render_block.cpp:
1321 (khtml::RenderBlock::lowestPosition):
1322 (khtml::RenderBlock::rightmostPosition):
1323 (khtml::RenderBlock::leftmostPosition):
1324 * khtml/rendering/render_box.cpp:
1325 (RenderBox::position):
1326 * khtml/rendering/render_box.h:
1327 (khtml::RenderBox::staticX):
1328 (khtml::RenderBox::staticY):
1329 * khtml/rendering/render_layer.cpp:
1330 (RenderLayer::updateLayerPosition):
1331 (RenderLayer::convertToLayerCoords):
1332 * khtml/rendering/render_line.cpp:
1333 (khtml::InlineFlowBox::placeBoxesHorizontally):
1334 * khtml/rendering/render_object.h:
1335 (khtml::RenderObject::staticX):
1336 (khtml::RenderObject::staticY):
1338 Finish turning on XSLT. Make sure child stylesheets can load.
1340 * khtml/xsl/xslt_processorimpl.cpp:
1341 (DOM::stylesheetLoadFunc):
1342 (DOM::XSLTProcessorImpl::transformDocument):
1344 2004-11-04 David Hyatt <hyatt@apple.com>
1346 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
1347 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
1348 keyword and length values.
1352 * khtml/css/cssparser.cpp:
1353 (CSSParser::parseValue):
1354 (CSSParser::addBackgroundValue):
1355 (CSSParser::parseBackgroundShorthand):
1356 (CSSParser::parseBackgroundColor):
1357 (CSSParser::parseBackgroundImage):
1358 (CSSParser::parseBackgroundPositionXY):
1359 (CSSParser::parseBackgroundPosition):
1360 (CSSParser::parseBackgroundProperty):
1361 (CSSParser::parseColorFromValue):
1362 * khtml/css/cssparser.h:
1363 * khtml/css/cssstyleselector.cpp:
1364 (khtml::CSSStyleSelector::adjustRenderStyle):
1365 (khtml::CSSStyleSelector::applyProperty):
1366 (khtml::CSSStyleSelector::mapBackgroundAttachment):
1367 (khtml::CSSStyleSelector::mapBackgroundImage):
1368 (khtml::CSSStyleSelector::mapBackgroundRepeat):
1369 (khtml::CSSStyleSelector::mapBackgroundXPosition):
1370 (khtml::CSSStyleSelector::mapBackgroundYPosition):
1371 * khtml/css/cssstyleselector.h:
1372 * khtml/rendering/render_box.cpp:
1373 (RenderBox::paintRootBoxDecorations):
1374 (RenderBox::paintBoxDecorations):
1375 (RenderBox::paintBackgrounds):
1376 (RenderBox::paintBackground):
1377 (RenderBox::paintBackgroundExtended):
1378 * khtml/rendering/render_box.h:
1379 * khtml/rendering/render_form.cpp:
1380 (RenderFieldset::paintBoxDecorations):
1381 * khtml/rendering/render_line.cpp:
1382 (khtml::InlineFlowBox::paintBackgrounds):
1383 (khtml::InlineFlowBox::paintBackground):
1384 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1385 * khtml/rendering/render_line.h:
1386 * khtml/rendering/render_object.cpp:
1387 (RenderObject::setStyle):
1388 (RenderObject::updateBackgroundImages):
1389 (RenderObject::getVerticalPosition):
1390 * khtml/rendering/render_object.h:
1391 (khtml::RenderObject::paintBackgroundExtended):
1392 * khtml/rendering/render_style.cpp:
1394 (BackgroundLayer::BackgroundLayer):
1395 (BackgroundLayer::~BackgroundLayer):
1396 (BackgroundLayer::operator=):
1397 (BackgroundLayer::operator==):
1398 (BackgroundLayer::fillUnsetProperties):
1399 (BackgroundLayer::cullEmptyLayers):
1400 (StyleBackgroundData::StyleBackgroundData):
1401 (StyleBackgroundData::operator==):
1402 (RenderStyle::diff):
1403 (RenderStyle::adjustBackgroundLayers):
1404 * khtml/rendering/render_style.h:
1405 (khtml::OutlineValue::operator==):
1406 (khtml::OutlineValue::operator!=):
1407 (khtml::BackgroundLayer::backgroundImage):
1408 (khtml::BackgroundLayer::backgroundXPosition):
1409 (khtml::BackgroundLayer::backgroundYPosition):
1410 (khtml::BackgroundLayer::backgroundAttachment):
1411 (khtml::BackgroundLayer::backgroundRepeat):
1412 (khtml::BackgroundLayer::next):
1413 (khtml::BackgroundLayer::isBackgroundImageSet):
1414 (khtml::BackgroundLayer::isBackgroundXPositionSet):
1415 (khtml::BackgroundLayer::isBackgroundYPositionSet):
1416 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
1417 (khtml::BackgroundLayer::isBackgroundRepeatSet):
1418 (khtml::BackgroundLayer::setBackgroundImage):
1419 (khtml::BackgroundLayer::setBackgroundXPosition):
1420 (khtml::BackgroundLayer::setBackgroundYPosition):
1421 (khtml::BackgroundLayer::setBackgroundAttachment):
1422 (khtml::BackgroundLayer::setBackgroundRepeat):
1423 (khtml::BackgroundLayer::clearBackgroundImage):
1424 (khtml::BackgroundLayer::clearBackgroundXPosition):
1425 (khtml::BackgroundLayer::clearBackgroundYPosition):
1426 (khtml::BackgroundLayer::clearBackgroundAttachment):
1427 (khtml::BackgroundLayer::clearBackgroundRepeat):
1428 (khtml::BackgroundLayer::setNext):
1429 (khtml::BackgroundLayer::operator!=):
1430 (khtml::BackgroundLayer::containsImage):
1431 (khtml::BackgroundLayer::hasImage):
1432 (khtml::BackgroundLayer::hasFixedImage):
1433 (khtml::RenderStyle::setBitDefaults):
1434 (khtml::RenderStyle::hasBackground):
1435 (khtml::RenderStyle::hasFixedBackgroundImage):
1436 (khtml::RenderStyle::outlineWidth):
1437 (khtml::RenderStyle::outlineStyle):
1438 (khtml::RenderStyle::outlineStyleIsAuto):
1439 (khtml::RenderStyle::outlineColor):
1440 (khtml::RenderStyle::backgroundColor):
1441 (khtml::RenderStyle::backgroundImage):
1442 (khtml::RenderStyle::backgroundRepeat):
1443 (khtml::RenderStyle::backgroundAttachment):
1444 (khtml::RenderStyle::backgroundXPosition):
1445 (khtml::RenderStyle::backgroundYPosition):
1446 (khtml::RenderStyle::accessBackgroundLayers):
1447 (khtml::RenderStyle::backgroundLayers):
1448 (khtml::RenderStyle::outlineOffset):
1449 (khtml::RenderStyle::resetOutline):
1450 (khtml::RenderStyle::setBackgroundColor):
1451 (khtml::RenderStyle::setOutlineWidth):
1452 (khtml::RenderStyle::setOutlineStyle):
1453 (khtml::RenderStyle::setOutlineColor):
1454 (khtml::RenderStyle::clearBackgroundLayers):
1455 (khtml::RenderStyle::inheritBackgroundLayers):
1456 (khtml::RenderStyle::setOutlineOffset):
1457 * khtml/rendering/render_table.cpp:
1458 (RenderTable::paintBoxDecorations):
1459 (RenderTableCell::paintBoxDecorations):
1461 2004-11-04 David Hyatt <hyatt@apple.com>
1463 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
1464 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
1468 * kwq/KWQTextCodec.mm:
1469 (KWQTextDecoder::convertLatin1):
1470 (KWQTextDecoder::convertUTF16):
1471 (KWQTextDecoder::convertUsingTEC):
1472 (KWQTextDecoder::toUnicode):
1474 2004-11-04 David Hyatt <hyatt@apple.com>
1476 Make sure line-height returns the correct value for normal.
1480 * khtml/css/css_computedstyle.cpp:
1481 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1483 2004-11-04 David Harrison <harrison@apple.com>
1485 Reviewed by Ken Kocienda.
1487 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
1489 * khtml/editing/htmlediting.cpp:
1490 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
1491 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
1492 Fixed to insert after the destination subtree, rather than the destination element. Handles
1493 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
1494 * khtml/xml/dom_nodeimpl.cpp:
1495 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
1496 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
1497 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
1498 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
1500 2004-11-03 Ken Kocienda <kocienda@apple.com>
1506 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
1507 * layout-tests/editing/deleting/delete-br-008.html: Added.
1508 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
1509 * layout-tests/editing/deleting/delete-br-009.html: Added.
1510 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
1511 * layout-tests/editing/deleting/delete-br-010.html: Added.
1513 2004-11-03 Maciej Stachowiak <mjs@apple.com>
1515 Fix by Yasuo Kida, reviewed by me.
1517 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
1519 * kwq/KWQKHTMLPart.mm:
1520 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
1521 same as a nil range - setting an empty marked range should clear
1522 the marked range entirely.
1524 2004-11-02 Maciej Stachowiak <mjs@apple.com>
1526 Reviewed by Dave Hyatt (when I originally coded it).
1528 WebCore part of fix for:
1530 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
1532 * kwq/WebCoreBridge.h:
1533 * kwq/WebCoreBridge.mm:
1534 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
1535 DOMRange, or if the range is split into multiple lines, the rect for the part on
1536 the first line only.
1538 * khtml/rendering/render_object.cpp:
1539 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
1540 for the overrides below.
1541 * khtml/rendering/render_object.h:
1542 * khtml/rendering/render_box.cpp:
1543 (RenderBox::caretRect):
1544 * khtml/rendering/render_box.h:
1545 * khtml/rendering/render_br.cpp:
1546 (RenderBR::caretRect):
1547 * khtml/rendering/render_br.h:
1548 * khtml/rendering/render_flow.cpp:
1549 (RenderFlow::caretRect):
1550 * khtml/rendering/render_flow.h:
1551 * khtml/rendering/render_text.cpp:
1552 (RenderText::caretRect):
1554 2004-11-02 Ken Kocienda <kocienda@apple.com>
1558 Implemented command to insert a block in response to typing a return key (even though
1559 I am not turning that on by default with this patch....that will come later).
1561 This new command is called InsertParagraphSeparatorCommand.
1563 Reworked the command and function names associated with inserting content into a
1564 document. Before this patch, there were inputXXX and insertXXX variants, with the
1565 former used for more high-level actions and the latter used for lower-level stuff.
1566 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
1567 in an insertXXX command going through an inputXXX WebCore step and then finally to an
1568 insertXXX WebCore step. To make this less confusing, I have changes all the names to
1569 be insertXXX, and modified the lower-level operations so that it is clear what they do.
1571 * khtml/editing/htmlediting.cpp:
1572 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
1573 (khtml::EditCommand::isInsertTextCommand): Ditto.
1574 (khtml::CompositeEditCommand::inputText): Ditto.
1575 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
1576 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
1577 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
1578 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
1579 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
1580 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
1581 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
1582 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
1583 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
1584 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
1585 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1586 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1587 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
1588 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
1589 (khtml::InsertIntoTextNode::doApply): Ditto.
1590 (khtml::InsertIntoTextNode::doUnapply): Ditto.
1591 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
1592 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
1593 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
1594 (khtml::InsertLineBreakCommand::doApply):
1595 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
1596 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
1597 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
1598 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
1599 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
1600 (khtml::InsertParagraphSeparatorCommand::doApply):
1601 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1602 Class name change, was InsertNewlineCommandInQuotedContentCommand.
1603 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
1604 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
1605 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1606 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
1607 (khtml::InsertTextCommand::doApply): Ditto.
1608 (khtml::InsertTextCommand::deleteCharacter): Ditto.
1609 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1610 (khtml::InsertTextCommand::input): Ditto.
1611 (khtml::InsertTextCommand::insertSpace): Ditto.
1612 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
1613 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
1614 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
1615 (khtml::TypingCommand::insertParagraphSeparator): New function.
1616 (khtml::TypingCommand::doApply): Name changes, as above.
1617 (khtml::TypingCommand::insertText): Ditto.
1618 (khtml::TypingCommand::deleteKeyPressed): Ditto.
1619 (khtml::TypingCommand::preservesTypingStyle): Ditto.
1620 * khtml/editing/htmlediting.h:
1621 (khtml::DeleteFromTextNodeCommand::node): Name change.
1622 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
1623 (khtml::DeleteFromTextNodeCommand::count): Ditto.
1624 (khtml::InsertIntoTextNode::text): Ditto.
1625 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
1626 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
1627 (khtml::TypingCommand::): Ditto.
1628 * khtml/editing/jsediting.cpp: Name changes, as above.
1629 * kwq/WebCoreBridge.h:
1630 * kwq/WebCoreBridge.mm:
1631 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
1632 (-[WebCoreBridge insertParagraphSeparator]): New function.
1633 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
1635 2004-11-01 Kevin Decker <kdecker@apple.com>
1639 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
1642 * khtml/ecma/kjs_window.cpp:
1643 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
1645 2004-11-01 Darin Adler <darin@apple.com>
1649 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
1651 * khtml/css/html4.css: Use color: initial for textarea and related ones.
1653 2004-11-01 Ken Kocienda <kocienda@apple.com>
1659 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
1661 * khtml/css/css_computedstyle.cpp:
1662 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
1663 implementation here into new copyPropertiesInSet helper. This now calls the
1664 generalized copyPropertiesInSet function with the arguments needed to make copying
1666 * khtml/css/css_computedstyle.h:
1667 * khtml/css/css_valueimpl.cpp:
1668 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
1669 In order to do apply block properties, "regular" style declarations need to do style
1671 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
1672 except that it uses a different set of properties that apply only to blocks.
1673 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
1674 and copies out those properties listed in a pre-defined set.
1675 * khtml/css/css_valueimpl.h:
1676 * khtml/editing/htmlediting.cpp:
1677 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
1678 block, factoring out some of the special case code that should now only run in the inline case.
1679 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
1680 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
1681 special handling for "legacy" HTML styles like <B> and <I>.
1682 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
1683 style changes into different kinds. CSS specifies certain properties only apply to certain
1684 element types. This set of changes now recognizes two such separate cases: styles that apply
1685 to blocks, and styles that apply to inlines.
1686 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
1687 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
1688 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
1689 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
1690 done so that the function can be passed a portion of the styles being applied so that block styles
1691 and inline styles can be handled separately.
1692 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1693 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
1694 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
1695 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
1696 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
1697 * khtml/editing/htmlediting.h:
1698 (khtml::StyleChange::): Changed as described above.
1699 (khtml::StyleChange::usesLegacyStyles):
1700 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
1701 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
1702 when text align changes.
1703 * khtml/khtml_part.cpp:
1704 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
1705 the passed-in argument.
1706 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
1707 is a caret. Formerly, this just set typing style and made no visible changes to the document.
1711 * layout-tests/editing/editing.js: Added some glue to change text align.
1712 * layout-tests/editing/style/block-style-001-expected.txt: Added.
1713 * layout-tests/editing/style/block-style-001.html: Added.
1714 * layout-tests/editing/style/block-style-002-expected.txt: Added.
1715 * layout-tests/editing/style/block-style-002.html: Added.
1716 * layout-tests/editing/style/block-style-003-expected.txt: Added.
1717 * layout-tests/editing/style/block-style-003.html: Added.
1721 2004-10-29 Darin Adler <darin@apple.com>
1725 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
1727 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
1728 before advancing one character; before it did it backwards.
1730 2004-10-29 Chris Blumenberg <cblu@apple.com>
1732 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
1734 Reviewed by kocienda, adele.
1736 * khtml/rendering/render_frames.cpp:
1737 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
1739 2004-10-29 Darin Adler <darin@apple.com>
1743 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
1745 * khtml/khtmlview.cpp:
1746 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
1747 deleted before this function finishes running.
1748 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
1749 (KHTMLView::viewportMouseReleaseEvent): Ditto.
1750 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
1751 is guaranteed to do ref/deref as needed.
1753 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
1755 2004-10-28 Chris Blumenberg <cblu@apple.com>
1757 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
1761 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
1762 * WebCorePrefix.h: always use XSLT
1764 2004-10-28 Ken Kocienda <kocienda@apple.com>
1770 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
1771 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
1773 * khtml/editing/htmlediting.cpp:
1774 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
1775 to initialization list, zeroing them out.
1776 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
1777 handle a delete of content in special cases where the only thing selected is a BR. This
1778 code path is much simpler than the newly-named performGeneralDelete, and detects when no
1779 content merging should be done between blocks. This aspect of the change fixes 3854848.
1780 One of the special cases added fixes 3803832.
1781 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
1782 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
1783 like the other helpers in this class.
1784 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
1785 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
1786 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
1788 2004-10-28 Chris Blumenberg <cblu@apple.com>
1790 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
1794 * kwq/KWQKHTMLPart.mm:
1795 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
1797 2004-10-28 Ken Kocienda <kocienda@apple.com>
1799 Reviewed by Harrison
1801 Reorganization of delete command functionality so that doApply is not
1802 several hundred lines long. This is not a squeaky-clean cleanup, but
1803 it is a step in the right direction. No functionality changes.
1805 * khtml/editing/htmlediting.cpp:
1806 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
1807 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
1808 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
1809 (khtml::DeleteSelectionCommand::performDelete): Ditto.
1810 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
1811 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
1812 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
1813 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
1814 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
1815 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
1816 * khtml/editing/htmlediting.h:
1818 2004-10-28 Ken Kocienda <kocienda@apple.com>
1822 * khtml/editing/htmlediting.cpp:
1823 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
1824 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
1826 2004-10-27 Ken Kocienda <kocienda@apple.com>
1830 * khtml/editing/htmlediting.cpp:
1831 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
1832 whether content not in the block containing the start of the selection is moved to that block
1833 after the selection is deleted.
1834 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
1835 (khtml::DeleteSelectionCommand::doApply): Ditto.
1836 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
1837 to handle the case of inserting a newline when in quoted content in Mail.
1838 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
1839 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
1840 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
1841 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
1842 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
1843 (khtml::TypingCommand::doApply): Ditto.
1844 (khtml::TypingCommand::preservesTypingStyle): Ditto.
1845 * khtml/editing/htmlediting.h: Add new delclarations.
1846 (khtml::TypingCommand::): Ditto.
1847 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
1848 * kwq/WebCoreBridge.mm:
1849 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
1851 2004-10-26 Chris Blumenberg <cblu@apple.com>
1853 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
1857 * khtml/ecma/kjs_dom.cpp:
1858 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
1859 * khtml/ecma/kjs_dom.h:
1860 (KJS::DOMElement::):
1861 * khtml/ecma/kjs_dom.lut.h:
1864 2004-10-26 David Hyatt <hyatt@apple.com>
1866 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
1869 Reviewed by kocienda
1871 * khtml/rendering/bidi.cpp:
1872 (khtml::RenderBlock::layoutInlineChildren):
1874 2004-10-26 David Hyatt <hyatt@apple.com>
1876 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
1877 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
1879 Reviewed by kocienda
1881 * khtml/rendering/render_canvas.cpp:
1882 (RenderCanvas::selectionRect):
1883 * khtml/rendering/render_object.h:
1884 (khtml::RenderObject::hasSelectedChildren):
1886 2004-10-26 Ken Kocienda <kocienda@apple.com>
1892 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
1894 * khtml/editing/htmlediting.cpp:
1895 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
1896 let the caller know if a placeholder was removed.
1897 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
1898 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
1899 some cases, the selection was still set on the removed BR, and this was the cause of the
1901 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
1903 2004-10-26 Darin Adler <darin@apple.com>
1907 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
1909 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
1911 2004-10-26 Ken Kocienda <kocienda@apple.com>
1915 * khtml/editing/htmlediting.cpp:
1916 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
1917 with a zero-length string. That triggers an assert. Call deleteText instead,
1918 using the same indices that are passed to replaceText.
1920 Cleaned up the asserts in these three functions below, making them
1921 more consistent. This is not needed for the fix, but I tripped over
1922 these in the course of debugging.
1924 (khtml::InsertTextCommand::InsertTextCommand):
1925 (khtml::InsertTextCommand::doApply):
1926 (khtml::InsertTextCommand::doUnapply):
1928 2004-10-25 Adele Amchan <adele@apple.com>
1932 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
1933 * khtml/xml/dom_docimpl.h:
1935 2004-10-25 Adele Amchan <adele@apple.com>
1937 Reviewed by me, code change by Darin.
1939 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
1941 2004-10-25 Ken Kocienda <kocienda@apple.com>
1943 Oops. These two test results changed with my last checkin, for the better.
1945 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
1946 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
1948 2004-10-25 Ken Kocienda <kocienda@apple.com>
1954 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
1956 * khtml/editing/htmlediting.cpp:
1957 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
1958 expand the selection outwards when the selection is on the visible boundary of a root
1959 editable element. This fixes the bug. Note that this function also contains a little code
1960 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
1961 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1962 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
1963 * khtml/editing/htmlediting.h: Declare new helpers.
1964 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
1965 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
1966 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
1967 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
1968 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
1969 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
1971 2004-10-25 Ken Kocienda <kocienda@apple.com>
1973 Added some more editing layout tests.
1975 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
1976 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
1977 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
1978 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
1979 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
1980 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
1981 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
1982 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
1983 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
1984 * layout-tests/editing/inserting/typing-003.html: Added.
1986 2004-10-25 Ken Kocienda <kocienda@apple.com>
1990 * khtml/rendering/bidi.cpp:
1991 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
1992 yesterday quite right: words that should have been placed on the next line were instead
1993 appearing on the line before, beyond the right margin. This was a one-word only error
1994 based on moving the line break object when it should have stayed put. Here is the rule:
1995 The line break object only moves to after the whitespace on the end of a line if that
1996 whitespace caused line overflow when its width is added in.
1998 2004-10-25 Adele Amchan <adele@apple.com>
2002 Fix for <rdar://problem/3619890> Feature request: designMode
2004 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
2005 This will enable more JS editing compatibility.
2007 * khtml/ecma/kjs_html.cpp:
2008 (KJS::HTMLDocument::tryGet): added case for designMode
2009 (KJS::HTMLDocument::putValue): added case for designMode
2010 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
2011 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
2012 * khtml/xml/dom_docimpl.cpp:
2013 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
2014 (DocumentImpl::setDesignMode): added function to assign m_designMode value
2015 (DocumentImpl::getDesignMode): return m_designMode value
2016 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
2017 Otherwise, it will just return the m_designMode value.
2018 (DocumentImpl::parentDocument):
2019 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
2020 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
2022 2004-10-22 Ken Kocienda <kocienda@apple.com>
2028 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
2030 * khtml/editing/htmlediting.cpp:
2031 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
2032 everything that could be affected.
2033 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
2034 braces, making it act as a comma operator, with a zero value as the right value!!! This made
2035 an important check always fail!!! It turns out that we do not want the constant at all, since
2036 that constant is only needed when checking a computed style, not an inline style as is being
2038 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
2039 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
2040 RangeImpl::compareBoundaryPoints to perform the required check.
2041 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
2043 2004-10-22 Ken Kocienda <kocienda@apple.com>
2049 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
2050 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
2052 * khtml/rendering/bidi.cpp:
2053 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
2054 it is when we are editing, add in the space of the current character when calculating the width
2055 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
2056 the line break object and call skipWhitespace to move past the end of the whitespace.
2060 2004-10-22 Ken Kocienda <kocienda@apple.com>
2062 * WebCore.pbproj/project.pbxproj:
2063 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
2065 2004-10-21 David Hyatt <hyatt@apple.com>
2069 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
2071 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
2072 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
2074 * khtml/rendering/render_block.cpp:
2075 (khtml::getInlineRun):
2076 (khtml::RenderBlock::makeChildrenNonInline):
2078 2004-10-21 David Hyatt <hyatt@apple.com>
2080 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
2081 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
2085 * khtml/rendering/render_inline.cpp:
2086 (RenderInline::splitFlow):
2088 2004-10-21 Ken Kocienda <kocienda@apple.com>
2092 Significant improvement to the way that whitespace is handled during editing.
2094 * khtml/editing/htmlediting.cpp:
2095 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
2096 two being added with this name) that delete "insignificant" unrendered text.
2097 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
2098 calculates the downstream position to use as the endpoint for the deletion, and
2099 then calls deleteInsignificantText with this start and end.
2100 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
2101 (khtml::InputNewlineCommand::doApply): Ditto.
2102 (khtml::InputTextCommand::input): Ditto.
2103 * khtml/editing/htmlediting.h: Add new declarations.
2105 Modified layout test results:
2106 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
2107 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
2108 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
2109 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
2110 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
2111 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
2112 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
2113 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
2114 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
2115 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
2116 * layout-tests/editing/inserting/insert-br-001-expected.txt:
2117 * layout-tests/editing/inserting/insert-br-004-expected.txt:
2118 * layout-tests/editing/inserting/insert-br-005-expected.txt:
2119 * layout-tests/editing/inserting/insert-br-006-expected.txt:
2120 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
2121 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
2122 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
2123 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
2124 * layout-tests/editing/inserting/typing-001-expected.txt:
2125 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
2126 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
2127 * layout-tests/editing/style/typing-style-003-expected.txt:
2128 * layout-tests/editing/undo/redo-typing-001-expected.txt:
2129 * layout-tests/editing/undo/undo-typing-001-expected.txt:
2131 2004-10-21 David Hyatt <hyatt@apple.com>
2133 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
2134 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
2138 * khtml/rendering/render_block.cpp:
2139 (khtml::getInlineRun):
2141 2004-10-20 David Hyatt <hyatt@apple.com>
2143 Add better dumping of overflow information for scrolling regions.
2145 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
2146 from the render tree so that layers and so forth are cleaned up.
2150 * khtml/rendering/render_container.cpp:
2151 (RenderContainer::detach):
2152 * khtml/rendering/render_layer.h:
2153 (khtml::RenderLayer::scrollXOffset):
2154 (khtml::RenderLayer::scrollYOffset):
2155 * kwq/KWQRenderTreeDebug.cpp:
2158 2004-10-20 David Hyatt <hyatt@apple.com>
2160 Fix for 3791146, make sure all lines are checked when computing overflow.
2162 Reviewed by kocienda
2164 * khtml/rendering/bidi.cpp:
2165 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2166 (khtml::RenderBlock::layoutInlineChildren):
2167 (khtml::RenderBlock::findNextLineBreak):
2168 (khtml::RenderBlock::checkLinesForOverflow):
2169 * khtml/rendering/render_block.h:
2171 2004-10-20 David Hyatt <hyatt@apple.com>
2173 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
2175 Reviewed by kocienda
2177 * khtml/rendering/break_lines.cpp:
2178 (khtml::isBreakable):
2180 2004-10-20 Darin Adler <darin@apple.com>
2184 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
2186 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
2187 Create a palette with the background and foreground colors in it and set it on the widget.
2189 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
2190 with APPLE_CHANGES. Removed palette and palette-related function members.
2191 * khtml/rendering/render_style.cpp:
2192 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
2193 (RenderStyle::diff): No palette to compare.
2195 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
2196 * kwq/KWQLineEdit.mm:
2197 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
2198 (QLineEdit::text): Made const.
2200 * kwq/KWQTextEdit.h: Added setPalette override.
2201 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
2204 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
2205 per color group, and only a single color group per palette.
2206 * kwq/KWQColorGroup.mm: Removed.
2207 * kwq/KWQPalette.mm: Removed.
2208 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
2210 * kwq/KWQApplication.h: Removed unused palette function.
2211 * kwq/KWQApplication.mm: Ditto.
2213 * kwq/KWQWidget.h: Removed unsetPalette.
2214 * kwq/KWQWidget.mm: Ditto.
2216 - fixed storage leak
2218 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
2219 Roll in storage leak fix from KDE guys.
2221 2004-10-19 David Hyatt <hyatt@apple.com>
2223 Reviewed by kocienda
2225 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
2226 and consolidates it with clearing.
2228 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
2230 * khtml/rendering/render_block.cpp:
2231 (khtml::getInlineRun):
2232 (khtml::RenderBlock::layoutBlock):
2233 (khtml::RenderBlock::adjustFloatingBlock):
2234 (khtml::RenderBlock::collapseMargins):
2235 (khtml::RenderBlock::clearFloatsIfNeeded):
2236 (khtml::RenderBlock::estimateVerticalPosition):
2237 (khtml::RenderBlock::layoutBlockChildren):
2238 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
2239 (khtml::RenderBlock::getClearDelta):
2240 (khtml::RenderBlock::calcBlockMinMaxWidth):
2241 * khtml/rendering/render_block.h:
2242 * khtml/rendering/render_frames.cpp:
2243 (RenderFrameSet::layout):
2244 * khtml/xml/dom_textimpl.cpp:
2245 (TextImpl::rendererIsNeeded):
2247 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
2249 * layout-tests/fast/frames/002-expected.txt: Added.
2250 * layout-tests/fast/frames/002.html: Added.
2252 2004-10-19 Darin Adler <darin@apple.com>
2256 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
2258 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
2259 scripts being loaded here. If the current code being run is the external script itself, then we don't want
2260 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
2261 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
2262 wrong since there can be a script loading in that case too. Layout tests check for both problems.
2264 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
2265 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
2266 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
2268 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
2270 2004-10-18 Darin Adler <darin@apple.com>
2272 Reviewed by Dave Hyatt.
2274 - 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)
2276 * khtml/html/htmltokenizer.cpp:
2277 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
2278 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
2279 we only want to look at loadingExtScript if m_executingScript is 0.
2281 2004-10-18 Ken Kocienda <kocienda@apple.com>
2287 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
2289 * khtml/css/css_valueimpl.cpp:
2290 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
2291 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
2292 lifecycle issues associated with creating a string to be returned in the ident case.
2293 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
2294 * khtml/css/cssstyleselector.cpp:
2295 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
2297 2004-10-18 Chris Blumenberg <cblu@apple.com>
2299 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
2301 Reviewed by kocienda.
2303 * khtml/rendering/render_frames.cpp:
2304 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
2306 2004-10-15 Chris Blumenberg <cblu@apple.com>
2308 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
2313 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
2316 2004-10-15 Ken Kocienda <kocienda@apple.com>
2320 * khtml/rendering/bidi.cpp:
2321 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
2322 skipping after a clean line break, in addition to the cases already
2324 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
2325 * layout-tests/editing/inserting/insert-br-007.html: Added.
2326 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
2327 * layout-tests/editing/inserting/insert-br-008.html: Added.
2331 2004-10-14 Ken Kocienda <kocienda@apple.com>
2337 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
2339 * khtml/editing/visible_position.cpp:
2340 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
2341 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
2342 Since we do a good job of insulating external code from the internal workings of
2343 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
2344 in the case of this bug, was doing harm. Simply removing this code makes the bug
2345 go away and does not cause any editing layout test regresssions.
2347 2004-10-14 Ken Kocienda <kocienda@apple.com>
2351 * khtml/rendering/bidi.cpp:
2352 (khtml::skipNonBreakingSpace): New helper.
2353 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
2354 at the start of a block. This was preventing users from typing spaces in empty
2356 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
2357 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
2359 2004-10-14 Adele Amchan <adele@apple.com>
2361 Reviewed by Darin and Ken.
2363 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
2365 This change shifts some code around so that the code that determines what typing style
2366 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
2367 to ensure that start and end nodes of the selection are in the document.
2369 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
2371 2004-10-14 Adele Amchan <adele@apple.com>
2375 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
2376 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
2378 * khtml/khtml_part.cpp:
2379 (KHTMLPart::shouldBeginEditing):
2380 (KHTMLPart::shouldEndEditing):
2381 (KHTMLPart::isContentEditable):
2382 * khtml/khtml_part.h:
2383 * kwq/KWQKHTMLPart.h:
2385 2004-10-14 Ken Kocienda <kocienda@apple.com>
2389 Final fix for these bugs:
2391 <rdar://problem/3806306> HTML editing puts spaces at start of line
2392 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
2394 This change sets some new CSS properties that have been added to WebCore to
2395 enable whitespace-handling and line-breaking features that make WebView work
2396 more like a text editor.
2398 * khtml/css/cssstyleselector.cpp:
2399 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
2400 based on property value.
2401 * khtml/html/html_elementimpl.cpp:
2402 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
2403 based on attribute value.
2404 * khtml/khtml_part.cpp:
2405 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
2407 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
2409 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
2410 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
2411 * khtml/khtml_part.h: Add new declarations.
2412 * kwq/WebCoreBridge.h: Ditto.
2413 * kwq/WebCoreBridge.mm:
2414 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
2415 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
2416 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
2417 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
2419 2004-10-14 John Sullivan <sullivan@apple.com>
2423 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
2425 * khtml/editing/htmlediting.cpp:
2426 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
2427 needed a nil check to handle empty document case
2429 2004-10-13 Maciej Stachowiak <mjs@apple.com>
2433 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
2435 - I fixed this by turning off all colormatching for WebKit
2436 content. We might turn it back on later. For now, it's possible to
2437 turn it on temporarily by defining COLORMATCH_EVERYTHING.
2440 * khtml/ecma/kjs_html.cpp:
2441 (KJS::Context2DFunction::tryCall):
2442 (Context2D::colorRefFromValue):
2443 (Gradient::getShading):
2444 * khtml/rendering/render_canvasimage.cpp:
2445 (RenderCanvasImage::createDrawingContext):
2447 (QColor::getNSColor):
2449 * kwq/KWQPainter.mm:
2450 (CGColorFromNSColor):
2451 (QPainter::selectedTextBackgroundColor):
2452 (QPainter::rgbColorSpace):
2453 (QPainter::grayColorSpace):
2454 (QPainter::cmykColorSpace):
2455 * kwq/WebCoreGraphicsBridge.h:
2456 * kwq/WebCoreGraphicsBridge.m:
2457 (-[WebCoreGraphicsBridge createRGBColorSpace]):
2458 (-[WebCoreGraphicsBridge createGrayColorSpace]):
2459 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
2461 2004-10-13 Ken Kocienda <kocienda@apple.com>
2465 * khtml/css/css_valueimpl.cpp:
2466 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
2467 is non-null before appending.
2469 2004-10-13 Ken Kocienda <kocienda@apple.com>
2471 Update expected results for improved behavior as a result of fix to 3816768.
2473 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
2474 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
2475 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
2477 2004-10-13 Ken Kocienda <kocienda@apple.com>
2481 * khtml/css/css_computedstyle.cpp:
2482 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
2483 for getting -khtml-line-break and -khml-nbsp-mode.
2485 2004-10-13 Ken Kocienda <kocienda@apple.com>
2491 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
2492 moves caret out of block.
2494 The issue here is that an empty block with no explicit height set by style collapses
2495 to zero height, and does so immediately after the last bit of content is removed from
2496 it (as a result of deleting text with the delete key for instance). Since zero-height
2497 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
2499 The fix is to detect when a block has not been removed itself, but has had all its
2500 contents removed. In this case, a BR element is placed in the block, one that is
2501 specially marked as a placeholder. Later, if the block ever receives content, this
2502 placeholder is removed.
2504 * khtml/editing/htmlediting.cpp:
2505 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
2506 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
2507 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
2508 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
2509 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
2510 (it's very clear that we needs to be able to move more than just text nodes). This may expose
2511 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
2512 made the test case in the bug work.
2513 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
2514 removeBlockPlaceholderIfNeeded.
2515 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
2516 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
2517 * khtml/editing/htmlediting.h: Declare new functions.
2519 2004-10-13 Richard Williamson <rjw@apple.com>
2521 Added support for -apple-dashboard-region:none. And fixed
2522 a few computed style problems.
2524 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
2527 * khtml/css/css_computedstyle.cpp:
2528 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2529 * khtml/css/css_valueimpl.cpp:
2530 (CSSPrimitiveValueImpl::cssText):
2531 * khtml/css/cssparser.cpp:
2532 (CSSParser::parseValue):
2533 (CSSParser::parseDashboardRegions):
2534 * khtml/css/cssstyleselector.cpp:
2535 (khtml::CSSStyleSelector::applyProperty):
2536 * khtml/rendering/render_style.cpp:
2537 (RenderStyle::noneDashboardRegions):
2538 * khtml/rendering/render_style.h:
2539 * kwq/KWQKHTMLPart.mm:
2540 (KWQKHTMLPart::dashboardRegionsDictionary):
2542 2004-10-13 David Hyatt <hyatt@apple.com>
2544 Rework block layout to clean it up and simplify it (r=kocienda).
2546 Also fixing the style sharing bug (r=mjs).
2548 * khtml/rendering/render_block.cpp:
2549 (khtml::RenderBlock::MarginInfo::MarginInfo):
2550 (khtml::RenderBlock::layoutBlock):
2551 (khtml::RenderBlock::adjustPositionedBlock):
2552 (khtml::RenderBlock::adjustFloatingBlock):
2553 (khtml::RenderBlock::handleSpecialChild):
2554 (khtml::RenderBlock::handleFloatingOrPositionedChild):
2555 (khtml::RenderBlock::handleCompactChild):
2556 (khtml::RenderBlock::insertCompactIfNeeded):
2557 (khtml::RenderBlock::handleRunInChild):
2558 (khtml::RenderBlock::collapseMargins):
2559 (khtml::RenderBlock::clearFloatsIfNeeded):
2560 (khtml::RenderBlock::estimateVerticalPosition):
2561 (khtml::RenderBlock::determineHorizontalPosition):
2562 (khtml::RenderBlock::setCollapsedBottomMargin):
2563 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
2564 (khtml::RenderBlock::handleBottomOfBlock):
2565 (khtml::RenderBlock::layoutBlockChildren):
2566 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
2567 (khtml::RenderBlock::addOverHangingFloats):
2568 * khtml/rendering/render_block.h:
2569 (khtml::RenderBlock::maxTopMargin):
2570 (khtml::RenderBlock::maxBottomMargin):
2571 (khtml::RenderBlock::CompactInfo::compact):
2572 (khtml::RenderBlock::CompactInfo::block):
2573 (khtml::RenderBlock::CompactInfo::matches):
2574 (khtml::RenderBlock::CompactInfo::clear):
2575 (khtml::RenderBlock::CompactInfo::set):
2576 (khtml::RenderBlock::CompactInfo::CompactInfo):
2577 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
2578 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
2579 (khtml::RenderBlock::MarginInfo::clearMargin):
2580 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
2581 (khtml::RenderBlock::MarginInfo::setTopQuirk):
2582 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
2583 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
2584 (khtml::RenderBlock::MarginInfo::setPosMargin):
2585 (khtml::RenderBlock::MarginInfo::setNegMargin):
2586 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
2587 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
2588 (khtml::RenderBlock::MarginInfo::setMargin):
2589 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
2590 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
2591 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
2592 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
2593 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
2594 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
2595 (khtml::RenderBlock::MarginInfo::quirkContainer):
2596 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
2597 (khtml::RenderBlock::MarginInfo::topQuirk):
2598 (khtml::RenderBlock::MarginInfo::bottomQuirk):
2599 (khtml::RenderBlock::MarginInfo::posMargin):
2600 (khtml::RenderBlock::MarginInfo::negMargin):
2601 (khtml::RenderBlock::MarginInfo::margin):
2602 * khtml/rendering/render_box.cpp:
2603 (RenderBox::calcAbsoluteVertical):
2604 * khtml/rendering/render_box.h:
2605 (khtml::RenderBox::marginTop):
2606 (khtml::RenderBox::marginBottom):
2607 (khtml::RenderBox::marginLeft):
2608 (khtml::RenderBox::marginRight):
2609 * khtml/rendering/render_image.cpp:
2610 (RenderImage::setImage):
2611 * khtml/rendering/render_object.cpp:
2612 (RenderObject::sizesToMaxWidth):
2613 * khtml/rendering/render_object.h:
2614 (khtml::RenderObject::collapsedMarginTop):
2615 (khtml::RenderObject::collapsedMarginBottom):
2616 (khtml::RenderObject::maxTopMargin):
2617 (khtml::RenderObject::maxBottomMargin):
2618 (khtml::RenderObject::marginTop):
2619 (khtml::RenderObject::marginBottom):
2620 (khtml::RenderObject::marginLeft):
2621 (khtml::RenderObject::marginRight):
2622 * khtml/rendering/render_text.h:
2623 (khtml::RenderText::marginLeft):
2624 (khtml::RenderText::marginRight):
2625 * khtml/xml/dom_elementimpl.cpp:
2626 (ElementImpl::recalcStyle):
2628 2004-10-12 Ken Kocienda <kocienda@apple.com>
2634 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
2636 * khtml/editing/selection.cpp:
2637 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
2638 This will make it seem like the run ends on the next line.
2640 2004-10-12 Ken Kocienda <kocienda@apple.com>
2646 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
2648 * khtml/editing/htmlediting.cpp:
2649 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
2650 row, section, or column.
2651 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
2652 of table structure when doing deletes, rather than deleting the structure elements themselves.
2653 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
2654 of table structure. We may want to revisit this some day, but this seems like the best behavior
2656 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
2658 * khtml/editing/htmlediting.h: Add declarations for new functions.
2660 2004-10-12 Richard Williamson <rjw@apple.com>
2662 Fixed access to DOM object via WebScriptObject API.
2663 The execution context for DOM objects wasn't being found.
2664 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
2667 Fixed <rdar://problem/3831063> regions use left offset instead of top offset
2670 * khtml/khtml_part.h:
2671 * khtml/rendering/render_object.cpp:
2672 (RenderObject::addDashboardRegions):
2674 (-[DOMNode isContentEditable]):
2675 (-[DOMNode KJS::Bindings::]):
2676 * kwq/KWQKHTMLPart.h:
2677 * kwq/KWQKHTMLPart.mm:
2678 (KWQKHTMLPart::executionContextForDOM):
2680 2004-10-12 Ken Kocienda <kocienda@apple.com>
2686 <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
2688 * kwq/KWQKHTMLPart.mm:
2689 (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
2690 insert our style-checking node is done with an appendChild rather than an insertBefore. Note
2691 that this table-related problem was exposed by fixing Selection::layout(), which I did
2692 yesterday. This change simply improves things even more so that we do not crash in the
2693 scenario described in the bug.
2695 2004-10-11 Ken Kocienda <kocienda@apple.com>
2699 This is a partial fix to this bug:
2701 <rdar://problem/3832886> increase quote level on new mail document leads to immediate
2702 crash in caret painting code
2704 To eliminate the bad behavior for good, I have done some investigations in Mail code,
2705 and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
2706 blocks (like blockquote elements used for quoting) to documents without giving those
2707 blocks some content (so they have a height).
2709 I added some other crash protections below.
2711 * khtml/editing/selection.cpp:
2712 (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
2713 the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
2714 a couple position-has-renderer assertion checks.
2715 * kwq/KWQKHTMLPart.mm:
2716 (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
2717 may not yield a position. This assertion is a holdover from before we had VisiblePosition.
2718 (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
2721 2004-10-11 Darin Adler <darin@apple.com>
2725 - fixed <rdar://problem/3834230> empty table can result in division by 0
2727 * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
2728 Added 0 check; rolled in from KDE.
2730 2004-10-11 Darin Adler <darin@apple.com>
2734 - fixed <rdar://problem/3818712> form checkbox value property is read only
2736 The underlying problem was that we were storing two separate values for all
2737 form elements; one for the value property (JavaScript) and the other for the
2738 value attribute (DOM). This is a good idea for text input, but not for other types.
2740 * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
2741 Added private storesValueSeparateFromAttribute function.
2742 * khtml/html/html_formimpl.cpp:
2743 (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
2744 if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
2745 (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
2746 switch so that we will get a warning if a type is left out.
2747 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
2748 (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
2749 separately from the attribute. Otherwise, we just want to lave it alone
2750 (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
2751 on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
2752 (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
2753 supposed to be stored separate from the attribute.
2754 (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
2755 input elements, and false for the others.
2757 2004-10-11 Darin Adler <darin@apple.com>
2761 - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
2763 * khtml/rendering/render_form.cpp:
2764 (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
2765 (RenderCheckBox::slotStateChanged): Added call to onChange.
2767 2004-10-11 Ken Kocienda <kocienda@apple.com>
2771 Finish selection affinity implementation. This includes code to set the
2772 affinity correctly when clicking with the mouse, and clearing the
2773 affinity when altering the selection using any of the Selection object
2776 Each instance of the positionForCoordinates, inlineBox and caretRect
2777 functions have been changed to include an EAffinity argument to give results
2778 which take this bit into account.
2780 * khtml/editing/selection.cpp:
2781 (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
2782 (khtml::Selection::modifyAffinity): New function to compute affinity based on
2783 modification constants.
2784 (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
2785 (khtml::Selection::modifyExtendingRightForward): Ditto.
2786 (khtml::Selection::modifyMovingRightForward): Ditto.
2787 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
2788 (khtml::Selection::modifyMovingLeftBackward): Ditto.
2789 (khtml::Selection::modify): Support saving, restoring, and then calculating new
2790 affinity value as needed.
2791 (khtml::Selection::xPosForVerticalArrowNavigation):
2792 (khtml::Selection::clear): Reset affinity to UPSTREAM.
2793 (khtml::Selection::setBase): Ditto.
2794 (khtml::Selection::setExtent): Ditto.
2795 (khtml::Selection::setBaseAndExtent): Ditto.
2796 (khtml::Selection::layout): Pass affinity to caretRect().
2797 (khtml::Selection::validate): Pass along affinity parameter to new functions that
2799 (khtml::startOfFirstRunAt): Changed the way that the y-coordinate search is done, to
2800 keep this code working with changes made in selectionForLine().
2801 (khtml::endOfLastRunAt): Ditto.
2802 (khtml::selectionForLine): Make this function work for all renderers, not just text
2804 * khtml/editing/selection.h:
2805 (khtml::operator==): Consider affinity in equality check.
2806 * khtml/editing/visible_units.cpp:
2807 (khtml::previousLinePosition): Pass affinity argument to function so it can take this
2808 information into account while processing.
2809 (khtml::nextLinePosition): Ditto.
2810 (khtml::previousParagraphPosition): Ditto.
2811 (khtml::nextParagraphPosition): Ditto.
2812 * khtml/editing/visible_units.h: Ditto, for each of the functions listed.
2813 * khtml/khtml_events.cpp:
2814 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
2815 as this function is being removed.
2816 * khtml/khtml_part.cpp:
2817 (KHTMLPart::isPointInsideSelection): Ditto.
2818 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
2819 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
2820 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
2821 call to positionForCoordinates, and set resulting affinity on the selection.
2822 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
2823 NodeImpl::positionForCoordinates, as this function is being removed.
2824 (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
2825 * khtml/rendering/render_block.cpp:
2826 (khtml::RenderBlock::positionForCoordinates): Now takes an affinity argument.
2827 * khtml/rendering/render_block.h:
2828 * khtml/rendering/render_box.cpp:
2829 (RenderBox::caretRect): Ditto.
2830 * khtml/rendering/render_box.h:
2831 * khtml/rendering/render_br.cpp:
2832 (RenderBR::positionForCoordinates): Ditto.
2833 (RenderBR::caretRect): Ditto.
2834 (RenderBR::inlineBox): Ditto.
2835 * khtml/rendering/render_br.h:
2836 * khtml/rendering/render_container.cpp:
2837 (RenderContainer::positionForCoordinates): Ditto.
2838 * khtml/rendering/render_container.h:
2839 * khtml/rendering/render_flow.cpp:
2840 (RenderFlow::caretRect): Ditto.
2841 * khtml/rendering/render_flow.h:
2842 * khtml/rendering/render_inline.cpp:
2843 (RenderInline::positionForCoordinates): Ditto.
2844 * khtml/rendering/render_inline.h:
2845 * khtml/rendering/render_object.cpp:
2846 (RenderObject::caretRect): Ditto.
2847 (RenderObject::positionForCoordinates): Ditto.
2848 (RenderObject::inlineBox): Ditto.
2849 * khtml/rendering/render_object.h:
2850 * khtml/rendering/render_replaced.cpp:
2851 (RenderReplaced::positionForCoordinates): Ditto.
2852 * khtml/rendering/render_replaced.h:
2853 * khtml/rendering/render_text.cpp:
2854 (RenderText::positionForCoordinates): Ditto.
2855 (firstRendererOnNextLine): New helper used by caretRect().
2856 (RenderText::caretRect): Now takes an affinity argument.
2857 (RenderText::inlineBox): Ditto.
2858 * khtml/rendering/render_text.h:
2859 * khtml/xml/dom_nodeimpl.cpp: Remove positionForCoordinates helper.
2860 * khtml/xml/dom_nodeimpl.h: Ditto.
2861 * khtml/xml/dom_position.cpp:
2862 (DOM::Position::previousLinePosition): Now takes an affinity argument.
2863 (DOM::Position::nextLinePosition): Ditto.
2864 * khtml/xml/dom_position.h:
2865 * kwq/WebCoreBridge.h:
2866 * kwq/WebCoreBridge.mm:
2867 (-[WebCoreBridge caretRectAtNode:offset:affinity:]): Ditto.
2868 (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
2869 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
2870 NodeImpl::positionForCoordinates, as this function is being removed.
2872 2004-10-11 Darin Adler <darin@apple.com>
2876 - fixed <rdar://problem/3670280> scroll position on overflowed textareas resets when leaving the tab
2878 * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]):
2879 Scroll to reveal the text area, don't scroll to reveal the text view itself.
2880 Scrolling the text view ended up putting it at the top left, regardless of
2881 where the insertion point is.
2883 2004-10-11 Darin Adler <darin@apple.com>
2887 - fixed <rdar://problem/3831546> More text is copied than is visually selected
2889 The bug here is that upstream was moving a position too far.
2891 * khtml/xml/dom_position.cpp:
2892 (DOM::Position::upstream): Use the "deep equivalent" node rather than the original node passed
2893 in for various checks. Also use local variables a bit more for slightly more efficiency.
2894 (DOM::Position::downstream): Ditto.
2896 2004-10-11 Darin Adler <darin@apple.com>
2900 - fixed <rdar://problem/3833841> adding an event listener for keypress events does not work
2902 * khtml/xml/dom2_eventsimpl.h: Added numEventIds and made typeToId take a const DOMString &.
2903 * khtml/xml/dom2_eventsimpl.cpp:
2904 (EventImpl::typeToId): Changed to use table. Added "keypress", otherwise, the same as before.
2905 (EventImpl::idToType): Changed to use table.
2907 2004-10-10 John Sullivan <sullivan@apple.com>
2909 - fixed <rdar://problem/3664375> repro crash in -[KWQAccObject accessibilityAttributeNames]
2911 (-[KWQAccObject accessibilityActionNames]):
2912 check for nil m_renderer
2914 2004-10-09 Darin Adler <darin@apple.com>
2918 - fixed <rdar://problem/3828147> REGRESSION: textareas with wrap="off" show their contents in a thin vertical line of text
2920 * kwq/KWQTextArea.h: Added setTextColor and setBackgroundColor methods. This is really for another fix
2921 I'm landing later, but it does no harm to add these now.
2922 * kwq/KWQTextArea.mm:
2923 (-[KWQTextArea _configureTextViewForWordWrapMode]): Set the container size after changing the flag that
2924 determines if the width tracks the text view. Otherwise, we won't successfully set the width in the case
2925 where we don't want it to track the text view. This caused the bug.
2926 (-[KWQTextArea _createTextView]): Remove unneeded call to setMaxSize. The above method already does that.
2927 (-[KWQTextArea setTextColor:]): Added.
2928 (-[KWQTextArea setBackgroundColor:]): Added.
2930 2004-10-09 Darin Adler <darin@apple.com>
2934 - fixed <rdar://problem/3829452> REGRESSION (156-157): onload handler doesn't run on page with meta refresh of 0 duration (new Apple start page)
2936 The fix for <rdar://problem/3773150> made it so <meta> redirects prevent tokenizing the rest of the page.
2937 This is incorrect; the reason the JavaScript-triggered loads prevent tokenizing is that they take place
2938 "right away" in other browsers, but that is not true of <meta> redirect. We fixed this by using a separate
2939 call for <meta> redirect and not preventing tokenizing when that's in effect.
2941 * khtml/khtml_part.h: Removed userGesture parameter from scheduleRedirection. Renamed
2942 isImmediateRedirectPending to isScheduledLocationChangePending. Added scheduleLocationChange.
2943 * khtml/khtml_part.cpp:
2944 (KHTMLPart::openURL): Updated for new constant name.
2945 (KHTMLPart::scheduleRedirection): Removed now-unneeded userGesture parameter, and removed code that
2946 does the special case for redirection during load; a <meta> refresh can never be one of those special
2947 redirects during a load because it redirects the frame itself, not another frame. Also tightened up
2948 the logic by always stopping the redirect timer even if we aren't restarting it.
2949 (KHTMLPart::scheduleLocationChange): Added. Like scheduleRedirection, but with a different constant
2950 so we can tell it apart and always a delay of 0. The "redirection during load" case was moved in here
2951 and renamed to locationChangeScheduledDuringLoad.
2952 (KHTMLPart::isScheduledLocationChangePending): Renamed from isImmediateRedirectPending. This now
2953 returns true only for location changes and history navigation, not <meta> redirects.
2954 (KHTMLPart::scheduleHistoryNavigation): Tightened up logic to do the stop() outside the if as above,
2955 and got rid of a silly timer delay computation that always resulted in 0.
2957 * khtml/khtmlpart_p.h: Added a new value to the RedirectionScheduled enum for scheduleLocationChange
2958 and also renamed one of the existing values.
2960 * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::write): Changed to use isScheduledLocationChangePending instead
2961 of isImmediateRedirectPending, because we do want to continue tokenizing if it's actually a redirect.
2963 * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::putValue): Changed to call the new scheduleLocationChange
2964 instead of calling scheduleRedirection with delay of 0.
2965 * khtml/ecma/kjs_window.cpp:
2966 (Window::put): Ditto.
2967 (WindowFunc::tryCall): Ditto.
2968 (Location::put): Ditto.
2969 (LocationFunc::tryCall): Ditto.
2971 2004-10-09 Darin Adler <darin@apple.com>
2975 - 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
2977 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::click): Use 0,0 for the coordinates.
2979 2004-10-09 Darin Adler <darin@apple.com>
2983 - fixed <rdar://problem/3804665> REGRESSION: WebCore framework now has many init routines
2985 * khtml/xml/dom_nodeimpl.h: Changed anyQName declaration to not use the inline function
2986 makeId. Surprisingly, the inline function was not "constant-folded" and we ended up with
2987 a copy of the function in each file as an init routine for the framework.
2989 * khtml/ecma/kjs_html.cpp: (Gradient::colorStops): Get rid of initialized ColorStop
2990 globals; their constructors were showing up as init routines for the framework.
2992 * khtml/rendering/render_style.h: Got rid of inline initialDashboardRegions function.
2993 * khtml/rendering/render_style.cpp: (RenderStyle::initialDashboardRegions): Made this
2994 a normal function. When it was an inline function, the constructors for the per-file
2995 copies of the globals were showing up as init routines for the framework.
2997 2004-10-09 Chris Blumenberg <cblu@apple.com>
3000 <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas
3001 <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS)
3002 <rdar://problem/3822027> REGRESSION (Mail): When selection moves out of visible area, should center as NSText does
3004 Reviewed by hyatt, kocienda.
3006 * khtml/rendering/render_layer.cpp:
3007 (RenderLayer::scroll): new
3008 * khtml/rendering/render_layer.h:
3009 * khtml/rendering/render_object.cpp:
3010 (RenderObject::scroll): new
3011 * khtml/rendering/render_object.h:
3012 * kwq/KWQKHTMLPart.h:
3013 * kwq/KWQKHTMLPart.mm:
3014 (KWQKHTMLPart::scrollOverflow): new
3015 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent): new
3016 (KWQKHTMLPart::khtmlMousePressEvent): store pressed node so we know where the focus is
3017 * kwq/KWQScrollBar.h:
3018 * kwq/KWQScrollBar.mm:
3019 (QScrollBar::setValue): return a bool
3020 (QScrollBar::scrollbarHit): ditto
3021 (QScrollBar::scroll): new
3022 * kwq/WebCoreBridge.h:
3023 * kwq/WebCoreBridge.mm:
3024 (-[WebCoreBridge scrollOverflowInDirection:granularity:]): new
3025 (-[WebCoreBridge scrollOverflowWithScrollWheelEvent:]): new
3026 (-[WebCoreBridge ensureSelectionVisible]): visually center the extent of the selection
3028 2004-10-06 David Hyatt <hyatt@apple.com>
3030 Back out style sharing perf fix.
3032 * khtml/css/cssstyleselector.cpp:
3033 (khtml::CSSStyleSelector::locateCousinList):
3034 (khtml::CSSStyleSelector::canShareStyleWithElement):
3035 (khtml::CSSStyleSelector::locateSharedStyle):
3036 * khtml/css/cssstyleselector.h:
3037 * khtml/html/html_elementimpl.h:
3038 (DOM::HTMLElementImpl::inlineStyleDecl):
3039 * khtml/xml/dom_elementimpl.cpp:
3040 (ElementImpl::recalcStyle):
3041 * khtml/xml/dom_elementimpl.h:
3045 2004-10-05 David Hyatt <hyatt@apple.com>
3047 Fix a bug in the iteration of locateCousinList and clean up the style sharing stats code.
3049 * khtml/css/cssstyleselector.cpp:
3050 (khtml::CSSStyleSelector::locateCousinList):
3051 (khtml::CSSStyleSelector::elementsCanShareStyle):
3052 (khtml::CSSStyleSelector::locateSharedStyle):
3053 (khtml::CSSStyleSelector::styleForElement):
3055 2004-10-05 Ken Kocienda <kocienda@apple.com>
3059 * khtml/rendering/bidi.cpp:
3060 (khtml::RenderBlock::computeHorizontalPositionsForLine): Fix coding mistake that
3061 broke layout tests involving compacts.
3063 2004-10-05 Ken Kocienda <kocienda@apple.com>
3067 Finish selection affinity implementation. This includes code to set the
3068 affinity correctly when clicking with the mouse, and clearing the
3069 affinity when altering the selection using any of the Selection object
3072 Each instance of the positionForCoordinates function in the render tree
3073 has been changed to include an EAffinity argument. It is now the job of this
3074 function to set the selection affinity.
3076 * khtml/editing/selection.cpp:
3077 (khtml::Selection::moveTo): Set affinity to DOWNSTREAM.
3078 (khtml::Selection::modify): Ditto.
3079 (khtml::Selection::clear): Ditto.
3080 (khtml::Selection::setBase): Ditto.
3081 (khtml::Selection::setExtent): Ditto.
3082 (khtml::Selection::setBaseAndExtent): Ditto.
3083 * khtml/editing/selection.h:
3084 (khtml::operator==): Consider affinity in equality check.
3085 * khtml/khtml_events.cpp:
3086 (khtml::MouseEvent::offset): Rework code to remove dependence on NodeImpl::positionForCoordinates,
3087 as this function is being removed.
3088 * khtml/khtml_part.cpp:
3089 (KHTMLPart::isPointInsideSelection): Ditto.
3090 (KHTMLPart::selectClosestWordFromMouseEvent): Ditto.
3091 (KHTMLPart::handleMousePressEventTripleClick): Ditto.
3092 (KHTMLPart::handleMousePressEventSingleClick): Ditto. Plus, pass affinity argument in
3093 call to positionForCoordinates, and set resulting affinity on the selection.
3094 (KHTMLPart::handleMouseMoveEventSelection): Rework code to remove dependence on
3095 NodeImpl::positionForCoordinates, as this function is being removed.
3096 (KHTMLPart::khtmlMouseReleaseEvent):
3097 * khtml/rendering/render_block.cpp:
3098 (khtml::RenderBlock::positionForCoordinates): Changed, as described above.
3099 * khtml/rendering/render_block.h:
3100 * khtml/rendering/render_br.cpp:
3101 (RenderBR::positionForCoordinates): Ditto.
3102 * khtml/rendering/render_br.h:
3103 * khtml/rendering/render_container.cpp:
3104 (RenderContainer::positionForCoordinates): Ditto.
3105 * khtml/rendering/render_container.h:
3106 * khtml/rendering/render_inline.cpp:
3107 (RenderInline::positionForCoordinates): Ditto.
3108 * khtml/rendering/render_inline.h:
3109 * khtml/rendering/render_object.cpp:
3110 (RenderObject::positionForCoordinates): Ditto.
3111 * khtml/rendering/render_object.h:
3112 * khtml/rendering/render_replaced.cpp:
3113 (RenderReplaced::positionForCoordinates): Ditto.
3114 * khtml/rendering/render_replaced.h:
3115 * khtml/rendering/render_text.cpp:
3116 (RenderText::positionForCoordinates): Ditto.
3117 * khtml/rendering/render_text.h:
3118 * khtml/xml/dom_nodeimpl.cpp: Removed positionForCoordinates convenience.
3119 * khtml/xml/dom_nodeimpl.h: Ditto.
3120 * kwq/WebCoreBridge.mm:
3121 (-[WebCoreBridge _positionForPoint:]): Rework code to remove dependence on
3122 NodeImpl::positionForCoordinates, as this function is being removed.
3124 2004-10-05 David Hyatt <hyatt@apple.com>
3126 Fix style sharing optimization to be fast again. Go back to using pointer comparisons when looking for
3131 * khtml/css/cssstyleselector.cpp:
3132 (khtml::CSSStyleSelector::locateCousinList):
3133 * khtml/rendering/render_object.cpp:
3134 (RenderObject::setStyleInternal):
3135 * khtml/rendering/render_object.h:
3136 * khtml/xml/dom_elementimpl.cpp:
3137 (ElementImpl::recalcStyle):
3139 2004-10-05 David Hyatt <hyatt@apple.com>
3141 Fix lists so that they properly participate in line layout as though they are text (when text bullets are
3142 used) and as images (when image bullets are used).
3144 Reviewed by kocienda
3146 * khtml/rendering/render_list.cpp:
3147 (RenderListMarker::createInlineBox):
3148 * khtml/rendering/render_list.h:
3149 (khtml::ListMarkerBox:::InlineBox):
3150 (khtml::ListMarkerBox::isText):
3152 2004-10-05 Ken Kocienda <kocienda@apple.com>
3156 Recent checkin adding upstreamDeepEquivalent had it backwards. The helper
3157 we want is downstreamDeepEquivalent, as the deepEquivalent function returns
3158 an upstream position.
3160 * khtml/editing/selection.cpp:
3161 (khtml::Selection::layout): DOWNSTREAM case now uses downstreamDeepEquivalent.
3162 UPSTREAM uses deepEquivalent.
3163 * khtml/editing/visible_position.cpp:
3164 (khtml::VisiblePosition::downstreamDeepEquivalent): New helper, replacing
3165 upstreamDeepEquivalent.
3166 * khtml/editing/visible_position.h
3168 2004-10-05 David Hyatt <hyatt@apple.com>
3170 New selection gap-filling architecture. Makes the gap-filling much more like NSTextView and puts the responsibility
3171 for gap-filling in the block. Fixes numerous bugs with selection drawing including bidi issues, incorrect old
3172 horizontal gap filling, and selection performance issues.
3174 Reviewed by kocienda
3176 * khtml/html/html_imageimpl.cpp:
3177 (HTMLImageLoader::notifyFinished):
3178 * khtml/misc/khtmllayout.h:
3179 (khtml::GapRects::left):
3180 (khtml::GapRects::center):
3181 (khtml::GapRects::right):
3182 (khtml::GapRects::uniteLeft):
3183 (khtml::GapRects::uniteCenter):
3184 (khtml::GapRects::uniteRight):
3185 (khtml::GapRects::unite):
3186 (khtml::GapRects::operator QRect):
3187 (khtml::GapRects::operator==):
3188 (khtml::GapRects::operator!=):
3189 * khtml/rendering/font.cpp:
3190 (Font::drawHighlightForText):
3191 * khtml/rendering/font.h:
3192 * khtml/rendering/render_block.cpp:
3193 (khtml:::RenderFlow):
3194 (khtml::RenderBlock::removeChild):
3195 (khtml::RenderBlock::paintObject):
3196 (khtml::RenderBlock::paintEllipsisBoxes):
3197 (khtml::RenderBlock::setSelectionState):
3198 (khtml::RenderBlock::shouldPaintSelectionGaps):
3199 (khtml::RenderBlock::isSelectionRoot):
3200 (khtml::RenderBlock::selectionGapRects):
3201 (khtml::RenderBlock::paintSelection):
3202 (khtml::RenderBlock::fillSelectionGaps):
3203 (khtml::RenderBlock::fillInlineSelectionGaps):
3204 (khtml::RenderBlock::fillBlockSelectionGaps):
3205 (khtml::RenderBlock::fillHorizontalSelectionGap):
3206 (khtml::RenderBlock::fillVerticalSelectionGap):
3207 (khtml::RenderBlock::fillLeftSelectionGap):
3208 (khtml::RenderBlock::fillRightSelectionGap):
3209 (khtml::RenderBlock::getHorizontalSelectionGapInfo):
3210 (khtml::RenderBlock::leftSelectionOffset):
3211 (khtml::RenderBlock::rightSelectionOffset):
3212 * khtml/rendering/render_block.h:
3213 (khtml::RenderBlock::hasSelectedChildren):
3214 (khtml::RenderBlock::selectionState):
3215 (khtml::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
3216 (khtml::RenderBlock::BlockSelectionInfo::rects):
3217 (khtml::RenderBlock::BlockSelectionInfo::state):
3218 (khtml::RenderBlock::BlockSelectionInfo::block):
3219 (khtml::RenderBlock::selectionRect):
3220 * khtml/rendering/render_box.cpp:
3221 (RenderBox::position):
3222 * khtml/rendering/render_br.cpp:
3223 (RenderBR::inlineBox):
3224 * khtml/rendering/render_br.h:
3225 (khtml::RenderBR::selectionRect):
3226 (khtml::RenderBR::paint):
3227 * khtml/rendering/render_canvas.cpp:
3228 (RenderCanvas::selectionRect):
3229 (RenderCanvas::setSelection):
3230 * khtml/rendering/render_canvasimage.cpp:
3231 (RenderCanvasImage::paint):
3232 * khtml/rendering/render_image.cpp:
3233 (RenderImage::paint):
3234 * khtml/rendering/render_image.h:
3235 * khtml/rendering/render_line.cpp:
3236 (khtml::InlineBox::nextLeafChild):
3237 (khtml::InlineBox::prevLeafChild):
3238 (khtml::InlineBox::selectionState):
3239 (khtml::InlineFlowBox::addToLine):
3240 (khtml::InlineFlowBox::firstLeafChild):
3241 (khtml::InlineFlowBox::lastLeafChild):
3242 (khtml::InlineFlowBox::firstLeafChildAfterBox):
3243 (khtml::InlineFlowBox::lastLeafChildBeforeBox):
3244 (khtml::InlineFlowBox::selectionState):
3245 (khtml::RootInlineBox::fillLineSelectionGap):
3246 (khtml::RootInlineBox::setHasSelectedChildren):
3247 (khtml::RootInlineBox::selectionState):
3248 (khtml::RootInlineBox::firstSelectedBox):
3249 (khtml::RootInlineBox::lastSelectedBox):
3250 (khtml::RootInlineBox::selectionTop):
3251 (khtml::RootInlineBox::block):
3252 * khtml/rendering/render_line.h:
3253 (khtml::RootInlineBox::RootInlineBox):
3254 (khtml::RootInlineBox::hasSelectedChildren):
3255 (khtml::RootInlineBox::selectionHeight):
3256 * khtml/rendering/render_object.cpp:
3257 (RenderObject::selectionColor):
3258 * khtml/rendering/render_object.h:
3259 (khtml::RenderObject::):
3260 (khtml::RenderObject::selectionState):
3261 (khtml::RenderObject::setSelectionState):
3262 (khtml::RenderObject::selectionRect):
3263 (khtml::RenderObject::canBeSelectionLeaf):
3264 (khtml::RenderObject::hasSelectedChildren):
3265 (khtml::RenderObject::hasDirtySelectionState):
3266 (khtml::RenderObject::setHasDirtySelectionState):
3267 (khtml::RenderObject::shouldPaintSelectionGaps):
3268 (khtml::RenderObject::SelectionInfo::SelectionInfo):
3269 * khtml/rendering/render_replaced.cpp:
3270 (RenderReplaced::RenderReplaced):
3271 (RenderReplaced::shouldPaint):
3272 (RenderReplaced::selectionRect):
3273 (RenderReplaced::setSelectionState):
3274 (RenderReplaced::selectionColor):
3275 (RenderWidget::paint):
3276 (RenderWidget::setSelectionState):
3277 * khtml/rendering/render_replaced.h:
3278 (khtml::RenderReplaced::canBeSelectionLeaf):
3279 (khtml::RenderReplaced::selectionState):
3280 * khtml/rendering/render_text.cpp:
3281 (InlineTextBox::checkVerticalPoint):
3282 (InlineTextBox::isSelected):
3283 (InlineTextBox::selectionState):
3284 (InlineTextBox::selectionRect):
3285 (InlineTextBox::paintSelection):
3286 (InlineTextBox::paintMarkedTextBackground):
3287 (RenderText::paint):
3288 (RenderText::setSelectionState):
3289 (RenderText::selectionRect):
3290 * khtml/rendering/render_text.h:
3291 (khtml::RenderText::canBeSelectionLeaf):
3293 * kwq/KWQPainter.mm:
3294 (QPainter::drawHighlightForText):
3296 (QPtrDictIterator::toFirst):
3299 * kwq/WebCoreTextRenderer.h:
3300 * kwq/WebCoreTextRendererFactory.mm:
3301 (WebCoreInitializeEmptyTextGeometry):
3303 2004-10-05 Ken Kocienda <kocienda@apple.com>
3307 Use the new CSS properties I added with my previous check-in. Also makes
3308 some changes to caret positioning and drawing to make the proper editing
3309 end-of-line behavior work correctly.
3311 * khtml/editing/selection.cpp:
3312 (khtml::Selection::layout): Caret drawing now takes affinity into account
3313 when deciding where to paint the caret (finally!).
3314 * khtml/editing/visible_position.cpp:
3315 (khtml::VisiblePosition::previousVisiblePosition): Move off Position::rendersInDifferentPosition
3316 to determine the result. Use a simpler test involving comparisons between