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