1 2004-12-03 Ken Kocienda <kocienda@apple.com>
5 Terminology change in execCommand command identifiers. Specifically, the name of
6 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
7 terminology used by AppKit. It is also more accurate, since the insertion of a
8 "br" element is what the command does. The inspiration for this change is so the
9 -insertNewline AppKit method can be mapped to insert a new "div" element in
10 a document and avoid ambiguity with what the javascript editing command does.
12 * khtml/editing/jsediting.cpp
13 * layout-tests/editing/deleting/delete-tab-004.html
14 * layout-tests/editing/editing.js
15 * layout-tests/editing/inserting/insert-3654864-fix.html
16 * layout-tests/editing/inserting/insert-3659587-fix.html
17 * layout-tests/editing/inserting/insert-3775316-fix.html
18 * layout-tests/editing/inserting/insert-3800346-fix.html
19 * layout-tests/editing/inserting/insert-br-001.html
20 * layout-tests/editing/inserting/insert-br-002.html
21 * layout-tests/editing/inserting/insert-br-003.html
22 * layout-tests/editing/inserting/insert-br-004.html
23 * layout-tests/editing/inserting/insert-br-005.html
24 * layout-tests/editing/inserting/insert-br-006.html
25 * layout-tests/editing/inserting/insert-br-007.html
26 * layout-tests/editing/inserting/insert-br-008.html
27 * layout-tests/editing/inserting/insert-tab-004.html
28 * layout-tests/editing/inserting/insert-text-with-newlines.html
29 * layout-tests/editing/pasteboard/paste-text-010.html
31 2004-12-02 Ken Kocienda <kocienda@apple.com>
37 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
39 * khtml/editing/htmlediting.cpp:
40 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
41 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
42 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
43 in a block and the document is in quirks mode, add an additional br to make the one in the
44 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
45 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
46 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
48 2004-12-02 Richard Williamson <rjw@apple.com>
50 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
52 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
53 the b/f cache won't incorrectly trash the previous state when restoring.
57 * kwq/WebCoreBridge.h:
58 * kwq/WebCoreBridge.mm:
59 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
60 (-[WebCoreBridge canCachePage]):
61 (-[WebCoreBridge clear]):
63 2004-12-02 Ken Kocienda <kocienda@apple.com>
69 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
71 * khtml/xml/dom2_rangeimpl.cpp:
72 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
73 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
74 of this bug where there is content after the body tag). Did a little code clean up as well.
75 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
77 2004-12-02 Ken Kocienda <kocienda@apple.com>
83 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
85 * khtml/khtml_part.cpp:
86 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
87 to figure out which end of the selection to extend.
89 2004-12-02 David Harrison <harrison@apple.com>
91 Reviewed by Ken Kocienda.
93 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
94 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
96 * khtml/editing/visible_text.cpp:
97 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
98 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
99 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
100 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
101 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
102 Distinguish BR from whitespace.
103 * khtml/editing/visible_text.h:
104 Distinguish BR from whitespace.
105 * khtml/editing/visible_units.cpp:
106 (khtml::previousWordBoundary):
107 Use UPSTREAM visible position now that SimplifiedBackwardsTextIterator distinguishes BR from whitespace. Otherwise, double-clicking at end of line would result in caret selection at start of next line.
109 2004-12-02 Ken Kocienda <kocienda@apple.com>
115 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
117 * khtml/xml/dom_position.cpp:
118 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
119 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
120 exception trying to use a Position returned from this function to set the boundary point of a Range (which
121 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
122 contract to return a range-compliant position, hence the need for this fix.
124 2004-12-01 Ken Kocienda <kocienda@apple.com>
130 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
131 regard to other editing commands. The class had a name change ages ago, and it was never
133 * khtml/editing/htmlediting.h: Ditto.
135 2004-12-01 Ken Kocienda <kocienda@apple.com>
139 Some improvements for paste, including some new code to annotate
140 whitespace when writing to the pasteboard to ensure that the meaning
141 of the markup on the pasteboard is unambiguous.
143 There is also new code for reading this annotated markup from the pasteboard,
144 removing the nodes that were added only to prevent ambiguity.
146 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
147 The header should have been added earlier, but I did not do so.
148 * khtml/editing/html_interchange.cpp: Added.
149 (convertHTMLTextToInterchangeFormat):
150 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
151 * khtml/editing/htmlediting.cpp:
152 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
153 Also fixed a bug in the code that counts blocks in a fragment.
154 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
155 (khtml::ReplacementFragment::insertNodeBefore): New helper.
156 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
157 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
158 * khtml/editing/htmlediting.h: Add some new declarations.
159 * khtml/xml/dom2_rangeimpl.cpp:
160 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
161 * khtml/xml/dom_nodeimpl.cpp:
162 (NodeImpl::stringValueForRange): New helper.
163 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
164 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
165 should be added. Called by the paste code.
166 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
168 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
169 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
170 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
172 2004-11-30 Chris Blumenberg <cblu@apple.com>
174 * ChangeLog: removed conflict marker
176 2004-11-30 Chris Blumenberg <cblu@apple.com>
179 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
180 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
184 * khtml/misc/loader.cpp:
185 (CachedObject::~CachedObject): release m_allData
186 (CachedObject::setAllData): new
187 (Loader::servePendingRequests): connect slotAllData
188 (Loader::slotAllData): new
189 (Cache::requestImage): tweak
190 * khtml/misc/loader.h:
191 (khtml::CachedObject::CachedObject): set allData to 0
192 (khtml::CachedObject::allData): new
193 * kwq/KWQKJobClasses.h:
194 * kwq/KWQKJobClasses.mm:
195 (KIO::TransferJob::TransferJob): set m_allData
196 (KIO::TransferJob::emitAllData): new
198 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
199 * kwq/KWQResourceLoader.mm:
200 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
202 (KWQSlot::KWQSlot): support for slotAllData
204 * kwq/WebCoreBridge.h:
205 * kwq/WebCoreResourceLoader.h:
207 2004-11-30 Maciej Stachowiak <mjs@apple.com>
211 2004-11-30 Maciej Stachowiak <mjs@apple.com>
215 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
217 * khtml/khtml_part.cpp:
218 (KHTMLPart::begin): call setParsing on document here after opening
219 - from now on we'll only set parsing to true for a document open
220 caused by page loading, not a programmatic one.
221 * khtml/xml/dom_docimpl.cpp:
222 (DocumentImpl::open): don't setParsing to true here any more.
224 2004-11-30 Maciej Stachowiak <mjs@apple.com>
228 - fix recent regression from collection perf fixes.
230 * khtml/html/html_miscimpl.cpp:
231 (HTMLFormCollectionImpl::updateNameCache): Look up the name
232 attribute in the name cache, not the id cache (d'oh!)
234 2004-11-30 Darin Adler <darin@apple.com>
238 - rolled in a KDE fix for a problem that may underlie a number of crashes
240 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
241 the KDE guys to fix a subtle problem. Code said "n = n =".
243 - rolled in a KDE fix for a containingBlock crash
245 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
246 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
249 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
252 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
253 (-[KWQButton detachQButton]): Added.
254 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
255 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
256 (-[KWQButton widget]): Added.
257 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
258 (-[KWQButton resignFirstResponder]): Ditto.
259 (-[KWQButton canBecomeKeyView]): Ditto.
260 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
261 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
263 * kwq/KWQComboBox.mm:
264 (QComboBox::~QComboBox): Call detachQComboBox.
265 (-[KWQPopUpButtonCell detachQComboBox]): Added.
266 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
267 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
268 (-[KWQPopUpButton action:]): Ditto.
269 (-[KWQPopUpButton widget]): Tweaked.
270 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
271 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
272 (-[KWQPopUpButton resignFirstResponder]): Ditto.
273 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
275 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
278 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
280 * kwq/KWQScrollBar.h: Removed m_scroller field.
281 * kwq/KWQScrollBar.mm:
282 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
283 (-[KWQScrollBar detachQScrollBar]): Added.
284 (-[KWQScrollBar widget]): Added.
285 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
286 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
287 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
288 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
289 (QScrollBar::setKnobProportion): Ditto.
290 (QScrollBar::scrollbarHit): Ditto.
292 * kwq/KWQScrollView.mm:
293 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
294 hack where we don't remove right away when doing mouse tracking.
295 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
296 the hack where we don't add right away when doing mouse tracking.
298 * kwq/KWQSlider.h: Added destructor.
300 (-[KWQSlider initWithQSlider:]): Tweaked a little.
301 (-[KWQSlider detachQSlider]): Added.
302 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
303 (-[KWQSlider widget]): Added.
304 (QSlider::~QSlider): Added. Calls detachQSlider.
306 * kwq/KWQTextArea.h: Added detachQTextEdit method.
307 * kwq/KWQTextArea.mm:
308 (-[KWQTextArea detachQTextEdit]): Added.
309 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
310 (-[KWQTextArea becomeFirstResponder]): Ditto.
311 (-[KWQTextArea nextKeyView]): Ditto.
312 (-[KWQTextArea previousKeyView]): Ditto.
313 (-[KWQTextArea drawRect:]): Ditto.
314 (-[KWQTextAreaTextView insertTab:]): Ditto.
315 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
316 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
317 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
318 (-[KWQTextAreaTextView mouseDown:]): Ditto.
319 (-[KWQTextAreaTextView keyDown:]): Ditto.
320 (-[KWQTextAreaTextView keyUp:]): Ditto.
322 * kwq/KWQTextEdit.h: Added ~QTextEdit.
323 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
325 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
326 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
328 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
329 Added beforeMouseDown and afterMouseDown for use in widget implementations.
330 Removed unused hasMouseTracking function.
332 (QWidget::QWidget): Initialize two new fields.
333 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
334 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
335 (QWidget::addToSuperview): Added.
336 (QWidget::removeFromSuperview): Added.
337 (QWidget::beforeMouseDown): Added.
338 (QWidget::afterMouseDown): Added.
340 * khtml/rendering/render_layer.cpp:
341 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
342 (RenderLayer::setHasVerticalScrollbar): Ditto.
344 2004-11-30 Ken Kocienda <kocienda@apple.com>
350 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
352 * khtml/khtml_part.cpp:
353 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
354 with no blink if it is.
356 2004-11-30 Ken Kocienda <kocienda@apple.com>
362 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
364 * khtml/khtml_part.cpp:
365 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
366 or <input type=image> was checked for focus since these elements are keyboard-focusable,
367 but not mouse focusable. Also, this function did not work hard enough to set the focused
368 node, and was content to clear it if the first element checked failed the test, rather
369 than looking more at parents. This would have the effect of clearing, then resetting the
370 focus on a DIV containing a button or image with content on either side of it in the
371 process of arrowing over such content.
373 2004-11-30 Ken Kocienda <kocienda@apple.com>
377 * khtml/editing/htmlediting.cpp:
378 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
379 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
380 * khtml/khtml_part.cpp:
381 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
382 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
383 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
384 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
385 isCharacterSmartReplaceExempt virtual.
387 2004-11-30 Ken Kocienda <kocienda@apple.com>
391 * khtml/editing/htmlediting.cpp:
392 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
393 Seemed simple enough to land without review.
395 2004-11-29 Ken Kocienda <kocienda@apple.com>
399 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
400 are handled correctly now, including selections that span multiple blocks, and cases
401 where content on the pasteboard ends in newlines (or what appear to be newlines to a
402 user, really block ends or BRs). I also made one small, but important change in the
403 copy code to annotate the markup written to the pasteboard to support these selections
406 New header that defines a couple of constants used in copying and pasting.
408 * ForwardingHeaders/editing/html_interchange.h: Added.
409 * khtml/editing/html_interchange.h: Added.
411 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
412 as a new helper class, ReplacementFragment, which encapsulates information and functions
413 pertaining to a document fragment that is being inserted into a document.
415 * khtml/editing/htmlediting.cpp:
416 (khtml::ReplacementFragment::ReplacementFragment):
417 (khtml::ReplacementFragment::~ReplacementFragment):
418 (khtml::ReplacementFragment::firstChild): Simple accessor.
419 (khtml::ReplacementFragment::lastChild): Ditto.
420 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
421 the starting node to use for merging into the block containing the start of the selection.
422 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
423 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
424 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
425 special annotation comment added in by the copy code.
426 (khtml::ReplacementFragment::removeNode): Simple helper.
427 (khtml::isComment): Simple helper.
428 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
429 I would like to do better than this some day, but this check will hold us until I can do better.
430 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
431 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
432 (khtml::ReplaceSelectionCommand::doApply):
433 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
434 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
435 (khtml::ReplacementFragment::root):
436 (khtml::ReplacementFragment::type):
437 (khtml::ReplacementFragment::isEmpty):
438 (khtml::ReplacementFragment::isSingleTextNode):
439 (khtml::ReplacementFragment::isTreeFragment):
440 (khtml::ReplacementFragment::hasMoreThanOneBlock):
441 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
443 This smaller set of changes markup generation to add the newline annotation described in the
444 comment at the start of this entry.
446 * khtml/xml/dom2_rangeimpl.cpp:
447 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
448 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
449 comment annotations are added to the markup generated.
450 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
451 * kwq/WebCoreBridge.mm:
452 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
453 DOM::RangeImpl::toHTML uses annotations when generating.
457 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
458 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
459 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
460 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
461 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
462 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
463 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
464 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
465 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
466 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
467 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
468 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
469 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
470 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
471 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
472 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
473 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
474 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
476 2004-11-29 Ken Kocienda <kocienda@apple.com>
480 Made two small changes that make it possible for comments to have DOM nodes made for them
481 when pasting. This relies on some earlier work I did some days ago.
483 * khtml/xml/dom_nodeimpl.cpp:
484 (NodeImpl::startMarkup): Get the string from the comment.
485 * kwq/WebCoreBridge.mm:
486 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
487 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
488 be included in the DOM.
490 2004-11-29 Ken Kocienda <kocienda@apple.com>
494 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
495 my improved paste code.
497 * khtml/editing/visible_position.cpp:
498 (khtml::blockRelationship)
499 (khtml::visiblePositionsInDifferentBlocks)
500 (khtml::isFirstVisiblePositionInBlock)
501 (khtml::isFirstVisiblePositionInNode)
502 (khtml::isLastVisiblePositionInBlock)
503 * khtml/editing/visible_position.h
505 2004-11-29 Ken Kocienda <kocienda@apple.com>
509 * khtml/xml/dom_position.cpp:
510 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
511 specified from obeying that directive. The old code would stop at an outer block boundary in
512 the case where that block had a block as its first child. The correct behavior is to drill into
513 that inner block (and continue on drilling down, if possible), to find the correct position.
515 2004-11-29 Ken Kocienda <kocienda@apple.com>
519 Small improvements to the node-display debugging helpers.
521 * khtml/xml/dom_nodeimpl.cpp:
522 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
523 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
525 2004-11-29 Ken Kocienda <kocienda@apple.com>
529 * khtml/editing/htmlediting.cpp:
530 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
531 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
532 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
533 place after the delete.
535 2004-11-29 Ken Kocienda <kocienda@apple.com>
539 Add a new helper function to insert a paragraph separator. Will be used in my
540 upcoming paste improvments.
542 * khtml/editing/htmlediting.cpp: Added function
543 (khtml::CompositeEditCommand::insertParagraphSeparator)
544 * khtml/editing/htmlediting.h: Ditto.
546 2004-11-23 David Harrison <harrison@apple.com>
548 Added various comments.
550 * khtml/editing/htmlediting.cpp:
551 (khtml::StyleChange::init):
552 (khtml::ApplyStyleCommand::doApply):
553 (khtml::ApplyStyleCommand::applyBlockStyle):
554 (khtml::ApplyStyleCommand::applyInlineStyle):
556 2004-11-23 David Hyatt <hyatt@apple.com>
558 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
559 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
561 * khtml/rendering/render_block.cpp:
562 (khtml::RenderBlock::nodeAtPoint):
564 2004-11-22 David Hyatt <hyatt@apple.com>
566 Make sure you can use document.createElement to make a <canvas> element.
568 * khtml/xml/dom_docimpl.cpp:
569 (DocumentImpl::createHTMLElement):
571 2004-11-22 Maciej Stachowiak <mjs@apple.com>
575 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
576 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
577 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
578 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
580 * khtml/ecma/kjs_html.cpp:
581 (KJS::HTMLDocument::tryGet):
582 * khtml/html/html_formimpl.cpp:
583 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
584 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
585 * khtml/html/html_formimpl.h:
586 * khtml/html/html_miscimpl.cpp:
587 (HTMLCollectionImpl::HTMLCollectionImpl):
588 (HTMLCollectionImpl::~HTMLCollectionImpl):
589 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
590 (HTMLCollectionImpl::CollectionInfo::reset):
591 (HTMLCollectionImpl::resetCollectionInfo):
592 (HTMLCollectionImpl::checkForNameMatch):
594 (HTMLCollectionImpl::updateNameCache):
595 (HTMLCollectionImpl::namedItems):
596 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
597 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
598 (HTMLFormCollectionImpl::item):
599 (HTMLFormCollectionImpl::updateNameCache):
600 * khtml/html/html_miscimpl.h:
602 2004-11-22 David Hyatt <hyatt@apple.com>
604 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
609 * khtml/misc/loader.cpp:
610 (CachedObject::finish):
613 * khtml/misc/loader.h:
614 (khtml::Cache::maxCacheableObjectSize):
616 2004-11-22 David Hyatt <hyatt@apple.com>
618 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
619 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
620 that lets us short circuit earlier when painting and hit testing.
624 * khtml/khtml_part.cpp:
625 (KHTMLPart::isPointInsideSelection):
626 * khtml/rendering/render_block.cpp:
627 (khtml::RenderBlock::paint):
628 (khtml::RenderBlock::paintChildren):
629 (khtml::RenderBlock::paintObject):
630 (khtml::RenderBlock::paintFloats):
631 (khtml::RenderBlock::nodeAtPoint):
632 * khtml/rendering/render_block.h:
633 * khtml/rendering/render_box.cpp:
634 (RenderBox::nodeAtPoint):
635 * khtml/rendering/render_box.h:
636 * khtml/rendering/render_br.h:
637 * khtml/rendering/render_canvas.cpp:
638 (RenderCanvas::paint):
639 * khtml/rendering/render_flow.cpp:
640 (RenderFlow::paintLines):
641 (RenderFlow::hitTestLines):
642 (RenderFlow::caretRect):
643 (RenderFlow::addFocusRingRects):
644 (RenderFlow::paintFocusRing):
645 (RenderFlow::paintOutlines):
646 (RenderFlow::paintOutlineForLine):
647 * khtml/rendering/render_flow.h:
648 * khtml/rendering/render_frames.cpp:
649 (RenderFrameSet::nodeAtPoint):
650 * khtml/rendering/render_frames.h:
651 * khtml/rendering/render_image.cpp:
652 (RenderImage::nodeAtPoint):
653 * khtml/rendering/render_image.h:
654 * khtml/rendering/render_inline.cpp:
655 (RenderInline::paint):
656 (RenderInline::nodeAtPoint):
657 * khtml/rendering/render_inline.h:
658 * khtml/rendering/render_layer.cpp:
659 (RenderLayer::paintLayer):
660 (RenderLayer::hitTest):
661 (RenderLayer::hitTestLayer):
662 * khtml/rendering/render_layer.h:
663 * khtml/rendering/render_line.cpp:
664 (khtml::InlineBox::paint):
665 (khtml::InlineBox::nodeAtPoint):
666 (khtml::InlineFlowBox::flowObject):
667 (khtml::InlineFlowBox::nodeAtPoint):
668 (khtml::InlineFlowBox::paint):
669 (khtml::InlineFlowBox::paintBackgrounds):
670 (khtml::InlineFlowBox::paintBackground):
671 (khtml::InlineFlowBox::paintBackgroundAndBorder):
672 (khtml::InlineFlowBox::paintDecorations):
673 (khtml::EllipsisBox::paint):
674 (khtml::EllipsisBox::nodeAtPoint):
675 (khtml::RootInlineBox::paintEllipsisBox):
676 (khtml::RootInlineBox::paint):
677 (khtml::RootInlineBox::nodeAtPoint):
678 * khtml/rendering/render_line.h:
679 (khtml::InlineRunBox::paintBackgroundAndBorder):
680 * khtml/rendering/render_object.cpp:
681 (RenderObject::hitTest):
682 (RenderObject::setInnerNode):
683 (RenderObject::nodeAtPoint):
684 * khtml/rendering/render_object.h:
685 (khtml::RenderObject::PaintInfo::PaintInfo):
686 (khtml::RenderObject::PaintInfo::~PaintInfo):
687 (khtml::RenderObject::paintingRootForChildren):
688 (khtml::RenderObject::shouldPaintWithinRoot):
689 * khtml/rendering/render_table.cpp:
690 (RenderTable::layout):
691 (RenderTable::paint):
692 * khtml/rendering/render_text.cpp:
693 (simpleDifferenceBetweenColors):
694 (correctedTextColor):
695 (InlineTextBox::nodeAtPoint):
696 (InlineTextBox::paint):
697 (InlineTextBox::selectionStartEnd):
698 (InlineTextBox::paintSelection):
699 (InlineTextBox::paintMarkedTextBackground):
700 (InlineTextBox::paintDecoration):
701 (RenderText::posOfChar):
702 * khtml/rendering/render_text.h:
703 (khtml::RenderText::paint):
704 (khtml::RenderText::layout):
705 (khtml::RenderText::nodeAtPoint):
706 * khtml/xml/dom2_eventsimpl.cpp:
707 (MouseEventImpl::computeLayerPos):
708 * khtml/xml/dom_docimpl.cpp:
709 (DocumentImpl::prepareMouseEvent):
710 * kwq/KWQAccObject.mm:
711 (-[KWQAccObject accessibilityHitTest:]):
712 * kwq/KWQKHTMLPart.mm:
713 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
714 (KWQKHTMLPart::eventMayStartDrag):
715 (KWQKHTMLPart::khtmlMouseMoveEvent):
716 * kwq/WebCoreBridge.mm:
717 (-[WebCoreBridge elementAtPoint:]):
718 (-[WebCoreBridge _positionForPoint:]):
720 2004-11-22 Maciej Stachowiak <mjs@apple.com>
724 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
725 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
727 This avoids the O(N^2) penalty for named item traversal for form collections.
729 It also combines the item traversal logic for all non-form
730 collection operations into a single traverseNextItem
731 function. This avoids having 5 copies of the big switch statement
734 Also fixed a bug that prevented the last form element from being removed properly.
736 * khtml/html/html_formimpl.cpp:
737 (DOM::removeFromVector):
738 * khtml/dom/html_misc.cpp:
739 (HTMLCollection::namedItems):
740 * khtml/dom/html_misc.h:
741 * khtml/ecma/kjs_html.cpp:
742 (KJS::HTMLCollection::getNamedItems):
743 * khtml/html/html_miscimpl.cpp:
744 (HTMLCollectionImpl::traverseNextItem):
745 (HTMLCollectionImpl::calcLength):
746 (HTMLCollectionImpl::length):
747 (HTMLCollectionImpl::item):
748 (HTMLCollectionImpl::nextItem):
749 (HTMLCollectionImpl::checkForNameMatch):
750 (HTMLCollectionImpl::namedItem):
751 (HTMLCollectionImpl::namedItems):
752 (HTMLCollectionImpl::nextNamedItem):
753 (HTMLFormCollectionImpl::calcLength):
754 (HTMLFormCollectionImpl::namedItem):
755 (HTMLFormCollectionImpl::nextNamedItem):
756 (HTMLFormCollectionImpl::namedItems):
757 * khtml/html/html_miscimpl.h:
759 2004-11-22 Ken Kocienda <kocienda@apple.com>
763 Change around the way we block the Javascript "Paste" command identifier from
764 being available. Formerly, this was done with an ifdef we never compiled in.
765 Now, this is done with a couple of cheap runtime checks. The advantage is that
766 we can now compile this command into development builds, and still yet switch
767 on the command in deployment builds through the use of WebCore SPI so we can
768 write and run layout tests with all of our builds.
770 * khtml/editing/jsediting.cpp:
771 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
772 command being queried is the paste command.
773 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
774 * khtml/editing/jsediting.h: Ditto.
775 * khtml/khtml_part.cpp:
776 (KHTMLPart::pasteFromPasteboard): Added.
777 (KHTMLPart::canPaste): Added.
778 * kwq/KWQKHTMLPart.mm:
779 (KHTMLPart::canPaste): Added.
780 * kwq/KWQRenderTreeDebug.cpp:
781 (externalRepresentation): Turn on paste command.
782 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
784 2004-11-21 Maciej Stachowiak <mjs@apple.com>
788 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
790 * khtml/html/html_miscimpl.cpp:
791 (HTMLCollectionImpl::calcLength):
792 (HTMLCollectionImpl::getItem):
793 (HTMLCollectionImpl::item):
794 (HTMLCollectionImpl::nextItem):
795 (HTMLCollectionImpl::getNamedItem):
796 (HTMLCollectionImpl::namedItem):
797 (HTMLCollectionImpl::nextNamedItemInternal):
798 (HTMLFormCollectionImpl::nextNamedItemInternal):
800 2004-11-19 Maciej Stachowiak <mjs@apple.com>
804 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
805 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
806 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
808 Many optimizations to HTMLFormCollection. Iterating it should not
809 be N^2 any more, though finding items by name could still be.
811 * khtml/html/html_formimpl.cpp:
812 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
813 (DOM::HTMLFormElementImpl::length):
814 (DOM::HTMLFormElementImpl::submitClick):
815 (DOM::HTMLFormElementImpl::formData):
816 (DOM::HTMLFormElementImpl::submit):
817 (DOM::HTMLFormElementImpl::reset):
818 (DOM::HTMLFormElementImpl::radioClicked):
819 (DOM::appendToVector):
820 (DOM::removeFromVector):
821 (DOM::HTMLFormElementImpl::registerFormElement):
822 (DOM::HTMLFormElementImpl::removeFormElement):
823 (DOM::HTMLFormElementImpl::makeFormElementDormant):
824 (DOM::HTMLFormElementImpl::registerImgElement):
825 (DOM::HTMLFormElementImpl::removeImgElement):
826 * khtml/html/html_formimpl.h:
827 * khtml/html/html_miscimpl.cpp:
828 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
829 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
830 (HTMLFormCollectionImpl::resetCollectionInfo):
831 (HTMLFormCollectionImpl::calcLength):
832 (HTMLFormCollectionImpl::item):
833 (HTMLFormCollectionImpl::getNamedItem):
834 (HTMLFormCollectionImpl::getNamedFormItem):
835 (HTMLFormCollectionImpl::firstItem):
836 (HTMLFormCollectionImpl::nextItem):
837 * khtml/html/html_miscimpl.h:
838 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
839 * khtml/xml/dom_elementimpl.cpp:
840 (ElementImpl::setAttribute):
841 (ElementImpl::setAttributeMap):
842 * kwq/KWQPtrVector.h:
843 (QPtrVector::findRef):
844 * kwq/KWQVectorImpl.h:
845 * kwq/KWQVectorImpl.mm:
846 (KWQVectorImpl::findRef):
847 * kwq/WebCoreBridge.mm:
848 (-[WebCoreBridge elementWithName:inForm:]):
849 (-[WebCoreBridge controlsInForm:]):
851 2004-11-19 David Harrison <harrison@apple.com>
853 Reviewed by Ken and Darin.
855 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
857 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
858 for the existing style, but in this case (hitting cmd-B with caret at top of
859 file) there is nothing upstream. Changed this to use the VisiblePosition
860 deepEquivalent instead.
862 * khtml/khtml_part.cpp:
863 (KHTMLPart::computeAndSetTypingStyle):
867 2004-11-19 Maciej Stachowiak <mjs@apple.com>
871 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
873 * khtml/xml/dom_docimpl.cpp:
874 (DocumentImpl::close): Don't fire the onload handler if there is a
875 redirect pending. This is a very long-standing bug that was masked
876 by our previously incorrect redirect logic. It used to be that an
877 older redirect would always win. Recently we changed things so
878 that a newer redirect would win, but a script that causes a
879 redirect would stop parsing once complete (so if there are two
880 redirects in the same script, the latter wins). However, we should
881 have also prevented onload in this case. Testing with other
882 browsers shows that onload handlers do not run at all when there
883 is a pending redirect.
885 2004-11-19 Ken Kocienda <kocienda@apple.com>
889 Fix some object lifetime issues in these two commands. This fixes some crashes
890 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
892 * khtml/editing/htmlediting.cpp:
893 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
894 in the ancestor list. They are not ref'ed when put on list. D'uh.
895 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
896 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
897 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
899 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
901 2004-11-19 Ken Kocienda <kocienda@apple.com>
907 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
909 * khtml/khtml_part.cpp:
910 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
911 declaration given the current selection, and then sets the minimum necessary style as the typing
913 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
914 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
916 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
917 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
918 * kwq/WebCoreBridge.mm:
919 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
920 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
922 2004-11-18 David Harrison <harrison@apple.com>
926 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
927 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
930 (-[DOMCSSStyleDeclaration setProperty:::]):
932 2004-11-18 Chris Blumenberg <cblu@apple.com>
934 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
938 * kwq/KWQKHTMLPart.mm:
939 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
941 2004-11-18 Maciej Stachowiak <mjs@apple.com>
945 - fix recursive item traversal, use traverseNextNode() instead of
946 the buggy hand-rolled traversal.
948 * khtml/xml/dom_nodeimpl.cpp:
949 (NodeListImpl::recursiveItem):
951 2004-11-17 Darin Adler <darin@apple.com>
955 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
957 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
958 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
960 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
961 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
962 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
963 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
964 an entire category of leaks we have been fixing one by one recently
965 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
966 stale RenderObject pointer, although I never saw it do that in practice
967 - implemented the length and item methods for computed styles
968 - implemented querying additional properties in computed styles (29 more)
970 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
971 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
972 take a mutable style.
973 * khtml/khtml_part.cpp:
974 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
975 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
976 a computed style; also change some types to mutable style.
977 (updateState): Update iteration of CSSProperty objects in a style declaration to use
978 the new valuesIterator interface.
979 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
980 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
981 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
982 including accomodating the exception code that setCssText has now.
983 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
984 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
985 the style attributes really was a change, although it's not an important optimization it's
988 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
989 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
990 calling it were already removing the old property explicitly, so the code in here to remove
991 the property again was redundant.
993 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
994 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
995 * khtml/css/css_computedstyle.cpp:
996 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
997 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
998 Before we had no guarantee the object would outlast us.
999 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1000 exception to NO_MODIFICATION_ALLOWED_ERR.
1001 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1002 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1003 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1004 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1005 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1006 page-break-inside, position, unicode-bidi, widows, z-index.
1007 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1008 exception to NO_MODIFICATION_ALLOWED_ERR.
1009 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1010 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1011 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1012 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1013 CSSMutableStyleDeclarationImpl.
1014 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1015 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1017 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1018 now a separate class rather than a typedef.
1019 * khtml/css/cssparser.h: Ditto.
1021 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1022 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1023 Removed a bunch of redundant stuff from other classes in this file too.
1024 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1025 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1026 (DOM::CSSProperty::operator=): Added.
1027 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1029 * khtml/css/css_valueimpl.cpp:
1030 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1031 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1032 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1033 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1034 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1035 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1036 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1037 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1038 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1039 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1040 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1041 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1042 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1043 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1044 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1045 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1046 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1047 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1048 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1049 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1050 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1051 no styles in the list. Update to use QValueList.
1052 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1053 parameter and set it.
1054 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1055 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1056 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1057 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1058 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1059 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1061 * khtml/css/cssparser.cpp:
1062 (CSSParser::parseValue): Changed to use addParsedProperties.
1063 (CSSParser::parseDeclaration): Ditto.
1064 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1066 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
1067 * khtml/css/cssproperties.c: Regenerated.
1068 * khtml/css/cssproperties.h: Regenerated.
1070 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
1071 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
1073 * khtml/dom/css_value.cpp:
1074 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
1075 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
1076 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
1077 first doing getPropertyCSSValue and then doing cssText.
1078 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
1079 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
1080 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
1081 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
1082 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
1083 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
1084 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
1086 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
1087 * khtml/dom/dom_node.cpp: Ditto.
1089 * khtml/editing/htmlediting.h: Change some types to mutable style.
1090 * khtml/editing/htmlediting.cpp:
1091 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
1092 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
1093 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
1094 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
1095 (khtml::EditCommand::setTypingStyle): Ditto.
1096 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
1097 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
1098 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
1099 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1100 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
1101 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
1102 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
1103 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1104 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1105 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1106 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
1107 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1108 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
1110 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
1111 * khtml/html/html_baseimpl.h: Change type to mutable style.
1112 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
1114 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
1115 class as a base class, and change types to mutable style as needed.
1116 * khtml/html/html_elementimpl.cpp:
1117 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
1118 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
1119 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
1120 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
1121 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
1122 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
1124 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
1127 * khtml/html/html_tableimpl.h: Change types to mutable style.
1128 * khtml/html/html_tableimpl.cpp:
1129 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1130 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
1131 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1133 * khtml/html/htmlparser.cpp:
1134 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
1135 than using an explicit delete to make the node go away, and is required for compatibility with the
1136 changes to the NodeImpl functions.
1137 (KHTMLParser::insertNode): Ditto.
1138 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
1139 the NodeImpl functions.
1141 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
1142 now that there's no need to make the property list explictly.
1145 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
1146 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
1147 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
1149 * khtml/xml/dom_nodeimpl.cpp:
1150 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
1151 function succeeded or not for ownership purposes.
1152 (NodeImpl::replaceChild): Ditto.
1153 (NodeImpl::appendChild): Ditto.
1154 (NodeBaseImpl::insertBefore): Ditto.
1155 (NodeBaseImpl::replaceChild): Ditto.
1156 (NodeBaseImpl::appendChild): Ditto.
1157 (NodeBaseImpl::addChild): Ditto.
1159 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
1160 * WebCore-combined.exp: Regenerated.
1162 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1164 still even more build fixing
1166 * khtml/html/html_miscimpl.cpp:
1167 (HTMLCollectionImpl::resetCollectionInfo):
1169 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1173 * khtml/html/html_miscimpl.cpp:
1174 (HTMLCollectionImpl::resetCollectionInfo):
1176 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1178 Fixed build problem.
1180 * khtml/html/html_miscimpl.h:
1181 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
1183 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1187 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
1189 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
1190 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
1192 This is also a start on fixing 5 other bugs, but those need additional work to make
1193 HTMLFormCollection fast.
1195 * khtml/html/html_documentimpl.h:
1196 (DOM::HTMLDocumentImpl::collectionInfo):
1197 * khtml/html/html_formimpl.cpp:
1198 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1199 (DOM::HTMLFormElementImpl::isURLAttribute):
1200 (DOM::HTMLFormElementImpl::registerImgElement):
1201 (DOM::HTMLFormElementImpl::removeImgElement):
1202 * khtml/html/html_formimpl.h:
1203 * khtml/html/html_imageimpl.cpp:
1204 (HTMLImageElementImpl::HTMLImageElementImpl):
1205 (HTMLImageElementImpl::~HTMLImageElementImpl):
1206 * khtml/html/html_imageimpl.h:
1207 * khtml/html/html_miscimpl.cpp:
1208 (HTMLCollectionImpl::HTMLCollectionImpl):
1209 (HTMLCollectionImpl::~HTMLCollectionImpl):
1210 (HTMLCollectionImpl::updateCollectionInfo):
1211 (HTMLCollectionImpl::length):
1212 (HTMLCollectionImpl::item):
1213 (HTMLCollectionImpl::firstItem):
1214 (HTMLCollectionImpl::nextItem):
1215 (HTMLCollectionImpl::namedItem):
1216 (HTMLCollectionImpl::nextNamedItemInternal):
1217 (HTMLFormCollectionImpl::getNamedFormItem):
1218 * khtml/html/html_miscimpl.h:
1219 (DOM::HTMLCollectionImpl::):
1220 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1221 * khtml/html/htmlparser.cpp:
1222 (KHTMLParser::getElement):
1223 * khtml/xml/dom_docimpl.cpp:
1224 (DocumentImpl::DocumentImpl):
1225 * khtml/xml/dom_docimpl.h:
1226 (DOM::DocumentImpl::incDOMTreeVersion):
1227 (DOM::DocumentImpl::domTreeVersion):
1228 * khtml/xml/dom_nodeimpl.cpp:
1232 2004-11-18 Kevin Decker <kdecker@apple.com>
1236 fixed: <rdar://problem/3841842> getPropertyID expensive
1239 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
1241 2004-11-17 David Hyatt <hyatt@apple.com>
1243 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
1244 and subsequently backed out).
1246 Reviewed by kocienda
1248 * khtml/html/html_baseimpl.cpp:
1249 (HTMLBodyElementImpl::insertedIntoDocument):
1250 * khtml/html/htmltokenizer.cpp:
1251 (khtml::HTMLTokenizer::reset):
1252 (khtml::HTMLTokenizer::scriptHandler):
1253 (khtml::HTMLTokenizer::scriptExecution):
1254 (khtml::HTMLTokenizer::write):
1255 (khtml::HTMLTokenizer::continueProcessing):
1256 (khtml::HTMLTokenizer::timerEvent):
1257 (khtml::HTMLTokenizer::notifyFinished):
1258 * khtml/html/htmltokenizer.h:
1259 * khtml/khtmlview.cpp:
1260 (KHTMLViewPrivate::KHTMLViewPrivate):
1261 (KHTMLViewPrivate::reset):
1263 (KHTMLView::layout):
1264 (KHTMLView::timerEvent):
1265 (KHTMLView::scheduleRelayout):
1266 (KHTMLView::layoutPending):
1267 (KHTMLView::haveDelayedLayoutScheduled):
1268 (KHTMLView::unscheduleRelayout):
1269 * khtml/khtmlview.h:
1270 * khtml/xml/dom_docimpl.cpp:
1271 (DocumentImpl::DocumentImpl):
1272 (DocumentImpl::close):
1273 (DocumentImpl::setParsing):
1274 (DocumentImpl::shouldScheduleLayout):
1275 (DocumentImpl::minimumLayoutDelay):
1276 (DocumentImpl::write):
1277 (DocumentImpl::finishParsing):
1278 (DocumentImpl::stylesheetLoaded):
1279 (DocumentImpl::updateStyleSelector):
1280 * khtml/xml/dom_docimpl.h:
1281 (DOM::DocumentImpl::parsing):
1282 * kwq/KWQDateTime.mm:
1283 (KWQUIEventTime::uiEventPending):
1285 2004-11-17 David Harrison <harrison@apple.com>
1287 Reviewed by Ken Kocienda.
1289 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
1290 Treat null case as meaning no post-move merge is needed.
1292 * khtml/editing/htmlediting.cpp:
1293 (khtml::DeleteSelectionCommand::initializePositionData):
1295 2004-11-17 David Harrison <harrison@apple.com>
1297 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
1298 * khtml/xml/dom_nodeimpl.cpp:
1299 (NodeImpl::displayNode):
1300 (NodeImpl::displayTree):
1301 (NodeBaseImpl::dispatchChildRemovalEvents):
1302 * khtml/xml/dom_nodeimpl.h:
1304 2004-11-16 John Sullivan <sullivan@apple.com>
1306 Reviewed by Richard.
1308 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
1310 * khtml/khtml_part.cpp:
1312 delete the list we created when we're done with it
1314 2004-11-16 Ken Kocienda <kocienda@apple.com>
1318 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
1319 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
1320 QPtrList when the list goes out of scope.
1322 * khtml/editing/htmlediting.cpp:
1323 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
1324 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
1325 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
1326 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1327 No longer set lists to autodelete.
1328 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
1329 Call new derefNodesInList helper.
1330 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
1331 of one before, but now it does.
1333 2004-11-15 David Harrison <harrison@apple.com>
1335 Reviewed by Chris and Darin.
1337 <rdar://problem/3880304> Non-linear performance hit for style changes
1339 * khtml/xml/dom_nodeimpl.cpp:
1340 (NodeImpl::traverseNextNode):
1341 (NodeImpl::traverseNextSibling):
1342 (NodeImpl::traversePreviousNodePostOrder):
1343 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
1344 Add asserts that stayWithin is an ancestor of the returned node.
1346 2004-11-15 Darin Adler <darin@apple.com>
1350 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
1352 * khtml/css/css_computedstyle.cpp:
1353 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
1354 since there's no guarantee it's already ref'd.
1355 * khtml/css/css_valueimpl.cpp:
1356 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
1357 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
1358 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
1359 (CSSStyleDeclarationImpl::merge): Ditto.
1360 (CSSStyleDeclarationImpl::diff): Ditto.
1361 * khtml/editing/htmlediting.cpp:
1362 (khtml::StyleChange::currentlyHasStyle): Ditto.
1363 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1364 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
1365 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
1367 2004-11-15 Darin Adler <darin@apple.com>
1371 Use separate mutable style and computed style types as appropriate.
1372 For now this should have no effect, but it prepares us for refactoring later.
1373 Also remove some unnecessary "DOM::" prefixes and in one case factor out
1376 * khtml/khtml_part.cpp:
1377 (KHTMLPart::typingStyle):
1378 (KHTMLPart::setTypingStyle):
1380 (KHTMLPart::selectionHasStyle):
1381 (KHTMLPart::selectionStartHasStyle):
1382 (KHTMLPart::selectionComputedStyle):
1383 * khtml/khtml_part.h:
1384 * khtml/khtmlpart_p.h:
1386 * khtml/css/css_base.h:
1387 * khtml/css/css_ruleimpl.cpp:
1388 (CSSStyleRuleImpl::setDeclaration):
1389 * khtml/css/css_ruleimpl.h:
1390 (DOM::CSSFontFaceRuleImpl::style):
1391 (DOM::CSSPageRuleImpl::style):
1392 (DOM::CSSStyleRuleImpl::style):
1393 (DOM::CSSStyleRuleImpl::declaration):
1394 * khtml/css/css_valueimpl.h:
1395 (DOM::CSSPrimitiveValueImpl::):
1396 * khtml/css/cssparser.cpp:
1397 (CSSParser::parseValue):
1398 (CSSParser::parseColor):
1399 (CSSParser::parseDeclaration):
1400 (CSSParser::createStyleDeclaration):
1401 * khtml/css/cssparser.h:
1402 * khtml/css/cssstyleselector.cpp:
1403 (khtml::CSSStyleSelector::addMatchedDeclaration):
1404 (khtml::CSSStyleSelector::matchRulesForList):
1405 (khtml::CSSStyleSelector::styleForElement):
1406 (khtml::CSSStyleSelector::applyDeclarations):
1407 * khtml/css/cssstyleselector.h:
1408 * khtml/css/parser.cpp:
1409 * khtml/css/parser.y:
1410 * khtml/dom/css_rule.h:
1411 * khtml/dom/css_stylesheet.h:
1412 * khtml/dom/css_value.h:
1413 * khtml/dom/dom2_views.cpp:
1414 * khtml/xml/dom2_viewsimpl.cpp:
1415 (DOM::AbstractViewImpl::getComputedStyle):
1416 * khtml/xml/dom_docimpl.cpp:
1417 (DocumentImpl::importNode):
1418 (DocumentImpl::setStyleSheet):
1419 * khtml/xml/dom_docimpl.h:
1420 * khtml/xml/dom_xmlimpl.cpp:
1421 (DOM::ProcessingInstructionImpl::setStyleSheet):
1422 * khtml/xml/dom_xmlimpl.h:
1424 * khtml/dom/css_value.cpp:
1425 (DOM::throwException): Added.
1426 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
1427 The real thing is coming with the next change to refactor.
1428 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
1429 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
1431 2004-11-15 Darin Adler <darin@apple.com>
1435 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
1437 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
1438 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
1439 node's attributes changed without sending a misleading childrenChanged call,
1440 but the childrenChanged call can happen at the exact right moment.
1441 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
1442 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
1443 the boolean true is passed in.
1445 * khtml/xml/dom_elementimpl.cpp:
1446 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
1447 (NamedAttrMapImpl::removeAttribute): Ditto.
1449 2004-11-15 John Sullivan <sullivan@apple.com>
1453 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
1454 seen often in Mail and Blot
1456 * khtml/css/css_valueimpl.cpp:
1457 (CSSStyleDeclarationImpl::copyPropertiesInSet):
1458 delete temporary list after we're done using it
1460 2004-11-15 Richard Williamson <rjw@apple.com>
1462 Fixed leak (3879883) that John found. Early return leaked
1467 * khtml/css/css_computedstyle.cpp:
1468 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1470 2004-11-15 Ken Kocienda <kocienda@apple.com>
1476 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
1478 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
1479 EditCommandPtr to its parent, but this caused a a reference cycle in composite
1480 commands as the children held a ref to their parent. Now, the parent variable
1481 is a non-retained reference to an EditCommand *. It would be nice to have a
1482 weak reference to the parent or even override deref in composite commands (but I
1483 can't since deref() is not virtual). However, this should be OK since any
1484 dangling parent pointer is a sign of a bigger object lifetime problem that
1485 would need to be addressed anyway.
1487 * khtml/css/css_valueimpl.cpp:
1488 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
1489 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
1490 just assigning the list variable passed in to the local list variable, or the list will be
1492 * khtml/editing/htmlediting.cpp:
1493 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
1494 (khtml::EditCommand::setEndingSelection): Ditto.
1495 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
1496 Unrelated to the change, but saves some ref's and deref's.
1497 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
1498 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
1499 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
1500 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
1502 2004-11-15 Maciej Stachowiak <mjs@apple.com>
1506 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
1508 * khtml/xml/dom_nodeimpl.cpp:
1509 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
1511 (NodeListImpl::recursiveLength): Adjusted for rename.
1512 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
1513 If the same offset is looked up again, just return it, otherwise, if looking up
1514 a later offset, start at the last item and proceed from there.
1515 (NodeListImpl::itemById): Apply the special document optimization to all
1516 nodes that are either a document or in a document - just walk up to make
1517 sure the node found by ID has the root node as an ancestor.
1518 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
1519 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
1521 2004-11-15 John Sullivan <sullivan@apple.com>
1525 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
1527 * kwq/KWQKHTMLPart.mm:
1528 (KWQKHTMLPart::documentFragmentWithText):
1529 release mutable copy of string after we're done using it
1531 2004-11-14 Kevin Decker <kdecker@apple.com>
1535 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
1537 * khtml/html/html_elementimpl.cpp:
1538 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
1539 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
1541 2004-11-13 Maciej Stachowiak <mjs@apple.com>
1545 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
1547 * khtml/dom/dom_node.cpp:
1548 (NodeList::itemById): New method, just forward to impl.
1549 * khtml/dom/dom_node.h: Prototype it.
1550 * khtml/ecma/kjs_dom.cpp:
1551 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
1552 let the NodeList do it. The NodeList might be able to do it more efficiently.
1553 * khtml/xml/dom_nodeimpl.cpp:
1554 (NodeListImpl::itemById): Optimize for the case where the NodeList
1555 covers the whole document. In this case, just use getElementById,
1556 then check that the element satisfies the list criteria.
1557 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
1558 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
1559 * khtml/xml/dom_nodeimpl.h:
1561 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1565 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
1566 sometimes using a huge bogus length value.
1568 * khtml/xml/dom_nodeimpl.cpp:
1569 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
1571 2004-11-12 Darin Adler <darin@apple.com>
1575 - fixed an infinite loop in that last check-in
1577 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
1578 Added a ++i to the loop so it won't get stuck on the first element in the list.
1580 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1584 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
1586 I fixed this by changing NodeLists to cache their length, but
1587 invalidate it whenever there is a change in the DOM subtree at
1588 which they are rooted. This makes NodeListImpl::recursiveLength()
1589 drop completely off the profile, since we were repeatedly getting
1590 a length for the same NodeList over and over.
1592 * khtml/xml/dom_nodeimpl.cpp:
1593 (NodeImpl::NodeImpl):
1594 (NodeImpl::~NodeImpl):
1595 (NodeImpl::registerNodeList):
1596 (NodeImpl::unregisterNodeList):
1597 (NodeImpl::notifyLocalNodeListsSubtreeModified):
1598 (NodeImpl::notifyNodeListsSubtreeModified):
1599 (NodeImpl::dispatchSubtreeModifiedEvent):
1600 (NodeListImpl::NodeListImpl):
1601 (NodeListImpl::~NodeListImpl):
1602 (NodeListImpl::recursiveLength):
1603 (NodeListImpl::recursiveItem):
1604 (NodeListImpl::rootNodeSubtreeModified):
1605 (ChildNodeListImpl::ChildNodeListImpl):
1606 (ChildNodeListImpl::length):
1607 (ChildNodeListImpl::item):
1608 (TagNodeListImpl::TagNodeListImpl):
1609 (TagNodeListImpl::length):
1610 (TagNodeListImpl::item):
1611 (NameNodeListImpl::NameNodeListImpl):
1612 (NameNodeListImpl::length):
1613 (NameNodeListImpl::item):
1614 * khtml/xml/dom_nodeimpl.h:
1616 2004-11-12 Darin Adler <darin@apple.com>
1620 - various small cleanups
1622 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
1623 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
1625 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
1626 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
1627 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
1628 * khtml/html/htmltokenizer.cpp:
1629 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
1630 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
1632 * khtml/khtml_part.h: Removed docImpl function.
1633 * khtml/khtml_part.cpp: Ditto.
1635 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
1636 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
1638 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
1639 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
1640 part of the change last time, which is why the build broke).
1641 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
1642 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
1643 (KWQKHTMLPart::keyEvent): Ditto.
1644 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
1645 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
1647 2004-11-12 Chris Blumenberg <cblu@apple.com>
1649 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
1653 * kwq/KWQKHTMLPart.mm:
1654 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
1658 2004-11-12 Darin Adler <darin@apple.com>
1662 - fixed a couple places that would not work for XML documents
1664 * khtml/ecma/kjs_window.cpp:
1665 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
1666 is present on the base class.
1667 (WindowFunc::tryCall): More of the same.
1669 2004-11-12 Darin Adler <darin@apple.com>
1671 - land versions of these files generated by the newer gperf
1673 People building on Panther will continue to see these files modified.
1674 A workaround would be to install the newer gperf on our Tiger build machines.
1676 * khtml/css/cssproperties.c: Regenerated.
1677 * khtml/css/cssvalues.c: Regenerated.
1678 * khtml/html/doctypes.cpp: Regenerated.
1679 * khtml/html/kentities.c: Regenerated.
1680 * khtml/misc/htmlattrs.c: Regenerated.
1681 * khtml/misc/htmltags.c: Regenerated.
1682 * kwq/KWQColorData.c: Regenerated.
1684 2004-11-11 Richard Williamson <rjw@apple.com>
1686 Fix build horkage from previous checkin.
1688 * kwq/KWQKHTMLPart.h:
1690 2004-11-11 Darin Adler <darin@apple.com>
1694 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
1696 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
1698 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
1699 * kwq/KWQKHTMLPart.mm:
1700 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
1701 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
1702 we started with the NSTextField as first responder, and then took focus away and gave it back, which
1703 makes dragging text work again.
1704 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
1706 2004-11-11 David Hyatt <hyatt@apple.com>
1708 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
1712 * khtml/html/htmltokenizer.cpp:
1713 (khtml::HTMLTokenizer::continueProcessing):
1715 2004-11-11 Ken Kocienda <kocienda@apple.com>
1719 * khtml/editing/htmlediting.cpp:
1720 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
1721 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
1722 with the prevailing style for the VisiblePosition class.
1723 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
1724 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
1725 (khtml::visiblePositionsInDifferentBlocks): New helper method.
1726 (khtml::isLastVisiblePositionInBlock): Ditto.
1727 (khtml::isLastVisiblePositionInNode): Ditto.
1728 * khtml/editing/visible_position.h: Add declarations for new functions.
1730 2004-11-11 Ken Kocienda <kocienda@apple.com>
1734 * khtml/editing/htmlediting.cpp:
1735 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
1736 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
1737 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1738 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
1739 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
1740 * khtml/xml/dom2_rangeimpl.cpp:
1741 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
1742 * khtml/xml/dom2_rangeimpl.h: Ditto.
1744 2004-11-11 Ken Kocienda <kocienda@apple.com>
1746 Reviewed by Harrison
1748 Some improvements to deleting when complete lines are selected.
1750 * khtml/editing/htmlediting.cpp:
1751 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
1752 the end of a selection is fully selected. Turn off block merging in this case.
1753 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
1754 whether a BR immediately followed a block. The old code could erroneously skip nodes.
1755 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
1756 start block is selected. This new code will now delete this block in one call, rather
1757 than iterating over each child.
1758 * khtml/editing/visible_position.cpp:
1759 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
1760 to do the work mentioned above in the comment for that function.
1761 (khtml::isFirstVisiblePositionOnLine): Ditto.
1762 (khtml::isLastVisiblePositionOnLine): Ditto.
1763 * khtml/editing/visible_position.h: Add new functions.
1764 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
1765 * layout-tests/editing/deleting/delete-line-001.html: Added.
1766 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
1767 * layout-tests/editing/deleting/delete-line-002.html: Added.
1768 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
1769 * layout-tests/editing/deleting/delete-line-003.html: Added.
1770 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
1771 * layout-tests/editing/deleting/delete-line-004.html: Added.
1772 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
1773 * layout-tests/editing/deleting/delete-line-005.html: Added.
1774 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
1775 * layout-tests/editing/deleting/delete-line-006.html: Added.
1776 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
1777 * layout-tests/editing/deleting/delete-line-007.html: Added.
1778 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
1779 * layout-tests/editing/deleting/delete-line-008.html: Added.
1780 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
1781 * layout-tests/editing/deleting/delete-line-009.html: Added.
1782 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
1783 * layout-tests/editing/deleting/delete-line-010.html: Added.
1784 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
1785 * layout-tests/editing/deleting/delete-line-011.html: Added.
1786 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
1787 * layout-tests/editing/deleting/delete-line-012.html: Added.
1789 2004-11-11 Ken Kocienda <kocienda@apple.com>
1793 * khtml/editing/htmlediting.cpp:
1794 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
1796 2004-11-11 Ken Kocienda <kocienda@apple.com>
1802 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
1803 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
1805 * khtml/editing/selection.cpp:
1806 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
1807 the next line position when necessary.
1808 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
1809 * layout-tests/editing/selection/move-3875618-fix.html: Added.
1810 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
1811 * layout-tests/editing/selection/move-3875641-fix.html: Added.
1813 2004-11-11 Ken Kocienda <kocienda@apple.com>
1817 Improved some function names, at John's urging. No changes to the
1818 functions themselves.
1820 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
1821 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
1822 performGeneralDelete() --> handleGeneralDelete()
1824 * khtml/editing/htmlediting.cpp:
1825 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
1826 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
1827 (khtml::DeleteSelectionCommand::handleGeneralDelete)
1828 (khtml::DeleteSelectionCommand::doApply)
1829 * khtml/editing/htmlediting.h
1831 2004-11-11 Ken Kocienda <kocienda@apple.com>
1835 Updated some layout test results that changed as a result of my last checking.
1836 Added a new test that has been in my tree for a few days.
1838 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
1839 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
1840 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
1841 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
1843 2004-11-11 Ken Kocienda <kocienda@apple.com>
1847 * khtml/editing/htmlediting.cpp:
1848 (khtml::debugNode): New debugging helper.
1849 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
1850 startPositionForDelete() and endPositionForDelete() functions. Just use the
1851 m_selectionToDelete object to determine start and end positions for the delete.
1852 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
1853 function that creates a special case for deleting all the content in a root
1855 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
1856 function before BR special case and the general case delete functions.
1857 * khtml/editing/htmlediting.h: Updated for changed functions.
1859 2004-11-10 Kevin Decker <kdecker@apple.com>
1863 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
1865 * khtml/ecma/kjs_dom.cpp:
1866 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
1868 2004-11-10 Ken Kocienda <kocienda@apple.com>
1872 * khtml/editing/htmlediting.cpp:
1873 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
1874 smart delete from the two functions below to here. There was an unnecessary double
1875 calculation of the leading and trailing whitespace positions. Also refined the trailing
1876 case so it only acts when the leading position is null (which seems to match TextEdit in
1877 my tests). Also removed some unnecessary copying of Position objects.
1878 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
1880 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
1882 2004-11-10 Ken Kocienda <kocienda@apple.com>
1884 Reviewed by Harrison
1886 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
1887 make things more clear.
1888 * khtml/editing/selection.cpp:
1889 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
1890 resulting positions do not cross block boundaries. This was a bug and caused some
1891 delete problems when whole blocks were selected. I will be addressing that issue
1892 more fully in upcoming changes.
1894 2004-11-10 Ken Kocienda <kocienda@apple.com>
1896 Reviewed by Harrison
1898 Some cleanups and fixes in upstream and downstream functions.
1900 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
1901 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
1902 block's enclosing block will be returned.
1904 Remove code from upstream that confined the serach to block boundaries outside of
1905 the code which runs in the StayInBlock case. This code was redundant, and caused
1906 incorrect results to be returned in the DoNotStayInBlock case.
1908 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
1909 node, not the the this pointer's node.
1911 * khtml/xml/dom_position.cpp:
1912 (DOM::Position::upstream)
1913 (DOM::Position::downstream)
1915 2004-11-09 David Hyatt <hyatt@apple.com>
1917 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
1918 loading large local files.
1922 * khtml/html/htmltokenizer.cpp:
1923 (khtml::HTMLTokenizer::HTMLTokenizer):
1924 (khtml::HTMLTokenizer::reset):
1925 (khtml::HTMLTokenizer::write):
1926 (khtml::HTMLTokenizer::stopped):
1927 (khtml::HTMLTokenizer::processingData):
1928 (khtml::HTMLTokenizer::continueProcessing):
1929 (khtml::HTMLTokenizer::timerEvent):
1930 (khtml::HTMLTokenizer::allDataProcessed):
1931 (khtml::HTMLTokenizer::end):
1932 (khtml::HTMLTokenizer::finish):
1933 (khtml::HTMLTokenizer::notifyFinished):
1934 * khtml/html/htmltokenizer.h:
1935 * khtml/khtml_part.cpp:
1936 (KHTMLPart::slotFinished):
1939 * khtml/khtml_part.h:
1940 (KHTMLPart::tokenizerProcessedData):
1941 * khtml/khtmlview.cpp:
1942 * khtml/xml/dom_docimpl.cpp:
1943 * khtml/xml/xml_tokenizer.h:
1944 (khtml::Tokenizer::stopped):
1945 (khtml::Tokenizer::processingData):
1946 * kwq/KWQDateTime.h:
1947 * kwq/KWQDateTime.mm:
1948 (QDateTime::secsTo):
1949 (KWQUIEventTime::uiEventPending):
1950 * kwq/KWQKHTMLPart.h:
1951 * kwq/KWQKHTMLPart.mm:
1952 (KWQKHTMLPart::tokenizerProcessedData):
1953 * kwq/WebCoreBridge.h:
1954 * kwq/WebCoreBridge.mm:
1955 (-[WebCoreBridge stop]):
1956 (-[WebCoreBridge numPendingOrLoadingRequests]):
1957 (-[WebCoreBridge doneProcessingData]):
1959 2004-11-09 David Harrison <harrison@apple.com>
1961 Reviewed by Ken Kocienda.
1963 <rdar://problem/3865837> Wrong text style after delete to start of document
1965 * khtml/editing/htmlediting.cpp:
1966 (khtml::DeleteSelectionCommand::saveTypingStyleState):
1967 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
1969 2004-11-09 Richard Williamson <rjw@apple.com>
1971 Fixed <rdar://problem/3872440> NSTimer prematurely released.
1980 2004-11-09 Chris Blumenberg <cblu@apple.com>
1984 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
1986 2004-11-08 David Harrison <harrison@apple.com>
1988 Reviewed by Ken Kocienda.
1990 <rdar://problem/3865854> Deleting first line deletes all lines
1992 * khtml/editing/htmlediting.cpp:
1993 (khtml::DeleteSelectionCommand::performGeneralDelete):
1994 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
1995 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
1996 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
1997 update because it is handled in calculateEndingPosition now.
1998 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
1999 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2001 2004-11-08 Ken Kocienda <kocienda@apple.com>
2005 * khtml/html/html_elementimpl.cpp:
2006 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2007 are added to the DOM.
2008 * khtml/html/html_elementimpl.h: Ditto.
2009 * khtml/html/htmlparser.cpp:
2010 (KHTMLParser::KHTMLParser): Ditto.
2011 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2012 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2013 * khtml/html/htmltokenizer.cpp:
2014 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2015 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2016 There were a couple of indexing errors that resulted in the comment text containing part of the
2018 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2019 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
2021 2004-11-08 Chris Blumenberg <cblu@apple.com>
2023 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2027 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2028 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2029 * kwq/KWQKHTMLPart.h: ditto
2031 2004-11-08 Darin Adler <darin@apple.com>
2035 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2037 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2038 that possibly deletes the QTimer.
2040 2004-11-08 Chris Blumenberg <cblu@apple.com>
2042 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2046 * kwq/KWQTextField.mm:
2047 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2048 * kwq/WebCoreBridge.h:
2050 2004-11-08 David Harrison <harrison@apple.com>
2054 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2056 * khtml/editing/htmlediting.cpp:
2057 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2058 * khtml/xml/dom_nodeimpl.cpp:
2059 (NodeImpl::enclosingInlineElement):
2060 * khtml/xml/dom_nodeimpl.h:
2062 2004-11-05 Chris Blumenberg <cblu@apple.com>
2064 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
2068 * khtml/editing/htmlediting.cpp:
2069 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
2070 * khtml/editing/visible_position.cpp:
2071 (khtml::VisiblePosition::character): new, returns the character for the position
2072 * khtml/editing/visible_position.h:
2073 * kwq/KWQKHTMLPart.h:
2074 * kwq/KWQKHTMLPart.mm:
2075 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
2076 * kwq/WebCoreBridge.h:
2080 2004-11-05 Adele Amchan <adele@apple.com>
2084 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
2085 and a workaround for displaying transparent backgrounds for textareas.
2087 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
2088 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
2089 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
2090 on the contentView, and on the textView.
2092 2004-11-04 David Hyatt <hyatt@apple.com>
2094 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
2097 Reviewed by darin or ken
2099 * khtml/rendering/bidi.cpp:
2100 (khtml::appendRunsForObject):
2101 (khtml::RenderBlock::skipWhitespace):
2102 (khtml::RenderBlock::findNextLineBreak):
2103 * khtml/rendering/render_block.cpp:
2104 (khtml::RenderBlock::lowestPosition):
2105 (khtml::RenderBlock::rightmostPosition):
2106 (khtml::RenderBlock::leftmostPosition):
2107 * khtml/rendering/render_box.cpp:
2108 (RenderBox::position):
2109 * khtml/rendering/render_box.h:
2110 (khtml::RenderBox::staticX):
2111 (khtml::RenderBox::staticY):
2112 * khtml/rendering/render_layer.cpp:
2113 (RenderLayer::updateLayerPosition):
2114 (RenderLayer::convertToLayerCoords):
2115 * khtml/rendering/render_line.cpp:
2116 (khtml::InlineFlowBox::placeBoxesHorizontally):
2117 * khtml/rendering/render_object.h:
2118 (khtml::RenderObject::staticX):
2119 (khtml::RenderObject::staticY):
2121 Finish turning on XSLT. Make sure child stylesheets can load.
2123 * khtml/xsl/xslt_processorimpl.cpp:
2124 (DOM::stylesheetLoadFunc):
2125 (DOM::XSLTProcessorImpl::transformDocument):
2127 2004-11-04 David Hyatt <hyatt@apple.com>
2129 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
2130 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
2131 keyword and length values.
2135 * khtml/css/cssparser.cpp:
2136 (CSSParser::parseValue):
2137 (CSSParser::addBackgroundValue):
2138 (CSSParser::parseBackgroundShorthand):
2139 (CSSParser::parseBackgroundColor):
2140 (CSSParser::parseBackgroundImage):
2141 (CSSParser::parseBackgroundPositionXY):
2142 (CSSParser::parseBackgroundPosition):
2143 (CSSParser::parseBackgroundProperty):
2144 (CSSParser::parseColorFromValue):
2145 * khtml/css/cssparser.h:
2146 * khtml/css/cssstyleselector.cpp:
2147 (khtml::CSSStyleSelector::adjustRenderStyle):
2148 (khtml::CSSStyleSelector::applyProperty):
2149 (khtml::CSSStyleSelector::mapBackgroundAttachment):
2150 (khtml::CSSStyleSelector::mapBackgroundImage):
2151 (khtml::CSSStyleSelector::mapBackgroundRepeat):
2152 (khtml::CSSStyleSelector::mapBackgroundXPosition):
2153 (khtml::CSSStyleSelector::mapBackgroundYPosition):
2154 * khtml/css/cssstyleselector.h:
2155 * khtml/rendering/render_box.cpp:
2156 (RenderBox::paintRootBoxDecorations):
2157 (RenderBox::paintBoxDecorations):
2158 (RenderBox::paintBackgrounds):
2159 (RenderBox::paintBackground):
2160 (RenderBox::paintBackgroundExtended):
2161 * khtml/rendering/render_box.h:
2162 * khtml/rendering/render_form.cpp:
2163 (RenderFieldset::paintBoxDecorations):
2164 * khtml/rendering/render_line.cpp:
2165 (khtml::InlineFlowBox::paintBackgrounds):
2166 (khtml::InlineFlowBox::paintBackground):
2167 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2168 * khtml/rendering/render_line.h:
2169 * khtml/rendering/render_object.cpp:
2170 (RenderObject::setStyle):
2171 (RenderObject::updateBackgroundImages):
2172 (RenderObject::getVerticalPosition):
2173 * khtml/rendering/render_object.h:
2174 (khtml::RenderObject::paintBackgroundExtended):
2175 * khtml/rendering/render_style.cpp:
2177 (BackgroundLayer::BackgroundLayer):
2178 (BackgroundLayer::~BackgroundLayer):
2179 (BackgroundLayer::operator=):
2180 (BackgroundLayer::operator==):
2181 (BackgroundLayer::fillUnsetProperties):
2182 (BackgroundLayer::cullEmptyLayers):
2183 (StyleBackgroundData::StyleBackgroundData):
2184 (StyleBackgroundData::operator==):
2185 (RenderStyle::diff):
2186 (RenderStyle::adjustBackgroundLayers):
2187 * khtml/rendering/render_style.h:
2188 (khtml::OutlineValue::operator==):
2189 (khtml::OutlineValue::operator!=):
2190 (khtml::BackgroundLayer::backgroundImage):
2191 (khtml::BackgroundLayer::backgroundXPosition):
2192 (khtml::BackgroundLayer::backgroundYPosition):
2193 (khtml::BackgroundLayer::backgroundAttachment):
2194 (khtml::BackgroundLayer::backgroundRepeat):
2195 (khtml::BackgroundLayer::next):
2196 (khtml::BackgroundLayer::isBackgroundImageSet):
2197 (khtml::BackgroundLayer::isBackgroundXPositionSet):
2198 (khtml::BackgroundLayer::isBackgroundYPositionSet):
2199 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
2200 (khtml::BackgroundLayer::isBackgroundRepeatSet):
2201 (khtml::BackgroundLayer::setBackgroundImage):
2202 (khtml::BackgroundLayer::setBackgroundXPosition):
2203 (khtml::BackgroundLayer::setBackgroundYPosition):
2204 (khtml::BackgroundLayer::setBackgroundAttachment):
2205 (khtml::BackgroundLayer::setBackgroundRepeat):
2206 (khtml::BackgroundLayer::clearBackgroundImage):
2207 (khtml::BackgroundLayer::clearBackgroundXPosition):
2208 (khtml::BackgroundLayer::clearBackgroundYPosition):
2209 (khtml::BackgroundLayer::clearBackgroundAttachment):
2210 (khtml::BackgroundLayer::clearBackgroundRepeat):
2211 (khtml::BackgroundLayer::setNext):
2212 (khtml::BackgroundLayer::operator!=):
2213 (khtml::BackgroundLayer::containsImage):
2214 (khtml::BackgroundLayer::hasImage):
2215 (khtml::BackgroundLayer::hasFixedImage):
2216 (khtml::RenderStyle::setBitDefaults):
2217 (khtml::RenderStyle::hasBackground):
2218 (khtml::RenderStyle::hasFixedBackgroundImage):
2219 (khtml::RenderStyle::outlineWidth):
2220 (khtml::RenderStyle::outlineStyle):
2221 (khtml::RenderStyle::outlineStyleIsAuto):
2222 (khtml::RenderStyle::outlineColor):
2223 (khtml::RenderStyle::backgroundColor):
2224 (khtml::RenderStyle::backgroundImage):
2225 (khtml::RenderStyle::backgroundRepeat):
2226 (khtml::RenderStyle::backgroundAttachment):
2227 (khtml::RenderStyle::backgroundXPosition):
2228 (khtml::RenderStyle::backgroundYPosition):
2229 (khtml::RenderStyle::accessBackgroundLayers):
2230 (khtml::RenderStyle::backgroundLayers):
2231 (khtml::RenderStyle::outlineOffset):
2232 (khtml::RenderStyle::resetOutline):
2233 (khtml::RenderStyle::setBackgroundColor):
2234 (khtml::RenderStyle::setOutlineWidth):
2235 (khtml::RenderStyle::setOutlineStyle):
2236 (khtml::RenderStyle::setOutlineColor):
2237 (khtml::RenderStyle::clearBackgroundLayers):
2238 (khtml::RenderStyle::inheritBackgroundLayers):
2239 (khtml::RenderStyle::setOutlineOffset):
2240 * khtml/rendering/render_table.cpp:
2241 (RenderTable::paintBoxDecorations):
2242 (RenderTableCell::paintBoxDecorations):
2244 2004-11-04 David Hyatt <hyatt@apple.com>
2246 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
2247 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
2251 * kwq/KWQTextCodec.mm:
2252 (KWQTextDecoder::convertLatin1):
2253 (KWQTextDecoder::convertUTF16):
2254 (KWQTextDecoder::convertUsingTEC):
2255 (KWQTextDecoder::toUnicode):
2257 2004-11-04 David Hyatt <hyatt@apple.com>
2259 Make sure line-height returns the correct value for normal.
2263 * khtml/css/css_computedstyle.cpp:
2264 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2266 2004-11-04 David Harrison <harrison@apple.com>
2268 Reviewed by Ken Kocienda.
2270 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
2272 * khtml/editing/htmlediting.cpp:
2273 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
2274 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
2275 Fixed to insert after the destination subtree, rather than the destination element. Handles
2276 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
2277 * khtml/xml/dom_nodeimpl.cpp:
2278 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
2279 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
2280 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
2281 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
2283 2004-11-03 Ken Kocienda <kocienda@apple.com>
2289 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
2290 * layout-tests/editing/deleting/delete-br-008.html: Added.
2291 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
2292 * layout-tests/editing/deleting/delete-br-009.html: Added.
2293 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
2294 * layout-tests/editing/deleting/delete-br-010.html: Added.
2296 2004-11-03 Maciej Stachowiak <mjs@apple.com>
2298 Fix by Yasuo Kida, reviewed by me.
2300 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
2302 * kwq/KWQKHTMLPart.mm:
2303 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
2304 same as a nil range - setting an empty marked range should clear
2305 the marked range entirely.
2307 2004-11-02 Maciej Stachowiak <mjs@apple.com>
2309 Reviewed by Dave Hyatt (when I originally coded it).
2311 WebCore part of fix for:
2313 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
2315 * kwq/WebCoreBridge.h:
2316 * kwq/WebCoreBridge.mm:
2317 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
2318 DOMRange, or if the range is split into multiple lines, the rect for the part on
2319 the first line only.
2321 * khtml/rendering/render_object.cpp:
2322 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
2323 for the overrides below.
2324 * khtml/rendering/render_object.h:
2325 * khtml/rendering/render_box.cpp:
2326 (RenderBox::caretRect):
2327 * khtml/rendering/render_box.h:
2328 * khtml/rendering/render_br.cpp:
2329 (RenderBR::caretRect):
2330 * khtml/rendering/render_br.h:
2331 * khtml/rendering/render_flow.cpp:
2332 (RenderFlow::caretRect):
2333 * khtml/rendering/render_flow.h:
2334 * khtml/rendering/render_text.cpp:
2335 (RenderText::caretRect):
2337 2004-11-02 Ken Kocienda <kocienda@apple.com>
2341 Implemented command to insert a block in response to typing a return key (even though
2342 I am not turning that on by default with this patch....that will come later).
2344 This new command is called InsertParagraphSeparatorCommand.
2346 Reworked the command and function names associated with inserting content into a
2347 document. Before this patch, there were inputXXX and insertXXX variants, with the
2348 former used for more high-level actions and the latter used for lower-level stuff.
2349 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
2350 in an insertXXX command going through an inputXXX WebCore step and then finally to an
2351 insertXXX WebCore step. To make this less confusing, I have changes all the names to
2352 be insertXXX, and modified the lower-level operations so that it is clear what they do.
2354 * khtml/editing/htmlediting.cpp:
2355 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
2356 (khtml::EditCommand::isInsertTextCommand): Ditto.
2357 (khtml::CompositeEditCommand::inputText): Ditto.
2358 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
2359 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
2360 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
2361 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
2362 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
2363 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
2364 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
2365 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
2366 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
2367 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
2368 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2369 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2370 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
2371 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
2372 (khtml::InsertIntoTextNode::doApply): Ditto.
2373 (khtml::InsertIntoTextNode::doUnapply): Ditto.
2374 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
2375 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
2376 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
2377 (khtml::InsertLineBreakCommand::doApply):
2378 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
2379 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
2380 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
2381 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
2382 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
2383 (khtml::InsertParagraphSeparatorCommand::doApply):
2384 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2385 Class name change, was InsertNewlineCommandInQuotedContentCommand.
2386 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
2387 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
2388 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2389 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
2390 (khtml::InsertTextCommand::doApply): Ditto.
2391 (khtml::InsertTextCommand::deleteCharacter): Ditto.
2392 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2393 (khtml::InsertTextCommand::input): Ditto.
2394 (khtml::InsertTextCommand::insertSpace): Ditto.
2395 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
2396 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
2397 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
2398 (khtml::TypingCommand::insertParagraphSeparator): New function.
2399 (khtml::TypingCommand::doApply): Name changes, as above.
2400 (khtml::TypingCommand::insertText): Ditto.
2401 (khtml::TypingCommand::deleteKeyPressed): Ditto.
2402 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2403 * khtml/editing/htmlediting.h:
2404 (khtml::DeleteFromTextNodeCommand::node): Name change.
2405 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
2406 (khtml::DeleteFromTextNodeCommand::count): Ditto.
2407 (khtml::InsertIntoTextNode::text): Ditto.
2408 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
2409 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
2410 (khtml::TypingCommand::): Ditto.
2411 * khtml/editing/jsediting.cpp: Name changes, as above.
2412 * kwq/WebCoreBridge.h:
2413 * kwq/WebCoreBridge.mm:
2414 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
2415 (-[WebCoreBridge insertParagraphSeparator]): New function.
2416 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
2418 2004-11-01 Kevin Decker <kdecker@apple.com>
2422 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
2425 * khtml/ecma/kjs_window.cpp:
2426 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
2428 2004-11-01 Darin Adler <darin@apple.com>
2432 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
2434 * khtml/css/html4.css: Use color: initial for textarea and related ones.
2436 2004-11-01 Ken Kocienda <kocienda@apple.com>
2442 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
2444 * khtml/css/css_computedstyle.cpp:
2445 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
2446 implementation here into new copyPropertiesInSet helper. This now calls the
2447 generalized copyPropertiesInSet function with the arguments needed to make copying
2449 * khtml/css/css_computedstyle.h:
2450 * khtml/css/css_valueimpl.cpp:
2451 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
2452 In order to do apply block properties, "regular" style declarations need to do style
2454 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
2455 except that it uses a different set of properties that apply only to blocks.
2456 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
2457 and copies out those properties listed in a pre-defined set.
2458 * khtml/css/css_valueimpl.h:
2459 * khtml/editing/htmlediting.cpp:
2460 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
2461 block, factoring out some of the special case code that should now only run in the inline case.
2462 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
2463 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
2464 special handling for "legacy" HTML styles like <B> and <I>.
2465 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
2466 style changes into different kinds. CSS specifies certain properties only apply to certain
2467 element types. This set of changes now recognizes two such separate cases: styles that apply
2468 to blocks, and styles that apply to inlines.
2469 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
2470 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
2471 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
2472 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
2473 done so that the function can be passed a portion of the styles being applied so that block styles
2474 and inline styles can be handled separately.
2475 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2476 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
2477 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
2478 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
2479 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
2480 * khtml/editing/htmlediting.h:
2481 (khtml::StyleChange::): Changed as described above.
2482 (khtml::StyleChange::usesLegacyStyles):
2483 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
2484 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
2485 when text align changes.
2486 * khtml/khtml_part.cpp:
2487 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
2488 the passed-in argument.
2489 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
2490 is a caret. Formerly, this just set typing style and made no visible changes to the document.
2494 * layout-tests/editing/editing.js: Added some glue to change text align.
2495 * layout-tests/editing/style/block-style-001-expected.txt: Added.
2496 * layout-tests/editing/style/block-style-001.html: Added.
2497 * layout-tests/editing/style/block-style-002-expected.txt: Added.
2498 * layout-tests/editing/style/block-style-002.html: Added.
2499 * layout-tests/editing/style/block-style-003-expected.txt: Added.
2500 * layout-tests/editing/style/block-style-003.html: Added.
2504 2004-10-29 Darin Adler <darin@apple.com>
2508 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
2510 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
2511 before advancing one character; before it did it backwards.
2513 2004-10-29 Chris Blumenberg <cblu@apple.com>
2515 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
2517 Reviewed by kocienda, adele.
2519 * khtml/rendering/render_frames.cpp:
2520 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
2522 2004-10-29 Darin Adler <darin@apple.com>
2526 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
2528 * khtml/khtmlview.cpp:
2529 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
2530 deleted before this function finishes running.
2531 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
2532 (KHTMLView::viewportMouseReleaseEvent): Ditto.
2533 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
2534 is guaranteed to do ref/deref as needed.
2536 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
2538 2004-10-28 Chris Blumenberg <cblu@apple.com>
2540 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
2544 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
2545 * WebCorePrefix.h: always use XSLT
2547 2004-10-28 Ken Kocienda <kocienda@apple.com>
2553 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
2554 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
2556 * khtml/editing/htmlediting.cpp:
2557 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
2558 to initialization list, zeroing them out.
2559 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
2560 handle a delete of content in special cases where the only thing selected is a BR. This
2561 code path is much simpler than the newly-named performGeneralDelete, and detects when no
2562 content merging should be done between blocks. This aspect of the change fixes 3854848.
2563 One of the special cases added fixes 3803832.
2564 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
2565 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
2566 like the other helpers in this class.
2567 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
2568 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
2569 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
2571 2004-10-28 Chris Blumenberg <cblu@apple.com>
2573 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
2577 * kwq/KWQKHTMLPart.mm:
2578 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
2580 2004-10-28 Ken Kocienda <kocienda@apple.com>
2582 Reviewed by Harrison
2584 Reorganization of delete command functionality so that doApply is not
2585 several hundred lines long. This is not a squeaky-clean cleanup, but
2586 it is a step in the right direction. No functionality changes.
2588 * khtml/editing/htmlediting.cpp:
2589 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
2590 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
2591 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
2592 (khtml::DeleteSelectionCommand::performDelete): Ditto.
2593 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2594 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2595 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
2596 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
2597 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
2598 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
2599 * khtml/editing/htmlediting.h:
2601 2004-10-28 Ken Kocienda <kocienda@apple.com>
2605 * khtml/editing/htmlediting.cpp:
2606 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
2607 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
2609 2004-10-27 Ken Kocienda <kocienda@apple.com>
2613 * khtml/editing/htmlediting.cpp:
2614 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
2615 whether content not in the block containing the start of the selection is moved to that block
2616 after the selection is deleted.
2617 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
2618 (khtml::DeleteSelectionCommand::doApply): Ditto.
2619 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
2620 to handle the case of inserting a newline when in quoted content in Mail.
2621 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
2622 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
2623 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
2624 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
2625 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
2626 (khtml::TypingCommand::doApply): Ditto.
2627 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2628 * khtml/editing/htmlediting.h: Add new delclarations.
2629 (khtml::TypingCommand::): Ditto.
2630 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
2631 * kwq/WebCoreBridge.mm:
2632 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
2634 2004-10-26 Chris Blumenberg <cblu@apple.com>
2636 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
2640 * khtml/ecma/kjs_dom.cpp:
2641 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
2642 * khtml/ecma/kjs_dom.h:
2643 (KJS::DOMElement::):
2644 * khtml/ecma/kjs_dom.lut.h:
2647 2004-10-26 David Hyatt <hyatt@apple.com>
2649 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
2652 Reviewed by kocienda
2654 * khtml/rendering/bidi.cpp:
2655 (khtml::RenderBlock::layoutInlineChildren):
2657 2004-10-26 David Hyatt <hyatt@apple.com>
2659 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
2660 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
2662 Reviewed by kocienda
2664 * khtml/rendering/render_canvas.cpp:
2665 (RenderCanvas::selectionRect):
2666 * khtml/rendering/render_object.h:
2667 (khtml::RenderObject::hasSelectedChildren):
2669 2004-10-26 Ken Kocienda <kocienda@apple.com>
2675 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
2677 * khtml/editing/htmlediting.cpp:
2678 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
2679 let the caller know if a placeholder was removed.
2680 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
2681 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
2682 some cases, the selection was still set on the removed BR, and this was the cause of the
2684 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
2686 2004-10-26 Darin Adler <darin@apple.com>
2690 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
2692 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
2694 2004-10-26 Ken Kocienda <kocienda@apple.com>
2698 * khtml/editing/htmlediting.cpp:
2699 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
2700 with a zero-length string. That triggers an assert. Call deleteText instead,
2701 using the same indices that are passed to replaceText.
2703 Cleaned up the asserts in these three functions below, making them
2704 more consistent. This is not needed for the fix, but I tripped over
2705 these in the course of debugging.
2707 (khtml::InsertTextCommand::InsertTextCommand):
2708 (khtml::InsertTextCommand::doApply):
2709 (khtml::InsertTextCommand::doUnapply):
2711 2004-10-25 Adele Amchan <adele@apple.com>
2715 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
2716 * khtml/xml/dom_docimpl.h:
2718 2004-10-25 Adele Amchan <adele@apple.com>
2720 Reviewed by me, code change by Darin.
2722 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
2724 2004-10-25 Ken Kocienda <kocienda@apple.com>
2726 Oops. These two test results changed with my last checkin, for the better.
2728 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
2729 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
2731 2004-10-25 Ken Kocienda <kocienda@apple.com>
2737 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
2739 * khtml/editing/htmlediting.cpp:
2740 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
2741 expand the selection outwards when the selection is on the visible boundary of a root
2742 editable element. This fixes the bug. Note that this function also contains a little code
2743 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
2744 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2745 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
2746 * khtml/editing/htmlediting.h: Declare new helpers.
2747 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
2748 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
2749 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
2750 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
2751 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
2752 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
2754 2004-10-25 Ken Kocienda <kocienda@apple.com>
2756 Added some more editing layout tests.
2758 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
2759 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
2760 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
2761 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
2762 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
2763 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
2764 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
2765 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
2766 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
2767 * layout-tests/editing/inserting/typing-003.html: Added.
2769 2004-10-25 Ken Kocienda <kocienda@apple.com>
2773 * khtml/rendering/bidi.cpp:
2774 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
2775 yesterday quite right: words that should have been placed on the next line were instead
2776 appearing on the line before, beyond the right margin. This was a one-word only error
2777 based on moving the line break object when it should have stayed put. Here is the rule:
2778 The line break object only moves to after the whitespace on the end of a line if that
2779 whitespace caused line overflow when its width is added in.
2781 2004-10-25 Adele Amchan <adele@apple.com>
2785 Fix for <rdar://problem/3619890> Feature request: designMode
2787 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
2788 This will enable more JS editing compatibility.
2790 * khtml/ecma/kjs_html.cpp:
2791 (KJS::HTMLDocument::tryGet): added case for designMode
2792 (KJS::HTMLDocument::putValue): added case for designMode
2793 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
2794 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
2795 * khtml/xml/dom_docimpl.cpp:
2796 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
2797 (DocumentImpl::setDesignMode): added function to assign m_designMode value
2798 (DocumentImpl::getDesignMode): return m_designMode value
2799 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
2800 Otherwise, it will just return the m_designMode value.
2801 (DocumentImpl::parentDocument):
2802 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
2803 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
2805 2004-10-22 Ken Kocienda <kocienda@apple.com>
2811 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
2813 * khtml/editing/htmlediting.cpp:
2814 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
2815 everything that could be affected.
2816 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
2817 braces, making it act as a comma operator, with a zero value as the right value!!! This made
2818 an important check always fail!!! It turns out that we do not want the constant at all, since
2819 that constant is only needed when checking a computed style, not an inline style as is being
2821 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
2822 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
2823 RangeImpl::compareBoundaryPoints to perform the required check.
2824 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
2826 2004-10-22 Ken Kocienda <kocienda@apple.com>
2832 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
2833 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
2835 * khtml/rendering/bidi.cpp:
2836 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
2837 it is when we are editing, add in the space of the current character when calculating the width
2838 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
2839 the line break object and call skipWhitespace to move past the end of the whitespace.
2843 2004-10-22 Ken Kocienda <kocienda@apple.com>
2845 * WebCore.pbproj/project.pbxproj:
2846 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
2848 2004-10-21 David Hyatt <hyatt@apple.com>
2852 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
2854 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
2855 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
2857 * khtml/rendering/render_block.cpp:
2858 (khtml::getInlineRun):
2859 (khtml::RenderBlock::makeChildrenNonInline):
2861 2004-10-21 David Hyatt <hyatt@apple.com>
2863 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
2864 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
2868 * khtml/rendering/render_inline.cpp:
2869 (RenderInline::splitFlow):
2871 2004-10-21 Ken Kocienda <kocienda@apple.com>
2875 Significant improvement to the way that whitespace is handled during editing.
2877 * khtml/editing/htmlediting.cpp:
2878 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
2879 two being added with this name) that delete "insignificant" unrendered text.
2880 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
2881 calculates the downstream position to use as the endpoint for the deletion, and
2882 then calls deleteInsignificantText with this start and end.
2883 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
2884 (khtml::InputNewlineCommand::doApply): Ditto.
2885 (khtml::InputTextCommand::input): Ditto.
2886 * khtml/editing/htmlediting.h: Add new declarations.
2888 Modified layout test results:
2889 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
2890 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
2891 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
2892 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
2893 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
2894 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
2895 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
2896 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
2897 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
2898 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
2899 * layout-tests/editing/inserting/insert-br-001-expected.txt:
2900 * layout-tests/editing/inserting/insert-br-004-expected.txt:
2901 * layout-tests/editing/inserting/insert-br-005-expected.txt:
2902 * layout-tests/editing/inserting/insert-br-006-expected.txt:
2903 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
2904 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
2905 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
2906 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
2907 * layout-tests/editing/inserting/typing-001-expected.txt:
2908 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
2909 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
2910 * layout-tests/editing/style/typing-style-003-expected.txt:
2911 * layout-tests/editing/undo/redo-typing-001-expected.txt:
2912 * layout-tests/editing/undo/undo-typing-001-expected.txt:
2914 2004-10-21 David Hyatt <hyatt@apple.com>
2916 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
2917 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
2921 * khtml/rendering/render_block.cpp:
2922 (khtml::getInlineRun):
2924 2004-10-20 David Hyatt <hyatt@apple.com>
2926 Add better dumping of overflow information for scrolling regions.
2928 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
2929 from the render tree so that layers and so forth are cleaned up.
2933 * khtml/rendering/render_container.cpp:
2934 (RenderContainer::detach):
2935 * khtml/rendering/render_layer.h:
2936 (khtml::RenderLayer::scrollXOffset):
2937 (khtml::RenderLayer::scrollYOffset):
2938 * kwq/KWQRenderTreeDebug.cpp:
2941 2004-10-20 David Hyatt <hyatt@apple.com>
2943 Fix for 3791146, make sure all lines are checked when computing overflow.
2945 Reviewed by kocienda
2947 * khtml/rendering/bidi.cpp:
2948 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2949 (khtml::RenderBlock::layoutInlineChildren):
2950 (khtml::RenderBlock::findNextLineBreak):
2951 (khtml::RenderBlock::checkLinesForOverflow):
2952 * khtml/rendering/render_block.h:
2954 2004-10-20 David Hyatt <hyatt@apple.com>
2956 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
2958 Reviewed by kocienda
2960 * khtml/rendering/break_lines.cpp:
2961 (khtml::isBreakable):
2963 2004-10-20 Darin Adler <darin@apple.com>
2967 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
2969 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
2970 Create a palette with the background and foreground colors in it and set it on the widget.
2972 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
2973 with APPLE_CHANGES. Removed palette and palette-related function members.
2974 * khtml/rendering/render_style.cpp:
2975 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
2976 (RenderStyle::diff): No palette to compare.
2978 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
2979 * kwq/KWQLineEdit.mm:
2980 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
2981 (QLineEdit::text): Made const.
2983 * kwq/KWQTextEdit.h: Added setPalette override.
2984 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
2987 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
2988 per color group, and only a single color group per palette.
2989 * kwq/KWQColorGroup.mm: Removed.
2990 * kwq/KWQPalette.mm: Removed.
2991 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
2993 * kwq/KWQApplication.h: Removed unused palette function.
2994 * kwq/KWQApplication.mm: Ditto.
2996 * kwq/KWQWidget.h: Removed unsetPalette.
2997 * kwq/KWQWidget.mm: Ditto.
2999 - fixed storage leak
3001 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
3002 Roll in storage leak fix from KDE guys.
3004 2004-10-19 David Hyatt <hyatt@apple.com>
3006 Reviewed by kocienda
3008 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
3009 and consolidates it with clearing.
3011 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
3013 * khtml/rendering/render_block.cpp:
3014 (khtml::getInlineRun):
3015 (khtml::RenderBlock::layoutBlock):
3016 (khtml::RenderBlock::adjustFloatingBlock):
3017 (khtml::RenderBlock::collapseMargins):
3018 (khtml::RenderBlock::clearFloatsIfNeeded):
3019 (khtml::RenderBlock::estimateVerticalPosition):
3020 (khtml::RenderBlock::layoutBlockChildren):
3021 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
3022 (khtml::RenderBlock::getClearDelta):
3023 (khtml::RenderBlock::calcBlockMinMaxWidth):
3024 * khtml/rendering/render_block.h:
3025 * khtml/rendering/render_frames.cpp:
3026 (RenderFrameSet::layout):
3027 * khtml/xml/dom_textimpl.cpp:
3028 (TextImpl::rendererIsNeeded):
3030 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
3032 * layout-tests/fast/frames/002-expected.txt: Added.
3033 * layout-tests/fast/frames/002.html: Added.
3035 2004-10-19 Darin Adler <darin@apple.com>
3039 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
3041 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
3042 scripts being loaded here. If the current code being run is the external script itself, then we don't want
3043 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
3044 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
3045 wrong since there can be a script loading in that case too. Layout tests check for both problems.
3047 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
3048 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
3049 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
3051 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
3053 2004-10-18 Darin Adler <darin@apple.com>
3055 Reviewed by Dave Hyatt.
3057 - 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)
3059 * khtml/html/htmltokenizer.cpp:
3060 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
3061 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
3062 we only want to look at loadingExtScript if m_executingScript is 0.
3064 2004-10-18 Ken Kocienda <kocienda@apple.com>
3070 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
3072 * khtml/css/css_valueimpl.cpp:
3073 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
3074 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
3075 lifecycle issues associated with creating a string to be returned in the ident case.
3076 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
3077 * khtml/css/cssstyleselector.cpp:
3078 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
3080 2004-10-18 Chris Blumenberg <cblu@apple.com>
3082 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
3084 Reviewed by kocienda.
3086 * khtml/rendering/render_frames.cpp:
3087 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
3089 2004-10-15 Chris Blumenberg <cblu@apple.com>
3091 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
3096 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
3099 2004-10-15 Ken Kocienda <kocienda@apple.com>
3103 * khtml/rendering/bidi.cpp:
3104 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
3105 skipping after a clean line break, in addition to the cases already
3107 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
3108 * layout-tests/editing/inserting/insert-br-007.html: Added.
3109 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
3110 * layout-tests/editing/inserting/insert-br-008.html: Added.
3114 2004-10-14 Ken Kocienda <kocienda@apple.com>
3120 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
3122 * khtml/editing/visible_position.cpp:
3123 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
3124 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
3125 Since we do a good job of insulating external code from the internal workings of
3126 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
3127 in the case of this bug, was doing harm. Simply removing this code makes the bug
3128 go away and does not cause any editing layout test regresssions.
3130 2004-10-14 Ken Kocienda <kocienda@apple.com>
3134 * khtml/rendering/bidi.cpp:
3135 (khtml::skipNonBreakingSpace): New helper.
3136 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
3137 at the start of a block. This was preventing users from typing spaces in empty
3139 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
3140 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
3142 2004-10-14 Adele Amchan <adele@apple.com>
3144 Reviewed by Darin and Ken.
3146 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
3148 This change shifts some code around so that the code that determines what typing style
3149 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
3150 to ensure that start and end nodes of the selection are in the document.
3152 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
3154 2004-10-14 Adele Amchan <adele@apple.com>
3158 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
3159 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
3161 * khtml/khtml_part.cpp:
3162 (KHTMLPart::shouldBeginEditing):
3163 (KHTMLPart::shouldEndEditing):
3164 (KHTMLPart::isContentEditable):
3165 * khtml/khtml_part.h:
3166 * kwq/KWQKHTMLPart.h:
3168 2004-10-14 Ken Kocienda <kocienda@apple.com>
3172 Final fix for these bugs:
3174 <rdar://problem/3806306> HTML editing puts spaces at start of line
3175 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
3177 This change sets some new CSS properties that have been added to WebCore to
3178 enable whitespace-handling and line-breaking features that make WebView work
3179 more like a text editor.
3181 * khtml/css/cssstyleselector.cpp:
3182 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
3183 based on property value.
3184 * khtml/html/html_elementimpl.cpp:
3185 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
3186 based on attribute value.
3187 * khtml/khtml_part.cpp:
3188 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
3190 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
3192 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
3193 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
3194 * khtml/khtml_part.h: Add new declarations.
3195 * kwq/WebCoreBridge.h: Ditto.
3196 * kwq/WebCoreBridge.mm:
3197 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
3198 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
3199 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
3200 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
3202 2004-10-14 John Sullivan <sullivan@apple.com>
3206 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
3208 * khtml/editing/htmlediting.cpp:
3209 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
3210 needed a nil check to handle empty document case
3212 2004-10-13 Maciej Stachowiak <mjs@apple.com>
3216 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
3218 - I fixed this by turning off all colormatching for WebKit
3219 content. We might turn it back on later. For now, it's possible to
3220 turn it on temporarily by defining COLORMATCH_EVERYTHING.
3223 * khtml/ecma/kjs_html.cpp:
3224 (KJS::Context2DFunction::tryCall):
3225 (Context2D::colorRefFromValue):
3226 (Gradient::getShading):
3227 * khtml/rendering/render_canvasimage.cpp:
3228 (RenderCanvasImage::createDrawingContext):
3230 (QColor::getNSColor):
3232 * kwq/KWQPainter.mm:
3233 (CGColorFromNSColor):
3234 (QPainter::selectedTextBackgroundColor):
3235 (QPainter::rgbColorSpace):
3236 (QPainter::grayColorSpace):
3237 (QPainter::cmykColorSpace):
3238 * kwq/WebCoreGraphicsBridge.h:
3239 * kwq/WebCoreGraphicsBridge.m:
3240 (-[WebCoreGraphicsBridge createRGBColorSpace]):
3241 (-[WebCoreGraphicsBridge createGrayColorSpace]):
3242 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
3244 2004-10-13 Ken Kocienda <kocienda@apple.com>
3248 * khtml/css/css_valueimpl.cpp:
3249 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
3250 is non-null before appending.
3252 2004-10-13 Ken Kocienda <kocienda@apple.com>
3254 Update expected results for improved behavior as a result of fix to 3816768.
3256 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
3257 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3258 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
3260 2004-10-13 Ken Kocienda <kocienda@apple.com>
3264 * khtml/css/css_computedstyle.cpp:
3265 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
3266 for getting -khtml-line-break and -khml-nbsp-mode.
3268 2004-10-13 Ken Kocienda <kocienda@apple.com>
3274 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
3275 moves caret out of block.
3277 The issue here is that an empty block with no explicit height set by style collapses
3278 to zero height, and does so immediately after the last bit of content is removed from
3279 it (as a result of deleting text with the delete key for instance). Since zero-height
3280 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
3282 The fix is to detect when a block has not been removed itself, but has had all its
3283 contents removed. In this case, a BR element is placed in the block, one that is
3284 specially marked as a placeholder. Later, if the block ever receives content, this
3285 placeholder is removed.
3287 * khtml/editing/htmlediting.cpp:
3288 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
3289 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
3290 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
3291 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
3292 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
3293 (it's very clear that we needs to be able to move more than just text nodes). This may expose
3294 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
3295 made the test case in the bug work.
3296 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
3297 removeBlockPlaceholderIfNeeded.
3298 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
3299 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
3300 * khtml/editing/htmlediting.h: Declare new functions.
3302 2004-10-13 Richard Williamson <rjw@apple.com>
3304 Added support for -apple-dashboard-region:none. And fixed
3305 a few computed style problems.
3307 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
3310 * khtml/css/css_computedstyle.cpp:
3311 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3312 * khtml/css/css_valueimpl.cpp:
3313 (CSSPrimitiveValueImpl::cssText):
3314 * khtml/css/cssparser.cpp: