1 2004-12-05 Darin Adler <darin@apple.com>
3 - fixed small problem in my check-in from yesterday
6 (positionForEvent): Get location from event without raising exception if it's the wrong type.
7 (clickCountForEvent): Same, for clickCount.
8 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
9 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
10 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
12 2004-12-04 Darin Adler <darin@apple.com>
16 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
18 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
19 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
20 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
22 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
24 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
25 * khtml/rendering/render_form.cpp:
26 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
27 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
28 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
30 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
31 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
32 Added a fixState helper method so the constructors can save code.
34 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
35 and added a third constructor that uses the "current event" from AppKit (used above).
36 (QMouseEvent::fixState): Compute state and click count based on event type.
38 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
40 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
41 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
42 underlying cause in CSS.
44 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
46 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
47 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
49 2004-12-03 Chris Blumenberg <cblu@apple.com>
52 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
53 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
54 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
55 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
57 Reviewed by darin, rjw, kocienda.
59 * khtml/misc/loader.cpp:
60 (CachedObject::~CachedObject):
61 (CachedCSSStyleSheet::checkNotify):
62 (Loader::servePendingRequests):
63 (Loader::slotFinished):
64 (Loader::slotReceivedResponse):
65 (Cache::requestImage):
66 (Cache::requestScript):
67 * khtml/misc/loader.h:
68 (khtml::CachedObject::CachedObject):
69 (khtml::CachedObject::response):
70 (khtml::CachedObject::allData):
71 * kwq/KWQKJobClasses.h:
72 * kwq/KWQKJobClasses.mm:
73 (KIO::TransferJobPrivate::TransferJobPrivate):
74 (KIO::TransferJobPrivate::~TransferJobPrivate):
75 (KIO::TransferJob::TransferJob):
76 (KIO::TransferJob::assembleResponseHeaders):
77 (KIO::TransferJob::retrieveCharset):
78 (KIO::TransferJob::emitResult):
79 (KIO::TransferJob::emitReceivedResponse):
82 (KWQHeaderStringFromDictionary):
83 (KWQCheckCacheObjectStatus):
84 (KWQIsResponseURLEqualToURL):
86 (KWQResponseMIMEType):
87 (KWQCacheObjectExpiresTime):
88 (khtml::CachedObject::setResponse):
89 (khtml::CachedObject::setAllData):
93 * kwq/KWQResourceLoader.mm:
94 (-[KWQResourceLoader finishJobAndHandle:]):
95 (-[KWQResourceLoader cancel]):
96 (-[KWQResourceLoader reportError]):
97 (-[KWQResourceLoader finishWithData:]):
105 * kwq/WebCoreBridge.h:
106 * kwq/WebCoreResourceLoader.h:
108 2004-12-04 Darin Adler <darin@apple.com>
112 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
114 * khtml/rendering/render_form.cpp:
115 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
116 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
117 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
118 (RenderSlider::slotSliderValueChanged): Ditto.
120 2004-12-03 John Sullivan <sullivan@apple.com>
124 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
125 khtml::BackgroundLayer::cullEmptyLayers
127 * khtml/rendering/render_style.cpp:
128 (BackgroundLayer::cullEmptyLayers):
129 added missing nil check
133 2004-12-03 Ken Kocienda <kocienda@apple.com>
137 Roll out some recent changes by Chris that caused a performance regression.
138 Fix is in hand, but it is a little risky this close to a submission. So,
139 we have decided to roll back the change with the regression and roll in
140 the new code after we submit.
142 * khtml/css/cssproperties.c:
145 * khtml/css/cssvalues.c:
148 * khtml/misc/htmlattrs.c:
151 * khtml/misc/htmltags.c:
154 * khtml/misc/loader.cpp:
155 (CachedObject::~CachedObject):
156 (CachedObject::setResponse):
157 (CachedCSSStyleSheet::checkNotify):
158 (Loader::servePendingRequests):
159 (Loader::slotFinished):
160 (Loader::slotReceivedResponse):
161 (Cache::requestImage):
162 (Cache::requestScript):
163 * khtml/misc/loader.h:
164 (khtml::CachedObject::CachedObject):
165 (khtml::CachedObject::response):
166 * kwq/KWQKJobClasses.h:
167 * kwq/KWQKJobClasses.mm:
168 (KIO::TransferJobPrivate::TransferJobPrivate):
169 (KIO::TransferJobPrivate::~TransferJobPrivate):
170 (KIO::TransferJob::TransferJob):
171 (KIO::TransferJob::assembleResponseHeaders):
172 (KIO::TransferJob::retrieveCharset):
173 (KIO::TransferJob::emitResult):
174 (KIO::TransferJob::emitReceivedResponse):
177 (KWQHeaderStringFromDictionary):
178 (KWQCheckCacheObjectStatus):
180 (KWQReleaseResponse):
181 (KWQIsResponseURLEqualToURL):
183 (KWQResponseMIMEType):
184 (KWQResponseTextEncodingName):
185 (KWQResponseHeaderString):
186 (KWQCacheObjectExpiresTime):
187 (KWQLoader::KWQLoader):
191 * kwq/KWQResourceLoader.mm:
192 (-[KWQResourceLoader finishJobAndHandle]):
193 (-[KWQResourceLoader cancel]):
194 (-[KWQResourceLoader reportError]):
195 (-[KWQResourceLoader finish]):
203 * kwq/WebCoreBridge.h:
204 * kwq/WebCoreResourceLoader.h:
206 2004-12-03 John Sullivan <sullivan@apple.com>
210 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
212 * kwq/KWQKHTMLPart.mm:
213 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
214 when checking whether we moved the focus to another view, make sure we didn't "move" it to
215 our documentView, because that's no move at all.
217 2004-12-03 Darin Adler <darin@apple.com>
221 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
223 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
224 Added missing initialization for base class and node pointer.
226 - fixed a few places that could leave dangling node pointers
228 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
229 Clear out the node pointer when the node is destroyed.
230 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
232 2004-12-03 Chris Blumenberg <cblu@apple.com>
234 Fix for performance regression. My original patch added a signal for passing the data of a resource to its WebCore cache object. This patch passes the data with the preexisting "finished" symbol so we make less calls.
235 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
239 * khtml/misc/loader.cpp:
240 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
241 (Loader::slotFinished): take data param
242 * khtml/misc/loader.h:
243 * kwq/KWQKJobClasses.h:
244 * kwq/KWQKJobClasses.mm:
245 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
246 (KIO::TransferJob::emitResult): take data param and pass it
247 * kwq/KWQResourceLoader.mm:
248 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
249 (-[KWQResourceLoader cancel]): pass nil for data
250 (-[KWQResourceLoader reportError]): ditto
251 (-[KWQResourceLoader finishWithData:]): pass data
253 (KWQSlot::KWQSlot): pass data param to slotFinished
254 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
256 2004-12-03 Ken Kocienda <kocienda@apple.com>
260 Did some clean up in the Position class as a result of trying to write some new layout
261 tests and discovering a bug along the way.
263 I removed these three functions from the Position class:
265 1. bool isFirstRenderedPositionOnLine() const;
266 2. bool isLastRenderedPositionOnLine() const;
267 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
268 4. bool inFirstEditableInRootEditableElement() const;
270 The first two have replacements in the VisiblePosition class, and some code has been
271 moved to use these new variants. The third function was a helper used only by these
272 first two function, and can be removed as well. The fourth function was not used by anyone.
274 * khtml/editing/htmlediting.cpp:
275 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
276 * khtml/editing/visible_position.cpp:
277 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
278 Incorrect results were being returned when asking about positions at the starts of blocks.
279 * khtml/xml/dom_position.cpp:
280 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
281 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
282 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
283 * khtml/xml/dom_position.h: Update header for deletions.
285 2004-12-03 Ken Kocienda <kocienda@apple.com>
289 Terminology change in execCommand command identifiers. Specifically, the name of
290 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
291 terminology used by AppKit. It is also more accurate, since the insertion of a
292 "br" element is what the command does. The inspiration for this change is so the
293 -insertNewline AppKit method can be mapped to insert a new "div" element in
294 a document and avoid ambiguity with what the javascript editing command does.
296 * khtml/editing/jsediting.cpp
297 * layout-tests/editing/deleting/delete-tab-004.html
298 * layout-tests/editing/editing.js
299 * layout-tests/editing/inserting/insert-3654864-fix.html
300 * layout-tests/editing/inserting/insert-3659587-fix.html
301 * layout-tests/editing/inserting/insert-3775316-fix.html
302 * layout-tests/editing/inserting/insert-3800346-fix.html
303 * layout-tests/editing/inserting/insert-br-001.html
304 * layout-tests/editing/inserting/insert-br-002.html
305 * layout-tests/editing/inserting/insert-br-003.html
306 * layout-tests/editing/inserting/insert-br-004.html
307 * layout-tests/editing/inserting/insert-br-005.html
308 * layout-tests/editing/inserting/insert-br-006.html
309 * layout-tests/editing/inserting/insert-br-007.html
310 * layout-tests/editing/inserting/insert-br-008.html
311 * layout-tests/editing/inserting/insert-tab-004.html
312 * layout-tests/editing/inserting/insert-text-with-newlines.html
313 * layout-tests/editing/pasteboard/paste-text-010.html
315 2004-12-02 Ken Kocienda <kocienda@apple.com>
321 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
323 * khtml/editing/htmlediting.cpp:
324 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
325 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
326 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
327 in a block and the document is in quirks mode, add an additional br to make the one in the
328 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
329 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
330 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
332 2004-12-02 Richard Williamson <rjw@apple.com>
334 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
336 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
337 the b/f cache won't incorrectly trash the previous state when restoring.
341 * kwq/WebCoreBridge.h:
342 * kwq/WebCoreBridge.mm:
343 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
344 (-[WebCoreBridge canCachePage]):
345 (-[WebCoreBridge clear]):
347 2004-12-02 Ken Kocienda <kocienda@apple.com>
353 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
355 * khtml/xml/dom2_rangeimpl.cpp:
356 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
357 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
358 of this bug where there is content after the body tag). Did a little code clean up as well.
359 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
361 2004-12-02 Ken Kocienda <kocienda@apple.com>
367 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
369 * khtml/khtml_part.cpp:
370 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
371 to figure out which end of the selection to extend.
373 2004-12-02 David Harrison <harrison@apple.com>
375 Reviewed by Ken Kocienda.
377 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
378 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
380 * khtml/editing/visible_text.cpp:
381 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
382 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
383 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
384 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
385 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
386 Distinguish BR from whitespace.
387 * khtml/editing/visible_text.h:
388 Distinguish BR from whitespace.
389 * khtml/editing/visible_units.cpp:
390 (khtml::previousWordBoundary):
391 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.
393 2004-12-02 Ken Kocienda <kocienda@apple.com>
399 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
401 * khtml/xml/dom_position.cpp:
402 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
403 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
404 exception trying to use a Position returned from this function to set the boundary point of a Range (which
405 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
406 contract to return a range-compliant position, hence the need for this fix.
408 2004-12-01 Ken Kocienda <kocienda@apple.com>
414 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
415 regard to other editing commands. The class had a name change ages ago, and it was never
417 * khtml/editing/htmlediting.h: Ditto.
419 2004-12-01 Ken Kocienda <kocienda@apple.com>
423 Some improvements for paste, including some new code to annotate
424 whitespace when writing to the pasteboard to ensure that the meaning
425 of the markup on the pasteboard is unambiguous.
427 There is also new code for reading this annotated markup from the pasteboard,
428 removing the nodes that were added only to prevent ambiguity.
430 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
431 The header should have been added earlier, but I did not do so.
432 * khtml/editing/html_interchange.cpp: Added.
433 (convertHTMLTextToInterchangeFormat):
434 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
435 * khtml/editing/htmlediting.cpp:
436 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
437 Also fixed a bug in the code that counts blocks in a fragment.
438 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
439 (khtml::ReplacementFragment::insertNodeBefore): New helper.
440 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
441 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
442 * khtml/editing/htmlediting.h: Add some new declarations.
443 * khtml/xml/dom2_rangeimpl.cpp:
444 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
445 * khtml/xml/dom_nodeimpl.cpp:
446 (NodeImpl::stringValueForRange): New helper.
447 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
448 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
449 should be added. Called by the paste code.
450 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
452 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
453 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
454 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
456 2004-11-30 Chris Blumenberg <cblu@apple.com>
458 * ChangeLog: removed conflict marker
460 2004-11-30 Chris Blumenberg <cblu@apple.com>
463 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
464 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
468 * khtml/misc/loader.cpp:
469 (CachedObject::~CachedObject): release m_allData
470 (CachedObject::setAllData): new
471 (Loader::servePendingRequests): connect slotAllData
472 (Loader::slotAllData): new
473 (Cache::requestImage): tweak
474 * khtml/misc/loader.h:
475 (khtml::CachedObject::CachedObject): set allData to 0
476 (khtml::CachedObject::allData): new
477 * kwq/KWQKJobClasses.h:
478 * kwq/KWQKJobClasses.mm:
479 (KIO::TransferJob::TransferJob): set m_allData
480 (KIO::TransferJob::emitAllData): new
482 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
483 * kwq/KWQResourceLoader.mm:
484 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
486 (KWQSlot::KWQSlot): support for slotAllData
488 * kwq/WebCoreBridge.h:
489 * kwq/WebCoreResourceLoader.h:
491 2004-11-30 Maciej Stachowiak <mjs@apple.com>
495 2004-11-30 Maciej Stachowiak <mjs@apple.com>
499 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
501 * khtml/khtml_part.cpp:
502 (KHTMLPart::begin): call setParsing on document here after opening
503 - from now on we'll only set parsing to true for a document open
504 caused by page loading, not a programmatic one.
505 * khtml/xml/dom_docimpl.cpp:
506 (DocumentImpl::open): don't setParsing to true here any more.
508 2004-11-30 Maciej Stachowiak <mjs@apple.com>
512 - fix recent regression from collection perf fixes.
514 * khtml/html/html_miscimpl.cpp:
515 (HTMLFormCollectionImpl::updateNameCache): Look up the name
516 attribute in the name cache, not the id cache (d'oh!)
518 2004-11-30 Darin Adler <darin@apple.com>
522 - rolled in a KDE fix for a problem that may underlie a number of crashes
524 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
525 the KDE guys to fix a subtle problem. Code said "n = n =".
527 - rolled in a KDE fix for a containingBlock crash
529 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
530 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
533 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
536 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
537 (-[KWQButton detachQButton]): Added.
538 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
539 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
540 (-[KWQButton widget]): Added.
541 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
542 (-[KWQButton resignFirstResponder]): Ditto.
543 (-[KWQButton canBecomeKeyView]): Ditto.
544 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
545 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
547 * kwq/KWQComboBox.mm:
548 (QComboBox::~QComboBox): Call detachQComboBox.
549 (-[KWQPopUpButtonCell detachQComboBox]): Added.
550 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
551 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
552 (-[KWQPopUpButton action:]): Ditto.
553 (-[KWQPopUpButton widget]): Tweaked.
554 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
555 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
556 (-[KWQPopUpButton resignFirstResponder]): Ditto.
557 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
559 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
562 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
564 * kwq/KWQScrollBar.h: Removed m_scroller field.
565 * kwq/KWQScrollBar.mm:
566 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
567 (-[KWQScrollBar detachQScrollBar]): Added.
568 (-[KWQScrollBar widget]): Added.
569 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
570 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
571 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
572 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
573 (QScrollBar::setKnobProportion): Ditto.
574 (QScrollBar::scrollbarHit): Ditto.
576 * kwq/KWQScrollView.mm:
577 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
578 hack where we don't remove right away when doing mouse tracking.
579 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
580 the hack where we don't add right away when doing mouse tracking.
582 * kwq/KWQSlider.h: Added destructor.
584 (-[KWQSlider initWithQSlider:]): Tweaked a little.
585 (-[KWQSlider detachQSlider]): Added.
586 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
587 (-[KWQSlider widget]): Added.
588 (QSlider::~QSlider): Added. Calls detachQSlider.
590 * kwq/KWQTextArea.h: Added detachQTextEdit method.
591 * kwq/KWQTextArea.mm:
592 (-[KWQTextArea detachQTextEdit]): Added.
593 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
594 (-[KWQTextArea becomeFirstResponder]): Ditto.
595 (-[KWQTextArea nextKeyView]): Ditto.
596 (-[KWQTextArea previousKeyView]): Ditto.
597 (-[KWQTextArea drawRect:]): Ditto.
598 (-[KWQTextAreaTextView insertTab:]): Ditto.
599 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
600 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
601 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
602 (-[KWQTextAreaTextView mouseDown:]): Ditto.
603 (-[KWQTextAreaTextView keyDown:]): Ditto.
604 (-[KWQTextAreaTextView keyUp:]): Ditto.
606 * kwq/KWQTextEdit.h: Added ~QTextEdit.
607 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
609 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
610 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
612 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
613 Added beforeMouseDown and afterMouseDown for use in widget implementations.
614 Removed unused hasMouseTracking function.
616 (QWidget::QWidget): Initialize two new fields.
617 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
618 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
619 (QWidget::addToSuperview): Added.
620 (QWidget::removeFromSuperview): Added.
621 (QWidget::beforeMouseDown): Added.
622 (QWidget::afterMouseDown): Added.
624 * khtml/rendering/render_layer.cpp:
625 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
626 (RenderLayer::setHasVerticalScrollbar): Ditto.
628 2004-11-30 Ken Kocienda <kocienda@apple.com>
634 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
636 * khtml/khtml_part.cpp:
637 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
638 with no blink if it is.
640 2004-11-30 Ken Kocienda <kocienda@apple.com>
646 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
648 * khtml/khtml_part.cpp:
649 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
650 or <input type=image> was checked for focus since these elements are keyboard-focusable,
651 but not mouse focusable. Also, this function did not work hard enough to set the focused
652 node, and was content to clear it if the first element checked failed the test, rather
653 than looking more at parents. This would have the effect of clearing, then resetting the
654 focus on a DIV containing a button or image with content on either side of it in the
655 process of arrowing over such content.
657 2004-11-30 Ken Kocienda <kocienda@apple.com>
661 * khtml/editing/htmlediting.cpp:
662 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
663 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
664 * khtml/khtml_part.cpp:
665 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
666 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
667 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
668 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
669 isCharacterSmartReplaceExempt virtual.
671 2004-11-30 Ken Kocienda <kocienda@apple.com>
675 * khtml/editing/htmlediting.cpp:
676 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
677 Seemed simple enough to land without review.
679 2004-11-29 Ken Kocienda <kocienda@apple.com>
683 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
684 are handled correctly now, including selections that span multiple blocks, and cases
685 where content on the pasteboard ends in newlines (or what appear to be newlines to a
686 user, really block ends or BRs). I also made one small, but important change in the
687 copy code to annotate the markup written to the pasteboard to support these selections
690 New header that defines a couple of constants used in copying and pasting.
692 * ForwardingHeaders/editing/html_interchange.h: Added.
693 * khtml/editing/html_interchange.h: Added.
695 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
696 as a new helper class, ReplacementFragment, which encapsulates information and functions
697 pertaining to a document fragment that is being inserted into a document.
699 * khtml/editing/htmlediting.cpp:
700 (khtml::ReplacementFragment::ReplacementFragment):
701 (khtml::ReplacementFragment::~ReplacementFragment):
702 (khtml::ReplacementFragment::firstChild): Simple accessor.
703 (khtml::ReplacementFragment::lastChild): Ditto.
704 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
705 the starting node to use for merging into the block containing the start of the selection.
706 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
707 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
708 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
709 special annotation comment added in by the copy code.
710 (khtml::ReplacementFragment::removeNode): Simple helper.
711 (khtml::isComment): Simple helper.
712 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
713 I would like to do better than this some day, but this check will hold us until I can do better.
714 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
715 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
716 (khtml::ReplaceSelectionCommand::doApply):
717 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
718 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
719 (khtml::ReplacementFragment::root):
720 (khtml::ReplacementFragment::type):
721 (khtml::ReplacementFragment::isEmpty):
722 (khtml::ReplacementFragment::isSingleTextNode):
723 (khtml::ReplacementFragment::isTreeFragment):
724 (khtml::ReplacementFragment::hasMoreThanOneBlock):
725 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
727 This smaller set of changes markup generation to add the newline annotation described in the
728 comment at the start of this entry.
730 * khtml/xml/dom2_rangeimpl.cpp:
731 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
732 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
733 comment annotations are added to the markup generated.
734 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
735 * kwq/WebCoreBridge.mm:
736 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
737 DOM::RangeImpl::toHTML uses annotations when generating.
741 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
742 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
743 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
744 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
745 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
746 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
747 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
748 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
749 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
750 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
751 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
752 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
753 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
754 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
755 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
756 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
757 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
758 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
760 2004-11-29 Ken Kocienda <kocienda@apple.com>
764 Made two small changes that make it possible for comments to have DOM nodes made for them
765 when pasting. This relies on some earlier work I did some days ago.
767 * khtml/xml/dom_nodeimpl.cpp:
768 (NodeImpl::startMarkup): Get the string from the comment.
769 * kwq/WebCoreBridge.mm:
770 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
771 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
772 be included in the DOM.
774 2004-11-29 Ken Kocienda <kocienda@apple.com>
778 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
779 my improved paste code.
781 * khtml/editing/visible_position.cpp:
782 (khtml::blockRelationship)
783 (khtml::visiblePositionsInDifferentBlocks)
784 (khtml::isFirstVisiblePositionInBlock)
785 (khtml::isFirstVisiblePositionInNode)
786 (khtml::isLastVisiblePositionInBlock)
787 * khtml/editing/visible_position.h
789 2004-11-29 Ken Kocienda <kocienda@apple.com>
793 * khtml/xml/dom_position.cpp:
794 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
795 specified from obeying that directive. The old code would stop at an outer block boundary in
796 the case where that block had a block as its first child. The correct behavior is to drill into
797 that inner block (and continue on drilling down, if possible), to find the correct position.
799 2004-11-29 Ken Kocienda <kocienda@apple.com>
803 Small improvements to the node-display debugging helpers.
805 * khtml/xml/dom_nodeimpl.cpp:
806 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
807 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
809 2004-11-29 Ken Kocienda <kocienda@apple.com>
813 * khtml/editing/htmlediting.cpp:
814 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
815 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
816 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
817 place after the delete.
819 2004-11-29 Ken Kocienda <kocienda@apple.com>
823 Add a new helper function to insert a paragraph separator. Will be used in my
824 upcoming paste improvments.
826 * khtml/editing/htmlediting.cpp: Added function
827 (khtml::CompositeEditCommand::insertParagraphSeparator)
828 * khtml/editing/htmlediting.h: Ditto.
830 2004-11-23 David Harrison <harrison@apple.com>
832 Added various comments.
834 * khtml/editing/htmlediting.cpp:
835 (khtml::StyleChange::init):
836 (khtml::ApplyStyleCommand::doApply):
837 (khtml::ApplyStyleCommand::applyBlockStyle):
838 (khtml::ApplyStyleCommand::applyInlineStyle):
840 2004-11-23 David Hyatt <hyatt@apple.com>
842 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
843 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
845 * khtml/rendering/render_block.cpp:
846 (khtml::RenderBlock::nodeAtPoint):
848 2004-11-22 David Hyatt <hyatt@apple.com>
850 Make sure you can use document.createElement to make a <canvas> element.
852 * khtml/xml/dom_docimpl.cpp:
853 (DocumentImpl::createHTMLElement):
855 2004-11-22 Maciej Stachowiak <mjs@apple.com>
859 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
860 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
861 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
862 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
864 * khtml/ecma/kjs_html.cpp:
865 (KJS::HTMLDocument::tryGet):
866 * khtml/html/html_formimpl.cpp:
867 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
868 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
869 * khtml/html/html_formimpl.h:
870 * khtml/html/html_miscimpl.cpp:
871 (HTMLCollectionImpl::HTMLCollectionImpl):
872 (HTMLCollectionImpl::~HTMLCollectionImpl):
873 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
874 (HTMLCollectionImpl::CollectionInfo::reset):
875 (HTMLCollectionImpl::resetCollectionInfo):
876 (HTMLCollectionImpl::checkForNameMatch):
878 (HTMLCollectionImpl::updateNameCache):
879 (HTMLCollectionImpl::namedItems):
880 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
881 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
882 (HTMLFormCollectionImpl::item):
883 (HTMLFormCollectionImpl::updateNameCache):
884 * khtml/html/html_miscimpl.h:
886 2004-11-22 David Hyatt <hyatt@apple.com>
888 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
893 * khtml/misc/loader.cpp:
894 (CachedObject::finish):
897 * khtml/misc/loader.h:
898 (khtml::Cache::maxCacheableObjectSize):
900 2004-11-22 David Hyatt <hyatt@apple.com>
902 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
903 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
904 that lets us short circuit earlier when painting and hit testing.
908 * khtml/khtml_part.cpp:
909 (KHTMLPart::isPointInsideSelection):
910 * khtml/rendering/render_block.cpp:
911 (khtml::RenderBlock::paint):
912 (khtml::RenderBlock::paintChildren):
913 (khtml::RenderBlock::paintObject):
914 (khtml::RenderBlock::paintFloats):
915 (khtml::RenderBlock::nodeAtPoint):
916 * khtml/rendering/render_block.h:
917 * khtml/rendering/render_box.cpp:
918 (RenderBox::nodeAtPoint):
919 * khtml/rendering/render_box.h:
920 * khtml/rendering/render_br.h:
921 * khtml/rendering/render_canvas.cpp:
922 (RenderCanvas::paint):
923 * khtml/rendering/render_flow.cpp:
924 (RenderFlow::paintLines):
925 (RenderFlow::hitTestLines):
926 (RenderFlow::caretRect):
927 (RenderFlow::addFocusRingRects):
928 (RenderFlow::paintFocusRing):
929 (RenderFlow::paintOutlines):
930 (RenderFlow::paintOutlineForLine):
931 * khtml/rendering/render_flow.h:
932 * khtml/rendering/render_frames.cpp:
933 (RenderFrameSet::nodeAtPoint):
934 * khtml/rendering/render_frames.h:
935 * khtml/rendering/render_image.cpp:
936 (RenderImage::nodeAtPoint):
937 * khtml/rendering/render_image.h:
938 * khtml/rendering/render_inline.cpp:
939 (RenderInline::paint):
940 (RenderInline::nodeAtPoint):
941 * khtml/rendering/render_inline.h:
942 * khtml/rendering/render_layer.cpp:
943 (RenderLayer::paintLayer):
944 (RenderLayer::hitTest):
945 (RenderLayer::hitTestLayer):
946 * khtml/rendering/render_layer.h:
947 * khtml/rendering/render_line.cpp:
948 (khtml::InlineBox::paint):
949 (khtml::InlineBox::nodeAtPoint):
950 (khtml::InlineFlowBox::flowObject):
951 (khtml::InlineFlowBox::nodeAtPoint):
952 (khtml::InlineFlowBox::paint):
953 (khtml::InlineFlowBox::paintBackgrounds):
954 (khtml::InlineFlowBox::paintBackground):
955 (khtml::InlineFlowBox::paintBackgroundAndBorder):
956 (khtml::InlineFlowBox::paintDecorations):
957 (khtml::EllipsisBox::paint):
958 (khtml::EllipsisBox::nodeAtPoint):
959 (khtml::RootInlineBox::paintEllipsisBox):
960 (khtml::RootInlineBox::paint):
961 (khtml::RootInlineBox::nodeAtPoint):
962 * khtml/rendering/render_line.h:
963 (khtml::InlineRunBox::paintBackgroundAndBorder):
964 * khtml/rendering/render_object.cpp:
965 (RenderObject::hitTest):
966 (RenderObject::setInnerNode):
967 (RenderObject::nodeAtPoint):
968 * khtml/rendering/render_object.h:
969 (khtml::RenderObject::PaintInfo::PaintInfo):
970 (khtml::RenderObject::PaintInfo::~PaintInfo):
971 (khtml::RenderObject::paintingRootForChildren):
972 (khtml::RenderObject::shouldPaintWithinRoot):
973 * khtml/rendering/render_table.cpp:
974 (RenderTable::layout):
975 (RenderTable::paint):
976 * khtml/rendering/render_text.cpp:
977 (simpleDifferenceBetweenColors):
978 (correctedTextColor):
979 (InlineTextBox::nodeAtPoint):
980 (InlineTextBox::paint):
981 (InlineTextBox::selectionStartEnd):
982 (InlineTextBox::paintSelection):
983 (InlineTextBox::paintMarkedTextBackground):
984 (InlineTextBox::paintDecoration):
985 (RenderText::posOfChar):
986 * khtml/rendering/render_text.h:
987 (khtml::RenderText::paint):
988 (khtml::RenderText::layout):
989 (khtml::RenderText::nodeAtPoint):
990 * khtml/xml/dom2_eventsimpl.cpp:
991 (MouseEventImpl::computeLayerPos):
992 * khtml/xml/dom_docimpl.cpp:
993 (DocumentImpl::prepareMouseEvent):
994 * kwq/KWQAccObject.mm:
995 (-[KWQAccObject accessibilityHitTest:]):
996 * kwq/KWQKHTMLPart.mm:
997 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
998 (KWQKHTMLPart::eventMayStartDrag):
999 (KWQKHTMLPart::khtmlMouseMoveEvent):
1000 * kwq/WebCoreBridge.mm:
1001 (-[WebCoreBridge elementAtPoint:]):
1002 (-[WebCoreBridge _positionForPoint:]):
1004 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1008 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1009 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1011 This avoids the O(N^2) penalty for named item traversal for form collections.
1013 It also combines the item traversal logic for all non-form
1014 collection operations into a single traverseNextItem
1015 function. This avoids having 5 copies of the big switch statement
1018 Also fixed a bug that prevented the last form element from being removed properly.
1020 * khtml/html/html_formimpl.cpp:
1021 (DOM::removeFromVector):
1022 * khtml/dom/html_misc.cpp:
1023 (HTMLCollection::namedItems):
1024 * khtml/dom/html_misc.h:
1025 * khtml/ecma/kjs_html.cpp:
1026 (KJS::HTMLCollection::getNamedItems):
1027 * khtml/html/html_miscimpl.cpp:
1028 (HTMLCollectionImpl::traverseNextItem):
1029 (HTMLCollectionImpl::calcLength):
1030 (HTMLCollectionImpl::length):
1031 (HTMLCollectionImpl::item):
1032 (HTMLCollectionImpl::nextItem):
1033 (HTMLCollectionImpl::checkForNameMatch):
1034 (HTMLCollectionImpl::namedItem):
1035 (HTMLCollectionImpl::namedItems):
1036 (HTMLCollectionImpl::nextNamedItem):
1037 (HTMLFormCollectionImpl::calcLength):
1038 (HTMLFormCollectionImpl::namedItem):
1039 (HTMLFormCollectionImpl::nextNamedItem):
1040 (HTMLFormCollectionImpl::namedItems):
1041 * khtml/html/html_miscimpl.h:
1043 2004-11-22 Ken Kocienda <kocienda@apple.com>
1045 Reviewed by Harrison
1047 Change around the way we block the Javascript "Paste" command identifier from
1048 being available. Formerly, this was done with an ifdef we never compiled in.
1049 Now, this is done with a couple of cheap runtime checks. The advantage is that
1050 we can now compile this command into development builds, and still yet switch
1051 on the command in deployment builds through the use of WebCore SPI so we can
1052 write and run layout tests with all of our builds.
1054 * khtml/editing/jsediting.cpp:
1055 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1056 command being queried is the paste command.
1057 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1058 * khtml/editing/jsediting.h: Ditto.
1059 * khtml/khtml_part.cpp:
1060 (KHTMLPart::pasteFromPasteboard): Added.
1061 (KHTMLPart::canPaste): Added.
1062 * kwq/KWQKHTMLPart.mm:
1063 (KHTMLPart::canPaste): Added.
1064 * kwq/KWQRenderTreeDebug.cpp:
1065 (externalRepresentation): Turn on paste command.
1066 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1068 2004-11-21 Maciej Stachowiak <mjs@apple.com>
1070 Reviewed by Richard.
1072 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1074 * khtml/html/html_miscimpl.cpp:
1075 (HTMLCollectionImpl::calcLength):
1076 (HTMLCollectionImpl::getItem):
1077 (HTMLCollectionImpl::item):
1078 (HTMLCollectionImpl::nextItem):
1079 (HTMLCollectionImpl::getNamedItem):
1080 (HTMLCollectionImpl::namedItem):
1081 (HTMLCollectionImpl::nextNamedItemInternal):
1082 (HTMLFormCollectionImpl::nextNamedItemInternal):
1084 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1088 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
1089 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
1090 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
1092 Many optimizations to HTMLFormCollection. Iterating it should not
1093 be N^2 any more, though finding items by name could still be.
1095 * khtml/html/html_formimpl.cpp:
1096 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1097 (DOM::HTMLFormElementImpl::length):
1098 (DOM::HTMLFormElementImpl::submitClick):
1099 (DOM::HTMLFormElementImpl::formData):
1100 (DOM::HTMLFormElementImpl::submit):
1101 (DOM::HTMLFormElementImpl::reset):
1102 (DOM::HTMLFormElementImpl::radioClicked):
1103 (DOM::appendToVector):
1104 (DOM::removeFromVector):
1105 (DOM::HTMLFormElementImpl::registerFormElement):
1106 (DOM::HTMLFormElementImpl::removeFormElement):
1107 (DOM::HTMLFormElementImpl::makeFormElementDormant):
1108 (DOM::HTMLFormElementImpl::registerImgElement):
1109 (DOM::HTMLFormElementImpl::removeImgElement):
1110 * khtml/html/html_formimpl.h:
1111 * khtml/html/html_miscimpl.cpp:
1112 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
1113 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
1114 (HTMLFormCollectionImpl::resetCollectionInfo):
1115 (HTMLFormCollectionImpl::calcLength):
1116 (HTMLFormCollectionImpl::item):
1117 (HTMLFormCollectionImpl::getNamedItem):
1118 (HTMLFormCollectionImpl::getNamedFormItem):
1119 (HTMLFormCollectionImpl::firstItem):
1120 (HTMLFormCollectionImpl::nextItem):
1121 * khtml/html/html_miscimpl.h:
1122 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1123 * khtml/xml/dom_elementimpl.cpp:
1124 (ElementImpl::setAttribute):
1125 (ElementImpl::setAttributeMap):
1126 * kwq/KWQPtrVector.h:
1127 (QPtrVector::findRef):
1128 * kwq/KWQVectorImpl.h:
1129 * kwq/KWQVectorImpl.mm:
1130 (KWQVectorImpl::findRef):
1131 * kwq/WebCoreBridge.mm:
1132 (-[WebCoreBridge elementWithName:inForm:]):
1133 (-[WebCoreBridge controlsInForm:]):
1135 2004-11-19 David Harrison <harrison@apple.com>
1137 Reviewed by Ken and Darin.
1139 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
1141 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
1142 for the existing style, but in this case (hitting cmd-B with caret at top of
1143 file) there is nothing upstream. Changed this to use the VisiblePosition
1144 deepEquivalent instead.
1146 * khtml/khtml_part.cpp:
1147 (KHTMLPart::computeAndSetTypingStyle):
1151 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1155 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
1157 * khtml/xml/dom_docimpl.cpp:
1158 (DocumentImpl::close): Don't fire the onload handler if there is a
1159 redirect pending. This is a very long-standing bug that was masked
1160 by our previously incorrect redirect logic. It used to be that an
1161 older redirect would always win. Recently we changed things so
1162 that a newer redirect would win, but a script that causes a
1163 redirect would stop parsing once complete (so if there are two
1164 redirects in the same script, the latter wins). However, we should
1165 have also prevented onload in this case. Testing with other
1166 browsers shows that onload handlers do not run at all when there
1167 is a pending redirect.
1169 2004-11-19 Ken Kocienda <kocienda@apple.com>
1171 Reviewed by Harrison
1173 Fix some object lifetime issues in these two commands. This fixes some crashes
1174 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
1176 * khtml/editing/htmlediting.cpp:
1177 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
1178 in the ancestor list. They are not ref'ed when put on list. D'uh.
1179 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
1180 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
1181 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
1183 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
1185 2004-11-19 Ken Kocienda <kocienda@apple.com>
1187 Reviewed by Harrison
1191 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
1193 * khtml/khtml_part.cpp:
1194 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
1195 declaration given the current selection, and then sets the minimum necessary style as the typing
1197 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
1198 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
1200 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
1201 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
1202 * kwq/WebCoreBridge.mm:
1203 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
1204 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
1206 2004-11-18 David Harrison <harrison@apple.com>
1210 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
1211 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
1214 (-[DOMCSSStyleDeclaration setProperty:::]):
1216 2004-11-18 Chris Blumenberg <cblu@apple.com>
1218 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
1222 * kwq/KWQKHTMLPart.mm:
1223 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
1225 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1229 - fix recursive item traversal, use traverseNextNode() instead of
1230 the buggy hand-rolled traversal.
1232 * khtml/xml/dom_nodeimpl.cpp:
1233 (NodeListImpl::recursiveItem):
1235 2004-11-17 Darin Adler <darin@apple.com>
1239 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
1241 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
1242 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
1244 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1245 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
1246 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
1247 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
1248 an entire category of leaks we have been fixing one by one recently
1249 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
1250 stale RenderObject pointer, although I never saw it do that in practice
1251 - implemented the length and item methods for computed styles
1252 - implemented querying additional properties in computed styles (29 more)
1254 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1255 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
1256 take a mutable style.
1257 * khtml/khtml_part.cpp:
1258 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
1259 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
1260 a computed style; also change some types to mutable style.
1261 (updateState): Update iteration of CSSProperty objects in a style declaration to use
1262 the new valuesIterator interface.
1263 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
1264 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
1265 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
1266 including accomodating the exception code that setCssText has now.
1267 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
1268 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
1269 the style attributes really was a change, although it's not an important optimization it's
1270 good to do it right.
1272 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
1273 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
1274 calling it were already removing the old property explicitly, so the code in here to remove
1275 the property again was redundant.
1277 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
1278 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
1279 * khtml/css/css_computedstyle.cpp:
1280 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
1281 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
1282 Before we had no guarantee the object would outlast us.
1283 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1284 exception to NO_MODIFICATION_ALLOWED_ERR.
1285 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1286 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1287 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1288 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1289 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1290 page-break-inside, position, unicode-bidi, widows, z-index.
1291 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1292 exception to NO_MODIFICATION_ALLOWED_ERR.
1293 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1294 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1295 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1296 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1297 CSSMutableStyleDeclarationImpl.
1298 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1299 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1301 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1302 now a separate class rather than a typedef.
1303 * khtml/css/cssparser.h: Ditto.
1305 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1306 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1307 Removed a bunch of redundant stuff from other classes in this file too.
1308 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1309 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1310 (DOM::CSSProperty::operator=): Added.
1311 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1313 * khtml/css/css_valueimpl.cpp:
1314 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1315 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1316 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1317 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1318 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1319 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1320 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1321 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1322 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1323 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1324 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1325 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1326 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1327 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1328 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1329 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1330 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1331 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1332 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1333 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1334 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1335 no styles in the list. Update to use QValueList.
1336 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1337 parameter and set it.
1338 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1339 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1340 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1341 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1342 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1343 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1345 * khtml/css/cssparser.cpp:
1346 (CSSParser::parseValue): Changed to use addParsedProperties.
1347 (CSSParser::parseDeclaration): Ditto.
1348 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1350 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
1351 * khtml/css/cssproperties.c: Regenerated.
1352 * khtml/css/cssproperties.h: Regenerated.
1354 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
1355 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
1357 * khtml/dom/css_value.cpp:
1358 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
1359 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
1360 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
1361 first doing getPropertyCSSValue and then doing cssText.
1362 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
1363 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
1364 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
1365 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
1366 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
1367 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
1368 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
1370 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
1371 * khtml/dom/dom_node.cpp: Ditto.
1373 * khtml/editing/htmlediting.h: Change some types to mutable style.
1374 * khtml/editing/htmlediting.cpp:
1375 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
1376 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
1377 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
1378 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
1379 (khtml::EditCommand::setTypingStyle): Ditto.
1380 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
1381 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
1382 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
1383 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1384 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
1385 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
1386 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
1387 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1388 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1389 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1390 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
1391 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1392 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
1394 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
1395 * khtml/html/html_baseimpl.h: Change type to mutable style.
1396 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
1398 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
1399 class as a base class, and change types to mutable style as needed.
1400 * khtml/html/html_elementimpl.cpp:
1401 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
1402 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
1403 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
1404 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
1405 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
1406 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
1408 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
1411 * khtml/html/html_tableimpl.h: Change types to mutable style.
1412 * khtml/html/html_tableimpl.cpp:
1413 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1414 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
1415 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1417 * khtml/html/htmlparser.cpp:
1418 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
1419 than using an explicit delete to make the node go away, and is required for compatibility with the
1420 changes to the NodeImpl functions.
1421 (KHTMLParser::insertNode): Ditto.
1422 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
1423 the NodeImpl functions.
1425 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
1426 now that there's no need to make the property list explictly.
1429 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
1430 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
1431 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
1433 * khtml/xml/dom_nodeimpl.cpp:
1434 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
1435 function succeeded or not for ownership purposes.
1436 (NodeImpl::replaceChild): Ditto.
1437 (NodeImpl::appendChild): Ditto.
1438 (NodeBaseImpl::insertBefore): Ditto.
1439 (NodeBaseImpl::replaceChild): Ditto.
1440 (NodeBaseImpl::appendChild): Ditto.
1441 (NodeBaseImpl::addChild): Ditto.
1443 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
1444 * WebCore-combined.exp: Regenerated.
1446 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1448 still even more build fixing
1450 * khtml/html/html_miscimpl.cpp:
1451 (HTMLCollectionImpl::resetCollectionInfo):
1453 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1457 * khtml/html/html_miscimpl.cpp:
1458 (HTMLCollectionImpl::resetCollectionInfo):
1460 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1462 Fixed build problem.
1464 * khtml/html/html_miscimpl.h:
1465 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
1467 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1471 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
1473 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
1474 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
1476 This is also a start on fixing 5 other bugs, but those need additional work to make
1477 HTMLFormCollection fast.
1479 * khtml/html/html_documentimpl.h:
1480 (DOM::HTMLDocumentImpl::collectionInfo):
1481 * khtml/html/html_formimpl.cpp:
1482 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1483 (DOM::HTMLFormElementImpl::isURLAttribute):
1484 (DOM::HTMLFormElementImpl::registerImgElement):
1485 (DOM::HTMLFormElementImpl::removeImgElement):
1486 * khtml/html/html_formimpl.h:
1487 * khtml/html/html_imageimpl.cpp:
1488 (HTMLImageElementImpl::HTMLImageElementImpl):
1489 (HTMLImageElementImpl::~HTMLImageElementImpl):
1490 * khtml/html/html_imageimpl.h:
1491 * khtml/html/html_miscimpl.cpp:
1492 (HTMLCollectionImpl::HTMLCollectionImpl):
1493 (HTMLCollectionImpl::~HTMLCollectionImpl):
1494 (HTMLCollectionImpl::updateCollectionInfo):
1495 (HTMLCollectionImpl::length):
1496 (HTMLCollectionImpl::item):
1497 (HTMLCollectionImpl::firstItem):
1498 (HTMLCollectionImpl::nextItem):
1499 (HTMLCollectionImpl::namedItem):
1500 (HTMLCollectionImpl::nextNamedItemInternal):
1501 (HTMLFormCollectionImpl::getNamedFormItem):
1502 * khtml/html/html_miscimpl.h:
1503 (DOM::HTMLCollectionImpl::):
1504 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1505 * khtml/html/htmlparser.cpp:
1506 (KHTMLParser::getElement):
1507 * khtml/xml/dom_docimpl.cpp:
1508 (DocumentImpl::DocumentImpl):
1509 * khtml/xml/dom_docimpl.h:
1510 (DOM::DocumentImpl::incDOMTreeVersion):
1511 (DOM::DocumentImpl::domTreeVersion):
1512 * khtml/xml/dom_nodeimpl.cpp:
1516 2004-11-18 Kevin Decker <kdecker@apple.com>
1520 fixed: <rdar://problem/3841842> getPropertyID expensive
1523 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
1525 2004-11-17 David Hyatt <hyatt@apple.com>
1527 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
1528 and subsequently backed out).
1530 Reviewed by kocienda
1532 * khtml/html/html_baseimpl.cpp:
1533 (HTMLBodyElementImpl::insertedIntoDocument):
1534 * khtml/html/htmltokenizer.cpp:
1535 (khtml::HTMLTokenizer::reset):
1536 (khtml::HTMLTokenizer::scriptHandler):
1537 (khtml::HTMLTokenizer::scriptExecution):
1538 (khtml::HTMLTokenizer::write):
1539 (khtml::HTMLTokenizer::continueProcessing):
1540 (khtml::HTMLTokenizer::timerEvent):
1541 (khtml::HTMLTokenizer::notifyFinished):
1542 * khtml/html/htmltokenizer.h:
1543 * khtml/khtmlview.cpp:
1544 (KHTMLViewPrivate::KHTMLViewPrivate):
1545 (KHTMLViewPrivate::reset):
1547 (KHTMLView::layout):
1548 (KHTMLView::timerEvent):
1549 (KHTMLView::scheduleRelayout):
1550 (KHTMLView::layoutPending):
1551 (KHTMLView::haveDelayedLayoutScheduled):
1552 (KHTMLView::unscheduleRelayout):
1553 * khtml/khtmlview.h:
1554 * khtml/xml/dom_docimpl.cpp:
1555 (DocumentImpl::DocumentImpl):
1556 (DocumentImpl::close):
1557 (DocumentImpl::setParsing):
1558 (DocumentImpl::shouldScheduleLayout):
1559 (DocumentImpl::minimumLayoutDelay):
1560 (DocumentImpl::write):
1561 (DocumentImpl::finishParsing):
1562 (DocumentImpl::stylesheetLoaded):
1563 (DocumentImpl::updateStyleSelector):
1564 * khtml/xml/dom_docimpl.h:
1565 (DOM::DocumentImpl::parsing):
1566 * kwq/KWQDateTime.mm:
1567 (KWQUIEventTime::uiEventPending):
1569 2004-11-17 David Harrison <harrison@apple.com>
1571 Reviewed by Ken Kocienda.
1573 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
1574 Treat null case as meaning no post-move merge is needed.
1576 * khtml/editing/htmlediting.cpp:
1577 (khtml::DeleteSelectionCommand::initializePositionData):
1579 2004-11-17 David Harrison <harrison@apple.com>
1581 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
1582 * khtml/xml/dom_nodeimpl.cpp:
1583 (NodeImpl::displayNode):
1584 (NodeImpl::displayTree):
1585 (NodeBaseImpl::dispatchChildRemovalEvents):
1586 * khtml/xml/dom_nodeimpl.h:
1588 2004-11-16 John Sullivan <sullivan@apple.com>
1590 Reviewed by Richard.
1592 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
1594 * khtml/khtml_part.cpp:
1596 delete the list we created when we're done with it
1598 2004-11-16 Ken Kocienda <kocienda@apple.com>
1602 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
1603 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
1604 QPtrList when the list goes out of scope.
1606 * khtml/editing/htmlediting.cpp:
1607 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
1608 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
1609 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
1610 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1611 No longer set lists to autodelete.
1612 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
1613 Call new derefNodesInList helper.
1614 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
1615 of one before, but now it does.
1617 2004-11-15 David Harrison <harrison@apple.com>
1619 Reviewed by Chris and Darin.
1621 <rdar://problem/3880304> Non-linear performance hit for style changes
1623 * khtml/xml/dom_nodeimpl.cpp:
1624 (NodeImpl::traverseNextNode):
1625 (NodeImpl::traverseNextSibling):
1626 (NodeImpl::traversePreviousNodePostOrder):
1627 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
1628 Add asserts that stayWithin is an ancestor of the returned node.
1630 2004-11-15 Darin Adler <darin@apple.com>
1634 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
1636 * khtml/css/css_computedstyle.cpp:
1637 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
1638 since there's no guarantee it's already ref'd.
1639 * khtml/css/css_valueimpl.cpp:
1640 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
1641 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
1642 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
1643 (CSSStyleDeclarationImpl::merge): Ditto.
1644 (CSSStyleDeclarationImpl::diff): Ditto.
1645 * khtml/editing/htmlediting.cpp:
1646 (khtml::StyleChange::currentlyHasStyle): Ditto.
1647 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1648 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
1649 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
1651 2004-11-15 Darin Adler <darin@apple.com>
1655 Use separate mutable style and computed style types as appropriate.
1656 For now this should have no effect, but it prepares us for refactoring later.
1657 Also remove some unnecessary "DOM::" prefixes and in one case factor out
1660 * khtml/khtml_part.cpp:
1661 (KHTMLPart::typingStyle):
1662 (KHTMLPart::setTypingStyle):
1664 (KHTMLPart::selectionHasStyle):
1665 (KHTMLPart::selectionStartHasStyle):
1666 (KHTMLPart::selectionComputedStyle):
1667 * khtml/khtml_part.h:
1668 * khtml/khtmlpart_p.h:
1670 * khtml/css/css_base.h:
1671 * khtml/css/css_ruleimpl.cpp:
1672 (CSSStyleRuleImpl::setDeclaration):
1673 * khtml/css/css_ruleimpl.h:
1674 (DOM::CSSFontFaceRuleImpl::style):
1675 (DOM::CSSPageRuleImpl::style):
1676 (DOM::CSSStyleRuleImpl::style):
1677 (DOM::CSSStyleRuleImpl::declaration):
1678 * khtml/css/css_valueimpl.h:
1679 (DOM::CSSPrimitiveValueImpl::):
1680 * khtml/css/cssparser.cpp:
1681 (CSSParser::parseValue):
1682 (CSSParser::parseColor):
1683 (CSSParser::parseDeclaration):
1684 (CSSParser::createStyleDeclaration):
1685 * khtml/css/cssparser.h:
1686 * khtml/css/cssstyleselector.cpp:
1687 (khtml::CSSStyleSelector::addMatchedDeclaration):
1688 (khtml::CSSStyleSelector::matchRulesForList):
1689 (khtml::CSSStyleSelector::styleForElement):
1690 (khtml::CSSStyleSelector::applyDeclarations):
1691 * khtml/css/cssstyleselector.h:
1692 * khtml/css/parser.cpp:
1693 * khtml/css/parser.y:
1694 * khtml/dom/css_rule.h:
1695 * khtml/dom/css_stylesheet.h:
1696 * khtml/dom/css_value.h:
1697 * khtml/dom/dom2_views.cpp:
1698 * khtml/xml/dom2_viewsimpl.cpp:
1699 (DOM::AbstractViewImpl::getComputedStyle):
1700 * khtml/xml/dom_docimpl.cpp:
1701 (DocumentImpl::importNode):
1702 (DocumentImpl::setStyleSheet):
1703 * khtml/xml/dom_docimpl.h:
1704 * khtml/xml/dom_xmlimpl.cpp:
1705 (DOM::ProcessingInstructionImpl::setStyleSheet):
1706 * khtml/xml/dom_xmlimpl.h:
1708 * khtml/dom/css_value.cpp:
1709 (DOM::throwException): Added.
1710 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
1711 The real thing is coming with the next change to refactor.
1712 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
1713 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
1715 2004-11-15 Darin Adler <darin@apple.com>
1719 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
1721 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
1722 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
1723 node's attributes changed without sending a misleading childrenChanged call,
1724 but the childrenChanged call can happen at the exact right moment.
1725 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
1726 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
1727 the boolean true is passed in.
1729 * khtml/xml/dom_elementimpl.cpp:
1730 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
1731 (NamedAttrMapImpl::removeAttribute): Ditto.
1733 2004-11-15 John Sullivan <sullivan@apple.com>
1737 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
1738 seen often in Mail and Blot
1740 * khtml/css/css_valueimpl.cpp:
1741 (CSSStyleDeclarationImpl::copyPropertiesInSet):
1742 delete temporary list after we're done using it
1744 2004-11-15 Richard Williamson <rjw@apple.com>
1746 Fixed leak (3879883) that John found. Early return leaked
1751 * khtml/css/css_computedstyle.cpp:
1752 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1754 2004-11-15 Ken Kocienda <kocienda@apple.com>
1760 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
1762 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
1763 EditCommandPtr to its parent, but this caused a a reference cycle in composite
1764 commands as the children held a ref to their parent. Now, the parent variable
1765 is a non-retained reference to an EditCommand *. It would be nice to have a
1766 weak reference to the parent or even override deref in composite commands (but I
1767 can't since deref() is not virtual). However, this should be OK since any
1768 dangling parent pointer is a sign of a bigger object lifetime problem that
1769 would need to be addressed anyway.
1771 * khtml/css/css_valueimpl.cpp:
1772 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
1773 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
1774 just assigning the list variable passed in to the local list variable, or the list will be
1776 * khtml/editing/htmlediting.cpp:
1777 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
1778 (khtml::EditCommand::setEndingSelection): Ditto.
1779 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
1780 Unrelated to the change, but saves some ref's and deref's.
1781 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
1782 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
1783 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
1784 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
1786 2004-11-15 Maciej Stachowiak <mjs@apple.com>
1790 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
1792 * khtml/xml/dom_nodeimpl.cpp:
1793 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
1795 (NodeListImpl::recursiveLength): Adjusted for rename.
1796 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
1797 If the same offset is looked up again, just return it, otherwise, if looking up
1798 a later offset, start at the last item and proceed from there.
1799 (NodeListImpl::itemById): Apply the special document optimization to all
1800 nodes that are either a document or in a document - just walk up to make
1801 sure the node found by ID has the root node as an ancestor.
1802 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
1803 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
1805 2004-11-15 John Sullivan <sullivan@apple.com>
1809 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
1811 * kwq/KWQKHTMLPart.mm:
1812 (KWQKHTMLPart::documentFragmentWithText):
1813 release mutable copy of string after we're done using it
1815 2004-11-14 Kevin Decker <kdecker@apple.com>
1819 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
1821 * khtml/html/html_elementimpl.cpp:
1822 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
1823 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
1825 2004-11-13 Maciej Stachowiak <mjs@apple.com>
1829 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
1831 * khtml/dom/dom_node.cpp:
1832 (NodeList::itemById): New method, just forward to impl.
1833 * khtml/dom/dom_node.h: Prototype it.
1834 * khtml/ecma/kjs_dom.cpp:
1835 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
1836 let the NodeList do it. The NodeList might be able to do it more efficiently.
1837 * khtml/xml/dom_nodeimpl.cpp:
1838 (NodeListImpl::itemById): Optimize for the case where the NodeList
1839 covers the whole document. In this case, just use getElementById,
1840 then check that the element satisfies the list criteria.
1841 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
1842 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
1843 * khtml/xml/dom_nodeimpl.h:
1845 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1849 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
1850 sometimes using a huge bogus length value.
1852 * khtml/xml/dom_nodeimpl.cpp:
1853 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
1855 2004-11-12 Darin Adler <darin@apple.com>
1859 - fixed an infinite loop in that last check-in
1861 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
1862 Added a ++i to the loop so it won't get stuck on the first element in the list.
1864 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1868 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
1870 I fixed this by changing NodeLists to cache their length, but
1871 invalidate it whenever there is a change in the DOM subtree at
1872 which they are rooted. This makes NodeListImpl::recursiveLength()
1873 drop completely off the profile, since we were repeatedly getting
1874 a length for the same NodeList over and over.
1876 * khtml/xml/dom_nodeimpl.cpp:
1877 (NodeImpl::NodeImpl):
1878 (NodeImpl::~NodeImpl):
1879 (NodeImpl::registerNodeList):
1880 (NodeImpl::unregisterNodeList):
1881 (NodeImpl::notifyLocalNodeListsSubtreeModified):
1882 (NodeImpl::notifyNodeListsSubtreeModified):
1883 (NodeImpl::dispatchSubtreeModifiedEvent):
1884 (NodeListImpl::NodeListImpl):
1885 (NodeListImpl::~NodeListImpl):
1886 (NodeListImpl::recursiveLength):
1887 (NodeListImpl::recursiveItem):
1888 (NodeListImpl::rootNodeSubtreeModified):
1889 (ChildNodeListImpl::ChildNodeListImpl):
1890 (ChildNodeListImpl::length):
1891 (ChildNodeListImpl::item):
1892 (TagNodeListImpl::TagNodeListImpl):
1893 (TagNodeListImpl::length):
1894 (TagNodeListImpl::item):
1895 (NameNodeListImpl::NameNodeListImpl):
1896 (NameNodeListImpl::length):
1897 (NameNodeListImpl::item):
1898 * khtml/xml/dom_nodeimpl.h:
1900 2004-11-12 Darin Adler <darin@apple.com>
1904 - various small cleanups
1906 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
1907 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
1909 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
1910 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
1911 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
1912 * khtml/html/htmltokenizer.cpp:
1913 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
1914 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
1916 * khtml/khtml_part.h: Removed docImpl function.
1917 * khtml/khtml_part.cpp: Ditto.
1919 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
1920 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
1922 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
1923 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
1924 part of the change last time, which is why the build broke).
1925 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
1926 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
1927 (KWQKHTMLPart::keyEvent): Ditto.
1928 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
1929 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
1931 2004-11-12 Chris Blumenberg <cblu@apple.com>
1933 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
1937 * kwq/KWQKHTMLPart.mm:
1938 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
1942 2004-11-12 Darin Adler <darin@apple.com>
1946 - fixed a couple places that would not work for XML documents
1948 * khtml/ecma/kjs_window.cpp:
1949 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
1950 is present on the base class.
1951 (WindowFunc::tryCall): More of the same.
1953 2004-11-12 Darin Adler <darin@apple.com>
1955 - land versions of these files generated by the newer gperf
1957 People building on Panther will continue to see these files modified.
1958 A workaround would be to install the newer gperf on our Tiger build machines.
1960 * khtml/css/cssproperties.c: Regenerated.
1961 * khtml/css/cssvalues.c: Regenerated.
1962 * khtml/html/doctypes.cpp: Regenerated.
1963 * khtml/html/kentities.c: Regenerated.
1964 * khtml/misc/htmlattrs.c: Regenerated.
1965 * khtml/misc/htmltags.c: Regenerated.
1966 * kwq/KWQColorData.c: Regenerated.
1968 2004-11-11 Richard Williamson <rjw@apple.com>
1970 Fix build horkage from previous checkin.
1972 * kwq/KWQKHTMLPart.h:
1974 2004-11-11 Darin Adler <darin@apple.com>
1978 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
1980 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
1982 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
1983 * kwq/KWQKHTMLPart.mm:
1984 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
1985 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
1986 we started with the NSTextField as first responder, and then took focus away and gave it back, which
1987 makes dragging text work again.
1988 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
1990 2004-11-11 David Hyatt <hyatt@apple.com>
1992 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
1996 * khtml/html/htmltokenizer.cpp:
1997 (khtml::HTMLTokenizer::continueProcessing):
1999 2004-11-11 Ken Kocienda <kocienda@apple.com>
2003 * khtml/editing/htmlediting.cpp:
2004 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2005 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2006 with the prevailing style for the VisiblePosition class.
2007 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2008 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2009 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2010 (khtml::isLastVisiblePositionInBlock): Ditto.
2011 (khtml::isLastVisiblePositionInNode): Ditto.
2012 * khtml/editing/visible_position.h: Add declarations for new functions.
2014 2004-11-11 Ken Kocienda <kocienda@apple.com>
2018 * khtml/editing/htmlediting.cpp:
2019 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2020 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2021 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2022 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2023 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2024 * khtml/xml/dom2_rangeimpl.cpp:
2025 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2026 * khtml/xml/dom2_rangeimpl.h: Ditto.
2028 2004-11-11 Ken Kocienda <kocienda@apple.com>
2030 Reviewed by Harrison
2032 Some improvements to deleting when complete lines are selected.
2034 * khtml/editing/htmlediting.cpp:
2035 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2036 the end of a selection is fully selected. Turn off block merging in this case.
2037 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2038 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2039 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2040 start block is selected. This new code will now delete this block in one call, rather
2041 than iterating over each child.
2042 * khtml/editing/visible_position.cpp:
2043 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2044 to do the work mentioned above in the comment for that function.
2045 (khtml::isFirstVisiblePositionOnLine): Ditto.
2046 (khtml::isLastVisiblePositionOnLine): Ditto.
2047 * khtml/editing/visible_position.h: Add new functions.
2048 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2049 * layout-tests/editing/deleting/delete-line-001.html: Added.
2050 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2051 * layout-tests/editing/deleting/delete-line-002.html: Added.
2052 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2053 * layout-tests/editing/deleting/delete-line-003.html: Added.
2054 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2055 * layout-tests/editing/deleting/delete-line-004.html: Added.
2056 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2057 * layout-tests/editing/deleting/delete-line-005.html: Added.
2058 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2059 * layout-tests/editing/deleting/delete-line-006.html: Added.
2060 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2061 * layout-tests/editing/deleting/delete-line-007.html: Added.
2062 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2063 * layout-tests/editing/deleting/delete-line-008.html: Added.
2064 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2065 * layout-tests/editing/deleting/delete-line-009.html: Added.
2066 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2067 * layout-tests/editing/deleting/delete-line-010.html: Added.
2068 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2069 * layout-tests/editing/deleting/delete-line-011.html: Added.
2070 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2071 * layout-tests/editing/deleting/delete-line-012.html: Added.
2073 2004-11-11 Ken Kocienda <kocienda@apple.com>
2077 * khtml/editing/htmlediting.cpp:
2078 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2080 2004-11-11 Ken Kocienda <kocienda@apple.com>
2086 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
2087 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
2089 * khtml/editing/selection.cpp:
2090 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
2091 the next line position when necessary.
2092 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
2093 * layout-tests/editing/selection/move-3875618-fix.html: Added.
2094 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
2095 * layout-tests/editing/selection/move-3875641-fix.html: Added.
2097 2004-11-11 Ken Kocienda <kocienda@apple.com>
2101 Improved some function names, at John's urging. No changes to the
2102 functions themselves.
2104 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
2105 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
2106 performGeneralDelete() --> handleGeneralDelete()
2108 * khtml/editing/htmlediting.cpp:
2109 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
2110 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
2111 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2112 (khtml::DeleteSelectionCommand::doApply)
2113 * khtml/editing/htmlediting.h
2115 2004-11-11 Ken Kocienda <kocienda@apple.com>
2119 Updated some layout test results that changed as a result of my last checking.
2120 Added a new test that has been in my tree for a few days.
2122 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2123 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
2124 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
2125 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
2127 2004-11-11 Ken Kocienda <kocienda@apple.com>
2131 * khtml/editing/htmlediting.cpp:
2132 (khtml::debugNode): New debugging helper.
2133 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
2134 startPositionForDelete() and endPositionForDelete() functions. Just use the
2135 m_selectionToDelete object to determine start and end positions for the delete.
2136 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
2137 function that creates a special case for deleting all the content in a root
2139 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
2140 function before BR special case and the general case delete functions.
2141 * khtml/editing/htmlediting.h: Updated for changed functions.
2143 2004-11-10 Kevin Decker <kdecker@apple.com>
2147 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
2149 * khtml/ecma/kjs_dom.cpp:
2150 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
2152 2004-11-10 Ken Kocienda <kocienda@apple.com>
2156 * khtml/editing/htmlediting.cpp:
2157 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
2158 smart delete from the two functions below to here. There was an unnecessary double
2159 calculation of the leading and trailing whitespace positions. Also refined the trailing
2160 case so it only acts when the leading position is null (which seems to match TextEdit in
2161 my tests). Also removed some unnecessary copying of Position objects.
2162 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
2164 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2166 2004-11-10 Ken Kocienda <kocienda@apple.com>
2168 Reviewed by Harrison
2170 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
2171 make things more clear.
2172 * khtml/editing/selection.cpp:
2173 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
2174 resulting positions do not cross block boundaries. This was a bug and caused some
2175 delete problems when whole blocks were selected. I will be addressing that issue
2176 more fully in upcoming changes.
2178 2004-11-10 Ken Kocienda <kocienda@apple.com>
2180 Reviewed by Harrison
2182 Some cleanups and fixes in upstream and downstream functions.
2184 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
2185 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
2186 block's enclosing block will be returned.
2188 Remove code from upstream that confined the serach to block boundaries outside of
2189 the code which runs in the StayInBlock case. This code was redundant, and caused
2190 incorrect results to be returned in the DoNotStayInBlock case.
2192 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
2193 node, not the the this pointer's node.
2195 * khtml/xml/dom_position.cpp:
2196 (DOM::Position::upstream)
2197 (DOM::Position::downstream)
2199 2004-11-09 David Hyatt <hyatt@apple.com>
2201 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
2202 loading large local files.
2206 * khtml/html/htmltokenizer.cpp:
2207 (khtml::HTMLTokenizer::HTMLTokenizer):
2208 (khtml::HTMLTokenizer::reset):
2209 (khtml::HTMLTokenizer::write):
2210 (khtml::HTMLTokenizer::stopped):
2211 (khtml::HTMLTokenizer::processingData):
2212 (khtml::HTMLTokenizer::continueProcessing):
2213 (khtml::HTMLTokenizer::timerEvent):
2214 (khtml::HTMLTokenizer::allDataProcessed):
2215 (khtml::HTMLTokenizer::end):
2216 (khtml::HTMLTokenizer::finish):
2217 (khtml::HTMLTokenizer::notifyFinished):
2218 * khtml/html/htmltokenizer.h:
2219 * khtml/khtml_part.cpp:
2220 (KHTMLPart::slotFinished):
2223 * khtml/khtml_part.h:
2224 (KHTMLPart::tokenizerProcessedData):
2225 * khtml/khtmlview.cpp:
2226 * khtml/xml/dom_docimpl.cpp:
2227 * khtml/xml/xml_tokenizer.h:
2228 (khtml::Tokenizer::stopped):
2229 (khtml::Tokenizer::processingData):
2230 * kwq/KWQDateTime.h:
2231 * kwq/KWQDateTime.mm:
2232 (QDateTime::secsTo):
2233 (KWQUIEventTime::uiEventPending):
2234 * kwq/KWQKHTMLPart.h:
2235 * kwq/KWQKHTMLPart.mm:
2236 (KWQKHTMLPart::tokenizerProcessedData):
2237 * kwq/WebCoreBridge.h:
2238 * kwq/WebCoreBridge.mm:
2239 (-[WebCoreBridge stop]):
2240 (-[WebCoreBridge numPendingOrLoadingRequests]):
2241 (-[WebCoreBridge doneProcessingData]):
2243 2004-11-09 David Harrison <harrison@apple.com>
2245 Reviewed by Ken Kocienda.
2247 <rdar://problem/3865837> Wrong text style after delete to start of document
2249 * khtml/editing/htmlediting.cpp:
2250 (khtml::DeleteSelectionCommand::saveTypingStyleState):
2251 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
2253 2004-11-09 Richard Williamson <rjw@apple.com>
2255 Fixed <rdar://problem/3872440> NSTimer prematurely released.
2264 2004-11-09 Chris Blumenberg <cblu@apple.com>
2268 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
2270 2004-11-08 David Harrison <harrison@apple.com>
2272 Reviewed by Ken Kocienda.
2274 <rdar://problem/3865854> Deleting first line deletes all lines
2276 * khtml/editing/htmlediting.cpp:
2277 (khtml::DeleteSelectionCommand::performGeneralDelete):
2278 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
2279 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
2280 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
2281 update because it is handled in calculateEndingPosition now.
2282 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
2283 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2285 2004-11-08 Ken Kocienda <kocienda@apple.com>
2289 * khtml/html/html_elementimpl.cpp:
2290 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2291 are added to the DOM.
2292 * khtml/html/html_elementimpl.h: Ditto.
2293 * khtml/html/htmlparser.cpp:
2294 (KHTMLParser::KHTMLParser): Ditto.
2295 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2296 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2297 * khtml/html/htmltokenizer.cpp:
2298 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2299 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2300 There were a couple of indexing errors that resulted in the comment text containing part of the
2302 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2303 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
2305 2004-11-08 Chris Blumenberg <cblu@apple.com>
2307 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2311 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2312 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2313 * kwq/KWQKHTMLPart.h: ditto
2315 2004-11-08 Darin Adler <darin@apple.com>
2319 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2321 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2322 that possibly deletes the QTimer.
2324 2004-11-08 Chris Blumenberg <cblu@apple.com>
2326 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2330 * kwq/KWQTextField.mm:
2331 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2332 * kwq/WebCoreBridge.h:
2334 2004-11-08 David Harrison <harrison@apple.com>
2338 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2340 * khtml/editing/htmlediting.cpp:
2341 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2342 * khtml/xml/dom_nodeimpl.cpp:
2343 (NodeImpl::enclosingInlineElement):
2344 * khtml/xml/dom_nodeimpl.h:
2346 2004-11-05 Chris Blumenberg <cblu@apple.com>
2348 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
2352 * khtml/editing/htmlediting.cpp:
2353 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
2354 * khtml/editing/visible_position.cpp:
2355 (khtml::VisiblePosition::character): new, returns the character for the position
2356 * khtml/editing/visible_position.h:
2357 * kwq/KWQKHTMLPart.h:
2358 * kwq/KWQKHTMLPart.mm:
2359 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
2360 * kwq/WebCoreBridge.h:
2364 2004-11-05 Adele Amchan <adele@apple.com>
2368 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
2369 and a workaround for displaying transparent backgrounds for textareas.
2371 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
2372 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
2373 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
2374 on the contentView, and on the textView.
2376 2004-11-04 David Hyatt <hyatt@apple.com>
2378 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
2381 Reviewed by darin or ken
2383 * khtml/rendering/bidi.cpp:
2384 (khtml::appendRunsForObject):
2385 (khtml::RenderBlock::skipWhitespace):
2386 (khtml::RenderBlock::findNextLineBreak):
2387 * khtml/rendering/render_block.cpp:
2388 (khtml::RenderBlock::lowestPosition):
2389 (khtml::RenderBlock::rightmostPosition):
2390 (khtml::RenderBlock::leftmostPosition):
2391 * khtml/rendering/render_box.cpp:
2392 (RenderBox::position):
2393 * khtml/rendering/render_box.h:
2394 (khtml::RenderBox::staticX):
2395 (khtml::RenderBox::staticY):
2396 * khtml/rendering/render_layer.cpp:
2397 (RenderLayer::updateLayerPosition):
2398 (RenderLayer::convertToLayerCoords):
2399 * khtml/rendering/render_line.cpp:
2400 (khtml::InlineFlowBox::placeBoxesHorizontally):
2401 * khtml/rendering/render_object.h:
2402 (khtml::RenderObject::staticX):
2403 (khtml::RenderObject::staticY):
2405 Finish turning on XSLT. Make sure child stylesheets can load.
2407 * khtml/xsl/xslt_processorimpl.cpp:
2408 (DOM::stylesheetLoadFunc):
2409 (DOM::XSLTProcessorImpl::transformDocument):
2411 2004-11-04 David Hyatt <hyatt@apple.com>
2413 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
2414 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
2415 keyword and length values.
2419 * khtml/css/cssparser.cpp:
2420 (CSSParser::parseValue):
2421 (CSSParser::addBackgroundValue):
2422 (CSSParser::parseBackgroundShorthand):
2423 (CSSParser::parseBackgroundColor):
2424 (CSSParser::parseBackgroundImage):
2425 (CSSParser::parseBackgroundPositionXY):
2426 (CSSParser::parseBackgroundPosition):
2427 (CSSParser::parseBackgroundProperty):
2428 (CSSParser::parseColorFromValue):
2429 * khtml/css/cssparser.h:
2430 * khtml/css/cssstyleselector.cpp:
2431 (khtml::CSSStyleSelector::adjustRenderStyle):
2432 (khtml::CSSStyleSelector::applyProperty):
2433 (khtml::CSSStyleSelector::mapBackgroundAttachment):
2434 (khtml::CSSStyleSelector::mapBackgroundImage):
2435 (khtml::CSSStyleSelector::mapBackgroundRepeat):
2436 (khtml::CSSStyleSelector::mapBackgroundXPosition):
2437 (khtml::CSSStyleSelector::mapBackgroundYPosition):
2438 * khtml/css/cssstyleselector.h:
2439 * khtml/rendering/render_box.cpp:
2440 (RenderBox::paintRootBoxDecorations):
2441 (RenderBox::paintBoxDecorations):
2442 (RenderBox::paintBackgrounds):
2443 (RenderBox::paintBackground):
2444 (RenderBox::paintBackgroundExtended):
2445 * khtml/rendering/render_box.h:
2446 * khtml/rendering/render_form.cpp:
2447 (RenderFieldset::paintBoxDecorations):
2448 * khtml/rendering/render_line.cpp:
2449 (khtml::InlineFlowBox::paintBackgrounds):
2450 (khtml::InlineFlowBox::paintBackground):
2451 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2452 * khtml/rendering/render_line.h:
2453 * khtml/rendering/render_object.cpp:
2454 (RenderObject::setStyle):
2455 (RenderObject::updateBackgroundImages):
2456 (RenderObject::getVerticalPosition):
2457 * khtml/rendering/render_object.h:
2458 (khtml::RenderObject::paintBackgroundExtended):
2459 * khtml/rendering/render_style.cpp:
2461 (BackgroundLayer::BackgroundLayer):
2462 (BackgroundLayer::~BackgroundLayer):
2463 (BackgroundLayer::operator=):
2464 (BackgroundLayer::operator==):
2465 (BackgroundLayer::fillUnsetProperties):
2466 (BackgroundLayer::cullEmptyLayers):
2467 (StyleBackgroundData::StyleBackgroundData):
2468 (StyleBackgroundData::operator==):
2469 (RenderStyle::diff):
2470 (RenderStyle::adjustBackgroundLayers):
2471 * khtml/rendering/render_style.h:
2472 (khtml::OutlineValue::operator==):
2473 (khtml::OutlineValue::operator!=):
2474 (khtml::BackgroundLayer::backgroundImage):
2475 (khtml::BackgroundLayer::backgroundXPosition):
2476 (khtml::BackgroundLayer::backgroundYPosition):
2477 (khtml::BackgroundLayer::backgroundAttachment):
2478 (khtml::BackgroundLayer::backgroundRepeat):
2479 (khtml::BackgroundLayer::next):
2480 (khtml::BackgroundLayer::isBackgroundImageSet):
2481 (khtml::BackgroundLayer::isBackgroundXPositionSet):
2482 (khtml::BackgroundLayer::isBackgroundYPositionSet):
2483 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
2484 (khtml::BackgroundLayer::isBackgroundRepeatSet):
2485 (khtml::BackgroundLayer::setBackgroundImage):
2486 (khtml::BackgroundLayer::setBackgroundXPosition):
2487 (khtml::BackgroundLayer::setBackgroundYPosition):
2488 (khtml::BackgroundLayer::setBackgroundAttachment):
2489 (khtml::BackgroundLayer::setBackgroundRepeat):
2490 (khtml::BackgroundLayer::clearBackgroundImage):
2491 (khtml::BackgroundLayer::clearBackgroundXPosition):
2492 (khtml::BackgroundLayer::clearBackgroundYPosition):
2493 (khtml::BackgroundLayer::clearBackgroundAttachment):
2494 (khtml::BackgroundLayer::clearBackgroundRepeat):
2495 (khtml::BackgroundLayer::setNext):
2496 (khtml::BackgroundLayer::operator!=):
2497 (khtml::BackgroundLayer::containsImage):
2498 (khtml::BackgroundLayer::hasImage):
2499 (khtml::BackgroundLayer::hasFixedImage):
2500 (khtml::RenderStyle::setBitDefaults):
2501 (khtml::RenderStyle::hasBackground):
2502 (khtml::RenderStyle::hasFixedBackgroundImage):
2503 (khtml::RenderStyle::outlineWidth):
2504 (khtml::RenderStyle::outlineStyle):
2505 (khtml::RenderStyle::outlineStyleIsAuto):
2506 (khtml::RenderStyle::outlineColor):
2507 (khtml::RenderStyle::backgroundColor):
2508 (khtml::RenderStyle::backgroundImage):
2509 (khtml::RenderStyle::backgroundRepeat):
2510 (khtml::RenderStyle::backgroundAttachment):
2511 (khtml::RenderStyle::backgroundXPosition):
2512 (khtml::RenderStyle::backgroundYPosition):
2513 (khtml::RenderStyle::accessBackgroundLayers):
2514 (khtml::RenderStyle::backgroundLayers):
2515 (khtml::RenderStyle::outlineOffset):
2516 (khtml::RenderStyle::resetOutline):
2517 (khtml::RenderStyle::setBackgroundColor):
2518 (khtml::RenderStyle::setOutlineWidth):
2519 (khtml::RenderStyle::setOutlineStyle):
2520 (khtml::RenderStyle::setOutlineColor):
2521 (khtml::RenderStyle::clearBackgroundLayers):
2522 (khtml::RenderStyle::inheritBackgroundLayers):
2523 (khtml::RenderStyle::setOutlineOffset):
2524 * khtml/rendering/render_table.cpp:
2525 (RenderTable::paintBoxDecorations):
2526 (RenderTableCell::paintBoxDecorations):
2528 2004-11-04 David Hyatt <hyatt@apple.com>
2530 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
2531 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
2535 * kwq/KWQTextCodec.mm:
2536 (KWQTextDecoder::convertLatin1):
2537 (KWQTextDecoder::convertUTF16):
2538 (KWQTextDecoder::convertUsingTEC):
2539 (KWQTextDecoder::toUnicode):
2541 2004-11-04 David Hyatt <hyatt@apple.com>
2543 Make sure line-height returns the correct value for normal.
2547 * khtml/css/css_computedstyle.cpp:
2548 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2550 2004-11-04 David Harrison <harrison@apple.com>
2552 Reviewed by Ken Kocienda.
2554 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
2556 * khtml/editing/htmlediting.cpp:
2557 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
2558 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
2559 Fixed to insert after the destination subtree, rather than the destination element. Handles
2560 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
2561 * khtml/xml/dom_nodeimpl.cpp:
2562 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
2563 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
2564 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
2565 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
2567 2004-11-03 Ken Kocienda <kocienda@apple.com>
2573 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
2574 * layout-tests/editing/deleting/delete-br-008.html: Added.
2575 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
2576 * layout-tests/editing/deleting/delete-br-009.html: Added.
2577 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
2578 * layout-tests/editing/deleting/delete-br-010.html: Added.
2580 2004-11-03 Maciej Stachowiak <mjs@apple.com>
2582 Fix by Yasuo Kida, reviewed by me.
2584 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
2586 * kwq/KWQKHTMLPart.mm:
2587 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
2588 same as a nil range - setting an empty marked range should clear
2589 the marked range entirely.
2591 2004-11-02 Maciej Stachowiak <mjs@apple.com>
2593 Reviewed by Dave Hyatt (when I originally coded it).
2595 WebCore part of fix for:
2597 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
2599 * kwq/WebCoreBridge.h:
2600 * kwq/WebCoreBridge.mm:
2601 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
2602 DOMRange, or if the range is split into multiple lines, the rect for the part on
2603 the first line only.
2605 * khtml/rendering/render_object.cpp:
2606 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
2607 for the overrides below.
2608 * khtml/rendering/render_object.h:
2609 * khtml/rendering/render_box.cpp:
2610 (RenderBox::caretRect):
2611 * khtml/rendering/render_box.h:
2612 * khtml/rendering/render_br.cpp:
2613 (RenderBR::caretRect):
2614 * khtml/rendering/render_br.h:
2615 * khtml/rendering/render_flow.cpp:
2616 (RenderFlow::caretRect):
2617 * khtml/rendering/render_flow.h:
2618 * khtml/rendering/render_text.cpp:
2619 (RenderText::caretRect):
2621 2004-11-02 Ken Kocienda <kocienda@apple.com>
2625 Implemented command to insert a block in response to typing a return key (even though
2626 I am not turning that on by default with this patch....that will come later).
2628 This new command is called InsertParagraphSeparatorCommand.
2630 Reworked the command and function names associated with inserting content into a
2631 document. Before this patch, there were inputXXX and insertXXX variants, with the
2632 former used for more high-level actions and the latter used for lower-level stuff.
2633 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
2634 in an insertXXX command going through an inputXXX WebCore step and then finally to an
2635 insertXXX WebCore step. To make this less confusing, I have changes all the names to
2636 be insertXXX, and modified the lower-level operations so that it is clear what they do.
2638 * khtml/editing/htmlediting.cpp:
2639 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
2640 (khtml::EditCommand::isInsertTextCommand): Ditto.
2641 (khtml::CompositeEditCommand::inputText): Ditto.
2642 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
2643 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
2644 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
2645 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
2646 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
2647 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
2648 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
2649 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
2650 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
2651 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
2652 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2653 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2654 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
2655 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
2656 (khtml::InsertIntoTextNode::doApply): Ditto.
2657 (khtml::InsertIntoTextNode::doUnapply): Ditto.
2658 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
2659 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
2660 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
2661 (khtml::InsertLineBreakCommand::doApply):
2662 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
2663 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
2664 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
2665 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
2666 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
2667 (khtml::InsertParagraphSeparatorCommand::doApply):
2668 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2669 Class name change, was InsertNewlineCommandInQuotedContentCommand.
2670 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
2671 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
2672 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2673 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
2674 (khtml::InsertTextCommand::doApply): Ditto.
2675 (khtml::InsertTextCommand::deleteCharacter): Ditto.
2676 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2677 (khtml::InsertTextCommand::input): Ditto.
2678 (khtml::InsertTextCommand::insertSpace): Ditto.
2679 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
2680 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
2681 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
2682 (khtml::TypingCommand::insertParagraphSeparator): New function.
2683 (khtml::TypingCommand::doApply): Name changes, as above.
2684 (khtml::TypingCommand::insertText): Ditto.
2685 (khtml::TypingCommand::deleteKeyPressed): Ditto.
2686 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2687 * khtml/editing/htmlediting.h:
2688 (khtml::DeleteFromTextNodeCommand::node): Name change.
2689 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
2690 (khtml::DeleteFromTextNodeCommand::count): Ditto.
2691 (khtml::InsertIntoTextNode::text): Ditto.
2692 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
2693 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
2694 (khtml::TypingCommand::): Ditto.
2695 * khtml/editing/jsediting.cpp: Name changes, as above.
2696 * kwq/WebCoreBridge.h:
2697 * kwq/WebCoreBridge.mm:
2698 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
2699 (-[WebCoreBridge insertParagraphSeparator]): New function.
2700 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
2702 2004-11-01 Kevin Decker <kdecker@apple.com>
2706 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
2709 * khtml/ecma/kjs_window.cpp:
2710 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
2712 2004-11-01 Darin Adler <darin@apple.com>
2716 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
2718 * khtml/css/html4.css: Use color: initial for textarea and related ones.
2720 2004-11-01 Ken Kocienda <kocienda@apple.com>
2726 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
2728 * khtml/css/css_computedstyle.cpp:
2729 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
2730 implementation here into new copyPropertiesInSet helper. This now calls the
2731 generalized copyPropertiesInSet function with the arguments needed to make copying
2733 * khtml/css/css_computedstyle.h:
2734 * khtml/css/css_valueimpl.cpp:
2735 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
2736 In order to do apply block properties, "regular" style declarations need to do style
2738 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
2739 except that it uses a different set of properties that apply only to blocks.
2740 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
2741 and copies out those properties listed in a pre-defined set.
2742 * khtml/css/css_valueimpl.h:
2743 * khtml/editing/htmlediting.cpp:
2744 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
2745 block, factoring out some of the special case code that should now only run in the inline case.
2746 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
2747 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
2748 special handling for "legacy" HTML styles like <B> and <I>.
2749 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
2750 style changes into different kinds. CSS specifies certain properties only apply to certain
2751 element types. This set of changes now recognizes two such separate cases: styles that apply
2752 to blocks, and styles that apply to inlines.
2753 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
2754 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
2755 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
2756 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
2757 done so that the function can be passed a portion of the styles being applied so that block styles
2758 and inline styles can be handled separately.
2759 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2760 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
2761 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
2762 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
2763 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
2764 * khtml/editing/htmlediting.h:
2765 (khtml::StyleChange::): Changed as described above.
2766 (khtml::StyleChange::usesLegacyStyles):
2767 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
2768 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
2769 when text align changes.
2770 * khtml/khtml_part.cpp:
2771 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
2772 the passed-in argument.
2773 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
2774 is a caret. Formerly, this just set typing style and made no visible changes to the document.
2778 * layout-tests/editing/editing.js: Added some glue to change text align.
2779 * layout-tests/editing/style/block-style-001-expected.txt: Added.
2780 * layout-tests/editing/style/block-style-001.html: Added.
2781 * layout-tests/editing/style/block-style-002-expected.txt: Added.
2782 * layout-tests/editing/style/block-style-002.html: Added.
2783 * layout-tests/editing/style/block-style-003-expected.txt: Added.
2784 * layout-tests/editing/style/block-style-003.html: Added.
2788 2004-10-29 Darin Adler <darin@apple.com>
2792 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
2794 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
2795 before advancing one character; before it did it backwards.
2797 2004-10-29 Chris Blumenberg <cblu@apple.com>
2799 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
2801 Reviewed by kocienda, adele.
2803 * khtml/rendering/render_frames.cpp:
2804 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
2806 2004-10-29 Darin Adler <darin@apple.com>
2810 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
2812 * khtml/khtmlview.cpp:
2813 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
2814 deleted before this function finishes running.
2815 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
2816 (KHTMLView::viewportMouseReleaseEvent): Ditto.
2817 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
2818 is guaranteed to do ref/deref as needed.
2820 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
2822 2004-10-28 Chris Blumenberg <cblu@apple.com>
2824 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
2828 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
2829 * WebCorePrefix.h: always use XSLT
2831 2004-10-28 Ken Kocienda <kocienda@apple.com>
2837 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
2838 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
2840 * khtml/editing/htmlediting.cpp:
2841 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
2842 to initialization list, zeroing them out.
2843 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
2844 handle a delete of content in special cases where the only thing selected is a BR. This
2845 code path is much simpler than the newly-named performGeneralDelete, and detects when no
2846 content merging should be done between blocks. This aspect of the change fixes 3854848.
2847 One of the special cases added fixes 3803832.
2848 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
2849 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
2850 like the other helpers in this class.
2851 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
2852 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
2853 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
2855 2004-10-28 Chris Blumenberg <cblu@apple.com>
2857 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
2861 * kwq/KWQKHTMLPart.mm:
2862 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
2864 2004-10-28 Ken Kocienda <kocienda@apple.com>
2866 Reviewed by Harrison
2868 Reorganization of delete command functionality so that doApply is not
2869 several hundred lines long. This is not a squeaky-clean cleanup, but
2870 it is a step in the right direction. No functionality changes.
2872 * khtml/editing/htmlediting.cpp:
2873 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
2874 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
2875 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
2876 (khtml::DeleteSelectionCommand::performDelete): Ditto.
2877 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2878 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2879 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
2880 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
2881 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
2882 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
2883 * khtml/editing/htmlediting.h:
2885 2004-10-28 Ken Kocienda <kocienda@apple.com>
2889 * khtml/editing/htmlediting.cpp:
2890 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
2891 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
2893 2004-10-27 Ken Kocienda <kocienda@apple.com>
2897 * khtml/editing/htmlediting.cpp:
2898 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
2899 whether content not in the block containing the start of the selection is moved to that block
2900 after the selection is deleted.
2901 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
2902 (khtml::DeleteSelectionCommand::doApply): Ditto.
2903 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
2904 to handle the case of inserting a newline when in quoted content in Mail.
2905 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
2906 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
2907 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
2908 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
2909 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
2910 (khtml::TypingCommand::doApply): Ditto.
2911 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2912 * khtml/editing/htmlediting.h: Add new delclarations.
2913 (khtml::TypingCommand::): Ditto.
2914 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
2915 * kwq/WebCoreBridge.mm:
2916 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
2918 2004-10-26 Chris Blumenberg <cblu@apple.com>
2920 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
2924 * khtml/ecma/kjs_dom.cpp:
2925 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
2926 * khtml/ecma/kjs_dom.h:
2927 (KJS::DOMElement::):
2928 * khtml/ecma/kjs_dom.lut.h:
2931 2004-10-26 David Hyatt <hyatt@apple.com>
2933 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
2936 Reviewed by kocienda
2938 * khtml/rendering/bidi.cpp:
2939 (khtml::RenderBlock::layoutInlineChildren):
2941 2004-10-26 David Hyatt <hyatt@apple.com>
2943 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
2944 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
2946 Reviewed by kocienda
2948 * khtml/rendering/render_canvas.cpp:
2949 (RenderCanvas::selectionRect):
2950 * khtml/rendering/render_object.h:
2951 (khtml::RenderObject::hasSelectedChildren):
2953 2004-10-26 Ken Kocienda <kocienda@apple.com>
2959 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
2961 * khtml/editing/htmlediting.cpp:
2962 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
2963 let the caller know if a placeholder was removed.
2964 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
2965 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
2966 some cases, the selection was still set on the removed BR, and this was the cause of the
2968 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
2970 2004-10-26 Darin Adler <darin@apple.com>
2974 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
2976 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
2978 2004-10-26 Ken Kocienda <kocienda@apple.com>
2982 * khtml/editing/htmlediting.cpp:
2983 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
2984 with a zero-length string. That triggers an assert. Call deleteText instead,
2985 using the same indices that are passed to replaceText.
2987 Cleaned up the asserts in these three functions below, making them
2988 more consistent. This is not needed for the fix, but I tripped over
2989 these in the course of debugging.
2991 (khtml::InsertTextCommand::InsertTextCommand):
2992 (khtml::InsertTextCommand::doApply):
2993 (khtml::InsertTextCommand::doUnapply):
2995 2004-10-25 Adele Amchan <adele@apple.com>
2999 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
3000 * khtml/xml/dom_docimpl.h:
3002 2004-10-25 Adele Amchan <adele@apple.com>
3004 Reviewed by me, code change by Darin.
3006 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
3008 2004-10-25 Ken Kocienda <kocienda@apple.com>
3010 Oops. These two test results changed with my last checkin, for the better.
3012 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3013 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
3015 2004-10-25 Ken Kocienda <kocienda@apple.com>
3021 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
3023 * khtml/editing/htmlediting.cpp:
3024 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
3025 expand the selection outwards when the selection is on the visible boundary of a root
3026 editable element. This fixes the bug. Note that this function also contains a little code
3027 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
3028 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3029 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
3030 * khtml/editing/htmlediting.h: Declare new helpers.
3031 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
3032 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
3033 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
3034 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
3035 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
3036 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
3038 2004-10-25 Ken Kocienda <kocienda@apple.com>
3040 Added some more editing layout tests.
3042 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
3043 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
3044 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
3045 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
3046 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
3047 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
3048 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
3049 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
3050 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
3051 * layout-tests/editing/inserting/typing-003.html: Added.
3053 2004-10-25 Ken Kocienda <kocienda@apple.com>
3057 * khtml/rendering/bidi.cpp:
3058 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
3059 yesterday quite right: words that should have been placed on the next line were instead
3060 appearing on the line before, beyond the right margin. This was a one-word only error
3061 based on moving the line break object when it should have stayed put. Here is the rule:
3062 The line break object only moves to after the whitespace on the end of a line if that
3063 whitespace caused line overflow when its width is added in.
3065 2004-10-25 Adele Amchan <adele@apple.com>
3069 Fix for <rdar://problem/3619890> Feature request: designMode
3071 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
3072 This will enable more JS editing compatibility.
3074 * khtml/ecma/kjs_html.cpp:
3075 (KJS::HTMLDocument::tryGet): added case for designMode
3076 (KJS::HTMLDocument::putValue): added case for designMode
3077 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
3078 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
3079 * khtml/xml/dom_docimpl.cpp:
3080 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
3081 (DocumentImpl::setDesignMode): added function to assign m_designMode value
3082 (DocumentImpl::getDesignMode): return m_designMode value
3083 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
3084 Otherwise, it will just return the m_designMode value.
3085 (DocumentImpl::parentDocument):
3086 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
3087 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
3089 2004-10-22 Ken Kocienda <kocienda@apple.com>
3095 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
3097 * khtml/editing/htmlediting.cpp:
3098 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
3099 everything that could be affected.
3100 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
3101 braces, making it act as a comma operator, with a zero value as the right value!!! This made
3102 an important check always fail!!! It turns out that we do not want the constant at all, since
3103 that constant is only needed when checking a computed style, not an inline style as is being
3105 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
3106 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
3107 RangeImpl::compareBoundaryPoints to perform the required check.
3108 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
3110 2004-10-22 Ken Kocienda <kocienda@apple.com>
3116 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
3117 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
3119 * khtml/rendering/bidi.cpp:
3120 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
3121 it is when we are editing, add in the space of the current character when calculating the width
3122 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
3123 the line break object and call skipWhitespace to move past the end of the whitespace.
3127 2004-10-22 Ken Kocienda <kocienda@apple.com>
3129 * WebCore.pbproj/project.pbxproj:
3130 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
3132 2004-10-21 David Hyatt <hyatt@apple.com>
3136 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
3138 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
3139 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
3141 * khtml/rendering/render_block.cpp:
3142 (khtml::getInlineRun):
3143 (khtml::RenderBlock::makeChildrenNonInline):
3145 2004-10-21 David Hyatt <hyatt@apple.com>
3147 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
3148 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
3152 * khtml/rendering/render_inline.cpp:
3153 (RenderInline::splitFlow):
3155 2004-10-21 Ken Kocienda <kocienda@apple.com>
3159 Significant improvement to the way that whitespace is handled during editing.
3161 * khtml/editing/htmlediting.cpp:
3162 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
3163 two being added with this name) that delete "insignificant" unrendered text.
3164 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
3165 calculates the downstream position to use as the endpoint for the deletion, and
3166 then calls deleteInsignificantText with this start and end.
3167 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
3168 (khtml::InputNewlineCommand::doApply): Ditto.
3169 (khtml::InputTextCommand::input): Ditto.
3170 * khtml/editing/htmlediting.h: Add new declarations.
3172 Modified layout test results:
3173 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
3174 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
3175 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
3176 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
3177 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
3178 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
3179 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
3180 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
3181 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
3182 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
3183 * layout-tests/editing/inserting/insert-br-001-expected.txt:
3184 * layout-tests/editing/inserting/insert-br-004-expected.txt:
3185 * layout-tests/editing/inserting/insert-br-005-expected.txt:
3186 * layout-tests/editing/inserting/insert-br-006-expected.txt:
3187 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
3188 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
3189 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
3190 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
3191 * layout-tests/editing/inserting/typing-001-expected.txt:
3192 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
3193 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
3194 * layout-tests/editing/style/typing-style-003-expected.txt:
3195 * layout-tests/editing/undo/redo-typing-001-expected.txt:
3196 * layout-tests/editing/undo/undo-typing-001-expected.txt:
3198 2004-10-21 David Hyatt <hyatt@apple.com>
3200 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
3201 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
3205 * khtml/rendering/render_block.cpp:
3206 (khtml::getInlineRun):
3208 2004-10-20 David Hyatt <hyatt@apple.com>
3210 Add better dumping of overflow information for scrolling regions.
3212 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
3213 from the render tree so that layers and so forth are cleaned up.
3217 * khtml/rendering/render_container.cpp:
3218 (RenderContainer::detach):
3219 * khtml/rendering/render_layer.h:
3220 (khtml::RenderLayer::scrollXOffset):
3221 (khtml::RenderLayer::scrollYOffset):
3222 * kwq/KWQRenderTreeDebug.cpp:
3225 2004-10-20 David Hyatt <hyatt@apple.com>
3227 Fix for 3791146, make sure all lines are checked when computing overflow.
3229 Reviewed by kocienda
3231 * khtml/rendering/bidi.cpp:
3232 (khtml::RenderBlock::computeHorizontalPositionsForLine):
3233 (khtml::RenderBlock::layoutInlineChildren):
3234 (khtml::RenderBlock::findNextLineBreak):
3235 (khtml::RenderBlock::checkLinesForOverflow):
3236 * khtml/rendering/render_block.h:
3238 2004-10-20 David Hyatt <hyatt@apple.com>
3240 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
3242 Reviewed by kocienda
3244 * khtml/rendering/break_lines.cpp:
3245 (khtml::isBreakable):
3247 2004-10-20 Darin Adler <darin@apple.com>
3251 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
3253 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
3254 Create a palette with the background and foreground colors in it and set it on the widget.
3256 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
3257 with APPLE_CHANGES. Removed palette and palette-related function members.
3258 * khtml/rendering/render_style.cpp:
3259 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
3260 (RenderStyle::diff): No palette to compare.
3262 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
3263 * kwq/KWQLineEdit.mm:
3264 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
3265 (QLineEdit::text): Made const.
3267 * kwq/KWQTextEdit.h: Added setPalette override.
3268 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
3271 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
3272 per color group, and only a single color group per palette.
3273 * kwq/KWQColorGroup.mm: Removed.
3274 * kwq/KWQPalette.mm: Removed.
3275 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
3277 * kwq/KWQApplication.h: Removed unused palette function.
3278 * kwq/KWQApplication.mm: Ditto.
3280 * kwq/KWQWidget.h: Removed unsetPalette.
3281 * kwq/KWQWidget.mm: Ditto.
3283 - fixed storage leak
3285 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
3286 Roll in storage leak fix from KDE guys.
3288 2004-10-19 David Hyatt <hyatt@apple.com>
3290 Reviewed by kocienda
3292 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
3293 and consolidates it with clearing.
3295 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
3297 * khtml/rendering/render_block.cpp:
3298 (khtml::getInlineRun):
3299 (khtml::RenderBlock::layoutBlock):
3300 (khtml::RenderBlock::adjustFloatingBlock):
3301 (khtml::RenderBlock::collapseMargins):
3302 (khtml::RenderBlock::clearFloatsIfNeeded):
3303 (khtml::RenderBlock::estimateVerticalPosition):
3304 (khtml::RenderBlock::layoutBlockChildren):
3305 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
3306 (khtml::RenderBlock::getClearDelta):
3307 (khtml::RenderBlock::calcBlockMinMaxWidth):
3308 * khtml/rendering/render_block.h:
3309 * khtml/rendering/render_frames.cpp:
3310 (RenderFrameSet::layout):
3311 * khtml/xml/dom_textimpl.cpp:
3312 (TextImpl::rendererIsNeeded):
3314 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
3316 * layout-tests/fast/frames/002-expected.txt: Added.
3317 * layout-tests/fast/frames/002.html: Added.
3319 2004-10-19 Darin Adler <darin@apple.com>
3323 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
3325 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
3326 scripts being loaded here. If the current code being run is the external script itself, then we don't want
3327 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
3328 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
3329 wrong since there can be a script loading in that case too. Layout tests check for both problems.
3331 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
3332 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
3333 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
3335 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
3337 2004-10-18 Darin Adler <darin@apple.com>
3339 Reviewed by Dave Hyatt.
3341 - 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)
3343 * khtml/html/htmltokenizer.cpp:
3344 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
3345 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
3346 we only want to look at loadingExtScript if m_executingScript is 0.
3348 2004-10-18 Ken Kocienda <kocienda@apple.com>
3354 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
3356 * khtml/css/css_valueimpl.cpp:
3357 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
3358 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
3359 lifecycle issues associated with creating a string to be returned in the ident case.
3360 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
3361 * khtml/css/cssstyleselector.cpp:
3362 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
3364 2004-10-18 Chris Blumenberg <cblu@apple.com>
3366 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
3368 Reviewed by kocienda.
3370 * khtml/rendering/render_frames.cpp:
3371 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
3373 2004-10-15 Chris Blumenberg <cblu@apple.com>
3375 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
3380 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
3383 2004-10-15 Ken Kocienda <kocienda@apple.com>
3387 * khtml/rendering/bidi.cpp:
3388 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
3389 skipping after a clean line break, in addition to the cases already
3391 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
3392 * layout-tests/editing/inserting/insert-br-007.html: Added.
3393 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
3394 * layout-tests/editing/inserting/insert-br-008.html: Added.
3398 2004-10-14 Ken Kocienda <kocienda@apple.com>
3404 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
3406 * khtml/editing/visible_position.cpp:
3407 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
3408 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
3409 Since we do a good job of insulating external code from the internal workings of
3410 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
3411 in the case of this bug, was doing harm. Simply removing this code makes the bug
3412 go away and does not cause any editing layout test regresssions.
3414 2004-10-14 Ken Kocienda <kocienda@apple.com>
3418 * khtml/rendering/bidi.cpp:
3419 (khtml::skipNonBreakingSpace): New helper.
3420 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
3421 at the start of a block. This was preventing users from typing spaces in empty
3423 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
3424 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
3426 2004-10-14 Adele Amchan <adele@apple.com>
3428 Reviewed by Darin and Ken.
3430 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
3432 This change shifts some code around so that the code that determines what typing style
3433 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
3434 to ensure that start and end nodes of the selection are in the document.
3436 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
3438 2004-10-14 Adele Amchan <adele@apple.com>
3442 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
3443 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
3445 * khtml/khtml_part.cpp:
3446 (KHTMLPart::shouldBeginEditing):
3447 (KHTMLPart::shouldEndEditing):
3448 (KHTMLPart::isContentEditable):
3449 * khtml/khtml_part.h:
3450 * kwq/KWQKHTMLPart.h:
3452 2004-10-14 Ken Kocienda <kocienda@apple.com>
3456 Final fix for these bugs:
3458 <rdar://problem/3806306> HTML editing puts spaces at start of line
3459 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
3461 This change sets some new CSS properties that have been added to WebCore to
3462 enable whitespace-handling and line-breaking features that make WebView work
3463 more like a text editor.
3465 * khtml/css/cssstyleselector.cpp:
3466 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
3467 based on property value.
3468 * khtml/html/html_elementimpl.cpp:
3469 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
3470 based on attribute value.
3471 * khtml/khtml_part.cpp:
3472 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
3474 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
3476 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
3477 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
3478 * khtml/khtml_part.h: Add new declarations.
3479 * kwq/WebCoreBridge.h: Ditto.
3480 * kwq/WebCoreBridge.mm:
3481 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
3482 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
3483 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
3484 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
3486 2004-10-14 John Sullivan <sullivan@apple.com>
3490 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
3492 * khtml/editing/htmlediting.cpp:
3493 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
3494 needed a nil check to handle empty document case
3496 2004-10-13 Maciej Stachowiak <mjs@apple.com>
3500 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
3502 - I fixed this by turning off all colormatching for WebKit
3503 content. We might turn it back on later. For now, it's possible to
3504 turn it on temporarily by defining COLORMATCH_EVERYTHING.
3507 * khtml/ecma/kjs_html.cpp:
3508 (KJS::Context2DFunction::tryCall):
3509 (Context2D::colorRefFromValue):
3510 (Gradient::getShading):
3511 * khtml/rendering/render_canvasimage.cpp:
3512 (RenderCanvasImage::createDrawingContext):
3514 (QColor::getNSColor):
3516 * kwq/KWQPainter.mm:
3517 (CGColorFromNSColor):
3518 (QPainter::selectedTextBackgroundColor):
3519 (QPainter::rgbColorSpace):
3520 (QPainter::grayColorSpace):
3521 (QPainter::cmykColorSpace):
3522 * kwq/WebCoreGraphicsBridge.h:
3523 * kwq/WebCoreGraphicsBridge.m:
3524 (-[WebCoreGraphicsBridge createRGBColorSpace]):
3525 (-[WebCoreGraphicsBridge createGrayColorSpace]):
3526 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
3528 2004-10-13 Ken Kocienda <kocienda@apple.com>
3532 * khtml/css/css_valueimpl.cpp:
3533 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
3534 is non-null before appending.
3536 2004-10-13 Ken Kocienda <kocienda@apple.com>
3538 Update expected results for improved behavior as a result of fix to 3816768.
3540 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
3541 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3542 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
3544 2004-10-13 Ken Kocienda <kocienda@apple.com>
3548 * khtml/css/css_computedstyle.cpp:
3549 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
3550 for getting -khtml-line-break and -khml-nbsp-mode.
3552 2004-10-13 Ken Kocienda <kocienda@apple.com>
3558 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
3559 moves caret out of block.
3561 The issue here is that an empty block with no explicit height set by style collapses
3562 to zero height, and does so immediately after the last bit of content is removed from
3563 it (as a result of deleting text with the delete key for instance). Since zero-height
3564 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
3566 The fix is to detect when a block has not been removed itself, but has had all its
3567 contents removed. In this case, a BR element is placed in the block, one that is
3568 specially marked as a placeholder. Later, if the block ever receives content, this
3569 placeholder is removed.
3571 * khtml/editing/htmlediting.cpp:
3572 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
3573 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
3574 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
3575 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
3576 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
3577 (it's very clear that we needs to be able to move more than just text nodes). This may expose
3578 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
3579 made the test case in the bug work.
3580 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
3581 removeBlockPlaceholderIfNeeded.
3582 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
3583 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
3584 * khtml/editing/htmlediting.h: Declare new functions.
3586 2004-10-13 Richard Williamson <rjw@apple.com>
3588 Added support for -apple-dashboard-region:none. And fixed
3589 a few computed style problems.
3591 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
3594 * khtml/css/css_computedstyle.cpp:
3595 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3596 * khtml/css/css_valueimpl.cpp:
3597 (CSSPrimitiveValueImpl::cssText):
3598 * khtml/css/cssparser.cpp:
3599 (CSSParser::parseValue):
3600 (CSSParser::parseDashboardRegions):
3601 * khtml/css/cssstyleselector.cpp:
3602 (khtml::CSSStyleSelector::applyProperty):
3603 * khtml/rendering/render_style.cpp:
3604 (RenderStyle::noneDashboardRegions):
3605 * khtml/rendering/render_style.h:
3606 * kwq/KWQKHTMLPart.mm:
3607 (KWQKHTMLPart::dashboardRegionsDictionary):
3609 2004-10-13 David Hyatt <hyatt@apple.com>
3611 Rework block layout to clean it up and simplify it (r=kocienda).
3613 Also fixing the style sharing bug (r=mjs).
3615 * khtml/rendering/render_block.cpp:
3616 (khtml::RenderBlock::MarginInfo::MarginInfo):
3617 (khtml::RenderBlock::layoutBlock):
3618 (khtml::RenderBlock::adjustPositionedBlock):
3619 (khtml::RenderBlock::adjustFloatingBlock):
3620 (khtml::RenderBlock::handleSpecialChild):
3621 (khtml::RenderBlock::handleFloatingOrPositionedChild):
3622 (khtml::RenderBlock::handleCompactChild):
3623 (khtml::RenderBlock::insertCompactIfNeeded):
3624 (khtml::RenderBlock::handleRunInChild):
3625 (khtml::RenderBlock::collapseMargins):
3626 (khtml::RenderBlock::clearFloatsIfNeeded):
3627 (khtml::RenderBlock::estimateVerticalPosition):
3628 (khtml::RenderBlock::determineHorizontalPosition):
3629 (khtml::RenderBlock::setCollapsedBottomMargin):
3630 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
3631 (khtml::RenderBlock::handleBottomOfBlock):
3632 (khtml::RenderBlock::layoutBlockChildren):
3633 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
3634 (khtml::RenderBlock::addOverHangingFloats):
3635 * khtml/rendering/render_block.h:
3636 (khtml::RenderBlock::maxTopMargin):
3637 (khtml::RenderBlock::maxBottomMargin):
3638 (khtml::RenderBlock::CompactInfo::compact):
3639 (khtml::RenderBlock::CompactInfo::block):
3640 (khtml::RenderBlock::CompactInfo::matches):
3641 (khtml::RenderBlock::CompactInfo::clear):
3642 (khtml::RenderBlock::CompactInfo::set):
3643 (khtml::RenderBlock::CompactInfo::CompactInfo):
3644 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
3645 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
3646 (khtml::RenderBlock::MarginInfo::clearMargin):
3647 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
3648 (khtml::RenderBlock::MarginInfo::setTopQuirk):
3649 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
3650 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
3651 (khtml::RenderBlock::MarginInfo::setPosMargin):
3652 (khtml::RenderBlock::MarginInfo::setNegMargin):
3653 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
3654 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
3655 (khtml::RenderBlock::MarginInfo::setMargin):
3656 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
3657 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
3658 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
3659 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
3660 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
3661 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
3662 (khtml::RenderBlock::MarginInfo::quirkContainer):
3663 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
3664 (khtml::RenderBlock::MarginInfo::topQuirk):
3665 (khtml::RenderBlock::MarginInfo::bottomQuirk):
3666 (khtml::RenderBlock::MarginInfo::posMargin):
3667 (khtml::RenderBlock::MarginInfo::negMargin):
3668 (khtml::RenderBlock::MarginInfo::margin):
3669 * khtml/rendering/render_box.cpp:
3670 (RenderBox::calcAbsoluteVertical):
3671 * khtml/rendering/render_box.h:
3672 (khtml::RenderBox::marginTop):
3673 (khtml::RenderBox::marginBottom):
3674 (khtml::RenderBox::marginLeft):
3675 (khtml::RenderBox::marginRight):
3676 * khtml/rendering/render_image.cpp:
3677 (RenderImage::setImage):
3678 * khtml/rendering/render_object.cpp:
3679 (RenderObject::sizesToMaxWidth):
3680 * khtml/rendering/render_object.h:
3681 (khtml::RenderObject::collapsedMarginTop):
3682 (khtml::RenderObject::collapsedMarginBottom):
3683 (khtml::RenderObject::maxTopMargin):
3684 (khtml::RenderObject::maxBottomMargin):
3685 (khtml::RenderObject::marginTop):
3686 (khtml::RenderObject::marginBottom):
3687 (khtml::RenderObject::marginLeft):
3688 (khtml::RenderObject::marginRight):
3689 * khtml/rendering/render_text.h:
3690 (khtml::RenderText::marginLeft):
3691 (khtml::RenderText::marginRight):
3692 * khtml/xml/dom_elementimpl.cpp:
3693 (ElementImpl::recalcStyle):
3695 2004-10-12 Ken Kocienda <kocienda@apple.com>
3701 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
3703 * khtml/editing/selection.cpp:
3704 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
3705 This will make it seem like the run ends on the next line.
3707 2004-10-12 Ken Kocienda <kocienda@apple.com>
3713 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
3715 * khtml/editing/htmlediting.cpp:
3716 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
3717 row, section, or column.
3718 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
3719 of table structure when doing deletes, rather than deleting the structure elements themselves.
3720 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
3721 of table structure. We may want to revisit this some day, but this seems like the best behavior
3723 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
3725 * khtml/editing/htmlediting.h: Add declarations for new functions.
3727 2004-10-12 Richard Williamson <rjw@apple.com>
3729 Fixed access to DOM object via WebScriptObject API.
3730 The execution context for DOM objects wasn't being found.
3731 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
3734 Fixed <rdar://problem/3831063> regions use left offset instead of top offset
3737 * khtml/khtml_part.h:
3738 * khtml/rendering/render_object.cpp:
3739 (RenderObject::addDashboardRegions):
3741 (-[DOMNode isContentEditable]):
3742 (-[DOMNode KJS::Bindings::]):
3743 * kwq/KWQKHTMLPart.h:
3744 * kwq/KWQKHTMLPart.mm:
3745 (KWQKHTMLPart::executionContextForDOM):
3747 2004-10-12 Ken Kocienda <kocienda@apple.com>
3753 <rdar://problem/3834779> Mail crashes when editing HTML message - khtml::Selection::layout()
3755 * kwq/KWQKHTMLPart.mm:
3756 (KWQKHTMLPart::styleForSelectionStart): Table code seems to be more robust when the call to
3757 insert our style-checking node is done with an appendChild rather than an insertBefore. Note
3758 that this table-related problem was exposed by fixing Selection::layout(), which I did
3759 yesterday. This change simply improves things even more so that we do not crash in the
3760 scenario described in the bug.
3762 2004-10-11 Ken Kocienda <kocienda@apple.com>
3766 This is a partial fix to this bug:
3768 <rdar://problem/3832886> increase quote level on new mail document leads to immediate
3769 crash in caret painting code
3771 To eliminate the bad behavior for good, I have done some investigations in Mail code,
3772 and I have sent a suggested code change on to Grant. Basically, Mail can't add empty
3773 blocks (like blockquote elements used for quoting) to documents without giving those
3774 blocks some content (so they have a height).
3776 I added some other crash protections below.
3778 * khtml/editing/selection.cpp:
3779 (khtml::Selection::layout): Check for non-null position after calls to VisiblePosition, since
3780 the VisiblePosition constructors may fail to find a visible spot in the document. Also, add
3781 a couple position-has-renderer assertion checks.
3782 * kwq/KWQKHTMLPart.mm:
3783 (KWQKHTMLPart::styleForSelectionStart): Take out pos.isNotNull() assertion since VisiblePosition
3784 may not yield a position. This assertion is a holdover from before we had VisiblePosition.
3785 (KWQKHTMLPart::fontForSelection): Rearrange the code a little to deal with possible null results from
3788 2004-10-11 Darin Adler <darin@apple.com>
3792 - fixed <rdar://problem/3834230> empty table can result in division by 0
3794 * khtml/rendering/render_table.cpp: (RenderTableSection::layoutRows):
3795 Added 0 check; rolled in from KDE.
3797 2004-10-11 Darin Adler <darin@apple.com>
3801 - fixed <rdar://problem/3818712> form checkbox value property is read only
3803 The underlying problem was that we were storing two separate values for all
3804 form elements; one for the value property (JavaScript) and the other for the
3805 value attribute (DOM). This is a good idea for text input, but not for other types.
3807 * khtml/html/html_formimpl.h: Changed setValue to take a const DOMString reference.
3808 Added private storesValueSeparateFromAttribute function.
3809 * khtml/html/html_formimpl.cpp:
3810 (DOM::HTMLInputElementImpl::setType): Handle type changes, including detaching and re-attaching
3811 if type changed, and moving value from m_value to ATTR_VALUE and vice versa.
3812 (DOM::HTMLInputElementImpl::type): Added a case for ISINDEX and moved the default out of the
3813 switch so that we will get a warning if a type is left out.
3814 (DOM::HTMLInputElementImpl::parseHTMLAttribute): Tweaked comment format.
3815 (DOM::HTMLInputElementImpl::reset): Changed to only nuke the value if the value property is stored
3816 separately from the attribute. Otherwise, we just want to lave it alone
3817 (DOM::HTMLInputElementImpl::value): Changed to always use m_value if it's not null, then fall back
3818 on the attribute, and finally fall back to the "on" for the checkbox only if both are null.
3819 (DOM::HTMLInputElementImpl::setValue): Changed to set the attribute unless the value property is
3820 supposed to be stored separate from the attribute.
3821 (DOM::HTMLInputElementImpl::storesValueSeparateFromAttribute): Added. Returns true for text-type
3822 input elements, and false for the others.
3824 2004-10-11 Darin Adler <darin@apple.com>
3828 - fixed <rdar://problem/3296652> checkbox input type does not respond to onchange
3830 * khtml/rendering/render_form.cpp:
3831 (RenderFormElement::updateFromElement): Some new code, commented out, for form element colors.
3832 (RenderCheckBox::slotStateChanged): Added call to onChange.
3834 2004-10-11 Ken Kocienda <kocienda@apple.com>
3838 Finish selection affinity implementation. This includes code to set the
3839 affinity correctly when clicking with the mouse, and clearing the
3840 affinity when altering the selection using any of the Selection object
3843 Each instance of the positionForCoordinates, inlineBox and caretRect
3844 functions have been changed to include an EAffinity argument to give results
3845 which take this bit into account.
3847 * khtml/editing/selection.cpp:
3848 (khtml::Selection::init): Default affinity is now UPSTREAM, to match AppKit.
3849 (khtml::Selection::modifyAffinity): New function to compute affinity based on
3850 modification constants.
3851 (khtml::Selection::moveTo): Reset affinity to UPSTREAM.
3852 (khtml::Selection::modifyExtendingRightForward): Ditto.
3853 (khtml::Selection::modifyMovingRightForward): Ditto.
3854 (khtml::Selection::modifyExtendingLeftBackward): Ditto.
3855 (khtml::Selection::modifyMovingLeftBackward): Ditto.