1 2004-12-06 Ken Kocienda <kocienda@apple.com>
5 * khtml/dom/dom_string.cpp:
6 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
7 * khtml/dom/dom_string.h: Ditto.
8 * khtml/editing/htmlediting.cpp:
9 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
10 RebalanceWhitespaceCommand instance.
11 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
12 (khtml::InsertLineBreakCommand::doApply): Ditto.
13 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
14 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
15 (khtml::InsertTextCommand::input): Ditto.
16 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
17 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
18 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
19 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
20 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
21 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
22 * khtml/editing/htmlediting.h: Ditto.
23 (khtml::RebalanceWhitespaceCommand::): Ditto.
25 2004-12-05 Darin Adler <darin@apple.com>
27 - fixed small problem in my check-in from yesterday
30 (positionForEvent): Get location from event without raising exception if it's the wrong type.
31 (clickCountForEvent): Same, for clickCount.
32 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
33 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
34 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
36 2004-12-04 Darin Adler <darin@apple.com>
40 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
42 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
43 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
44 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
46 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
48 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
49 * khtml/rendering/render_form.cpp:
50 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
51 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
52 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
54 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
55 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
56 Added a fixState helper method so the constructors can save code.
58 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
59 and added a third constructor that uses the "current event" from AppKit (used above).
60 (QMouseEvent::fixState): Compute state and click count based on event type.
62 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
64 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
65 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
66 underlying cause in CSS.
68 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
70 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
71 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
73 2004-12-03 Chris Blumenberg <cblu@apple.com>
76 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
77 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
78 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
79 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
81 Reviewed by darin, rjw, kocienda.
83 * khtml/misc/loader.cpp:
84 (CachedObject::~CachedObject):
85 (CachedCSSStyleSheet::checkNotify):
86 (Loader::servePendingRequests):
87 (Loader::slotFinished):
88 (Loader::slotReceivedResponse):
89 (Cache::requestImage):
90 (Cache::requestScript):
91 * khtml/misc/loader.h:
92 (khtml::CachedObject::CachedObject):
93 (khtml::CachedObject::response):
94 (khtml::CachedObject::allData):
95 * kwq/KWQKJobClasses.h:
96 * kwq/KWQKJobClasses.mm:
97 (KIO::TransferJobPrivate::TransferJobPrivate):
98 (KIO::TransferJobPrivate::~TransferJobPrivate):
99 (KIO::TransferJob::TransferJob):
100 (KIO::TransferJob::assembleResponseHeaders):
101 (KIO::TransferJob::retrieveCharset):
102 (KIO::TransferJob::emitResult):
103 (KIO::TransferJob::emitReceivedResponse):
106 (KWQHeaderStringFromDictionary):
107 (KWQCheckCacheObjectStatus):
108 (KWQIsResponseURLEqualToURL):
110 (KWQResponseMIMEType):
111 (KWQCacheObjectExpiresTime):
112 (khtml::CachedObject::setResponse):
113 (khtml::CachedObject::setAllData):
117 * kwq/KWQResourceLoader.mm:
118 (-[KWQResourceLoader finishJobAndHandle:]):
119 (-[KWQResourceLoader cancel]):
120 (-[KWQResourceLoader reportError]):
121 (-[KWQResourceLoader finishWithData:]):
129 * kwq/WebCoreBridge.h:
130 * kwq/WebCoreResourceLoader.h:
132 2004-12-04 Darin Adler <darin@apple.com>
136 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
138 * khtml/rendering/render_form.cpp:
139 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
140 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
141 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
142 (RenderSlider::slotSliderValueChanged): Ditto.
144 2004-12-03 John Sullivan <sullivan@apple.com>
148 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
149 khtml::BackgroundLayer::cullEmptyLayers
151 * khtml/rendering/render_style.cpp:
152 (BackgroundLayer::cullEmptyLayers):
153 added missing nil check
157 2004-12-03 Ken Kocienda <kocienda@apple.com>
161 Roll out some recent changes by Chris that caused a performance regression.
162 Fix is in hand, but it is a little risky this close to a submission. So,
163 we have decided to roll back the change with the regression and roll in
164 the new code after we submit.
166 * khtml/css/cssproperties.c:
169 * khtml/css/cssvalues.c:
172 * khtml/misc/htmlattrs.c:
175 * khtml/misc/htmltags.c:
178 * khtml/misc/loader.cpp:
179 (CachedObject::~CachedObject):
180 (CachedObject::setResponse):
181 (CachedCSSStyleSheet::checkNotify):
182 (Loader::servePendingRequests):
183 (Loader::slotFinished):
184 (Loader::slotReceivedResponse):
185 (Cache::requestImage):
186 (Cache::requestScript):
187 * khtml/misc/loader.h:
188 (khtml::CachedObject::CachedObject):
189 (khtml::CachedObject::response):
190 * kwq/KWQKJobClasses.h:
191 * kwq/KWQKJobClasses.mm:
192 (KIO::TransferJobPrivate::TransferJobPrivate):
193 (KIO::TransferJobPrivate::~TransferJobPrivate):
194 (KIO::TransferJob::TransferJob):
195 (KIO::TransferJob::assembleResponseHeaders):
196 (KIO::TransferJob::retrieveCharset):
197 (KIO::TransferJob::emitResult):
198 (KIO::TransferJob::emitReceivedResponse):
201 (KWQHeaderStringFromDictionary):
202 (KWQCheckCacheObjectStatus):
204 (KWQReleaseResponse):
205 (KWQIsResponseURLEqualToURL):
207 (KWQResponseMIMEType):
208 (KWQResponseTextEncodingName):
209 (KWQResponseHeaderString):
210 (KWQCacheObjectExpiresTime):
211 (KWQLoader::KWQLoader):
215 * kwq/KWQResourceLoader.mm:
216 (-[KWQResourceLoader finishJobAndHandle]):
217 (-[KWQResourceLoader cancel]):
218 (-[KWQResourceLoader reportError]):
219 (-[KWQResourceLoader finish]):
227 * kwq/WebCoreBridge.h:
228 * kwq/WebCoreResourceLoader.h:
230 2004-12-03 John Sullivan <sullivan@apple.com>
234 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
236 * kwq/KWQKHTMLPart.mm:
237 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
238 when checking whether we moved the focus to another view, make sure we didn't "move" it to
239 our documentView, because that's no move at all.
241 2004-12-03 Darin Adler <darin@apple.com>
245 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
247 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
248 Added missing initialization for base class and node pointer.
250 - fixed a few places that could leave dangling node pointers
252 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
253 Clear out the node pointer when the node is destroyed.
254 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
256 2004-12-03 Chris Blumenberg <cblu@apple.com>
258 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.
259 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
263 * khtml/misc/loader.cpp:
264 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
265 (Loader::slotFinished): take data param
266 * khtml/misc/loader.h:
267 * kwq/KWQKJobClasses.h:
268 * kwq/KWQKJobClasses.mm:
269 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
270 (KIO::TransferJob::emitResult): take data param and pass it
271 * kwq/KWQResourceLoader.mm:
272 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
273 (-[KWQResourceLoader cancel]): pass nil for data
274 (-[KWQResourceLoader reportError]): ditto
275 (-[KWQResourceLoader finishWithData:]): pass data
277 (KWQSlot::KWQSlot): pass data param to slotFinished
278 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
280 2004-12-03 Ken Kocienda <kocienda@apple.com>
284 Did some clean up in the Position class as a result of trying to write some new layout
285 tests and discovering a bug along the way.
287 I removed these three functions from the Position class:
289 1. bool isFirstRenderedPositionOnLine() const;
290 2. bool isLastRenderedPositionOnLine() const;
291 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
292 4. bool inFirstEditableInRootEditableElement() const;
294 The first two have replacements in the VisiblePosition class, and some code has been
295 moved to use these new variants. The third function was a helper used only by these
296 first two function, and can be removed as well. The fourth function was not used by anyone.
298 * khtml/editing/htmlediting.cpp:
299 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
300 * khtml/editing/visible_position.cpp:
301 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
302 Incorrect results were being returned when asking about positions at the starts of blocks.
303 * khtml/xml/dom_position.cpp:
304 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
305 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
306 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
307 * khtml/xml/dom_position.h: Update header for deletions.
309 2004-12-03 Ken Kocienda <kocienda@apple.com>
313 Terminology change in execCommand command identifiers. Specifically, the name of
314 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
315 terminology used by AppKit. It is also more accurate, since the insertion of a
316 "br" element is what the command does. The inspiration for this change is so the
317 -insertNewline AppKit method can be mapped to insert a new "div" element in
318 a document and avoid ambiguity with what the javascript editing command does.
320 * khtml/editing/jsediting.cpp
321 * layout-tests/editing/deleting/delete-tab-004.html
322 * layout-tests/editing/editing.js
323 * layout-tests/editing/inserting/insert-3654864-fix.html
324 * layout-tests/editing/inserting/insert-3659587-fix.html
325 * layout-tests/editing/inserting/insert-3775316-fix.html
326 * layout-tests/editing/inserting/insert-3800346-fix.html
327 * layout-tests/editing/inserting/insert-br-001.html
328 * layout-tests/editing/inserting/insert-br-002.html
329 * layout-tests/editing/inserting/insert-br-003.html
330 * layout-tests/editing/inserting/insert-br-004.html
331 * layout-tests/editing/inserting/insert-br-005.html
332 * layout-tests/editing/inserting/insert-br-006.html
333 * layout-tests/editing/inserting/insert-br-007.html
334 * layout-tests/editing/inserting/insert-br-008.html
335 * layout-tests/editing/inserting/insert-tab-004.html
336 * layout-tests/editing/inserting/insert-text-with-newlines.html
337 * layout-tests/editing/pasteboard/paste-text-010.html
339 2004-12-02 Ken Kocienda <kocienda@apple.com>
345 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
347 * khtml/editing/htmlediting.cpp:
348 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
349 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
350 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
351 in a block and the document is in quirks mode, add an additional br to make the one in the
352 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
353 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
354 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
356 2004-12-02 Richard Williamson <rjw@apple.com>
358 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
360 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
361 the b/f cache won't incorrectly trash the previous state when restoring.
365 * kwq/WebCoreBridge.h:
366 * kwq/WebCoreBridge.mm:
367 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
368 (-[WebCoreBridge canCachePage]):
369 (-[WebCoreBridge clear]):
371 2004-12-02 Ken Kocienda <kocienda@apple.com>
377 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
379 * khtml/xml/dom2_rangeimpl.cpp:
380 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
381 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
382 of this bug where there is content after the body tag). Did a little code clean up as well.
383 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
385 2004-12-02 Ken Kocienda <kocienda@apple.com>
391 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
393 * khtml/khtml_part.cpp:
394 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
395 to figure out which end of the selection to extend.
397 2004-12-02 David Harrison <harrison@apple.com>
399 Reviewed by Ken Kocienda.
401 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
402 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
404 * khtml/editing/visible_text.cpp:
405 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
406 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
407 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
408 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
409 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
410 Distinguish BR from whitespace.
411 * khtml/editing/visible_text.h:
412 Distinguish BR from whitespace.
413 * khtml/editing/visible_units.cpp:
414 (khtml::previousWordBoundary):
415 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.
417 2004-12-02 Ken Kocienda <kocienda@apple.com>
423 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
425 * khtml/xml/dom_position.cpp:
426 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
427 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
428 exception trying to use a Position returned from this function to set the boundary point of a Range (which
429 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
430 contract to return a range-compliant position, hence the need for this fix.
432 2004-12-01 Ken Kocienda <kocienda@apple.com>
438 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
439 regard to other editing commands. The class had a name change ages ago, and it was never
441 * khtml/editing/htmlediting.h: Ditto.
443 2004-12-01 Ken Kocienda <kocienda@apple.com>
447 Some improvements for paste, including some new code to annotate
448 whitespace when writing to the pasteboard to ensure that the meaning
449 of the markup on the pasteboard is unambiguous.
451 There is also new code for reading this annotated markup from the pasteboard,
452 removing the nodes that were added only to prevent ambiguity.
454 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
455 The header should have been added earlier, but I did not do so.
456 * khtml/editing/html_interchange.cpp: Added.
457 (convertHTMLTextToInterchangeFormat):
458 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
459 * khtml/editing/htmlediting.cpp:
460 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
461 Also fixed a bug in the code that counts blocks in a fragment.
462 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
463 (khtml::ReplacementFragment::insertNodeBefore): New helper.
464 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
465 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
466 * khtml/editing/htmlediting.h: Add some new declarations.
467 * khtml/xml/dom2_rangeimpl.cpp:
468 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
469 * khtml/xml/dom_nodeimpl.cpp:
470 (NodeImpl::stringValueForRange): New helper.
471 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
472 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
473 should be added. Called by the paste code.
474 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
476 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
477 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
478 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
480 2004-11-30 Chris Blumenberg <cblu@apple.com>
482 * ChangeLog: removed conflict marker
484 2004-11-30 Chris Blumenberg <cblu@apple.com>
487 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
488 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
492 * khtml/misc/loader.cpp:
493 (CachedObject::~CachedObject): release m_allData
494 (CachedObject::setAllData): new
495 (Loader::servePendingRequests): connect slotAllData
496 (Loader::slotAllData): new
497 (Cache::requestImage): tweak
498 * khtml/misc/loader.h:
499 (khtml::CachedObject::CachedObject): set allData to 0
500 (khtml::CachedObject::allData): new
501 * kwq/KWQKJobClasses.h:
502 * kwq/KWQKJobClasses.mm:
503 (KIO::TransferJob::TransferJob): set m_allData
504 (KIO::TransferJob::emitAllData): new
506 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
507 * kwq/KWQResourceLoader.mm:
508 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
510 (KWQSlot::KWQSlot): support for slotAllData
512 * kwq/WebCoreBridge.h:
513 * kwq/WebCoreResourceLoader.h:
515 2004-11-30 Maciej Stachowiak <mjs@apple.com>
519 2004-11-30 Maciej Stachowiak <mjs@apple.com>
523 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
525 * khtml/khtml_part.cpp:
526 (KHTMLPart::begin): call setParsing on document here after opening
527 - from now on we'll only set parsing to true for a document open
528 caused by page loading, not a programmatic one.
529 * khtml/xml/dom_docimpl.cpp:
530 (DocumentImpl::open): don't setParsing to true here any more.
532 2004-11-30 Maciej Stachowiak <mjs@apple.com>
536 - fix recent regression from collection perf fixes.
538 * khtml/html/html_miscimpl.cpp:
539 (HTMLFormCollectionImpl::updateNameCache): Look up the name
540 attribute in the name cache, not the id cache (d'oh!)
542 2004-11-30 Darin Adler <darin@apple.com>
546 - rolled in a KDE fix for a problem that may underlie a number of crashes
548 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
549 the KDE guys to fix a subtle problem. Code said "n = n =".
551 - rolled in a KDE fix for a containingBlock crash
553 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
554 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
557 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
560 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
561 (-[KWQButton detachQButton]): Added.
562 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
563 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
564 (-[KWQButton widget]): Added.
565 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
566 (-[KWQButton resignFirstResponder]): Ditto.
567 (-[KWQButton canBecomeKeyView]): Ditto.
568 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
569 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
571 * kwq/KWQComboBox.mm:
572 (QComboBox::~QComboBox): Call detachQComboBox.
573 (-[KWQPopUpButtonCell detachQComboBox]): Added.
574 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
575 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
576 (-[KWQPopUpButton action:]): Ditto.
577 (-[KWQPopUpButton widget]): Tweaked.
578 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
579 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
580 (-[KWQPopUpButton resignFirstResponder]): Ditto.
581 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
583 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
586 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
588 * kwq/KWQScrollBar.h: Removed m_scroller field.
589 * kwq/KWQScrollBar.mm:
590 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
591 (-[KWQScrollBar detachQScrollBar]): Added.
592 (-[KWQScrollBar widget]): Added.
593 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
594 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
595 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
596 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
597 (QScrollBar::setKnobProportion): Ditto.
598 (QScrollBar::scrollbarHit): Ditto.
600 * kwq/KWQScrollView.mm:
601 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
602 hack where we don't remove right away when doing mouse tracking.
603 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
604 the hack where we don't add right away when doing mouse tracking.
606 * kwq/KWQSlider.h: Added destructor.
608 (-[KWQSlider initWithQSlider:]): Tweaked a little.
609 (-[KWQSlider detachQSlider]): Added.
610 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
611 (-[KWQSlider widget]): Added.
612 (QSlider::~QSlider): Added. Calls detachQSlider.
614 * kwq/KWQTextArea.h: Added detachQTextEdit method.
615 * kwq/KWQTextArea.mm:
616 (-[KWQTextArea detachQTextEdit]): Added.
617 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
618 (-[KWQTextArea becomeFirstResponder]): Ditto.
619 (-[KWQTextArea nextKeyView]): Ditto.
620 (-[KWQTextArea previousKeyView]): Ditto.
621 (-[KWQTextArea drawRect:]): Ditto.
622 (-[KWQTextAreaTextView insertTab:]): Ditto.
623 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
624 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
625 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
626 (-[KWQTextAreaTextView mouseDown:]): Ditto.
627 (-[KWQTextAreaTextView keyDown:]): Ditto.
628 (-[KWQTextAreaTextView keyUp:]): Ditto.
630 * kwq/KWQTextEdit.h: Added ~QTextEdit.
631 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
633 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
634 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
636 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
637 Added beforeMouseDown and afterMouseDown for use in widget implementations.
638 Removed unused hasMouseTracking function.
640 (QWidget::QWidget): Initialize two new fields.
641 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
642 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
643 (QWidget::addToSuperview): Added.
644 (QWidget::removeFromSuperview): Added.
645 (QWidget::beforeMouseDown): Added.
646 (QWidget::afterMouseDown): Added.
648 * khtml/rendering/render_layer.cpp:
649 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
650 (RenderLayer::setHasVerticalScrollbar): Ditto.
652 2004-11-30 Ken Kocienda <kocienda@apple.com>
658 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
660 * khtml/khtml_part.cpp:
661 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
662 with no blink if it is.
664 2004-11-30 Ken Kocienda <kocienda@apple.com>
670 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
672 * khtml/khtml_part.cpp:
673 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
674 or <input type=image> was checked for focus since these elements are keyboard-focusable,
675 but not mouse focusable. Also, this function did not work hard enough to set the focused
676 node, and was content to clear it if the first element checked failed the test, rather
677 than looking more at parents. This would have the effect of clearing, then resetting the
678 focus on a DIV containing a button or image with content on either side of it in the
679 process of arrowing over such content.
681 2004-11-30 Ken Kocienda <kocienda@apple.com>
685 * khtml/editing/htmlediting.cpp:
686 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
687 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
688 * khtml/khtml_part.cpp:
689 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
690 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
691 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
692 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
693 isCharacterSmartReplaceExempt virtual.
695 2004-11-30 Ken Kocienda <kocienda@apple.com>
699 * khtml/editing/htmlediting.cpp:
700 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
701 Seemed simple enough to land without review.
703 2004-11-29 Ken Kocienda <kocienda@apple.com>
707 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
708 are handled correctly now, including selections that span multiple blocks, and cases
709 where content on the pasteboard ends in newlines (or what appear to be newlines to a
710 user, really block ends or BRs). I also made one small, but important change in the
711 copy code to annotate the markup written to the pasteboard to support these selections
714 New header that defines a couple of constants used in copying and pasting.
716 * ForwardingHeaders/editing/html_interchange.h: Added.
717 * khtml/editing/html_interchange.h: Added.
719 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
720 as a new helper class, ReplacementFragment, which encapsulates information and functions
721 pertaining to a document fragment that is being inserted into a document.
723 * khtml/editing/htmlediting.cpp:
724 (khtml::ReplacementFragment::ReplacementFragment):
725 (khtml::ReplacementFragment::~ReplacementFragment):
726 (khtml::ReplacementFragment::firstChild): Simple accessor.
727 (khtml::ReplacementFragment::lastChild): Ditto.
728 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
729 the starting node to use for merging into the block containing the start of the selection.
730 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
731 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
732 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
733 special annotation comment added in by the copy code.
734 (khtml::ReplacementFragment::removeNode): Simple helper.
735 (khtml::isComment): Simple helper.
736 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
737 I would like to do better than this some day, but this check will hold us until I can do better.
738 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
739 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
740 (khtml::ReplaceSelectionCommand::doApply):
741 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
742 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
743 (khtml::ReplacementFragment::root):
744 (khtml::ReplacementFragment::type):
745 (khtml::ReplacementFragment::isEmpty):
746 (khtml::ReplacementFragment::isSingleTextNode):
747 (khtml::ReplacementFragment::isTreeFragment):
748 (khtml::ReplacementFragment::hasMoreThanOneBlock):
749 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
751 This smaller set of changes markup generation to add the newline annotation described in the
752 comment at the start of this entry.
754 * khtml/xml/dom2_rangeimpl.cpp:
755 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
756 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
757 comment annotations are added to the markup generated.
758 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
759 * kwq/WebCoreBridge.mm:
760 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
761 DOM::RangeImpl::toHTML uses annotations when generating.
765 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
766 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
767 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
768 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
769 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
770 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
771 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
772 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
773 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
774 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
775 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
776 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
777 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
778 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
779 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
780 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
781 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
782 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
784 2004-11-29 Ken Kocienda <kocienda@apple.com>
788 Made two small changes that make it possible for comments to have DOM nodes made for them
789 when pasting. This relies on some earlier work I did some days ago.
791 * khtml/xml/dom_nodeimpl.cpp:
792 (NodeImpl::startMarkup): Get the string from the comment.
793 * kwq/WebCoreBridge.mm:
794 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
795 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
796 be included in the DOM.
798 2004-11-29 Ken Kocienda <kocienda@apple.com>
802 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
803 my improved paste code.
805 * khtml/editing/visible_position.cpp:
806 (khtml::blockRelationship)
807 (khtml::visiblePositionsInDifferentBlocks)
808 (khtml::isFirstVisiblePositionInBlock)
809 (khtml::isFirstVisiblePositionInNode)
810 (khtml::isLastVisiblePositionInBlock)
811 * khtml/editing/visible_position.h
813 2004-11-29 Ken Kocienda <kocienda@apple.com>
817 * khtml/xml/dom_position.cpp:
818 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
819 specified from obeying that directive. The old code would stop at an outer block boundary in
820 the case where that block had a block as its first child. The correct behavior is to drill into
821 that inner block (and continue on drilling down, if possible), to find the correct position.
823 2004-11-29 Ken Kocienda <kocienda@apple.com>
827 Small improvements to the node-display debugging helpers.
829 * khtml/xml/dom_nodeimpl.cpp:
830 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
831 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
833 2004-11-29 Ken Kocienda <kocienda@apple.com>
837 * khtml/editing/htmlediting.cpp:
838 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
839 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
840 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
841 place after the delete.
843 2004-11-29 Ken Kocienda <kocienda@apple.com>
847 Add a new helper function to insert a paragraph separator. Will be used in my
848 upcoming paste improvments.
850 * khtml/editing/htmlediting.cpp: Added function
851 (khtml::CompositeEditCommand::insertParagraphSeparator)
852 * khtml/editing/htmlediting.h: Ditto.
854 2004-11-23 David Harrison <harrison@apple.com>
856 Added various comments.
858 * khtml/editing/htmlediting.cpp:
859 (khtml::StyleChange::init):
860 (khtml::ApplyStyleCommand::doApply):
861 (khtml::ApplyStyleCommand::applyBlockStyle):
862 (khtml::ApplyStyleCommand::applyInlineStyle):
864 2004-11-23 David Hyatt <hyatt@apple.com>
866 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
867 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
869 * khtml/rendering/render_block.cpp:
870 (khtml::RenderBlock::nodeAtPoint):
872 2004-11-22 David Hyatt <hyatt@apple.com>
874 Make sure you can use document.createElement to make a <canvas> element.
876 * khtml/xml/dom_docimpl.cpp:
877 (DocumentImpl::createHTMLElement):
879 2004-11-22 Maciej Stachowiak <mjs@apple.com>
883 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
884 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
885 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
886 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
888 * khtml/ecma/kjs_html.cpp:
889 (KJS::HTMLDocument::tryGet):
890 * khtml/html/html_formimpl.cpp:
891 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
892 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
893 * khtml/html/html_formimpl.h:
894 * khtml/html/html_miscimpl.cpp:
895 (HTMLCollectionImpl::HTMLCollectionImpl):
896 (HTMLCollectionImpl::~HTMLCollectionImpl):
897 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
898 (HTMLCollectionImpl::CollectionInfo::reset):
899 (HTMLCollectionImpl::resetCollectionInfo):
900 (HTMLCollectionImpl::checkForNameMatch):
902 (HTMLCollectionImpl::updateNameCache):
903 (HTMLCollectionImpl::namedItems):
904 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
905 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
906 (HTMLFormCollectionImpl::item):
907 (HTMLFormCollectionImpl::updateNameCache):
908 * khtml/html/html_miscimpl.h:
910 2004-11-22 David Hyatt <hyatt@apple.com>
912 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
917 * khtml/misc/loader.cpp:
918 (CachedObject::finish):
921 * khtml/misc/loader.h:
922 (khtml::Cache::maxCacheableObjectSize):
924 2004-11-22 David Hyatt <hyatt@apple.com>
926 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
927 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
928 that lets us short circuit earlier when painting and hit testing.
932 * khtml/khtml_part.cpp:
933 (KHTMLPart::isPointInsideSelection):
934 * khtml/rendering/render_block.cpp:
935 (khtml::RenderBlock::paint):
936 (khtml::RenderBlock::paintChildren):
937 (khtml::RenderBlock::paintObject):
938 (khtml::RenderBlock::paintFloats):
939 (khtml::RenderBlock::nodeAtPoint):
940 * khtml/rendering/render_block.h:
941 * khtml/rendering/render_box.cpp:
942 (RenderBox::nodeAtPoint):
943 * khtml/rendering/render_box.h:
944 * khtml/rendering/render_br.h:
945 * khtml/rendering/render_canvas.cpp:
946 (RenderCanvas::paint):
947 * khtml/rendering/render_flow.cpp:
948 (RenderFlow::paintLines):
949 (RenderFlow::hitTestLines):
950 (RenderFlow::caretRect):
951 (RenderFlow::addFocusRingRects):
952 (RenderFlow::paintFocusRing):
953 (RenderFlow::paintOutlines):
954 (RenderFlow::paintOutlineForLine):
955 * khtml/rendering/render_flow.h:
956 * khtml/rendering/render_frames.cpp:
957 (RenderFrameSet::nodeAtPoint):
958 * khtml/rendering/render_frames.h:
959 * khtml/rendering/render_image.cpp:
960 (RenderImage::nodeAtPoint):
961 * khtml/rendering/render_image.h:
962 * khtml/rendering/render_inline.cpp:
963 (RenderInline::paint):
964 (RenderInline::nodeAtPoint):
965 * khtml/rendering/render_inline.h:
966 * khtml/rendering/render_layer.cpp:
967 (RenderLayer::paintLayer):
968 (RenderLayer::hitTest):
969 (RenderLayer::hitTestLayer):
970 * khtml/rendering/render_layer.h:
971 * khtml/rendering/render_line.cpp:
972 (khtml::InlineBox::paint):
973 (khtml::InlineBox::nodeAtPoint):
974 (khtml::InlineFlowBox::flowObject):
975 (khtml::InlineFlowBox::nodeAtPoint):
976 (khtml::InlineFlowBox::paint):
977 (khtml::InlineFlowBox::paintBackgrounds):
978 (khtml::InlineFlowBox::paintBackground):
979 (khtml::InlineFlowBox::paintBackgroundAndBorder):
980 (khtml::InlineFlowBox::paintDecorations):
981 (khtml::EllipsisBox::paint):
982 (khtml::EllipsisBox::nodeAtPoint):
983 (khtml::RootInlineBox::paintEllipsisBox):
984 (khtml::RootInlineBox::paint):
985 (khtml::RootInlineBox::nodeAtPoint):
986 * khtml/rendering/render_line.h:
987 (khtml::InlineRunBox::paintBackgroundAndBorder):
988 * khtml/rendering/render_object.cpp:
989 (RenderObject::hitTest):
990 (RenderObject::setInnerNode):
991 (RenderObject::nodeAtPoint):
992 * khtml/rendering/render_object.h:
993 (khtml::RenderObject::PaintInfo::PaintInfo):
994 (khtml::RenderObject::PaintInfo::~PaintInfo):
995 (khtml::RenderObject::paintingRootForChildren):
996 (khtml::RenderObject::shouldPaintWithinRoot):
997 * khtml/rendering/render_table.cpp:
998 (RenderTable::layout):
999 (RenderTable::paint):
1000 * khtml/rendering/render_text.cpp:
1001 (simpleDifferenceBetweenColors):
1002 (correctedTextColor):
1003 (InlineTextBox::nodeAtPoint):
1004 (InlineTextBox::paint):
1005 (InlineTextBox::selectionStartEnd):
1006 (InlineTextBox::paintSelection):
1007 (InlineTextBox::paintMarkedTextBackground):
1008 (InlineTextBox::paintDecoration):
1009 (RenderText::posOfChar):
1010 * khtml/rendering/render_text.h:
1011 (khtml::RenderText::paint):
1012 (khtml::RenderText::layout):
1013 (khtml::RenderText::nodeAtPoint):
1014 * khtml/xml/dom2_eventsimpl.cpp:
1015 (MouseEventImpl::computeLayerPos):
1016 * khtml/xml/dom_docimpl.cpp:
1017 (DocumentImpl::prepareMouseEvent):
1018 * kwq/KWQAccObject.mm:
1019 (-[KWQAccObject accessibilityHitTest:]):
1020 * kwq/KWQKHTMLPart.mm:
1021 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1022 (KWQKHTMLPart::eventMayStartDrag):
1023 (KWQKHTMLPart::khtmlMouseMoveEvent):
1024 * kwq/WebCoreBridge.mm:
1025 (-[WebCoreBridge elementAtPoint:]):
1026 (-[WebCoreBridge _positionForPoint:]):
1028 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1032 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1033 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1035 This avoids the O(N^2) penalty for named item traversal for form collections.
1037 It also combines the item traversal logic for all non-form
1038 collection operations into a single traverseNextItem
1039 function. This avoids having 5 copies of the big switch statement
1042 Also fixed a bug that prevented the last form element from being removed properly.
1044 * khtml/html/html_formimpl.cpp:
1045 (DOM::removeFromVector):
1046 * khtml/dom/html_misc.cpp:
1047 (HTMLCollection::namedItems):
1048 * khtml/dom/html_misc.h:
1049 * khtml/ecma/kjs_html.cpp:
1050 (KJS::HTMLCollection::getNamedItems):
1051 * khtml/html/html_miscimpl.cpp:
1052 (HTMLCollectionImpl::traverseNextItem):
1053 (HTMLCollectionImpl::calcLength):
1054 (HTMLCollectionImpl::length):
1055 (HTMLCollectionImpl::item):
1056 (HTMLCollectionImpl::nextItem):
1057 (HTMLCollectionImpl::checkForNameMatch):
1058 (HTMLCollectionImpl::namedItem):
1059 (HTMLCollectionImpl::namedItems):
1060 (HTMLCollectionImpl::nextNamedItem):
1061 (HTMLFormCollectionImpl::calcLength):
1062 (HTMLFormCollectionImpl::namedItem):
1063 (HTMLFormCollectionImpl::nextNamedItem):
1064 (HTMLFormCollectionImpl::namedItems):
1065 * khtml/html/html_miscimpl.h:
1067 2004-11-22 Ken Kocienda <kocienda@apple.com>
1069 Reviewed by Harrison
1071 Change around the way we block the Javascript "Paste" command identifier from
1072 being available. Formerly, this was done with an ifdef we never compiled in.
1073 Now, this is done with a couple of cheap runtime checks. The advantage is that
1074 we can now compile this command into development builds, and still yet switch
1075 on the command in deployment builds through the use of WebCore SPI so we can
1076 write and run layout tests with all of our builds.
1078 * khtml/editing/jsediting.cpp:
1079 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1080 command being queried is the paste command.
1081 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1082 * khtml/editing/jsediting.h: Ditto.
1083 * khtml/khtml_part.cpp:
1084 (KHTMLPart::pasteFromPasteboard): Added.
1085 (KHTMLPart::canPaste): Added.
1086 * kwq/KWQKHTMLPart.mm:
1087 (KHTMLPart::canPaste): Added.
1088 * kwq/KWQRenderTreeDebug.cpp:
1089 (externalRepresentation): Turn on paste command.
1090 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1092 2004-11-21 Maciej Stachowiak <mjs@apple.com>
1094 Reviewed by Richard.
1096 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1098 * khtml/html/html_miscimpl.cpp:
1099 (HTMLCollectionImpl::calcLength):
1100 (HTMLCollectionImpl::getItem):
1101 (HTMLCollectionImpl::item):
1102 (HTMLCollectionImpl::nextItem):
1103 (HTMLCollectionImpl::getNamedItem):
1104 (HTMLCollectionImpl::namedItem):
1105 (HTMLCollectionImpl::nextNamedItemInternal):
1106 (HTMLFormCollectionImpl::nextNamedItemInternal):
1108 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1112 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
1113 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
1114 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
1116 Many optimizations to HTMLFormCollection. Iterating it should not
1117 be N^2 any more, though finding items by name could still be.
1119 * khtml/html/html_formimpl.cpp:
1120 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1121 (DOM::HTMLFormElementImpl::length):
1122 (DOM::HTMLFormElementImpl::submitClick):
1123 (DOM::HTMLFormElementImpl::formData):
1124 (DOM::HTMLFormElementImpl::submit):
1125 (DOM::HTMLFormElementImpl::reset):
1126 (DOM::HTMLFormElementImpl::radioClicked):
1127 (DOM::appendToVector):
1128 (DOM::removeFromVector):
1129 (DOM::HTMLFormElementImpl::registerFormElement):
1130 (DOM::HTMLFormElementImpl::removeFormElement):
1131 (DOM::HTMLFormElementImpl::makeFormElementDormant):
1132 (DOM::HTMLFormElementImpl::registerImgElement):
1133 (DOM::HTMLFormElementImpl::removeImgElement):
1134 * khtml/html/html_formimpl.h:
1135 * khtml/html/html_miscimpl.cpp:
1136 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
1137 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
1138 (HTMLFormCollectionImpl::resetCollectionInfo):
1139 (HTMLFormCollectionImpl::calcLength):
1140 (HTMLFormCollectionImpl::item):
1141 (HTMLFormCollectionImpl::getNamedItem):
1142 (HTMLFormCollectionImpl::getNamedFormItem):
1143 (HTMLFormCollectionImpl::firstItem):
1144 (HTMLFormCollectionImpl::nextItem):
1145 * khtml/html/html_miscimpl.h:
1146 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1147 * khtml/xml/dom_elementimpl.cpp:
1148 (ElementImpl::setAttribute):
1149 (ElementImpl::setAttributeMap):
1150 * kwq/KWQPtrVector.h:
1151 (QPtrVector::findRef):
1152 * kwq/KWQVectorImpl.h:
1153 * kwq/KWQVectorImpl.mm:
1154 (KWQVectorImpl::findRef):
1155 * kwq/WebCoreBridge.mm:
1156 (-[WebCoreBridge elementWithName:inForm:]):
1157 (-[WebCoreBridge controlsInForm:]):
1159 2004-11-19 David Harrison <harrison@apple.com>
1161 Reviewed by Ken and Darin.
1163 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
1165 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
1166 for the existing style, but in this case (hitting cmd-B with caret at top of
1167 file) there is nothing upstream. Changed this to use the VisiblePosition
1168 deepEquivalent instead.
1170 * khtml/khtml_part.cpp:
1171 (KHTMLPart::computeAndSetTypingStyle):
1175 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1179 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
1181 * khtml/xml/dom_docimpl.cpp:
1182 (DocumentImpl::close): Don't fire the onload handler if there is a
1183 redirect pending. This is a very long-standing bug that was masked
1184 by our previously incorrect redirect logic. It used to be that an
1185 older redirect would always win. Recently we changed things so
1186 that a newer redirect would win, but a script that causes a
1187 redirect would stop parsing once complete (so if there are two
1188 redirects in the same script, the latter wins). However, we should
1189 have also prevented onload in this case. Testing with other
1190 browsers shows that onload handlers do not run at all when there
1191 is a pending redirect.
1193 2004-11-19 Ken Kocienda <kocienda@apple.com>
1195 Reviewed by Harrison
1197 Fix some object lifetime issues in these two commands. This fixes some crashes
1198 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
1200 * khtml/editing/htmlediting.cpp:
1201 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
1202 in the ancestor list. They are not ref'ed when put on list. D'uh.
1203 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
1204 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
1205 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
1207 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
1209 2004-11-19 Ken Kocienda <kocienda@apple.com>
1211 Reviewed by Harrison
1215 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
1217 * khtml/khtml_part.cpp:
1218 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
1219 declaration given the current selection, and then sets the minimum necessary style as the typing
1221 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
1222 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
1224 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
1225 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
1226 * kwq/WebCoreBridge.mm:
1227 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
1228 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
1230 2004-11-18 David Harrison <harrison@apple.com>
1234 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
1235 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
1238 (-[DOMCSSStyleDeclaration setProperty:::]):
1240 2004-11-18 Chris Blumenberg <cblu@apple.com>
1242 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
1246 * kwq/KWQKHTMLPart.mm:
1247 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
1249 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1253 - fix recursive item traversal, use traverseNextNode() instead of
1254 the buggy hand-rolled traversal.
1256 * khtml/xml/dom_nodeimpl.cpp:
1257 (NodeListImpl::recursiveItem):
1259 2004-11-17 Darin Adler <darin@apple.com>
1263 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
1265 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
1266 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
1268 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1269 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
1270 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
1271 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
1272 an entire category of leaks we have been fixing one by one recently
1273 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
1274 stale RenderObject pointer, although I never saw it do that in practice
1275 - implemented the length and item methods for computed styles
1276 - implemented querying additional properties in computed styles (29 more)
1278 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1279 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
1280 take a mutable style.
1281 * khtml/khtml_part.cpp:
1282 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
1283 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
1284 a computed style; also change some types to mutable style.
1285 (updateState): Update iteration of CSSProperty objects in a style declaration to use
1286 the new valuesIterator interface.
1287 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
1288 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
1289 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
1290 including accomodating the exception code that setCssText has now.
1291 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
1292 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
1293 the style attributes really was a change, although it's not an important optimization it's
1294 good to do it right.
1296 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
1297 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
1298 calling it were already removing the old property explicitly, so the code in here to remove
1299 the property again was redundant.
1301 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
1302 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
1303 * khtml/css/css_computedstyle.cpp:
1304 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
1305 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
1306 Before we had no guarantee the object would outlast us.
1307 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1308 exception to NO_MODIFICATION_ALLOWED_ERR.
1309 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1310 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1311 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1312 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1313 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1314 page-break-inside, position, unicode-bidi, widows, z-index.
1315 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1316 exception to NO_MODIFICATION_ALLOWED_ERR.
1317 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1318 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1319 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1320 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1321 CSSMutableStyleDeclarationImpl.
1322 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1323 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1325 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1326 now a separate class rather than a typedef.
1327 * khtml/css/cssparser.h: Ditto.
1329 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1330 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1331 Removed a bunch of redundant stuff from other classes in this file too.
1332 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1333 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1334 (DOM::CSSProperty::operator=): Added.
1335 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1337 * khtml/css/css_valueimpl.cpp:
1338 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1339 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1340 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1341 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1342 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1343 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1344 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1345 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1346 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1347 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1348 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1349 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1350 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1351 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1352 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1353 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1354 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1355 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1356 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1357 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1358 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1359 no styles in the list. Update to use QValueList.
1360 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1361 parameter and set it.
1362 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1363 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1364 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1365 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1366 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1367 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1369 * khtml/css/cssparser.cpp:
1370 (CSSParser::parseValue): Changed to use addParsedProperties.
1371 (CSSParser::parseDeclaration): Ditto.
1372 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1374 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
1375 * khtml/css/cssproperties.c: Regenerated.
1376 * khtml/css/cssproperties.h: Regenerated.
1378 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
1379 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
1381 * khtml/dom/css_value.cpp:
1382 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
1383 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
1384 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
1385 first doing getPropertyCSSValue and then doing cssText.
1386 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
1387 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
1388 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
1389 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
1390 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
1391 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
1392 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
1394 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
1395 * khtml/dom/dom_node.cpp: Ditto.
1397 * khtml/editing/htmlediting.h: Change some types to mutable style.
1398 * khtml/editing/htmlediting.cpp:
1399 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
1400 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
1401 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
1402 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
1403 (khtml::EditCommand::setTypingStyle): Ditto.
1404 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
1405 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
1406 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
1407 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1408 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
1409 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
1410 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
1411 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1412 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1413 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1414 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
1415 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1416 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
1418 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
1419 * khtml/html/html_baseimpl.h: Change type to mutable style.
1420 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
1422 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
1423 class as a base class, and change types to mutable style as needed.
1424 * khtml/html/html_elementimpl.cpp:
1425 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
1426 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
1427 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
1428 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
1429 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
1430 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
1432 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
1435 * khtml/html/html_tableimpl.h: Change types to mutable style.
1436 * khtml/html/html_tableimpl.cpp:
1437 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1438 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
1439 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1441 * khtml/html/htmlparser.cpp:
1442 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
1443 than using an explicit delete to make the node go away, and is required for compatibility with the
1444 changes to the NodeImpl functions.
1445 (KHTMLParser::insertNode): Ditto.
1446 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
1447 the NodeImpl functions.
1449 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
1450 now that there's no need to make the property list explictly.
1453 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
1454 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
1455 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
1457 * khtml/xml/dom_nodeimpl.cpp:
1458 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
1459 function succeeded or not for ownership purposes.
1460 (NodeImpl::replaceChild): Ditto.
1461 (NodeImpl::appendChild): Ditto.
1462 (NodeBaseImpl::insertBefore): Ditto.
1463 (NodeBaseImpl::replaceChild): Ditto.
1464 (NodeBaseImpl::appendChild): Ditto.
1465 (NodeBaseImpl::addChild): Ditto.
1467 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
1468 * WebCore-combined.exp: Regenerated.
1470 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1472 still even more build fixing
1474 * khtml/html/html_miscimpl.cpp:
1475 (HTMLCollectionImpl::resetCollectionInfo):
1477 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1481 * khtml/html/html_miscimpl.cpp:
1482 (HTMLCollectionImpl::resetCollectionInfo):
1484 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1486 Fixed build problem.
1488 * khtml/html/html_miscimpl.h:
1489 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
1491 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1495 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
1497 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
1498 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
1500 This is also a start on fixing 5 other bugs, but those need additional work to make
1501 HTMLFormCollection fast.
1503 * khtml/html/html_documentimpl.h:
1504 (DOM::HTMLDocumentImpl::collectionInfo):
1505 * khtml/html/html_formimpl.cpp:
1506 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1507 (DOM::HTMLFormElementImpl::isURLAttribute):
1508 (DOM::HTMLFormElementImpl::registerImgElement):
1509 (DOM::HTMLFormElementImpl::removeImgElement):
1510 * khtml/html/html_formimpl.h:
1511 * khtml/html/html_imageimpl.cpp:
1512 (HTMLImageElementImpl::HTMLImageElementImpl):
1513 (HTMLImageElementImpl::~HTMLImageElementImpl):
1514 * khtml/html/html_imageimpl.h:
1515 * khtml/html/html_miscimpl.cpp:
1516 (HTMLCollectionImpl::HTMLCollectionImpl):
1517 (HTMLCollectionImpl::~HTMLCollectionImpl):
1518 (HTMLCollectionImpl::updateCollectionInfo):
1519 (HTMLCollectionImpl::length):
1520 (HTMLCollectionImpl::item):
1521 (HTMLCollectionImpl::firstItem):
1522 (HTMLCollectionImpl::nextItem):
1523 (HTMLCollectionImpl::namedItem):
1524 (HTMLCollectionImpl::nextNamedItemInternal):
1525 (HTMLFormCollectionImpl::getNamedFormItem):
1526 * khtml/html/html_miscimpl.h:
1527 (DOM::HTMLCollectionImpl::):
1528 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1529 * khtml/html/htmlparser.cpp:
1530 (KHTMLParser::getElement):
1531 * khtml/xml/dom_docimpl.cpp:
1532 (DocumentImpl::DocumentImpl):
1533 * khtml/xml/dom_docimpl.h:
1534 (DOM::DocumentImpl::incDOMTreeVersion):
1535 (DOM::DocumentImpl::domTreeVersion):
1536 * khtml/xml/dom_nodeimpl.cpp:
1540 2004-11-18 Kevin Decker <kdecker@apple.com>
1544 fixed: <rdar://problem/3841842> getPropertyID expensive
1547 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
1549 2004-11-17 David Hyatt <hyatt@apple.com>
1551 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
1552 and subsequently backed out).
1554 Reviewed by kocienda
1556 * khtml/html/html_baseimpl.cpp:
1557 (HTMLBodyElementImpl::insertedIntoDocument):
1558 * khtml/html/htmltokenizer.cpp:
1559 (khtml::HTMLTokenizer::reset):
1560 (khtml::HTMLTokenizer::scriptHandler):
1561 (khtml::HTMLTokenizer::scriptExecution):
1562 (khtml::HTMLTokenizer::write):
1563 (khtml::HTMLTokenizer::continueProcessing):
1564 (khtml::HTMLTokenizer::timerEvent):
1565 (khtml::HTMLTokenizer::notifyFinished):
1566 * khtml/html/htmltokenizer.h:
1567 * khtml/khtmlview.cpp:
1568 (KHTMLViewPrivate::KHTMLViewPrivate):
1569 (KHTMLViewPrivate::reset):
1571 (KHTMLView::layout):
1572 (KHTMLView::timerEvent):
1573 (KHTMLView::scheduleRelayout):
1574 (KHTMLView::layoutPending):
1575 (KHTMLView::haveDelayedLayoutScheduled):
1576 (KHTMLView::unscheduleRelayout):
1577 * khtml/khtmlview.h:
1578 * khtml/xml/dom_docimpl.cpp:
1579 (DocumentImpl::DocumentImpl):
1580 (DocumentImpl::close):
1581 (DocumentImpl::setParsing):
1582 (DocumentImpl::shouldScheduleLayout):
1583 (DocumentImpl::minimumLayoutDelay):
1584 (DocumentImpl::write):
1585 (DocumentImpl::finishParsing):
1586 (DocumentImpl::stylesheetLoaded):
1587 (DocumentImpl::updateStyleSelector):
1588 * khtml/xml/dom_docimpl.h:
1589 (DOM::DocumentImpl::parsing):
1590 * kwq/KWQDateTime.mm:
1591 (KWQUIEventTime::uiEventPending):
1593 2004-11-17 David Harrison <harrison@apple.com>
1595 Reviewed by Ken Kocienda.
1597 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
1598 Treat null case as meaning no post-move merge is needed.
1600 * khtml/editing/htmlediting.cpp:
1601 (khtml::DeleteSelectionCommand::initializePositionData):
1603 2004-11-17 David Harrison <harrison@apple.com>
1605 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
1606 * khtml/xml/dom_nodeimpl.cpp:
1607 (NodeImpl::displayNode):
1608 (NodeImpl::displayTree):
1609 (NodeBaseImpl::dispatchChildRemovalEvents):
1610 * khtml/xml/dom_nodeimpl.h:
1612 2004-11-16 John Sullivan <sullivan@apple.com>
1614 Reviewed by Richard.
1616 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
1618 * khtml/khtml_part.cpp:
1620 delete the list we created when we're done with it
1622 2004-11-16 Ken Kocienda <kocienda@apple.com>
1626 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
1627 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
1628 QPtrList when the list goes out of scope.
1630 * khtml/editing/htmlediting.cpp:
1631 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
1632 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
1633 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
1634 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1635 No longer set lists to autodelete.
1636 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
1637 Call new derefNodesInList helper.
1638 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
1639 of one before, but now it does.
1641 2004-11-15 David Harrison <harrison@apple.com>
1643 Reviewed by Chris and Darin.
1645 <rdar://problem/3880304> Non-linear performance hit for style changes
1647 * khtml/xml/dom_nodeimpl.cpp:
1648 (NodeImpl::traverseNextNode):
1649 (NodeImpl::traverseNextSibling):
1650 (NodeImpl::traversePreviousNodePostOrder):
1651 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
1652 Add asserts that stayWithin is an ancestor of the returned node.
1654 2004-11-15 Darin Adler <darin@apple.com>
1658 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
1660 * khtml/css/css_computedstyle.cpp:
1661 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
1662 since there's no guarantee it's already ref'd.
1663 * khtml/css/css_valueimpl.cpp:
1664 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
1665 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
1666 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
1667 (CSSStyleDeclarationImpl::merge): Ditto.
1668 (CSSStyleDeclarationImpl::diff): Ditto.
1669 * khtml/editing/htmlediting.cpp:
1670 (khtml::StyleChange::currentlyHasStyle): Ditto.
1671 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1672 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
1673 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
1675 2004-11-15 Darin Adler <darin@apple.com>
1679 Use separate mutable style and computed style types as appropriate.
1680 For now this should have no effect, but it prepares us for refactoring later.
1681 Also remove some unnecessary "DOM::" prefixes and in one case factor out
1684 * khtml/khtml_part.cpp:
1685 (KHTMLPart::typingStyle):
1686 (KHTMLPart::setTypingStyle):
1688 (KHTMLPart::selectionHasStyle):
1689 (KHTMLPart::selectionStartHasStyle):
1690 (KHTMLPart::selectionComputedStyle):
1691 * khtml/khtml_part.h:
1692 * khtml/khtmlpart_p.h:
1694 * khtml/css/css_base.h:
1695 * khtml/css/css_ruleimpl.cpp:
1696 (CSSStyleRuleImpl::setDeclaration):
1697 * khtml/css/css_ruleimpl.h:
1698 (DOM::CSSFontFaceRuleImpl::style):
1699 (DOM::CSSPageRuleImpl::style):
1700 (DOM::CSSStyleRuleImpl::style):
1701 (DOM::CSSStyleRuleImpl::declaration):
1702 * khtml/css/css_valueimpl.h:
1703 (DOM::CSSPrimitiveValueImpl::):
1704 * khtml/css/cssparser.cpp:
1705 (CSSParser::parseValue):
1706 (CSSParser::parseColor):
1707 (CSSParser::parseDeclaration):
1708 (CSSParser::createStyleDeclaration):
1709 * khtml/css/cssparser.h:
1710 * khtml/css/cssstyleselector.cpp:
1711 (khtml::CSSStyleSelector::addMatchedDeclaration):
1712 (khtml::CSSStyleSelector::matchRulesForList):
1713 (khtml::CSSStyleSelector::styleForElement):
1714 (khtml::CSSStyleSelector::applyDeclarations):
1715 * khtml/css/cssstyleselector.h:
1716 * khtml/css/parser.cpp:
1717 * khtml/css/parser.y:
1718 * khtml/dom/css_rule.h:
1719 * khtml/dom/css_stylesheet.h:
1720 * khtml/dom/css_value.h:
1721 * khtml/dom/dom2_views.cpp:
1722 * khtml/xml/dom2_viewsimpl.cpp:
1723 (DOM::AbstractViewImpl::getComputedStyle):
1724 * khtml/xml/dom_docimpl.cpp:
1725 (DocumentImpl::importNode):
1726 (DocumentImpl::setStyleSheet):
1727 * khtml/xml/dom_docimpl.h:
1728 * khtml/xml/dom_xmlimpl.cpp:
1729 (DOM::ProcessingInstructionImpl::setStyleSheet):
1730 * khtml/xml/dom_xmlimpl.h:
1732 * khtml/dom/css_value.cpp:
1733 (DOM::throwException): Added.
1734 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
1735 The real thing is coming with the next change to refactor.
1736 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
1737 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
1739 2004-11-15 Darin Adler <darin@apple.com>
1743 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
1745 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
1746 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
1747 node's attributes changed without sending a misleading childrenChanged call,
1748 but the childrenChanged call can happen at the exact right moment.
1749 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
1750 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
1751 the boolean true is passed in.
1753 * khtml/xml/dom_elementimpl.cpp:
1754 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
1755 (NamedAttrMapImpl::removeAttribute): Ditto.
1757 2004-11-15 John Sullivan <sullivan@apple.com>
1761 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
1762 seen often in Mail and Blot
1764 * khtml/css/css_valueimpl.cpp:
1765 (CSSStyleDeclarationImpl::copyPropertiesInSet):
1766 delete temporary list after we're done using it
1768 2004-11-15 Richard Williamson <rjw@apple.com>
1770 Fixed leak (3879883) that John found. Early return leaked
1775 * khtml/css/css_computedstyle.cpp:
1776 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1778 2004-11-15 Ken Kocienda <kocienda@apple.com>
1784 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
1786 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
1787 EditCommandPtr to its parent, but this caused a a reference cycle in composite
1788 commands as the children held a ref to their parent. Now, the parent variable
1789 is a non-retained reference to an EditCommand *. It would be nice to have a
1790 weak reference to the parent or even override deref in composite commands (but I
1791 can't since deref() is not virtual). However, this should be OK since any
1792 dangling parent pointer is a sign of a bigger object lifetime problem that
1793 would need to be addressed anyway.
1795 * khtml/css/css_valueimpl.cpp:
1796 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
1797 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
1798 just assigning the list variable passed in to the local list variable, or the list will be
1800 * khtml/editing/htmlediting.cpp:
1801 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
1802 (khtml::EditCommand::setEndingSelection): Ditto.
1803 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
1804 Unrelated to the change, but saves some ref's and deref's.
1805 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
1806 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
1807 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
1808 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
1810 2004-11-15 Maciej Stachowiak <mjs@apple.com>
1814 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
1816 * khtml/xml/dom_nodeimpl.cpp:
1817 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
1819 (NodeListImpl::recursiveLength): Adjusted for rename.
1820 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
1821 If the same offset is looked up again, just return it, otherwise, if looking up
1822 a later offset, start at the last item and proceed from there.
1823 (NodeListImpl::itemById): Apply the special document optimization to all
1824 nodes that are either a document or in a document - just walk up to make
1825 sure the node found by ID has the root node as an ancestor.
1826 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
1827 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
1829 2004-11-15 John Sullivan <sullivan@apple.com>
1833 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
1835 * kwq/KWQKHTMLPart.mm:
1836 (KWQKHTMLPart::documentFragmentWithText):
1837 release mutable copy of string after we're done using it
1839 2004-11-14 Kevin Decker <kdecker@apple.com>
1843 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
1845 * khtml/html/html_elementimpl.cpp:
1846 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
1847 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
1849 2004-11-13 Maciej Stachowiak <mjs@apple.com>
1853 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
1855 * khtml/dom/dom_node.cpp:
1856 (NodeList::itemById): New method, just forward to impl.
1857 * khtml/dom/dom_node.h: Prototype it.
1858 * khtml/ecma/kjs_dom.cpp:
1859 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
1860 let the NodeList do it. The NodeList might be able to do it more efficiently.
1861 * khtml/xml/dom_nodeimpl.cpp:
1862 (NodeListImpl::itemById): Optimize for the case where the NodeList
1863 covers the whole document. In this case, just use getElementById,
1864 then check that the element satisfies the list criteria.
1865 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
1866 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
1867 * khtml/xml/dom_nodeimpl.h:
1869 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1873 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
1874 sometimes using a huge bogus length value.
1876 * khtml/xml/dom_nodeimpl.cpp:
1877 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
1879 2004-11-12 Darin Adler <darin@apple.com>
1883 - fixed an infinite loop in that last check-in
1885 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
1886 Added a ++i to the loop so it won't get stuck on the first element in the list.
1888 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1892 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
1894 I fixed this by changing NodeLists to cache their length, but
1895 invalidate it whenever there is a change in the DOM subtree at
1896 which they are rooted. This makes NodeListImpl::recursiveLength()
1897 drop completely off the profile, since we were repeatedly getting
1898 a length for the same NodeList over and over.
1900 * khtml/xml/dom_nodeimpl.cpp:
1901 (NodeImpl::NodeImpl):
1902 (NodeImpl::~NodeImpl):
1903 (NodeImpl::registerNodeList):
1904 (NodeImpl::unregisterNodeList):
1905 (NodeImpl::notifyLocalNodeListsSubtreeModified):
1906 (NodeImpl::notifyNodeListsSubtreeModified):
1907 (NodeImpl::dispatchSubtreeModifiedEvent):
1908 (NodeListImpl::NodeListImpl):
1909 (NodeListImpl::~NodeListImpl):
1910 (NodeListImpl::recursiveLength):
1911 (NodeListImpl::recursiveItem):
1912 (NodeListImpl::rootNodeSubtreeModified):
1913 (ChildNodeListImpl::ChildNodeListImpl):
1914 (ChildNodeListImpl::length):
1915 (ChildNodeListImpl::item):
1916 (TagNodeListImpl::TagNodeListImpl):
1917 (TagNodeListImpl::length):
1918 (TagNodeListImpl::item):
1919 (NameNodeListImpl::NameNodeListImpl):
1920 (NameNodeListImpl::length):
1921 (NameNodeListImpl::item):
1922 * khtml/xml/dom_nodeimpl.h:
1924 2004-11-12 Darin Adler <darin@apple.com>
1928 - various small cleanups
1930 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
1931 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
1933 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
1934 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
1935 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
1936 * khtml/html/htmltokenizer.cpp:
1937 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
1938 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
1940 * khtml/khtml_part.h: Removed docImpl function.
1941 * khtml/khtml_part.cpp: Ditto.
1943 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
1944 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
1946 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
1947 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
1948 part of the change last time, which is why the build broke).
1949 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
1950 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
1951 (KWQKHTMLPart::keyEvent): Ditto.
1952 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
1953 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
1955 2004-11-12 Chris Blumenberg <cblu@apple.com>
1957 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
1961 * kwq/KWQKHTMLPart.mm:
1962 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
1966 2004-11-12 Darin Adler <darin@apple.com>
1970 - fixed a couple places that would not work for XML documents
1972 * khtml/ecma/kjs_window.cpp:
1973 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
1974 is present on the base class.
1975 (WindowFunc::tryCall): More of the same.
1977 2004-11-12 Darin Adler <darin@apple.com>
1979 - land versions of these files generated by the newer gperf
1981 People building on Panther will continue to see these files modified.
1982 A workaround would be to install the newer gperf on our Tiger build machines.
1984 * khtml/css/cssproperties.c: Regenerated.
1985 * khtml/css/cssvalues.c: Regenerated.
1986 * khtml/html/doctypes.cpp: Regenerated.
1987 * khtml/html/kentities.c: Regenerated.
1988 * khtml/misc/htmlattrs.c: Regenerated.
1989 * khtml/misc/htmltags.c: Regenerated.
1990 * kwq/KWQColorData.c: Regenerated.
1992 2004-11-11 Richard Williamson <rjw@apple.com>
1994 Fix build horkage from previous checkin.
1996 * kwq/KWQKHTMLPart.h:
1998 2004-11-11 Darin Adler <darin@apple.com>
2002 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2004 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2006 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2007 * kwq/KWQKHTMLPart.mm:
2008 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2009 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2010 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2011 makes dragging text work again.
2012 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2014 2004-11-11 David Hyatt <hyatt@apple.com>
2016 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2020 * khtml/html/htmltokenizer.cpp:
2021 (khtml::HTMLTokenizer::continueProcessing):
2023 2004-11-11 Ken Kocienda <kocienda@apple.com>
2027 * khtml/editing/htmlediting.cpp:
2028 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2029 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2030 with the prevailing style for the VisiblePosition class.
2031 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2032 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2033 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2034 (khtml::isLastVisiblePositionInBlock): Ditto.
2035 (khtml::isLastVisiblePositionInNode): Ditto.
2036 * khtml/editing/visible_position.h: Add declarations for new functions.
2038 2004-11-11 Ken Kocienda <kocienda@apple.com>
2042 * khtml/editing/htmlediting.cpp:
2043 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2044 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2045 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2046 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2047 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2048 * khtml/xml/dom2_rangeimpl.cpp:
2049 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2050 * khtml/xml/dom2_rangeimpl.h: Ditto.
2052 2004-11-11 Ken Kocienda <kocienda@apple.com>
2054 Reviewed by Harrison
2056 Some improvements to deleting when complete lines are selected.
2058 * khtml/editing/htmlediting.cpp:
2059 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2060 the end of a selection is fully selected. Turn off block merging in this case.
2061 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2062 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2063 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2064 start block is selected. This new code will now delete this block in one call, rather
2065 than iterating over each child.
2066 * khtml/editing/visible_position.cpp:
2067 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2068 to do the work mentioned above in the comment for that function.
2069 (khtml::isFirstVisiblePositionOnLine): Ditto.
2070 (khtml::isLastVisiblePositionOnLine): Ditto.
2071 * khtml/editing/visible_position.h: Add new functions.
2072 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2073 * layout-tests/editing/deleting/delete-line-001.html: Added.
2074 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2075 * layout-tests/editing/deleting/delete-line-002.html: Added.
2076 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2077 * layout-tests/editing/deleting/delete-line-003.html: Added.
2078 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2079 * layout-tests/editing/deleting/delete-line-004.html: Added.
2080 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2081 * layout-tests/editing/deleting/delete-line-005.html: Added.
2082 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2083 * layout-tests/editing/deleting/delete-line-006.html: Added.
2084 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2085 * layout-tests/editing/deleting/delete-line-007.html: Added.
2086 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2087 * layout-tests/editing/deleting/delete-line-008.html: Added.
2088 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2089 * layout-tests/editing/deleting/delete-line-009.html: Added.
2090 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2091 * layout-tests/editing/deleting/delete-line-010.html: Added.
2092 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2093 * layout-tests/editing/deleting/delete-line-011.html: Added.
2094 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2095 * layout-tests/editing/deleting/delete-line-012.html: Added.
2097 2004-11-11 Ken Kocienda <kocienda@apple.com>
2101 * khtml/editing/htmlediting.cpp:
2102 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2104 2004-11-11 Ken Kocienda <kocienda@apple.com>
2110 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
2111 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
2113 * khtml/editing/selection.cpp:
2114 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
2115 the next line position when necessary.
2116 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
2117 * layout-tests/editing/selection/move-3875618-fix.html: Added.
2118 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
2119 * layout-tests/editing/selection/move-3875641-fix.html: Added.
2121 2004-11-11 Ken Kocienda <kocienda@apple.com>
2125 Improved some function names, at John's urging. No changes to the
2126 functions themselves.
2128 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
2129 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
2130 performGeneralDelete() --> handleGeneralDelete()
2132 * khtml/editing/htmlediting.cpp:
2133 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
2134 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
2135 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2136 (khtml::DeleteSelectionCommand::doApply)
2137 * khtml/editing/htmlediting.h
2139 2004-11-11 Ken Kocienda <kocienda@apple.com>
2143 Updated some layout test results that changed as a result of my last checking.
2144 Added a new test that has been in my tree for a few days.
2146 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2147 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
2148 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
2149 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
2151 2004-11-11 Ken Kocienda <kocienda@apple.com>
2155 * khtml/editing/htmlediting.cpp:
2156 (khtml::debugNode): New debugging helper.
2157 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
2158 startPositionForDelete() and endPositionForDelete() functions. Just use the
2159 m_selectionToDelete object to determine start and end positions for the delete.
2160 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
2161 function that creates a special case for deleting all the content in a root
2163 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
2164 function before BR special case and the general case delete functions.
2165 * khtml/editing/htmlediting.h: Updated for changed functions.
2167 2004-11-10 Kevin Decker <kdecker@apple.com>
2171 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
2173 * khtml/ecma/kjs_dom.cpp:
2174 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
2176 2004-11-10 Ken Kocienda <kocienda@apple.com>
2180 * khtml/editing/htmlediting.cpp:
2181 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
2182 smart delete from the two functions below to here. There was an unnecessary double
2183 calculation of the leading and trailing whitespace positions. Also refined the trailing
2184 case so it only acts when the leading position is null (which seems to match TextEdit in
2185 my tests). Also removed some unnecessary copying of Position objects.
2186 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
2188 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2190 2004-11-10 Ken Kocienda <kocienda@apple.com>
2192 Reviewed by Harrison
2194 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
2195 make things more clear.
2196 * khtml/editing/selection.cpp:
2197 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
2198 resulting positions do not cross block boundaries. This was a bug and caused some
2199 delete problems when whole blocks were selected. I will be addressing that issue
2200 more fully in upcoming changes.
2202 2004-11-10 Ken Kocienda <kocienda@apple.com>
2204 Reviewed by Harrison
2206 Some cleanups and fixes in upstream and downstream functions.
2208 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
2209 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
2210 block's enclosing block will be returned.
2212 Remove code from upstream that confined the serach to block boundaries outside of
2213 the code which runs in the StayInBlock case. This code was redundant, and caused
2214 incorrect results to be returned in the DoNotStayInBlock case.
2216 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
2217 node, not the the this pointer's node.
2219 * khtml/xml/dom_position.cpp:
2220 (DOM::Position::upstream)
2221 (DOM::Position::downstream)
2223 2004-11-09 David Hyatt <hyatt@apple.com>
2225 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
2226 loading large local files.
2230 * khtml/html/htmltokenizer.cpp:
2231 (khtml::HTMLTokenizer::HTMLTokenizer):
2232 (khtml::HTMLTokenizer::reset):
2233 (khtml::HTMLTokenizer::write):
2234 (khtml::HTMLTokenizer::stopped):
2235 (khtml::HTMLTokenizer::processingData):
2236 (khtml::HTMLTokenizer::continueProcessing):
2237 (khtml::HTMLTokenizer::timerEvent):
2238 (khtml::HTMLTokenizer::allDataProcessed):
2239 (khtml::HTMLTokenizer::end):
2240 (khtml::HTMLTokenizer::finish):
2241 (khtml::HTMLTokenizer::notifyFinished):
2242 * khtml/html/htmltokenizer.h:
2243 * khtml/khtml_part.cpp:
2244 (KHTMLPart::slotFinished):
2247 * khtml/khtml_part.h:
2248 (KHTMLPart::tokenizerProcessedData):
2249 * khtml/khtmlview.cpp:
2250 * khtml/xml/dom_docimpl.cpp:
2251 * khtml/xml/xml_tokenizer.h:
2252 (khtml::Tokenizer::stopped):
2253 (khtml::Tokenizer::processingData):
2254 * kwq/KWQDateTime.h:
2255 * kwq/KWQDateTime.mm:
2256 (QDateTime::secsTo):
2257 (KWQUIEventTime::uiEventPending):
2258 * kwq/KWQKHTMLPart.h:
2259 * kwq/KWQKHTMLPart.mm:
2260 (KWQKHTMLPart::tokenizerProcessedData):
2261 * kwq/WebCoreBridge.h:
2262 * kwq/WebCoreBridge.mm:
2263 (-[WebCoreBridge stop]):
2264 (-[WebCoreBridge numPendingOrLoadingRequests]):
2265 (-[WebCoreBridge doneProcessingData]):
2267 2004-11-09 David Harrison <harrison@apple.com>
2269 Reviewed by Ken Kocienda.
2271 <rdar://problem/3865837> Wrong text style after delete to start of document
2273 * khtml/editing/htmlediting.cpp:
2274 (khtml::DeleteSelectionCommand::saveTypingStyleState):
2275 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
2277 2004-11-09 Richard Williamson <rjw@apple.com>
2279 Fixed <rdar://problem/3872440> NSTimer prematurely released.
2288 2004-11-09 Chris Blumenberg <cblu@apple.com>
2292 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
2294 2004-11-08 David Harrison <harrison@apple.com>
2296 Reviewed by Ken Kocienda.
2298 <rdar://problem/3865854> Deleting first line deletes all lines
2300 * khtml/editing/htmlediting.cpp:
2301 (khtml::DeleteSelectionCommand::performGeneralDelete):
2302 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
2303 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
2304 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
2305 update because it is handled in calculateEndingPosition now.
2306 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
2307 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2309 2004-11-08 Ken Kocienda <kocienda@apple.com>
2313 * khtml/html/html_elementimpl.cpp:
2314 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2315 are added to the DOM.
2316 * khtml/html/html_elementimpl.h: Ditto.
2317 * khtml/html/htmlparser.cpp:
2318 (KHTMLParser::KHTMLParser): Ditto.
2319 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2320 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2321 * khtml/html/htmltokenizer.cpp:
2322 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2323 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2324 There were a couple of indexing errors that resulted in the comment text containing part of the
2326 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2327 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
2329 2004-11-08 Chris Blumenberg <cblu@apple.com>
2331 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2335 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2336 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2337 * kwq/KWQKHTMLPart.h: ditto
2339 2004-11-08 Darin Adler <darin@apple.com>
2343 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2345 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2346 that possibly deletes the QTimer.
2348 2004-11-08 Chris Blumenberg <cblu@apple.com>
2350 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2354 * kwq/KWQTextField.mm:
2355 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2356 * kwq/WebCoreBridge.h:
2358 2004-11-08 David Harrison <harrison@apple.com>
2362 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2364 * khtml/editing/htmlediting.cpp:
2365 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2366 * khtml/xml/dom_nodeimpl.cpp:
2367 (NodeImpl::enclosingInlineElement):
2368 * khtml/xml/dom_nodeimpl.h:
2370 2004-11-05 Chris Blumenberg <cblu@apple.com>
2372 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
2376 * khtml/editing/htmlediting.cpp:
2377 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
2378 * khtml/editing/visible_position.cpp:
2379 (khtml::VisiblePosition::character): new, returns the character for the position
2380 * khtml/editing/visible_position.h:
2381 * kwq/KWQKHTMLPart.h:
2382 * kwq/KWQKHTMLPart.mm:
2383 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
2384 * kwq/WebCoreBridge.h:
2388 2004-11-05 Adele Amchan <adele@apple.com>
2392 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
2393 and a workaround for displaying transparent backgrounds for textareas.
2395 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
2396 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
2397 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
2398 on the contentView, and on the textView.
2400 2004-11-04 David Hyatt <hyatt@apple.com>
2402 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
2405 Reviewed by darin or ken
2407 * khtml/rendering/bidi.cpp:
2408 (khtml::appendRunsForObject):
2409 (khtml::RenderBlock::skipWhitespace):
2410 (khtml::RenderBlock::findNextLineBreak):
2411 * khtml/rendering/render_block.cpp:
2412 (khtml::RenderBlock::lowestPosition):
2413 (khtml::RenderBlock::rightmostPosition):
2414 (khtml::RenderBlock::leftmostPosition):
2415 * khtml/rendering/render_box.cpp:
2416 (RenderBox::position):
2417 * khtml/rendering/render_box.h:
2418 (khtml::RenderBox::staticX):
2419 (khtml::RenderBox::staticY):
2420 * khtml/rendering/render_layer.cpp:
2421 (RenderLayer::updateLayerPosition):
2422 (RenderLayer::convertToLayerCoords):
2423 * khtml/rendering/render_line.cpp:
2424 (khtml::InlineFlowBox::placeBoxesHorizontally):
2425 * khtml/rendering/render_object.h:
2426 (khtml::RenderObject::staticX):
2427 (khtml::RenderObject::staticY):
2429 Finish turning on XSLT. Make sure child stylesheets can load.
2431 * khtml/xsl/xslt_processorimpl.cpp:
2432 (DOM::stylesheetLoadFunc):
2433 (DOM::XSLTProcessorImpl::transformDocument):
2435 2004-11-04 David Hyatt <hyatt@apple.com>
2437 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
2438 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
2439 keyword and length values.
2443 * khtml/css/cssparser.cpp:
2444 (CSSParser::parseValue):
2445 (CSSParser::addBackgroundValue):
2446 (CSSParser::parseBackgroundShorthand):
2447 (CSSParser::parseBackgroundColor):
2448 (CSSParser::parseBackgroundImage):
2449 (CSSParser::parseBackgroundPositionXY):
2450 (CSSParser::parseBackgroundPosition):
2451 (CSSParser::parseBackgroundProperty):
2452 (CSSParser::parseColorFromValue):
2453 * khtml/css/cssparser.h:
2454 * khtml/css/cssstyleselector.cpp:
2455 (khtml::CSSStyleSelector::adjustRenderStyle):
2456 (khtml::CSSStyleSelector::applyProperty):
2457 (khtml::CSSStyleSelector::mapBackgroundAttachment):
2458 (khtml::CSSStyleSelector::mapBackgroundImage):
2459 (khtml::CSSStyleSelector::mapBackgroundRepeat):
2460 (khtml::CSSStyleSelector::mapBackgroundXPosition):
2461 (khtml::CSSStyleSelector::mapBackgroundYPosition):
2462 * khtml/css/cssstyleselector.h:
2463 * khtml/rendering/render_box.cpp:
2464 (RenderBox::paintRootBoxDecorations):
2465 (RenderBox::paintBoxDecorations):
2466 (RenderBox::paintBackgrounds):
2467 (RenderBox::paintBackground):
2468 (RenderBox::paintBackgroundExtended):
2469 * khtml/rendering/render_box.h:
2470 * khtml/rendering/render_form.cpp:
2471 (RenderFieldset::paintBoxDecorations):
2472 * khtml/rendering/render_line.cpp:
2473 (khtml::InlineFlowBox::paintBackgrounds):
2474 (khtml::InlineFlowBox::paintBackground):
2475 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2476 * khtml/rendering/render_line.h:
2477 * khtml/rendering/render_object.cpp:
2478 (RenderObject::setStyle):
2479 (RenderObject::updateBackgroundImages):
2480 (RenderObject::getVerticalPosition):
2481 * khtml/rendering/render_object.h:
2482 (khtml::RenderObject::paintBackgroundExtended):
2483 * khtml/rendering/render_style.cpp:
2485 (BackgroundLayer::BackgroundLayer):
2486 (BackgroundLayer::~BackgroundLayer):
2487 (BackgroundLayer::operator=):
2488 (BackgroundLayer::operator==):
2489 (BackgroundLayer::fillUnsetProperties):
2490 (BackgroundLayer::cullEmptyLayers):
2491 (StyleBackgroundData::StyleBackgroundData):
2492 (StyleBackgroundData::operator==):
2493 (RenderStyle::diff):
2494 (RenderStyle::adjustBackgroundLayers):
2495 * khtml/rendering/render_style.h:
2496 (khtml::OutlineValue::operator==):
2497 (khtml::OutlineValue::operator!=):
2498 (khtml::BackgroundLayer::backgroundImage):
2499 (khtml::BackgroundLayer::backgroundXPosition):
2500 (khtml::BackgroundLayer::backgroundYPosition):
2501 (khtml::BackgroundLayer::backgroundAttachment):
2502 (khtml::BackgroundLayer::backgroundRepeat):
2503 (khtml::BackgroundLayer::next):
2504 (khtml::BackgroundLayer::isBackgroundImageSet):
2505 (khtml::BackgroundLayer::isBackgroundXPositionSet):
2506 (khtml::BackgroundLayer::isBackgroundYPositionSet):
2507 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
2508 (khtml::BackgroundLayer::isBackgroundRepeatSet):
2509 (khtml::BackgroundLayer::setBackgroundImage):
2510 (khtml::BackgroundLayer::setBackgroundXPosition):
2511 (khtml::BackgroundLayer::setBackgroundYPosition):
2512 (khtml::BackgroundLayer::setBackgroundAttachment):
2513 (khtml::BackgroundLayer::setBackgroundRepeat):
2514 (khtml::BackgroundLayer::clearBackgroundImage):
2515 (khtml::BackgroundLayer::clearBackgroundXPosition):
2516 (khtml::BackgroundLayer::clearBackgroundYPosition):
2517 (khtml::BackgroundLayer::clearBackgroundAttachment):
2518 (khtml::BackgroundLayer::clearBackgroundRepeat):
2519 (khtml::BackgroundLayer::setNext):
2520 (khtml::BackgroundLayer::operator!=):
2521 (khtml::BackgroundLayer::containsImage):
2522 (khtml::BackgroundLayer::hasImage):
2523 (khtml::BackgroundLayer::hasFixedImage):
2524 (khtml::RenderStyle::setBitDefaults):
2525 (khtml::RenderStyle::hasBackground):
2526 (khtml::RenderStyle::hasFixedBackgroundImage):
2527 (khtml::RenderStyle::outlineWidth):
2528 (khtml::RenderStyle::outlineStyle):
2529 (khtml::RenderStyle::outlineStyleIsAuto):
2530 (khtml::RenderStyle::outlineColor):
2531 (khtml::RenderStyle::backgroundColor):
2532 (khtml::RenderStyle::backgroundImage):
2533 (khtml::RenderStyle::backgroundRepeat):
2534 (khtml::RenderStyle::backgroundAttachment):
2535 (khtml::RenderStyle::backgroundXPosition):
2536 (khtml::RenderStyle::backgroundYPosition):
2537 (khtml::RenderStyle::accessBackgroundLayers):
2538 (khtml::RenderStyle::backgroundLayers):
2539 (khtml::RenderStyle::outlineOffset):
2540 (khtml::RenderStyle::resetOutline):
2541 (khtml::RenderStyle::setBackgroundColor):
2542 (khtml::RenderStyle::setOutlineWidth):
2543 (khtml::RenderStyle::setOutlineStyle):
2544 (khtml::RenderStyle::setOutlineColor):
2545 (khtml::RenderStyle::clearBackgroundLayers):
2546 (khtml::RenderStyle::inheritBackgroundLayers):
2547 (khtml::RenderStyle::setOutlineOffset):
2548 * khtml/rendering/render_table.cpp:
2549 (RenderTable::paintBoxDecorations):
2550 (RenderTableCell::paintBoxDecorations):
2552 2004-11-04 David Hyatt <hyatt@apple.com>
2554 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
2555 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
2559 * kwq/KWQTextCodec.mm:
2560 (KWQTextDecoder::convertLatin1):
2561 (KWQTextDecoder::convertUTF16):
2562 (KWQTextDecoder::convertUsingTEC):
2563 (KWQTextDecoder::toUnicode):
2565 2004-11-04 David Hyatt <hyatt@apple.com>
2567 Make sure line-height returns the correct value for normal.
2571 * khtml/css/css_computedstyle.cpp:
2572 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2574 2004-11-04 David Harrison <harrison@apple.com>
2576 Reviewed by Ken Kocienda.
2578 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
2580 * khtml/editing/htmlediting.cpp:
2581 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
2582 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
2583 Fixed to insert after the destination subtree, rather than the destination element. Handles
2584 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
2585 * khtml/xml/dom_nodeimpl.cpp:
2586 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
2587 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
2588 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
2589 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
2591 2004-11-03 Ken Kocienda <kocienda@apple.com>
2597 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
2598 * layout-tests/editing/deleting/delete-br-008.html: Added.
2599 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
2600 * layout-tests/editing/deleting/delete-br-009.html: Added.
2601 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
2602 * layout-tests/editing/deleting/delete-br-010.html: Added.
2604 2004-11-03 Maciej Stachowiak <mjs@apple.com>
2606 Fix by Yasuo Kida, reviewed by me.
2608 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
2610 * kwq/KWQKHTMLPart.mm:
2611 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
2612 same as a nil range - setting an empty marked range should clear
2613 the marked range entirely.
2615 2004-11-02 Maciej Stachowiak <mjs@apple.com>
2617 Reviewed by Dave Hyatt (when I originally coded it).
2619 WebCore part of fix for:
2621 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
2623 * kwq/WebCoreBridge.h:
2624 * kwq/WebCoreBridge.mm:
2625 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
2626 DOMRange, or if the range is split into multiple lines, the rect for the part on
2627 the first line only.
2629 * khtml/rendering/render_object.cpp:
2630 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
2631 for the overrides below.
2632 * khtml/rendering/render_object.h:
2633 * khtml/rendering/render_box.cpp:
2634 (RenderBox::caretRect):
2635 * khtml/rendering/render_box.h:
2636 * khtml/rendering/render_br.cpp:
2637 (RenderBR::caretRect):
2638 * khtml/rendering/render_br.h:
2639 * khtml/rendering/render_flow.cpp:
2640 (RenderFlow::caretRect):
2641 * khtml/rendering/render_flow.h:
2642 * khtml/rendering/render_text.cpp:
2643 (RenderText::caretRect):
2645 2004-11-02 Ken Kocienda <kocienda@apple.com>
2649 Implemented command to insert a block in response to typing a return key (even though
2650 I am not turning that on by default with this patch....that will come later).
2652 This new command is called InsertParagraphSeparatorCommand.
2654 Reworked the command and function names associated with inserting content into a
2655 document. Before this patch, there were inputXXX and insertXXX variants, with the
2656 former used for more high-level actions and the latter used for lower-level stuff.
2657 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
2658 in an insertXXX command going through an inputXXX WebCore step and then finally to an
2659 insertXXX WebCore step. To make this less confusing, I have changes all the names to
2660 be insertXXX, and modified the lower-level operations so that it is clear what they do.
2662 * khtml/editing/htmlediting.cpp:
2663 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
2664 (khtml::EditCommand::isInsertTextCommand): Ditto.
2665 (khtml::CompositeEditCommand::inputText): Ditto.
2666 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
2667 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
2668 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
2669 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
2670 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
2671 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
2672 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
2673 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
2674 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
2675 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
2676 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2677 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2678 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
2679 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
2680 (khtml::InsertIntoTextNode::doApply): Ditto.
2681 (khtml::InsertIntoTextNode::doUnapply): Ditto.
2682 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
2683 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
2684 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
2685 (khtml::InsertLineBreakCommand::doApply):
2686 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
2687 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
2688 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
2689 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
2690 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
2691 (khtml::InsertParagraphSeparatorCommand::doApply):
2692 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2693 Class name change, was InsertNewlineCommandInQuotedContentCommand.
2694 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
2695 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
2696 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2697 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
2698 (khtml::InsertTextCommand::doApply): Ditto.
2699 (khtml::InsertTextCommand::deleteCharacter): Ditto.
2700 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2701 (khtml::InsertTextCommand::input): Ditto.
2702 (khtml::InsertTextCommand::insertSpace): Ditto.
2703 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
2704 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
2705 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
2706 (khtml::TypingCommand::insertParagraphSeparator): New function.
2707 (khtml::TypingCommand::doApply): Name changes, as above.
2708 (khtml::TypingCommand::insertText): Ditto.
2709 (khtml::TypingCommand::deleteKeyPressed): Ditto.
2710 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2711 * khtml/editing/htmlediting.h:
2712 (khtml::DeleteFromTextNodeCommand::node): Name change.
2713 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
2714 (khtml::DeleteFromTextNodeCommand::count): Ditto.
2715 (khtml::InsertIntoTextNode::text): Ditto.
2716 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
2717 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
2718 (khtml::TypingCommand::): Ditto.
2719 * khtml/editing/jsediting.cpp: Name changes, as above.
2720 * kwq/WebCoreBridge.h:
2721 * kwq/WebCoreBridge.mm:
2722 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
2723 (-[WebCoreBridge insertParagraphSeparator]): New function.
2724 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
2726 2004-11-01 Kevin Decker <kdecker@apple.com>
2730 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
2733 * khtml/ecma/kjs_window.cpp:
2734 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
2736 2004-11-01 Darin Adler <darin@apple.com>
2740 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
2742 * khtml/css/html4.css: Use color: initial for textarea and related ones.
2744 2004-11-01 Ken Kocienda <kocienda@apple.com>
2750 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
2752 * khtml/css/css_computedstyle.cpp:
2753 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
2754 implementation here into new copyPropertiesInSet helper. This now calls the
2755 generalized copyPropertiesInSet function with the arguments needed to make copying
2757 * khtml/css/css_computedstyle.h:
2758 * khtml/css/css_valueimpl.cpp:
2759 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
2760 In order to do apply block properties, "regular" style declarations need to do style
2762 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
2763 except that it uses a different set of properties that apply only to blocks.
2764 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
2765 and copies out those properties listed in a pre-defined set.
2766 * khtml/css/css_valueimpl.h:
2767 * khtml/editing/htmlediting.cpp:
2768 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
2769 block, factoring out some of the special case code that should now only run in the inline case.
2770 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
2771 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
2772 special handling for "legacy" HTML styles like <B> and <I>.
2773 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
2774 style changes into different kinds. CSS specifies certain properties only apply to certain
2775 element types. This set of changes now recognizes two such separate cases: styles that apply
2776 to blocks, and styles that apply to inlines.
2777 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
2778 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
2779 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
2780 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
2781 done so that the function can be passed a portion of the styles being applied so that block styles
2782 and inline styles can be handled separately.
2783 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2784 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
2785 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
2786 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
2787 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
2788 * khtml/editing/htmlediting.h:
2789 (khtml::StyleChange::): Changed as described above.
2790 (khtml::StyleChange::usesLegacyStyles):
2791 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
2792 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
2793 when text align changes.
2794 * khtml/khtml_part.cpp:
2795 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
2796 the passed-in argument.
2797 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
2798 is a caret. Formerly, this just set typing style and made no visible changes to the document.
2802 * layout-tests/editing/editing.js: Added some glue to change text align.
2803 * layout-tests/editing/style/block-style-001-expected.txt: Added.
2804 * layout-tests/editing/style/block-style-001.html: Added.
2805 * layout-tests/editing/style/block-style-002-expected.txt: Added.
2806 * layout-tests/editing/style/block-style-002.html: Added.
2807 * layout-tests/editing/style/block-style-003-expected.txt: Added.
2808 * layout-tests/editing/style/block-style-003.html: Added.
2812 2004-10-29 Darin Adler <darin@apple.com>
2816 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
2818 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
2819 before advancing one character; before it did it backwards.
2821 2004-10-29 Chris Blumenberg <cblu@apple.com>
2823 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
2825 Reviewed by kocienda, adele.
2827 * khtml/rendering/render_frames.cpp:
2828 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
2830 2004-10-29 Darin Adler <darin@apple.com>
2834 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
2836 * khtml/khtmlview.cpp:
2837 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
2838 deleted before this function finishes running.
2839 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
2840 (KHTMLView::viewportMouseReleaseEvent): Ditto.
2841 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
2842 is guaranteed to do ref/deref as needed.
2844 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
2846 2004-10-28 Chris Blumenberg <cblu@apple.com>
2848 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
2852 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
2853 * WebCorePrefix.h: always use XSLT
2855 2004-10-28 Ken Kocienda <kocienda@apple.com>
2861 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
2862 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
2864 * khtml/editing/htmlediting.cpp:
2865 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
2866 to initialization list, zeroing them out.
2867 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
2868 handle a delete of content in special cases where the only thing selected is a BR. This
2869 code path is much simpler than the newly-named performGeneralDelete, and detects when no
2870 content merging should be done between blocks. This aspect of the change fixes 3854848.
2871 One of the special cases added fixes 3803832.
2872 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
2873 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
2874 like the other helpers in this class.
2875 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
2876 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
2877 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
2879 2004-10-28 Chris Blumenberg <cblu@apple.com>
2881 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
2885 * kwq/KWQKHTMLPart.mm:
2886 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
2888 2004-10-28 Ken Kocienda <kocienda@apple.com>
2890 Reviewed by Harrison
2892 Reorganization of delete command functionality so that doApply is not
2893 several hundred lines long. This is not a squeaky-clean cleanup, but
2894 it is a step in the right direction. No functionality changes.
2896 * khtml/editing/htmlediting.cpp:
2897 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
2898 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
2899 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
2900 (khtml::DeleteSelectionCommand::performDelete): Ditto.
2901 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2902 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2903 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
2904 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
2905 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
2906 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
2907 * khtml/editing/htmlediting.h:
2909 2004-10-28 Ken Kocienda <kocienda@apple.com>
2913 * khtml/editing/htmlediting.cpp:
2914 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
2915 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
2917 2004-10-27 Ken Kocienda <kocienda@apple.com>
2921 * khtml/editing/htmlediting.cpp:
2922 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
2923 whether content not in the block containing the start of the selection is moved to that block
2924 after the selection is deleted.
2925 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
2926 (khtml::DeleteSelectionCommand::doApply): Ditto.
2927 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
2928 to handle the case of inserting a newline when in quoted content in Mail.
2929 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
2930 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
2931 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
2932 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
2933 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
2934 (khtml::TypingCommand::doApply): Ditto.
2935 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2936 * khtml/editing/htmlediting.h: Add new delclarations.
2937 (khtml::TypingCommand::): Ditto.
2938 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
2939 * kwq/WebCoreBridge.mm:
2940 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
2942 2004-10-26 Chris Blumenberg <cblu@apple.com>
2944 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
2948 * khtml/ecma/kjs_dom.cpp:
2949 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
2950 * khtml/ecma/kjs_dom.h:
2951 (KJS::DOMElement::):
2952 * khtml/ecma/kjs_dom.lut.h:
2955 2004-10-26 David Hyatt <hyatt@apple.com>
2957 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
2960 Reviewed by kocienda
2962 * khtml/rendering/bidi.cpp:
2963 (khtml::RenderBlock::layoutInlineChildren):
2965 2004-10-26 David Hyatt <hyatt@apple.com>
2967 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
2968 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
2970 Reviewed by kocienda
2972 * khtml/rendering/render_canvas.cpp:
2973 (RenderCanvas::selectionRect):
2974 * khtml/rendering/render_object.h:
2975 (khtml::RenderObject::hasSelectedChildren):
2977 2004-10-26 Ken Kocienda <kocienda@apple.com>
2983 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
2985 * khtml/editing/htmlediting.cpp:
2986 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
2987 let the caller know if a placeholder was removed.
2988 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
2989 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
2990 some cases, the selection was still set on the removed BR, and this was the cause of the
2992 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
2994 2004-10-26 Darin Adler <darin@apple.com>
2998 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
3000 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
3002 2004-10-26 Ken Kocienda <kocienda@apple.com>
3006 * khtml/editing/htmlediting.cpp:
3007 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
3008 with a zero-length string. That triggers an assert. Call deleteText instead,
3009 using the same indices that are passed to replaceText.
3011 Cleaned up the asserts in these three functions below, making them
3012 more consistent. This is not needed for the fix, but I tripped over
3013 these in the course of debugging.
3015 (khtml::InsertTextCommand::InsertTextCommand):
3016 (khtml::InsertTextCommand::doApply):
3017 (khtml::InsertTextCommand::doUnapply):
3019 2004-10-25 Adele Amchan <adele@apple.com>
3023 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
3024 * khtml/xml/dom_docimpl.h:
3026 2004-10-25 Adele Amchan <adele@apple.com>
3028 Reviewed by me, code change by Darin.
3030 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
3032 2004-10-25 Ken Kocienda <kocienda@apple.com>
3034 Oops. These two test results changed with my last checkin, for the better.
3036 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3037 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
3039 2004-10-25 Ken Kocienda <kocienda@apple.com>
3045 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
3047 * khtml/editing/htmlediting.cpp:
3048 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
3049 expand the selection outwards when the selection is on the visible boundary of a root
3050 editable element. This fixes the bug. Note that this function also contains a little code
3051 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
3052 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3053 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
3054 * khtml/editing/htmlediting.h: Declare new helpers.
3055 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
3056 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
3057 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
3058 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
3059 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
3060 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
3062 2004-10-25 Ken Kocienda <kocienda@apple.com>
3064 Added some more editing layout tests.
3066 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
3067 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
3068 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
3069 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
3070 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
3071 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
3072 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
3073 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
3074 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
3075 * layout-tests/editing/inserting/typing-003.html: Added.
3077 2004-10-25 Ken Kocienda <kocienda@apple.com>
3081 * khtml/rendering/bidi.cpp:
3082 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
3083 yesterday quite right: words that should have been placed on the next line were instead
3084 appearing on the line before, beyond the right margin. This was a one-word only error
3085 based on moving the line break object when it should have stayed put. Here is the rule:
3086 The line break object only moves to after the whitespace on the end of a line if that
3087 whitespace caused line overflow when its width is added in.
3089 2004-10-25 Adele Amchan <adele@apple.com>
3093 Fix for <rdar://problem/3619890> Feature request: designMode
3095 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
3096 This will enable more JS editing compatibility.
3098 * khtml/ecma/kjs_html.cpp:
3099 (KJS::HTMLDocument::tryGet): added case for designMode
3100 (KJS::HTMLDocument::putValue): added case for designMode
3101 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
3102 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
3103 * khtml/xml/dom_docimpl.cpp:
3104 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
3105 (DocumentImpl::setDesignMode): added function to assign m_designMode value
3106 (DocumentImpl::getDesignMode): return m_designMode value
3107 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
3108 Otherwise, it will just return the m_designMode value.
3109 (DocumentImpl::parentDocument):
3110 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
3111 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
3113 2004-10-22 Ken Kocienda <kocienda@apple.com>
3119 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
3121 * khtml/editing/htmlediting.cpp:
3122 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
3123 everything that could be affected.
3124 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
3125 braces, making it act as a comma operator, with a zero value as the right value!!! This made
3126 an important check always fail!!! It turns out that we do not want the constant at all, since
3127 that constant is only needed when checking a computed style, not an inline style as is being
3129 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
3130 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
3131 RangeImpl::compareBoundaryPoints to perform the required check.
3132 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
3134 2004-10-22 Ken Kocienda <kocienda@apple.com>
3140 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
3141 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
3143 * khtml/rendering/bidi.cpp:
3144 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
3145 it is when we are editing, add in the space of the current character when calculating the width
3146 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
3147 the line break object and call skipWhitespace to move past the end of the whitespace.
3151 2004-10-22 Ken Kocienda <kocienda@apple.com>
3153 * WebCore.pbproj/project.pbxproj:
3154 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
3156 2004-10-21 David Hyatt <hyatt@apple.com>
3160 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
3162 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
3163 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
3165 * khtml/rendering/render_block.cpp:
3166 (khtml::getInlineRun):
3167 (khtml::RenderBlock::makeChildrenNonInline):
3169 2004-10-21 David Hyatt <hyatt@apple.com>
3171 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
3172 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
3176 * khtml/rendering/render_inline.cpp:
3177 (RenderInline::splitFlow):
3179 2004-10-21 Ken Kocienda <kocienda@apple.com>
3183 Significant improvement to the way that whitespace is handled during editing.
3185 * khtml/editing/htmlediting.cpp:
3186 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
3187 two being added with this name) that delete "insignificant" unrendered text.
3188 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
3189 calculates the downstream position to use as the endpoint for the deletion, and
3190 then calls deleteInsignificantText with this start and end.
3191 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
3192 (khtml::InputNewlineCommand::doApply): Ditto.
3193 (khtml::InputTextCommand::input): Ditto.
3194 * khtml/editing/htmlediting.h: Add new declarations.
3196 Modified layout test results:
3197 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
3198 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
3199 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
3200 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
3201 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
3202 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
3203 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
3204 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
3205 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
3206 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
3207 * layout-tests/editing/inserting/insert-br-001-expected.txt:
3208 * layout-tests/editing/inserting/insert-br-004-expected.txt:
3209 * layout-tests/editing/inserting/insert-br-005-expected.txt:
3210 * layout-tests/editing/inserting/insert-br-006-expected.txt:
3211 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
3212 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
3213 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
3214 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
3215 * layout-tests/editing/inserting/typing-001-expected.txt:
3216 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
3217 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
3218 * layout-tests/editing/style/typing-style-003-expected.txt:
3219 * layout-tests/editing/undo/redo-typing-001-expected.txt:
3220 * layout-tests/editing/undo/undo-typing-001-expected.txt:
3222 2004-10-21 David Hyatt <hyatt@apple.com>
3224 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
3225 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
3229 * khtml/rendering/render_block.cpp:
3230 (khtml::getInlineRun):
3232 2004-10-20 David Hyatt <hyatt@apple.com>
3234 Add better dumping of overflow information for scrolling regions.
3236 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
3237 from the render tree so that layers and so forth are cleaned up.
3241 * khtml/rendering/render_container.cpp:
3242 (RenderContainer::detach):
3243 * khtml/rendering/render_layer.h:
3244 (khtml::RenderLayer::scrollXOffset):
3245 (khtml::RenderLayer::scrollYOffset):
3246 * kwq/KWQRenderTreeDebug.cpp:
3249 2004-10-20 David Hyatt <hyatt@apple.com>
3251 Fix for 3791146, make sure all lines are checked when computing overflow.
3253 Reviewed by kocienda
3255 * khtml/rendering/bidi.cpp:
3256 (khtml::RenderBlock::computeHorizontalPositionsForLine):
3257 (khtml::RenderBlock::layoutInlineChildren):
3258 (khtml::RenderBlock::findNextLineBreak):
3259 (khtml::RenderBlock::checkLinesForOverflow):
3260 * khtml/rendering/render_block.h:
3262 2004-10-20 David Hyatt <hyatt@apple.com>
3264 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
3266 Reviewed by kocienda
3268 * khtml/rendering/break_lines.cpp:
3269 (khtml::isBreakable):
3271 2004-10-20 Darin Adler <darin@apple.com>
3275 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
3277 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
3278 Create a palette with the background and foreground colors in it and set it on the widget.
3280 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
3281 with APPLE_CHANGES. Removed palette and palette-related function members.
3282 * khtml/rendering/render_style.cpp:
3283 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
3284 (RenderStyle::diff): No palette to compare.
3286 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
3287 * kwq/KWQLineEdit.mm:
3288 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
3289 (QLineEdit::text): Made const.
3291 * kwq/KWQTextEdit.h: Added setPalette override.
3292 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
3295 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
3296 per color group, and only a single color group per palette.
3297 * kwq/KWQColorGroup.mm: Removed.
3298 * kwq/KWQPalette.mm: Removed.
3299 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
3301 * kwq/KWQApplication.h: Removed unused palette function.
3302 * kwq/KWQApplication.mm: Ditto.
3304 * kwq/KWQWidget.h: Removed unsetPalette.
3305 * kwq/KWQWidget.mm: Ditto.
3307 - fixed storage leak
3309 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
3310 Roll in storage leak fix from KDE guys.