1 2004-12-06 Maciej Stachowiak <mjs@apple.com>
5 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
7 I changed all unprotected places that can navigate a different
8 window or frame from script to check for a javascript: URL, and if
9 found, to check for safety using cross-site-script rules.
11 I considered a few other possible exploits and made no change:
13 - document.location is already protected because the document
14 object itself is protected
16 - frame.src, frame.location, iframe.src and targetted links are
17 all safe because setting the URL of a frame to a javascript: URL
18 executes the script in the context of the parent
20 * khtml/ecma/kjs_window.cpp:
21 (WindowFunc::tryCall):
23 (LocationFunc::tryCall):
25 2004-12-06 Ken Kocienda <kocienda@apple.com>
31 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
33 * khtml/editing/htmlediting.cpp:
34 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
35 check for one of the special cases being checked for in this function. The specific case
36 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
37 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
38 case where a selection ended in a <br> after a block and would not delete any part of the
39 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
42 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
43 new use of the function exposed this bug:
45 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
47 * khtml/xml/dom_position.cpp:
48 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
49 not have this fatal flaw. It is a much better design as well.
51 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
52 have what I consider to be a better result. Going with it.
54 2004-12-06 Chris Blumenberg <cblu@apple.com>
56 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
61 (-[DOMElement _font]): new SPI for AppKit
64 2004-12-06 Darin Adler <darin@apple.com>
68 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
70 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
71 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
73 2004-12-06 John Sullivan <sullivan@apple.com>
75 Darin found what appears to be the real leak that we were falsely blaming
76 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
79 * khtml/css/cssparser.cpp:
80 (CSSParser::parseValue):
81 call clearProperties() instead of just setting numParsedProperties to 0
82 (CSSParser::parseDeclaration):
84 (CSSParser::createStyleDeclaration):
87 2004-12-06 Ken Kocienda <kocienda@apple.com>
93 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
94 * layout-tests/editing/inserting/insert-div-001.html: Added.
95 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
96 * layout-tests/editing/inserting/insert-div-002.html: Added.
97 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
98 * layout-tests/editing/inserting/insert-div-003.html: Added.
99 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
100 * layout-tests/editing/inserting/insert-div-004.html: Added.
101 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
102 * layout-tests/editing/inserting/insert-div-005.html: Added.
103 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
104 * layout-tests/editing/inserting/insert-div-006.html: Added.
105 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
106 * layout-tests/editing/inserting/insert-div-007.html: Added.
107 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
108 * layout-tests/editing/inserting/insert-div-008.html: Added.
109 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
110 * layout-tests/editing/inserting/insert-div-009.html: Added.
112 2004-12-06 Ken Kocienda <kocienda@apple.com>
118 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
120 * khtml/editing/htmlediting.cpp:
121 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
122 being added to this function. This ensures that the added block has a height.
123 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
125 2004-12-06 Ken Kocienda <kocienda@apple.com>
129 * khtml/dom/dom_string.cpp:
130 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
131 * khtml/dom/dom_string.h: Ditto.
132 * khtml/editing/htmlediting.cpp:
133 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
134 RebalanceWhitespaceCommand instance.
135 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
136 (khtml::InsertLineBreakCommand::doApply): Ditto.
137 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
138 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
139 (khtml::InsertTextCommand::input): Ditto.
140 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
141 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
142 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
143 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
144 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
145 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
146 * khtml/editing/htmlediting.h: Ditto.
147 (khtml::RebalanceWhitespaceCommand::): Ditto.
149 2004-12-05 Darin Adler <darin@apple.com>
151 - fixed small problem in my check-in from yesterday
154 (positionForEvent): Get location from event without raising exception if it's the wrong type.
155 (clickCountForEvent): Same, for clickCount.
156 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
157 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
158 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
160 2004-12-04 Darin Adler <darin@apple.com>
164 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
166 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
167 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
168 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
170 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
172 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
173 * khtml/rendering/render_form.cpp:
174 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
175 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
176 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
178 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
179 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
180 Added a fixState helper method so the constructors can save code.
182 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
183 and added a third constructor that uses the "current event" from AppKit (used above).
184 (QMouseEvent::fixState): Compute state and click count based on event type.
186 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
188 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
189 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
190 underlying cause in CSS.
192 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
194 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
195 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
197 2004-12-03 Chris Blumenberg <cblu@apple.com>
200 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
201 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
202 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
203 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
205 Reviewed by darin, rjw, kocienda.
207 * khtml/misc/loader.cpp:
208 (CachedObject::~CachedObject):
209 (CachedCSSStyleSheet::checkNotify):
210 (Loader::servePendingRequests):
211 (Loader::slotFinished):
212 (Loader::slotReceivedResponse):
213 (Cache::requestImage):
214 (Cache::requestScript):
215 * khtml/misc/loader.h:
216 (khtml::CachedObject::CachedObject):
217 (khtml::CachedObject::response):
218 (khtml::CachedObject::allData):
219 * kwq/KWQKJobClasses.h:
220 * kwq/KWQKJobClasses.mm:
221 (KIO::TransferJobPrivate::TransferJobPrivate):
222 (KIO::TransferJobPrivate::~TransferJobPrivate):
223 (KIO::TransferJob::TransferJob):
224 (KIO::TransferJob::assembleResponseHeaders):
225 (KIO::TransferJob::retrieveCharset):
226 (KIO::TransferJob::emitResult):
227 (KIO::TransferJob::emitReceivedResponse):
230 (KWQHeaderStringFromDictionary):
231 (KWQCheckCacheObjectStatus):
232 (KWQIsResponseURLEqualToURL):
234 (KWQResponseMIMEType):
235 (KWQCacheObjectExpiresTime):
236 (khtml::CachedObject::setResponse):
237 (khtml::CachedObject::setAllData):
241 * kwq/KWQResourceLoader.mm:
242 (-[KWQResourceLoader finishJobAndHandle:]):
243 (-[KWQResourceLoader cancel]):
244 (-[KWQResourceLoader reportError]):
245 (-[KWQResourceLoader finishWithData:]):
253 * kwq/WebCoreBridge.h:
254 * kwq/WebCoreResourceLoader.h:
256 2004-12-04 Darin Adler <darin@apple.com>
260 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
262 * khtml/rendering/render_form.cpp:
263 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
264 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
265 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
266 (RenderSlider::slotSliderValueChanged): Ditto.
268 2004-12-03 John Sullivan <sullivan@apple.com>
272 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
273 khtml::BackgroundLayer::cullEmptyLayers
275 * khtml/rendering/render_style.cpp:
276 (BackgroundLayer::cullEmptyLayers):
277 added missing nil check
281 2004-12-03 Ken Kocienda <kocienda@apple.com>
285 Roll out some recent changes by Chris that caused a performance regression.
286 Fix is in hand, but it is a little risky this close to a submission. So,
287 we have decided to roll back the change with the regression and roll in
288 the new code after we submit.
290 * khtml/css/cssproperties.c:
293 * khtml/css/cssvalues.c:
296 * khtml/misc/htmlattrs.c:
299 * khtml/misc/htmltags.c:
302 * khtml/misc/loader.cpp:
303 (CachedObject::~CachedObject):
304 (CachedObject::setResponse):
305 (CachedCSSStyleSheet::checkNotify):
306 (Loader::servePendingRequests):
307 (Loader::slotFinished):
308 (Loader::slotReceivedResponse):
309 (Cache::requestImage):
310 (Cache::requestScript):
311 * khtml/misc/loader.h:
312 (khtml::CachedObject::CachedObject):
313 (khtml::CachedObject::response):
314 * kwq/KWQKJobClasses.h:
315 * kwq/KWQKJobClasses.mm:
316 (KIO::TransferJobPrivate::TransferJobPrivate):
317 (KIO::TransferJobPrivate::~TransferJobPrivate):
318 (KIO::TransferJob::TransferJob):
319 (KIO::TransferJob::assembleResponseHeaders):
320 (KIO::TransferJob::retrieveCharset):
321 (KIO::TransferJob::emitResult):
322 (KIO::TransferJob::emitReceivedResponse):
325 (KWQHeaderStringFromDictionary):
326 (KWQCheckCacheObjectStatus):
328 (KWQReleaseResponse):
329 (KWQIsResponseURLEqualToURL):
331 (KWQResponseMIMEType):
332 (KWQResponseTextEncodingName):
333 (KWQResponseHeaderString):
334 (KWQCacheObjectExpiresTime):
335 (KWQLoader::KWQLoader):
339 * kwq/KWQResourceLoader.mm:
340 (-[KWQResourceLoader finishJobAndHandle]):
341 (-[KWQResourceLoader cancel]):
342 (-[KWQResourceLoader reportError]):
343 (-[KWQResourceLoader finish]):
351 * kwq/WebCoreBridge.h:
352 * kwq/WebCoreResourceLoader.h:
354 2004-12-03 John Sullivan <sullivan@apple.com>
358 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
360 * kwq/KWQKHTMLPart.mm:
361 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
362 when checking whether we moved the focus to another view, make sure we didn't "move" it to
363 our documentView, because that's no move at all.
365 2004-12-03 Darin Adler <darin@apple.com>
369 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
371 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
372 Added missing initialization for base class and node pointer.
374 - fixed a few places that could leave dangling node pointers
376 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
377 Clear out the node pointer when the node is destroyed.
378 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
380 2004-12-03 Chris Blumenberg <cblu@apple.com>
382 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.
383 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
387 * khtml/misc/loader.cpp:
388 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
389 (Loader::slotFinished): take data param
390 * khtml/misc/loader.h:
391 * kwq/KWQKJobClasses.h:
392 * kwq/KWQKJobClasses.mm:
393 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
394 (KIO::TransferJob::emitResult): take data param and pass it
395 * kwq/KWQResourceLoader.mm:
396 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
397 (-[KWQResourceLoader cancel]): pass nil for data
398 (-[KWQResourceLoader reportError]): ditto
399 (-[KWQResourceLoader finishWithData:]): pass data
401 (KWQSlot::KWQSlot): pass data param to slotFinished
402 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
404 2004-12-03 Ken Kocienda <kocienda@apple.com>
408 Did some clean up in the Position class as a result of trying to write some new layout
409 tests and discovering a bug along the way.
411 I removed these three functions from the Position class:
413 1. bool isFirstRenderedPositionOnLine() const;
414 2. bool isLastRenderedPositionOnLine() const;
415 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
416 4. bool inFirstEditableInRootEditableElement() const;
418 The first two have replacements in the VisiblePosition class, and some code has been
419 moved to use these new variants. The third function was a helper used only by these
420 first two function, and can be removed as well. The fourth function was not used by anyone.
422 * khtml/editing/htmlediting.cpp:
423 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
424 * khtml/editing/visible_position.cpp:
425 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
426 Incorrect results were being returned when asking about positions at the starts of blocks.
427 * khtml/xml/dom_position.cpp:
428 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
429 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
430 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
431 * khtml/xml/dom_position.h: Update header for deletions.
433 2004-12-03 Ken Kocienda <kocienda@apple.com>
437 Terminology change in execCommand command identifiers. Specifically, the name of
438 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
439 terminology used by AppKit. It is also more accurate, since the insertion of a
440 "br" element is what the command does. The inspiration for this change is so the
441 -insertNewline AppKit method can be mapped to insert a new "div" element in
442 a document and avoid ambiguity with what the javascript editing command does.
444 * khtml/editing/jsediting.cpp
445 * layout-tests/editing/deleting/delete-tab-004.html
446 * layout-tests/editing/editing.js
447 * layout-tests/editing/inserting/insert-3654864-fix.html
448 * layout-tests/editing/inserting/insert-3659587-fix.html
449 * layout-tests/editing/inserting/insert-3775316-fix.html
450 * layout-tests/editing/inserting/insert-3800346-fix.html
451 * layout-tests/editing/inserting/insert-br-001.html
452 * layout-tests/editing/inserting/insert-br-002.html
453 * layout-tests/editing/inserting/insert-br-003.html
454 * layout-tests/editing/inserting/insert-br-004.html
455 * layout-tests/editing/inserting/insert-br-005.html
456 * layout-tests/editing/inserting/insert-br-006.html
457 * layout-tests/editing/inserting/insert-br-007.html
458 * layout-tests/editing/inserting/insert-br-008.html
459 * layout-tests/editing/inserting/insert-tab-004.html
460 * layout-tests/editing/inserting/insert-text-with-newlines.html
461 * layout-tests/editing/pasteboard/paste-text-010.html
463 2004-12-02 Ken Kocienda <kocienda@apple.com>
469 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
471 * khtml/editing/htmlediting.cpp:
472 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
473 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
474 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
475 in a block and the document is in quirks mode, add an additional br to make the one in the
476 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
477 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
478 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
480 2004-12-02 Richard Williamson <rjw@apple.com>
482 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
484 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
485 the b/f cache won't incorrectly trash the previous state when restoring.
489 * kwq/WebCoreBridge.h:
490 * kwq/WebCoreBridge.mm:
491 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
492 (-[WebCoreBridge canCachePage]):
493 (-[WebCoreBridge clear]):
495 2004-12-02 Ken Kocienda <kocienda@apple.com>
501 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
503 * khtml/xml/dom2_rangeimpl.cpp:
504 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
505 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
506 of this bug where there is content after the body tag). Did a little code clean up as well.
507 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
509 2004-12-02 Ken Kocienda <kocienda@apple.com>
515 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
517 * khtml/khtml_part.cpp:
518 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
519 to figure out which end of the selection to extend.
521 2004-12-02 David Harrison <harrison@apple.com>
523 Reviewed by Ken Kocienda.
525 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
526 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
528 * khtml/editing/visible_text.cpp:
529 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
530 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
531 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
532 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
533 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
534 Distinguish BR from whitespace.
535 * khtml/editing/visible_text.h:
536 Distinguish BR from whitespace.
537 * khtml/editing/visible_units.cpp:
538 (khtml::previousWordBoundary):
539 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.
541 2004-12-02 Ken Kocienda <kocienda@apple.com>
547 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
549 * khtml/xml/dom_position.cpp:
550 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
551 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
552 exception trying to use a Position returned from this function to set the boundary point of a Range (which
553 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
554 contract to return a range-compliant position, hence the need for this fix.
556 2004-12-01 Ken Kocienda <kocienda@apple.com>
562 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
563 regard to other editing commands. The class had a name change ages ago, and it was never
565 * khtml/editing/htmlediting.h: Ditto.
567 2004-12-01 Ken Kocienda <kocienda@apple.com>
571 Some improvements for paste, including some new code to annotate
572 whitespace when writing to the pasteboard to ensure that the meaning
573 of the markup on the pasteboard is unambiguous.
575 There is also new code for reading this annotated markup from the pasteboard,
576 removing the nodes that were added only to prevent ambiguity.
578 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
579 The header should have been added earlier, but I did not do so.
580 * khtml/editing/html_interchange.cpp: Added.
581 (convertHTMLTextToInterchangeFormat):
582 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
583 * khtml/editing/htmlediting.cpp:
584 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
585 Also fixed a bug in the code that counts blocks in a fragment.
586 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
587 (khtml::ReplacementFragment::insertNodeBefore): New helper.
588 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
589 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
590 * khtml/editing/htmlediting.h: Add some new declarations.
591 * khtml/xml/dom2_rangeimpl.cpp:
592 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
593 * khtml/xml/dom_nodeimpl.cpp:
594 (NodeImpl::stringValueForRange): New helper.
595 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
596 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
597 should be added. Called by the paste code.
598 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
600 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
601 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
602 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
604 2004-11-30 Chris Blumenberg <cblu@apple.com>
606 * ChangeLog: removed conflict marker
608 2004-11-30 Chris Blumenberg <cblu@apple.com>
611 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
612 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
616 * khtml/misc/loader.cpp:
617 (CachedObject::~CachedObject): release m_allData
618 (CachedObject::setAllData): new
619 (Loader::servePendingRequests): connect slotAllData
620 (Loader::slotAllData): new
621 (Cache::requestImage): tweak
622 * khtml/misc/loader.h:
623 (khtml::CachedObject::CachedObject): set allData to 0
624 (khtml::CachedObject::allData): new
625 * kwq/KWQKJobClasses.h:
626 * kwq/KWQKJobClasses.mm:
627 (KIO::TransferJob::TransferJob): set m_allData
628 (KIO::TransferJob::emitAllData): new
630 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
631 * kwq/KWQResourceLoader.mm:
632 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
634 (KWQSlot::KWQSlot): support for slotAllData
636 * kwq/WebCoreBridge.h:
637 * kwq/WebCoreResourceLoader.h:
639 2004-11-30 Maciej Stachowiak <mjs@apple.com>
643 2004-11-30 Maciej Stachowiak <mjs@apple.com>
647 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
649 * khtml/khtml_part.cpp:
650 (KHTMLPart::begin): call setParsing on document here after opening
651 - from now on we'll only set parsing to true for a document open
652 caused by page loading, not a programmatic one.
653 * khtml/xml/dom_docimpl.cpp:
654 (DocumentImpl::open): don't setParsing to true here any more.
656 2004-11-30 Maciej Stachowiak <mjs@apple.com>
660 - fix recent regression from collection perf fixes.
662 * khtml/html/html_miscimpl.cpp:
663 (HTMLFormCollectionImpl::updateNameCache): Look up the name
664 attribute in the name cache, not the id cache (d'oh!)
666 2004-11-30 Darin Adler <darin@apple.com>
670 - rolled in a KDE fix for a problem that may underlie a number of crashes
672 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
673 the KDE guys to fix a subtle problem. Code said "n = n =".
675 - rolled in a KDE fix for a containingBlock crash
677 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
678 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
681 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
684 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
685 (-[KWQButton detachQButton]): Added.
686 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
687 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
688 (-[KWQButton widget]): Added.
689 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
690 (-[KWQButton resignFirstResponder]): Ditto.
691 (-[KWQButton canBecomeKeyView]): Ditto.
692 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
693 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
695 * kwq/KWQComboBox.mm:
696 (QComboBox::~QComboBox): Call detachQComboBox.
697 (-[KWQPopUpButtonCell detachQComboBox]): Added.
698 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
699 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
700 (-[KWQPopUpButton action:]): Ditto.
701 (-[KWQPopUpButton widget]): Tweaked.
702 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
703 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
704 (-[KWQPopUpButton resignFirstResponder]): Ditto.
705 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
707 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
710 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
712 * kwq/KWQScrollBar.h: Removed m_scroller field.
713 * kwq/KWQScrollBar.mm:
714 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
715 (-[KWQScrollBar detachQScrollBar]): Added.
716 (-[KWQScrollBar widget]): Added.
717 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
718 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
719 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
720 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
721 (QScrollBar::setKnobProportion): Ditto.
722 (QScrollBar::scrollbarHit): Ditto.
724 * kwq/KWQScrollView.mm:
725 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
726 hack where we don't remove right away when doing mouse tracking.
727 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
728 the hack where we don't add right away when doing mouse tracking.
730 * kwq/KWQSlider.h: Added destructor.
732 (-[KWQSlider initWithQSlider:]): Tweaked a little.
733 (-[KWQSlider detachQSlider]): Added.
734 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
735 (-[KWQSlider widget]): Added.
736 (QSlider::~QSlider): Added. Calls detachQSlider.
738 * kwq/KWQTextArea.h: Added detachQTextEdit method.
739 * kwq/KWQTextArea.mm:
740 (-[KWQTextArea detachQTextEdit]): Added.
741 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
742 (-[KWQTextArea becomeFirstResponder]): Ditto.
743 (-[KWQTextArea nextKeyView]): Ditto.
744 (-[KWQTextArea previousKeyView]): Ditto.
745 (-[KWQTextArea drawRect:]): Ditto.
746 (-[KWQTextAreaTextView insertTab:]): Ditto.
747 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
748 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
749 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
750 (-[KWQTextAreaTextView mouseDown:]): Ditto.
751 (-[KWQTextAreaTextView keyDown:]): Ditto.
752 (-[KWQTextAreaTextView keyUp:]): Ditto.
754 * kwq/KWQTextEdit.h: Added ~QTextEdit.
755 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
757 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
758 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
760 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
761 Added beforeMouseDown and afterMouseDown for use in widget implementations.
762 Removed unused hasMouseTracking function.
764 (QWidget::QWidget): Initialize two new fields.
765 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
766 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
767 (QWidget::addToSuperview): Added.
768 (QWidget::removeFromSuperview): Added.
769 (QWidget::beforeMouseDown): Added.
770 (QWidget::afterMouseDown): Added.
772 * khtml/rendering/render_layer.cpp:
773 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
774 (RenderLayer::setHasVerticalScrollbar): Ditto.
776 2004-11-30 Ken Kocienda <kocienda@apple.com>
782 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
784 * khtml/khtml_part.cpp:
785 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
786 with no blink if it is.
788 2004-11-30 Ken Kocienda <kocienda@apple.com>
794 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
796 * khtml/khtml_part.cpp:
797 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
798 or <input type=image> was checked for focus since these elements are keyboard-focusable,
799 but not mouse focusable. Also, this function did not work hard enough to set the focused
800 node, and was content to clear it if the first element checked failed the test, rather
801 than looking more at parents. This would have the effect of clearing, then resetting the
802 focus on a DIV containing a button or image with content on either side of it in the
803 process of arrowing over such content.
805 2004-11-30 Ken Kocienda <kocienda@apple.com>
809 * khtml/editing/htmlediting.cpp:
810 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
811 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
812 * khtml/khtml_part.cpp:
813 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
814 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
815 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
816 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
817 isCharacterSmartReplaceExempt virtual.
819 2004-11-30 Ken Kocienda <kocienda@apple.com>
823 * khtml/editing/htmlediting.cpp:
824 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
825 Seemed simple enough to land without review.
827 2004-11-29 Ken Kocienda <kocienda@apple.com>
831 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
832 are handled correctly now, including selections that span multiple blocks, and cases
833 where content on the pasteboard ends in newlines (or what appear to be newlines to a
834 user, really block ends or BRs). I also made one small, but important change in the
835 copy code to annotate the markup written to the pasteboard to support these selections
838 New header that defines a couple of constants used in copying and pasting.
840 * ForwardingHeaders/editing/html_interchange.h: Added.
841 * khtml/editing/html_interchange.h: Added.
843 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
844 as a new helper class, ReplacementFragment, which encapsulates information and functions
845 pertaining to a document fragment that is being inserted into a document.
847 * khtml/editing/htmlediting.cpp:
848 (khtml::ReplacementFragment::ReplacementFragment):
849 (khtml::ReplacementFragment::~ReplacementFragment):
850 (khtml::ReplacementFragment::firstChild): Simple accessor.
851 (khtml::ReplacementFragment::lastChild): Ditto.
852 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
853 the starting node to use for merging into the block containing the start of the selection.
854 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
855 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
856 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
857 special annotation comment added in by the copy code.
858 (khtml::ReplacementFragment::removeNode): Simple helper.
859 (khtml::isComment): Simple helper.
860 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
861 I would like to do better than this some day, but this check will hold us until I can do better.
862 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
863 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
864 (khtml::ReplaceSelectionCommand::doApply):
865 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
866 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
867 (khtml::ReplacementFragment::root):
868 (khtml::ReplacementFragment::type):
869 (khtml::ReplacementFragment::isEmpty):
870 (khtml::ReplacementFragment::isSingleTextNode):
871 (khtml::ReplacementFragment::isTreeFragment):
872 (khtml::ReplacementFragment::hasMoreThanOneBlock):
873 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
875 This smaller set of changes markup generation to add the newline annotation described in the
876 comment at the start of this entry.
878 * khtml/xml/dom2_rangeimpl.cpp:
879 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
880 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
881 comment annotations are added to the markup generated.
882 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
883 * kwq/WebCoreBridge.mm:
884 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
885 DOM::RangeImpl::toHTML uses annotations when generating.
889 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
890 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
891 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
892 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
893 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
894 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
895 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
896 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
897 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
898 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
899 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
900 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
901 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
902 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
903 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
904 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
905 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
906 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
908 2004-11-29 Ken Kocienda <kocienda@apple.com>
912 Made two small changes that make it possible for comments to have DOM nodes made for them
913 when pasting. This relies on some earlier work I did some days ago.
915 * khtml/xml/dom_nodeimpl.cpp:
916 (NodeImpl::startMarkup): Get the string from the comment.
917 * kwq/WebCoreBridge.mm:
918 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
919 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
920 be included in the DOM.
922 2004-11-29 Ken Kocienda <kocienda@apple.com>
926 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
927 my improved paste code.
929 * khtml/editing/visible_position.cpp:
930 (khtml::blockRelationship)
931 (khtml::visiblePositionsInDifferentBlocks)
932 (khtml::isFirstVisiblePositionInBlock)
933 (khtml::isFirstVisiblePositionInNode)
934 (khtml::isLastVisiblePositionInBlock)
935 * khtml/editing/visible_position.h
937 2004-11-29 Ken Kocienda <kocienda@apple.com>
941 * khtml/xml/dom_position.cpp:
942 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
943 specified from obeying that directive. The old code would stop at an outer block boundary in
944 the case where that block had a block as its first child. The correct behavior is to drill into
945 that inner block (and continue on drilling down, if possible), to find the correct position.
947 2004-11-29 Ken Kocienda <kocienda@apple.com>
951 Small improvements to the node-display debugging helpers.
953 * khtml/xml/dom_nodeimpl.cpp:
954 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
955 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
957 2004-11-29 Ken Kocienda <kocienda@apple.com>
961 * khtml/editing/htmlediting.cpp:
962 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
963 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
964 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
965 place after the delete.
967 2004-11-29 Ken Kocienda <kocienda@apple.com>
971 Add a new helper function to insert a paragraph separator. Will be used in my
972 upcoming paste improvments.
974 * khtml/editing/htmlediting.cpp: Added function
975 (khtml::CompositeEditCommand::insertParagraphSeparator)
976 * khtml/editing/htmlediting.h: Ditto.
978 2004-11-23 David Harrison <harrison@apple.com>
980 Added various comments.
982 * khtml/editing/htmlediting.cpp:
983 (khtml::StyleChange::init):
984 (khtml::ApplyStyleCommand::doApply):
985 (khtml::ApplyStyleCommand::applyBlockStyle):
986 (khtml::ApplyStyleCommand::applyInlineStyle):
988 2004-11-23 David Hyatt <hyatt@apple.com>
990 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
991 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
993 * khtml/rendering/render_block.cpp:
994 (khtml::RenderBlock::nodeAtPoint):
996 2004-11-22 David Hyatt <hyatt@apple.com>
998 Make sure you can use document.createElement to make a <canvas> element.
1000 * khtml/xml/dom_docimpl.cpp:
1001 (DocumentImpl::createHTMLElement):
1003 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1007 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
1008 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
1009 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
1010 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
1012 * khtml/ecma/kjs_html.cpp:
1013 (KJS::HTMLDocument::tryGet):
1014 * khtml/html/html_formimpl.cpp:
1015 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
1016 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1017 * khtml/html/html_formimpl.h:
1018 * khtml/html/html_miscimpl.cpp:
1019 (HTMLCollectionImpl::HTMLCollectionImpl):
1020 (HTMLCollectionImpl::~HTMLCollectionImpl):
1021 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1022 (HTMLCollectionImpl::CollectionInfo::reset):
1023 (HTMLCollectionImpl::resetCollectionInfo):
1024 (HTMLCollectionImpl::checkForNameMatch):
1026 (HTMLCollectionImpl::updateNameCache):
1027 (HTMLCollectionImpl::namedItems):
1028 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1029 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1030 (HTMLFormCollectionImpl::item):
1031 (HTMLFormCollectionImpl::updateNameCache):
1032 * khtml/html/html_miscimpl.h:
1034 2004-11-22 David Hyatt <hyatt@apple.com>
1036 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1041 * khtml/misc/loader.cpp:
1042 (CachedObject::finish):
1045 * khtml/misc/loader.h:
1046 (khtml::Cache::maxCacheableObjectSize):
1048 2004-11-22 David Hyatt <hyatt@apple.com>
1050 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
1051 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
1052 that lets us short circuit earlier when painting and hit testing.
1056 * khtml/khtml_part.cpp:
1057 (KHTMLPart::isPointInsideSelection):
1058 * khtml/rendering/render_block.cpp:
1059 (khtml::RenderBlock::paint):
1060 (khtml::RenderBlock::paintChildren):
1061 (khtml::RenderBlock::paintObject):
1062 (khtml::RenderBlock::paintFloats):
1063 (khtml::RenderBlock::nodeAtPoint):
1064 * khtml/rendering/render_block.h:
1065 * khtml/rendering/render_box.cpp:
1066 (RenderBox::nodeAtPoint):
1067 * khtml/rendering/render_box.h:
1068 * khtml/rendering/render_br.h:
1069 * khtml/rendering/render_canvas.cpp:
1070 (RenderCanvas::paint):
1071 * khtml/rendering/render_flow.cpp:
1072 (RenderFlow::paintLines):
1073 (RenderFlow::hitTestLines):
1074 (RenderFlow::caretRect):
1075 (RenderFlow::addFocusRingRects):
1076 (RenderFlow::paintFocusRing):
1077 (RenderFlow::paintOutlines):
1078 (RenderFlow::paintOutlineForLine):
1079 * khtml/rendering/render_flow.h:
1080 * khtml/rendering/render_frames.cpp:
1081 (RenderFrameSet::nodeAtPoint):
1082 * khtml/rendering/render_frames.h:
1083 * khtml/rendering/render_image.cpp:
1084 (RenderImage::nodeAtPoint):
1085 * khtml/rendering/render_image.h:
1086 * khtml/rendering/render_inline.cpp:
1087 (RenderInline::paint):
1088 (RenderInline::nodeAtPoint):
1089 * khtml/rendering/render_inline.h:
1090 * khtml/rendering/render_layer.cpp:
1091 (RenderLayer::paintLayer):
1092 (RenderLayer::hitTest):
1093 (RenderLayer::hitTestLayer):
1094 * khtml/rendering/render_layer.h:
1095 * khtml/rendering/render_line.cpp:
1096 (khtml::InlineBox::paint):
1097 (khtml::InlineBox::nodeAtPoint):
1098 (khtml::InlineFlowBox::flowObject):
1099 (khtml::InlineFlowBox::nodeAtPoint):
1100 (khtml::InlineFlowBox::paint):
1101 (khtml::InlineFlowBox::paintBackgrounds):
1102 (khtml::InlineFlowBox::paintBackground):
1103 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1104 (khtml::InlineFlowBox::paintDecorations):
1105 (khtml::EllipsisBox::paint):
1106 (khtml::EllipsisBox::nodeAtPoint):
1107 (khtml::RootInlineBox::paintEllipsisBox):
1108 (khtml::RootInlineBox::paint):
1109 (khtml::RootInlineBox::nodeAtPoint):
1110 * khtml/rendering/render_line.h:
1111 (khtml::InlineRunBox::paintBackgroundAndBorder):
1112 * khtml/rendering/render_object.cpp:
1113 (RenderObject::hitTest):
1114 (RenderObject::setInnerNode):
1115 (RenderObject::nodeAtPoint):
1116 * khtml/rendering/render_object.h:
1117 (khtml::RenderObject::PaintInfo::PaintInfo):
1118 (khtml::RenderObject::PaintInfo::~PaintInfo):
1119 (khtml::RenderObject::paintingRootForChildren):
1120 (khtml::RenderObject::shouldPaintWithinRoot):
1121 * khtml/rendering/render_table.cpp:
1122 (RenderTable::layout):
1123 (RenderTable::paint):
1124 * khtml/rendering/render_text.cpp:
1125 (simpleDifferenceBetweenColors):
1126 (correctedTextColor):
1127 (InlineTextBox::nodeAtPoint):
1128 (InlineTextBox::paint):
1129 (InlineTextBox::selectionStartEnd):
1130 (InlineTextBox::paintSelection):
1131 (InlineTextBox::paintMarkedTextBackground):
1132 (InlineTextBox::paintDecoration):
1133 (RenderText::posOfChar):
1134 * khtml/rendering/render_text.h:
1135 (khtml::RenderText::paint):
1136 (khtml::RenderText::layout):
1137 (khtml::RenderText::nodeAtPoint):
1138 * khtml/xml/dom2_eventsimpl.cpp:
1139 (MouseEventImpl::computeLayerPos):
1140 * khtml/xml/dom_docimpl.cpp:
1141 (DocumentImpl::prepareMouseEvent):
1142 * kwq/KWQAccObject.mm:
1143 (-[KWQAccObject accessibilityHitTest:]):
1144 * kwq/KWQKHTMLPart.mm:
1145 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1146 (KWQKHTMLPart::eventMayStartDrag):
1147 (KWQKHTMLPart::khtmlMouseMoveEvent):
1148 * kwq/WebCoreBridge.mm:
1149 (-[WebCoreBridge elementAtPoint:]):
1150 (-[WebCoreBridge _positionForPoint:]):
1152 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1156 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1157 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1159 This avoids the O(N^2) penalty for named item traversal for form collections.
1161 It also combines the item traversal logic for all non-form
1162 collection operations into a single traverseNextItem
1163 function. This avoids having 5 copies of the big switch statement
1166 Also fixed a bug that prevented the last form element from being removed properly.
1168 * khtml/html/html_formimpl.cpp:
1169 (DOM::removeFromVector):
1170 * khtml/dom/html_misc.cpp:
1171 (HTMLCollection::namedItems):
1172 * khtml/dom/html_misc.h:
1173 * khtml/ecma/kjs_html.cpp:
1174 (KJS::HTMLCollection::getNamedItems):
1175 * khtml/html/html_miscimpl.cpp:
1176 (HTMLCollectionImpl::traverseNextItem):
1177 (HTMLCollectionImpl::calcLength):
1178 (HTMLCollectionImpl::length):
1179 (HTMLCollectionImpl::item):
1180 (HTMLCollectionImpl::nextItem):
1181 (HTMLCollectionImpl::checkForNameMatch):
1182 (HTMLCollectionImpl::namedItem):
1183 (HTMLCollectionImpl::namedItems):
1184 (HTMLCollectionImpl::nextNamedItem):
1185 (HTMLFormCollectionImpl::calcLength):
1186 (HTMLFormCollectionImpl::namedItem):
1187 (HTMLFormCollectionImpl::nextNamedItem):
1188 (HTMLFormCollectionImpl::namedItems):
1189 * khtml/html/html_miscimpl.h:
1191 2004-11-22 Ken Kocienda <kocienda@apple.com>
1193 Reviewed by Harrison
1195 Change around the way we block the Javascript "Paste" command identifier from
1196 being available. Formerly, this was done with an ifdef we never compiled in.
1197 Now, this is done with a couple of cheap runtime checks. The advantage is that
1198 we can now compile this command into development builds, and still yet switch
1199 on the command in deployment builds through the use of WebCore SPI so we can
1200 write and run layout tests with all of our builds.
1202 * khtml/editing/jsediting.cpp:
1203 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1204 command being queried is the paste command.
1205 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1206 * khtml/editing/jsediting.h: Ditto.
1207 * khtml/khtml_part.cpp:
1208 (KHTMLPart::pasteFromPasteboard): Added.
1209 (KHTMLPart::canPaste): Added.
1210 * kwq/KWQKHTMLPart.mm:
1211 (KHTMLPart::canPaste): Added.
1212 * kwq/KWQRenderTreeDebug.cpp:
1213 (externalRepresentation): Turn on paste command.
1214 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1216 2004-11-21 Maciej Stachowiak <mjs@apple.com>
1218 Reviewed by Richard.
1220 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1222 * khtml/html/html_miscimpl.cpp:
1223 (HTMLCollectionImpl::calcLength):
1224 (HTMLCollectionImpl::getItem):
1225 (HTMLCollectionImpl::item):
1226 (HTMLCollectionImpl::nextItem):
1227 (HTMLCollectionImpl::getNamedItem):
1228 (HTMLCollectionImpl::namedItem):
1229 (HTMLCollectionImpl::nextNamedItemInternal):
1230 (HTMLFormCollectionImpl::nextNamedItemInternal):
1232 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1236 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
1237 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
1238 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
1240 Many optimizations to HTMLFormCollection. Iterating it should not
1241 be N^2 any more, though finding items by name could still be.
1243 * khtml/html/html_formimpl.cpp:
1244 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1245 (DOM::HTMLFormElementImpl::length):
1246 (DOM::HTMLFormElementImpl::submitClick):
1247 (DOM::HTMLFormElementImpl::formData):
1248 (DOM::HTMLFormElementImpl::submit):
1249 (DOM::HTMLFormElementImpl::reset):
1250 (DOM::HTMLFormElementImpl::radioClicked):
1251 (DOM::appendToVector):
1252 (DOM::removeFromVector):
1253 (DOM::HTMLFormElementImpl::registerFormElement):
1254 (DOM::HTMLFormElementImpl::removeFormElement):
1255 (DOM::HTMLFormElementImpl::makeFormElementDormant):
1256 (DOM::HTMLFormElementImpl::registerImgElement):
1257 (DOM::HTMLFormElementImpl::removeImgElement):
1258 * khtml/html/html_formimpl.h:
1259 * khtml/html/html_miscimpl.cpp:
1260 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
1261 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
1262 (HTMLFormCollectionImpl::resetCollectionInfo):
1263 (HTMLFormCollectionImpl::calcLength):
1264 (HTMLFormCollectionImpl::item):
1265 (HTMLFormCollectionImpl::getNamedItem):
1266 (HTMLFormCollectionImpl::getNamedFormItem):
1267 (HTMLFormCollectionImpl::firstItem):
1268 (HTMLFormCollectionImpl::nextItem):
1269 * khtml/html/html_miscimpl.h:
1270 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1271 * khtml/xml/dom_elementimpl.cpp:
1272 (ElementImpl::setAttribute):
1273 (ElementImpl::setAttributeMap):
1274 * kwq/KWQPtrVector.h:
1275 (QPtrVector::findRef):
1276 * kwq/KWQVectorImpl.h:
1277 * kwq/KWQVectorImpl.mm:
1278 (KWQVectorImpl::findRef):
1279 * kwq/WebCoreBridge.mm:
1280 (-[WebCoreBridge elementWithName:inForm:]):
1281 (-[WebCoreBridge controlsInForm:]):
1283 2004-11-19 David Harrison <harrison@apple.com>
1285 Reviewed by Ken and Darin.
1287 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
1289 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
1290 for the existing style, but in this case (hitting cmd-B with caret at top of
1291 file) there is nothing upstream. Changed this to use the VisiblePosition
1292 deepEquivalent instead.
1294 * khtml/khtml_part.cpp:
1295 (KHTMLPart::computeAndSetTypingStyle):
1299 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1303 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
1305 * khtml/xml/dom_docimpl.cpp:
1306 (DocumentImpl::close): Don't fire the onload handler if there is a
1307 redirect pending. This is a very long-standing bug that was masked
1308 by our previously incorrect redirect logic. It used to be that an
1309 older redirect would always win. Recently we changed things so
1310 that a newer redirect would win, but a script that causes a
1311 redirect would stop parsing once complete (so if there are two
1312 redirects in the same script, the latter wins). However, we should
1313 have also prevented onload in this case. Testing with other
1314 browsers shows that onload handlers do not run at all when there
1315 is a pending redirect.
1317 2004-11-19 Ken Kocienda <kocienda@apple.com>
1319 Reviewed by Harrison
1321 Fix some object lifetime issues in these two commands. This fixes some crashes
1322 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
1324 * khtml/editing/htmlediting.cpp:
1325 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
1326 in the ancestor list. They are not ref'ed when put on list. D'uh.
1327 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
1328 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
1329 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
1331 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
1333 2004-11-19 Ken Kocienda <kocienda@apple.com>
1335 Reviewed by Harrison
1339 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
1341 * khtml/khtml_part.cpp:
1342 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
1343 declaration given the current selection, and then sets the minimum necessary style as the typing
1345 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
1346 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
1348 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
1349 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
1350 * kwq/WebCoreBridge.mm:
1351 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
1352 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
1354 2004-11-18 David Harrison <harrison@apple.com>
1358 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
1359 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
1362 (-[DOMCSSStyleDeclaration setProperty:::]):
1364 2004-11-18 Chris Blumenberg <cblu@apple.com>
1366 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
1370 * kwq/KWQKHTMLPart.mm:
1371 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
1373 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1377 - fix recursive item traversal, use traverseNextNode() instead of
1378 the buggy hand-rolled traversal.
1380 * khtml/xml/dom_nodeimpl.cpp:
1381 (NodeListImpl::recursiveItem):
1383 2004-11-17 Darin Adler <darin@apple.com>
1387 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
1389 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
1390 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
1392 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1393 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
1394 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
1395 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
1396 an entire category of leaks we have been fixing one by one recently
1397 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
1398 stale RenderObject pointer, although I never saw it do that in practice
1399 - implemented the length and item methods for computed styles
1400 - implemented querying additional properties in computed styles (29 more)
1402 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1403 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
1404 take a mutable style.
1405 * khtml/khtml_part.cpp:
1406 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
1407 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
1408 a computed style; also change some types to mutable style.
1409 (updateState): Update iteration of CSSProperty objects in a style declaration to use
1410 the new valuesIterator interface.
1411 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
1412 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
1413 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
1414 including accomodating the exception code that setCssText has now.
1415 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
1416 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
1417 the style attributes really was a change, although it's not an important optimization it's
1418 good to do it right.
1420 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
1421 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
1422 calling it were already removing the old property explicitly, so the code in here to remove
1423 the property again was redundant.
1425 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
1426 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
1427 * khtml/css/css_computedstyle.cpp:
1428 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
1429 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
1430 Before we had no guarantee the object would outlast us.
1431 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1432 exception to NO_MODIFICATION_ALLOWED_ERR.
1433 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1434 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1435 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1436 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1437 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1438 page-break-inside, position, unicode-bidi, widows, z-index.
1439 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1440 exception to NO_MODIFICATION_ALLOWED_ERR.
1441 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1442 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1443 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1444 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1445 CSSMutableStyleDeclarationImpl.
1446 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1447 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1449 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1450 now a separate class rather than a typedef.
1451 * khtml/css/cssparser.h: Ditto.
1453 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1454 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1455 Removed a bunch of redundant stuff from other classes in this file too.
1456 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1457 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1458 (DOM::CSSProperty::operator=): Added.
1459 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1461 * khtml/css/css_valueimpl.cpp:
1462 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1463 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1464 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1465 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1466 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1467 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1468 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1469 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1470 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1471 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1472 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1473 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1474 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1475 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1476 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1477 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1478 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1479 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1480 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1481 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1482 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1483 no styles in the list. Update to use QValueList.
1484 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1485 parameter and set it.
1486 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1487 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1488 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1489 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1490 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1491 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1493 * khtml/css/cssparser.cpp:
1494 (CSSParser::parseValue): Changed to use addParsedProperties.
1495 (CSSParser::parseDeclaration): Ditto.
1496 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1498 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
1499 * khtml/css/cssproperties.c: Regenerated.
1500 * khtml/css/cssproperties.h: Regenerated.
1502 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
1503 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
1505 * khtml/dom/css_value.cpp:
1506 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
1507 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
1508 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
1509 first doing getPropertyCSSValue and then doing cssText.
1510 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
1511 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
1512 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
1513 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
1514 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
1515 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
1516 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
1518 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
1519 * khtml/dom/dom_node.cpp: Ditto.
1521 * khtml/editing/htmlediting.h: Change some types to mutable style.
1522 * khtml/editing/htmlediting.cpp:
1523 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
1524 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
1525 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
1526 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
1527 (khtml::EditCommand::setTypingStyle): Ditto.
1528 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
1529 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
1530 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
1531 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1532 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
1533 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
1534 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
1535 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1536 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1537 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1538 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
1539 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1540 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
1542 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
1543 * khtml/html/html_baseimpl.h: Change type to mutable style.
1544 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
1546 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
1547 class as a base class, and change types to mutable style as needed.
1548 * khtml/html/html_elementimpl.cpp:
1549 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
1550 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
1551 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
1552 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
1553 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
1554 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
1556 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
1559 * khtml/html/html_tableimpl.h: Change types to mutable style.
1560 * khtml/html/html_tableimpl.cpp:
1561 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1562 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
1563 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1565 * khtml/html/htmlparser.cpp:
1566 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
1567 than using an explicit delete to make the node go away, and is required for compatibility with the
1568 changes to the NodeImpl functions.
1569 (KHTMLParser::insertNode): Ditto.
1570 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
1571 the NodeImpl functions.
1573 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
1574 now that there's no need to make the property list explictly.
1577 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
1578 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
1579 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
1581 * khtml/xml/dom_nodeimpl.cpp:
1582 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
1583 function succeeded or not for ownership purposes.
1584 (NodeImpl::replaceChild): Ditto.
1585 (NodeImpl::appendChild): Ditto.
1586 (NodeBaseImpl::insertBefore): Ditto.
1587 (NodeBaseImpl::replaceChild): Ditto.
1588 (NodeBaseImpl::appendChild): Ditto.
1589 (NodeBaseImpl::addChild): Ditto.
1591 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
1592 * WebCore-combined.exp: Regenerated.
1594 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1596 still even more build fixing
1598 * khtml/html/html_miscimpl.cpp:
1599 (HTMLCollectionImpl::resetCollectionInfo):
1601 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1605 * khtml/html/html_miscimpl.cpp:
1606 (HTMLCollectionImpl::resetCollectionInfo):
1608 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1610 Fixed build problem.
1612 * khtml/html/html_miscimpl.h:
1613 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
1615 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1619 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
1621 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
1622 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
1624 This is also a start on fixing 5 other bugs, but those need additional work to make
1625 HTMLFormCollection fast.
1627 * khtml/html/html_documentimpl.h:
1628 (DOM::HTMLDocumentImpl::collectionInfo):
1629 * khtml/html/html_formimpl.cpp:
1630 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1631 (DOM::HTMLFormElementImpl::isURLAttribute):
1632 (DOM::HTMLFormElementImpl::registerImgElement):
1633 (DOM::HTMLFormElementImpl::removeImgElement):
1634 * khtml/html/html_formimpl.h:
1635 * khtml/html/html_imageimpl.cpp:
1636 (HTMLImageElementImpl::HTMLImageElementImpl):
1637 (HTMLImageElementImpl::~HTMLImageElementImpl):
1638 * khtml/html/html_imageimpl.h:
1639 * khtml/html/html_miscimpl.cpp:
1640 (HTMLCollectionImpl::HTMLCollectionImpl):
1641 (HTMLCollectionImpl::~HTMLCollectionImpl):
1642 (HTMLCollectionImpl::updateCollectionInfo):
1643 (HTMLCollectionImpl::length):
1644 (HTMLCollectionImpl::item):
1645 (HTMLCollectionImpl::firstItem):
1646 (HTMLCollectionImpl::nextItem):
1647 (HTMLCollectionImpl::namedItem):
1648 (HTMLCollectionImpl::nextNamedItemInternal):
1649 (HTMLFormCollectionImpl::getNamedFormItem):
1650 * khtml/html/html_miscimpl.h:
1651 (DOM::HTMLCollectionImpl::):
1652 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1653 * khtml/html/htmlparser.cpp:
1654 (KHTMLParser::getElement):
1655 * khtml/xml/dom_docimpl.cpp:
1656 (DocumentImpl::DocumentImpl):
1657 * khtml/xml/dom_docimpl.h:
1658 (DOM::DocumentImpl::incDOMTreeVersion):
1659 (DOM::DocumentImpl::domTreeVersion):
1660 * khtml/xml/dom_nodeimpl.cpp:
1664 2004-11-18 Kevin Decker <kdecker@apple.com>
1668 fixed: <rdar://problem/3841842> getPropertyID expensive
1671 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
1673 2004-11-17 David Hyatt <hyatt@apple.com>
1675 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
1676 and subsequently backed out).
1678 Reviewed by kocienda
1680 * khtml/html/html_baseimpl.cpp:
1681 (HTMLBodyElementImpl::insertedIntoDocument):
1682 * khtml/html/htmltokenizer.cpp:
1683 (khtml::HTMLTokenizer::reset):
1684 (khtml::HTMLTokenizer::scriptHandler):
1685 (khtml::HTMLTokenizer::scriptExecution):
1686 (khtml::HTMLTokenizer::write):
1687 (khtml::HTMLTokenizer::continueProcessing):
1688 (khtml::HTMLTokenizer::timerEvent):
1689 (khtml::HTMLTokenizer::notifyFinished):
1690 * khtml/html/htmltokenizer.h:
1691 * khtml/khtmlview.cpp:
1692 (KHTMLViewPrivate::KHTMLViewPrivate):
1693 (KHTMLViewPrivate::reset):
1695 (KHTMLView::layout):
1696 (KHTMLView::timerEvent):
1697 (KHTMLView::scheduleRelayout):
1698 (KHTMLView::layoutPending):
1699 (KHTMLView::haveDelayedLayoutScheduled):
1700 (KHTMLView::unscheduleRelayout):
1701 * khtml/khtmlview.h:
1702 * khtml/xml/dom_docimpl.cpp:
1703 (DocumentImpl::DocumentImpl):
1704 (DocumentImpl::close):
1705 (DocumentImpl::setParsing):
1706 (DocumentImpl::shouldScheduleLayout):
1707 (DocumentImpl::minimumLayoutDelay):
1708 (DocumentImpl::write):
1709 (DocumentImpl::finishParsing):
1710 (DocumentImpl::stylesheetLoaded):
1711 (DocumentImpl::updateStyleSelector):
1712 * khtml/xml/dom_docimpl.h:
1713 (DOM::DocumentImpl::parsing):
1714 * kwq/KWQDateTime.mm:
1715 (KWQUIEventTime::uiEventPending):
1717 2004-11-17 David Harrison <harrison@apple.com>
1719 Reviewed by Ken Kocienda.
1721 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
1722 Treat null case as meaning no post-move merge is needed.
1724 * khtml/editing/htmlediting.cpp:
1725 (khtml::DeleteSelectionCommand::initializePositionData):
1727 2004-11-17 David Harrison <harrison@apple.com>
1729 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
1730 * khtml/xml/dom_nodeimpl.cpp:
1731 (NodeImpl::displayNode):
1732 (NodeImpl::displayTree):
1733 (NodeBaseImpl::dispatchChildRemovalEvents):
1734 * khtml/xml/dom_nodeimpl.h:
1736 2004-11-16 John Sullivan <sullivan@apple.com>
1738 Reviewed by Richard.
1740 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
1742 * khtml/khtml_part.cpp:
1744 delete the list we created when we're done with it
1746 2004-11-16 Ken Kocienda <kocienda@apple.com>
1750 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
1751 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
1752 QPtrList when the list goes out of scope.
1754 * khtml/editing/htmlediting.cpp:
1755 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
1756 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
1757 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
1758 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1759 No longer set lists to autodelete.
1760 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
1761 Call new derefNodesInList helper.
1762 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
1763 of one before, but now it does.
1765 2004-11-15 David Harrison <harrison@apple.com>
1767 Reviewed by Chris and Darin.
1769 <rdar://problem/3880304> Non-linear performance hit for style changes
1771 * khtml/xml/dom_nodeimpl.cpp:
1772 (NodeImpl::traverseNextNode):
1773 (NodeImpl::traverseNextSibling):
1774 (NodeImpl::traversePreviousNodePostOrder):
1775 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
1776 Add asserts that stayWithin is an ancestor of the returned node.
1778 2004-11-15 Darin Adler <darin@apple.com>
1782 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
1784 * khtml/css/css_computedstyle.cpp:
1785 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
1786 since there's no guarantee it's already ref'd.
1787 * khtml/css/css_valueimpl.cpp:
1788 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
1789 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
1790 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
1791 (CSSStyleDeclarationImpl::merge): Ditto.
1792 (CSSStyleDeclarationImpl::diff): Ditto.
1793 * khtml/editing/htmlediting.cpp:
1794 (khtml::StyleChange::currentlyHasStyle): Ditto.
1795 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1796 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
1797 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
1799 2004-11-15 Darin Adler <darin@apple.com>
1803 Use separate mutable style and computed style types as appropriate.
1804 For now this should have no effect, but it prepares us for refactoring later.
1805 Also remove some unnecessary "DOM::" prefixes and in one case factor out
1808 * khtml/khtml_part.cpp:
1809 (KHTMLPart::typingStyle):
1810 (KHTMLPart::setTypingStyle):
1812 (KHTMLPart::selectionHasStyle):
1813 (KHTMLPart::selectionStartHasStyle):
1814 (KHTMLPart::selectionComputedStyle):
1815 * khtml/khtml_part.h:
1816 * khtml/khtmlpart_p.h:
1818 * khtml/css/css_base.h:
1819 * khtml/css/css_ruleimpl.cpp:
1820 (CSSStyleRuleImpl::setDeclaration):
1821 * khtml/css/css_ruleimpl.h:
1822 (DOM::CSSFontFaceRuleImpl::style):
1823 (DOM::CSSPageRuleImpl::style):
1824 (DOM::CSSStyleRuleImpl::style):
1825 (DOM::CSSStyleRuleImpl::declaration):
1826 * khtml/css/css_valueimpl.h:
1827 (DOM::CSSPrimitiveValueImpl::):
1828 * khtml/css/cssparser.cpp:
1829 (CSSParser::parseValue):
1830 (CSSParser::parseColor):
1831 (CSSParser::parseDeclaration):
1832 (CSSParser::createStyleDeclaration):
1833 * khtml/css/cssparser.h:
1834 * khtml/css/cssstyleselector.cpp:
1835 (khtml::CSSStyleSelector::addMatchedDeclaration):
1836 (khtml::CSSStyleSelector::matchRulesForList):
1837 (khtml::CSSStyleSelector::styleForElement):
1838 (khtml::CSSStyleSelector::applyDeclarations):
1839 * khtml/css/cssstyleselector.h:
1840 * khtml/css/parser.cpp:
1841 * khtml/css/parser.y:
1842 * khtml/dom/css_rule.h:
1843 * khtml/dom/css_stylesheet.h:
1844 * khtml/dom/css_value.h:
1845 * khtml/dom/dom2_views.cpp:
1846 * khtml/xml/dom2_viewsimpl.cpp:
1847 (DOM::AbstractViewImpl::getComputedStyle):
1848 * khtml/xml/dom_docimpl.cpp:
1849 (DocumentImpl::importNode):
1850 (DocumentImpl::setStyleSheet):
1851 * khtml/xml/dom_docimpl.h:
1852 * khtml/xml/dom_xmlimpl.cpp:
1853 (DOM::ProcessingInstructionImpl::setStyleSheet):
1854 * khtml/xml/dom_xmlimpl.h:
1856 * khtml/dom/css_value.cpp:
1857 (DOM::throwException): Added.
1858 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
1859 The real thing is coming with the next change to refactor.
1860 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
1861 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
1863 2004-11-15 Darin Adler <darin@apple.com>
1867 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
1869 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
1870 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
1871 node's attributes changed without sending a misleading childrenChanged call,
1872 but the childrenChanged call can happen at the exact right moment.
1873 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
1874 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
1875 the boolean true is passed in.
1877 * khtml/xml/dom_elementimpl.cpp:
1878 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
1879 (NamedAttrMapImpl::removeAttribute): Ditto.
1881 2004-11-15 John Sullivan <sullivan@apple.com>
1885 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
1886 seen often in Mail and Blot
1888 * khtml/css/css_valueimpl.cpp:
1889 (CSSStyleDeclarationImpl::copyPropertiesInSet):
1890 delete temporary list after we're done using it
1892 2004-11-15 Richard Williamson <rjw@apple.com>
1894 Fixed leak (3879883) that John found. Early return leaked
1899 * khtml/css/css_computedstyle.cpp:
1900 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1902 2004-11-15 Ken Kocienda <kocienda@apple.com>
1908 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
1910 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
1911 EditCommandPtr to its parent, but this caused a a reference cycle in composite
1912 commands as the children held a ref to their parent. Now, the parent variable
1913 is a non-retained reference to an EditCommand *. It would be nice to have a
1914 weak reference to the parent or even override deref in composite commands (but I
1915 can't since deref() is not virtual). However, this should be OK since any
1916 dangling parent pointer is a sign of a bigger object lifetime problem that
1917 would need to be addressed anyway.
1919 * khtml/css/css_valueimpl.cpp:
1920 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
1921 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
1922 just assigning the list variable passed in to the local list variable, or the list will be
1924 * khtml/editing/htmlediting.cpp:
1925 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
1926 (khtml::EditCommand::setEndingSelection): Ditto.
1927 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
1928 Unrelated to the change, but saves some ref's and deref's.
1929 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
1930 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
1931 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
1932 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
1934 2004-11-15 Maciej Stachowiak <mjs@apple.com>
1938 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
1940 * khtml/xml/dom_nodeimpl.cpp:
1941 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
1943 (NodeListImpl::recursiveLength): Adjusted for rename.
1944 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
1945 If the same offset is looked up again, just return it, otherwise, if looking up
1946 a later offset, start at the last item and proceed from there.
1947 (NodeListImpl::itemById): Apply the special document optimization to all
1948 nodes that are either a document or in a document - just walk up to make
1949 sure the node found by ID has the root node as an ancestor.
1950 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
1951 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
1953 2004-11-15 John Sullivan <sullivan@apple.com>
1957 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
1959 * kwq/KWQKHTMLPart.mm:
1960 (KWQKHTMLPart::documentFragmentWithText):
1961 release mutable copy of string after we're done using it
1963 2004-11-14 Kevin Decker <kdecker@apple.com>
1967 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
1969 * khtml/html/html_elementimpl.cpp:
1970 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
1971 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
1973 2004-11-13 Maciej Stachowiak <mjs@apple.com>
1977 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
1979 * khtml/dom/dom_node.cpp:
1980 (NodeList::itemById): New method, just forward to impl.
1981 * khtml/dom/dom_node.h: Prototype it.
1982 * khtml/ecma/kjs_dom.cpp:
1983 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
1984 let the NodeList do it. The NodeList might be able to do it more efficiently.
1985 * khtml/xml/dom_nodeimpl.cpp:
1986 (NodeListImpl::itemById): Optimize for the case where the NodeList
1987 covers the whole document. In this case, just use getElementById,
1988 then check that the element satisfies the list criteria.
1989 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
1990 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
1991 * khtml/xml/dom_nodeimpl.h:
1993 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1997 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
1998 sometimes using a huge bogus length value.
2000 * khtml/xml/dom_nodeimpl.cpp:
2001 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
2003 2004-11-12 Darin Adler <darin@apple.com>
2007 - fixed an infinite loop in that last check-in
2009 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
2010 Added a ++i to the loop so it won't get stuck on the first element in the list.
2012 2004-11-12 Maciej Stachowiak <mjs@apple.com>
2016 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
2018 I fixed this by changing NodeLists to cache their length, but
2019 invalidate it whenever there is a change in the DOM subtree at
2020 which they are rooted. This makes NodeListImpl::recursiveLength()
2021 drop completely off the profile, since we were repeatedly getting
2022 a length for the same NodeList over and over.
2024 * khtml/xml/dom_nodeimpl.cpp:
2025 (NodeImpl::NodeImpl):
2026 (NodeImpl::~NodeImpl):
2027 (NodeImpl::registerNodeList):
2028 (NodeImpl::unregisterNodeList):
2029 (NodeImpl::notifyLocalNodeListsSubtreeModified):
2030 (NodeImpl::notifyNodeListsSubtreeModified):
2031 (NodeImpl::dispatchSubtreeModifiedEvent):
2032 (NodeListImpl::NodeListImpl):
2033 (NodeListImpl::~NodeListImpl):
2034 (NodeListImpl::recursiveLength):
2035 (NodeListImpl::recursiveItem):
2036 (NodeListImpl::rootNodeSubtreeModified):
2037 (ChildNodeListImpl::ChildNodeListImpl):
2038 (ChildNodeListImpl::length):
2039 (ChildNodeListImpl::item):
2040 (TagNodeListImpl::TagNodeListImpl):
2041 (TagNodeListImpl::length):
2042 (TagNodeListImpl::item):
2043 (NameNodeListImpl::NameNodeListImpl):
2044 (NameNodeListImpl::length):
2045 (NameNodeListImpl::item):
2046 * khtml/xml/dom_nodeimpl.h:
2048 2004-11-12 Darin Adler <darin@apple.com>
2052 - various small cleanups
2054 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2055 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2057 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2058 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2059 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2060 * khtml/html/htmltokenizer.cpp:
2061 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2062 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2064 * khtml/khtml_part.h: Removed docImpl function.
2065 * khtml/khtml_part.cpp: Ditto.
2067 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2068 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2070 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2071 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2072 part of the change last time, which is why the build broke).
2073 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2074 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2075 (KWQKHTMLPart::keyEvent): Ditto.
2076 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2077 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2079 2004-11-12 Chris Blumenberg <cblu@apple.com>
2081 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2085 * kwq/KWQKHTMLPart.mm:
2086 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2090 2004-11-12 Darin Adler <darin@apple.com>
2094 - fixed a couple places that would not work for XML documents
2096 * khtml/ecma/kjs_window.cpp:
2097 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2098 is present on the base class.
2099 (WindowFunc::tryCall): More of the same.
2101 2004-11-12 Darin Adler <darin@apple.com>
2103 - land versions of these files generated by the newer gperf
2105 People building on Panther will continue to see these files modified.
2106 A workaround would be to install the newer gperf on our Tiger build machines.
2108 * khtml/css/cssproperties.c: Regenerated.
2109 * khtml/css/cssvalues.c: Regenerated.
2110 * khtml/html/doctypes.cpp: Regenerated.
2111 * khtml/html/kentities.c: Regenerated.
2112 * khtml/misc/htmlattrs.c: Regenerated.
2113 * khtml/misc/htmltags.c: Regenerated.
2114 * kwq/KWQColorData.c: Regenerated.
2116 2004-11-11 Richard Williamson <rjw@apple.com>
2118 Fix build horkage from previous checkin.
2120 * kwq/KWQKHTMLPart.h:
2122 2004-11-11 Darin Adler <darin@apple.com>
2126 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2128 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2130 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2131 * kwq/KWQKHTMLPart.mm:
2132 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2133 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2134 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2135 makes dragging text work again.
2136 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2138 2004-11-11 David Hyatt <hyatt@apple.com>
2140 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2144 * khtml/html/htmltokenizer.cpp:
2145 (khtml::HTMLTokenizer::continueProcessing):
2147 2004-11-11 Ken Kocienda <kocienda@apple.com>
2151 * khtml/editing/htmlediting.cpp:
2152 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2153 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2154 with the prevailing style for the VisiblePosition class.
2155 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2156 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2157 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2158 (khtml::isLastVisiblePositionInBlock): Ditto.
2159 (khtml::isLastVisiblePositionInNode): Ditto.
2160 * khtml/editing/visible_position.h: Add declarations for new functions.
2162 2004-11-11 Ken Kocienda <kocienda@apple.com>
2166 * khtml/editing/htmlediting.cpp:
2167 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2168 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2169 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2170 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2171 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2172 * khtml/xml/dom2_rangeimpl.cpp:
2173 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2174 * khtml/xml/dom2_rangeimpl.h: Ditto.
2176 2004-11-11 Ken Kocienda <kocienda@apple.com>
2178 Reviewed by Harrison
2180 Some improvements to deleting when complete lines are selected.
2182 * khtml/editing/htmlediting.cpp:
2183 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2184 the end of a selection is fully selected. Turn off block merging in this case.
2185 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2186 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2187 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2188 start block is selected. This new code will now delete this block in one call, rather
2189 than iterating over each child.
2190 * khtml/editing/visible_position.cpp:
2191 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2192 to do the work mentioned above in the comment for that function.
2193 (khtml::isFirstVisiblePositionOnLine): Ditto.
2194 (khtml::isLastVisiblePositionOnLine): Ditto.
2195 * khtml/editing/visible_position.h: Add new functions.
2196 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2197 * layout-tests/editing/deleting/delete-line-001.html: Added.
2198 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2199 * layout-tests/editing/deleting/delete-line-002.html: Added.
2200 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2201 * layout-tests/editing/deleting/delete-line-003.html: Added.
2202 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2203 * layout-tests/editing/deleting/delete-line-004.html: Added.
2204 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2205 * layout-tests/editing/deleting/delete-line-005.html: Added.
2206 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2207 * layout-tests/editing/deleting/delete-line-006.html: Added.
2208 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2209 * layout-tests/editing/deleting/delete-line-007.html: Added.
2210 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2211 * layout-tests/editing/deleting/delete-line-008.html: Added.
2212 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2213 * layout-tests/editing/deleting/delete-line-009.html: Added.
2214 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2215 * layout-tests/editing/deleting/delete-line-010.html: Added.
2216 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2217 * layout-tests/editing/deleting/delete-line-011.html: Added.
2218 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2219 * layout-tests/editing/deleting/delete-line-012.html: Added.
2221 2004-11-11 Ken Kocienda <kocienda@apple.com>
2225 * khtml/editing/htmlediting.cpp:
2226 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2228 2004-11-11 Ken Kocienda <kocienda@apple.com>
2234 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
2235 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
2237 * khtml/editing/selection.cpp:
2238 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
2239 the next line position when necessary.
2240 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
2241 * layout-tests/editing/selection/move-3875618-fix.html: Added.
2242 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
2243 * layout-tests/editing/selection/move-3875641-fix.html: Added.
2245 2004-11-11 Ken Kocienda <kocienda@apple.com>
2249 Improved some function names, at John's urging. No changes to the
2250 functions themselves.
2252 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
2253 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
2254 performGeneralDelete() --> handleGeneralDelete()
2256 * khtml/editing/htmlediting.cpp:
2257 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
2258 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
2259 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2260 (khtml::DeleteSelectionCommand::doApply)
2261 * khtml/editing/htmlediting.h
2263 2004-11-11 Ken Kocienda <kocienda@apple.com>
2267 Updated some layout test results that changed as a result of my last checking.
2268 Added a new test that has been in my tree for a few days.
2270 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2271 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
2272 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
2273 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
2275 2004-11-11 Ken Kocienda <kocienda@apple.com>
2279 * khtml/editing/htmlediting.cpp:
2280 (khtml::debugNode): New debugging helper.
2281 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
2282 startPositionForDelete() and endPositionForDelete() functions. Just use the
2283 m_selectionToDelete object to determine start and end positions for the delete.
2284 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
2285 function that creates a special case for deleting all the content in a root
2287 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
2288 function before BR special case and the general case delete functions.
2289 * khtml/editing/htmlediting.h: Updated for changed functions.
2291 2004-11-10 Kevin Decker <kdecker@apple.com>
2295 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
2297 * khtml/ecma/kjs_dom.cpp:
2298 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
2300 2004-11-10 Ken Kocienda <kocienda@apple.com>
2304 * khtml/editing/htmlediting.cpp:
2305 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
2306 smart delete from the two functions below to here. There was an unnecessary double
2307 calculation of the leading and trailing whitespace positions. Also refined the trailing
2308 case so it only acts when the leading position is null (which seems to match TextEdit in
2309 my tests). Also removed some unnecessary copying of Position objects.
2310 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
2312 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2314 2004-11-10 Ken Kocienda <kocienda@apple.com>
2316 Reviewed by Harrison
2318 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
2319 make things more clear.
2320 * khtml/editing/selection.cpp:
2321 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
2322 resulting positions do not cross block boundaries. This was a bug and caused some
2323 delete problems when whole blocks were selected. I will be addressing that issue
2324 more fully in upcoming changes.
2326 2004-11-10 Ken Kocienda <kocienda@apple.com>
2328 Reviewed by Harrison
2330 Some cleanups and fixes in upstream and downstream functions.
2332 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
2333 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
2334 block's enclosing block will be returned.
2336 Remove code from upstream that confined the serach to block boundaries outside of
2337 the code which runs in the StayInBlock case. This code was redundant, and caused
2338 incorrect results to be returned in the DoNotStayInBlock case.
2340 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
2341 node, not the the this pointer's node.
2343 * khtml/xml/dom_position.cpp:
2344 (DOM::Position::upstream)
2345 (DOM::Position::downstream)
2347 2004-11-09 David Hyatt <hyatt@apple.com>
2349 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
2350 loading large local files.
2354 * khtml/html/htmltokenizer.cpp:
2355 (khtml::HTMLTokenizer::HTMLTokenizer):
2356 (khtml::HTMLTokenizer::reset):
2357 (khtml::HTMLTokenizer::write):
2358 (khtml::HTMLTokenizer::stopped):
2359 (khtml::HTMLTokenizer::processingData):
2360 (khtml::HTMLTokenizer::continueProcessing):
2361 (khtml::HTMLTokenizer::timerEvent):
2362 (khtml::HTMLTokenizer::allDataProcessed):
2363 (khtml::HTMLTokenizer::end):
2364 (khtml::HTMLTokenizer::finish):
2365 (khtml::HTMLTokenizer::notifyFinished):
2366 * khtml/html/htmltokenizer.h:
2367 * khtml/khtml_part.cpp:
2368 (KHTMLPart::slotFinished):
2371 * khtml/khtml_part.h:
2372 (KHTMLPart::tokenizerProcessedData):
2373 * khtml/khtmlview.cpp:
2374 * khtml/xml/dom_docimpl.cpp:
2375 * khtml/xml/xml_tokenizer.h:
2376 (khtml::Tokenizer::stopped):
2377 (khtml::Tokenizer::processingData):
2378 * kwq/KWQDateTime.h:
2379 * kwq/KWQDateTime.mm:
2380 (QDateTime::secsTo):
2381 (KWQUIEventTime::uiEventPending):
2382 * kwq/KWQKHTMLPart.h:
2383 * kwq/KWQKHTMLPart.mm:
2384 (KWQKHTMLPart::tokenizerProcessedData):
2385 * kwq/WebCoreBridge.h:
2386 * kwq/WebCoreBridge.mm:
2387 (-[WebCoreBridge stop]):
2388 (-[WebCoreBridge numPendingOrLoadingRequests]):
2389 (-[WebCoreBridge doneProcessingData]):
2391 2004-11-09 David Harrison <harrison@apple.com>
2393 Reviewed by Ken Kocienda.
2395 <rdar://problem/3865837> Wrong text style after delete to start of document
2397 * khtml/editing/htmlediting.cpp:
2398 (khtml::DeleteSelectionCommand::saveTypingStyleState):
2399 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
2401 2004-11-09 Richard Williamson <rjw@apple.com>
2403 Fixed <rdar://problem/3872440> NSTimer prematurely released.
2412 2004-11-09 Chris Blumenberg <cblu@apple.com>
2416 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
2418 2004-11-08 David Harrison <harrison@apple.com>
2420 Reviewed by Ken Kocienda.
2422 <rdar://problem/3865854> Deleting first line deletes all lines
2424 * khtml/editing/htmlediting.cpp:
2425 (khtml::DeleteSelectionCommand::performGeneralDelete):
2426 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
2427 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
2428 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
2429 update because it is handled in calculateEndingPosition now.
2430 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
2431 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2433 2004-11-08 Ken Kocienda <kocienda@apple.com>
2437 * khtml/html/html_elementimpl.cpp:
2438 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2439 are added to the DOM.
2440 * khtml/html/html_elementimpl.h: Ditto.
2441 * khtml/html/htmlparser.cpp:
2442 (KHTMLParser::KHTMLParser): Ditto.
2443 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2444 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2445 * khtml/html/htmltokenizer.cpp:
2446 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2447 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2448 There were a couple of indexing errors that resulted in the comment text containing part of the
2450 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2451 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
2453 2004-11-08 Chris Blumenberg <cblu@apple.com>
2455 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2459 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2460 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2461 * kwq/KWQKHTMLPart.h: ditto
2463 2004-11-08 Darin Adler <darin@apple.com>
2467 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2469 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2470 that possibly deletes the QTimer.
2472 2004-11-08 Chris Blumenberg <cblu@apple.com>
2474 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2478 * kwq/KWQTextField.mm:
2479 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2480 * kwq/WebCoreBridge.h:
2482 2004-11-08 David Harrison <harrison@apple.com>
2486 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2488 * khtml/editing/htmlediting.cpp:
2489 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2490 * khtml/xml/dom_nodeimpl.cpp:
2491 (NodeImpl::enclosingInlineElement):
2492 * khtml/xml/dom_nodeimpl.h:
2494 2004-11-05 Chris Blumenberg <cblu@apple.com>
2496 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
2500 * khtml/editing/htmlediting.cpp:
2501 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
2502 * khtml/editing/visible_position.cpp:
2503 (khtml::VisiblePosition::character): new, returns the character for the position
2504 * khtml/editing/visible_position.h:
2505 * kwq/KWQKHTMLPart.h:
2506 * kwq/KWQKHTMLPart.mm:
2507 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
2508 * kwq/WebCoreBridge.h:
2512 2004-11-05 Adele Amchan <adele@apple.com>
2516 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
2517 and a workaround for displaying transparent backgrounds for textareas.
2519 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
2520 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
2521 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
2522 on the contentView, and on the textView.
2524 2004-11-04 David Hyatt <hyatt@apple.com>
2526 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
2529 Reviewed by darin or ken
2531 * khtml/rendering/bidi.cpp:
2532 (khtml::appendRunsForObject):
2533 (khtml::RenderBlock::skipWhitespace):
2534 (khtml::RenderBlock::findNextLineBreak):
2535 * khtml/rendering/render_block.cpp:
2536 (khtml::RenderBlock::lowestPosition):
2537 (khtml::RenderBlock::rightmostPosition):
2538 (khtml::RenderBlock::leftmostPosition):
2539 * khtml/rendering/render_box.cpp:
2540 (RenderBox::position):
2541 * khtml/rendering/render_box.h:
2542 (khtml::RenderBox::staticX):
2543 (khtml::RenderBox::staticY):
2544 * khtml/rendering/render_layer.cpp:
2545 (RenderLayer::updateLayerPosition):
2546 (RenderLayer::convertToLayerCoords):
2547 * khtml/rendering/render_line.cpp:
2548 (khtml::InlineFlowBox::placeBoxesHorizontally):
2549 * khtml/rendering/render_object.h:
2550 (khtml::RenderObject::staticX):
2551 (khtml::RenderObject::staticY):
2553 Finish turning on XSLT. Make sure child stylesheets can load.
2555 * khtml/xsl/xslt_processorimpl.cpp:
2556 (DOM::stylesheetLoadFunc):
2557 (DOM::XSLTProcessorImpl::transformDocument):
2559 2004-11-04 David Hyatt <hyatt@apple.com>
2561 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
2562 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
2563 keyword and length values.
2567 * khtml/css/cssparser.cpp:
2568 (CSSParser::parseValue):
2569 (CSSParser::addBackgroundValue):
2570 (CSSParser::parseBackgroundShorthand):
2571 (CSSParser::parseBackgroundColor):
2572 (CSSParser::parseBackgroundImage):
2573 (CSSParser::parseBackgroundPositionXY):
2574 (CSSParser::parseBackgroundPosition):
2575 (CSSParser::parseBackgroundProperty):
2576 (CSSParser::parseColorFromValue):
2577 * khtml/css/cssparser.h:
2578 * khtml/css/cssstyleselector.cpp:
2579 (khtml::CSSStyleSelector::adjustRenderStyle):
2580 (khtml::CSSStyleSelector::applyProperty):
2581 (khtml::CSSStyleSelector::mapBackgroundAttachment):
2582 (khtml::CSSStyleSelector::mapBackgroundImage):
2583 (khtml::CSSStyleSelector::mapBackgroundRepeat):
2584 (khtml::CSSStyleSelector::mapBackgroundXPosition):
2585 (khtml::CSSStyleSelector::mapBackgroundYPosition):
2586 * khtml/css/cssstyleselector.h:
2587 * khtml/rendering/render_box.cpp:
2588 (RenderBox::paintRootBoxDecorations):
2589 (RenderBox::paintBoxDecorations):
2590 (RenderBox::paintBackgrounds):
2591 (RenderBox::paintBackground):
2592 (RenderBox::paintBackgroundExtended):
2593 * khtml/rendering/render_box.h:
2594 * khtml/rendering/render_form.cpp:
2595 (RenderFieldset::paintBoxDecorations):
2596 * khtml/rendering/render_line.cpp:
2597 (khtml::InlineFlowBox::paintBackgrounds):
2598 (khtml::InlineFlowBox::paintBackground):
2599 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2600 * khtml/rendering/render_line.h:
2601 * khtml/rendering/render_object.cpp:
2602 (RenderObject::setStyle):
2603 (RenderObject::updateBackgroundImages):
2604 (RenderObject::getVerticalPosition):
2605 * khtml/rendering/render_object.h:
2606 (khtml::RenderObject::paintBackgroundExtended):
2607 * khtml/rendering/render_style.cpp:
2609 (BackgroundLayer::BackgroundLayer):
2610 (BackgroundLayer::~BackgroundLayer):
2611 (BackgroundLayer::operator=):
2612 (BackgroundLayer::operator==):
2613 (BackgroundLayer::fillUnsetProperties):
2614 (BackgroundLayer::cullEmptyLayers):
2615 (StyleBackgroundData::StyleBackgroundData):
2616 (StyleBackgroundData::operator==):
2617 (RenderStyle::diff):
2618 (RenderStyle::adjustBackgroundLayers):
2619 * khtml/rendering/render_style.h:
2620 (khtml::OutlineValue::operator==):
2621 (khtml::OutlineValue::operator!=):
2622 (khtml::BackgroundLayer::backgroundImage):
2623 (khtml::BackgroundLayer::backgroundXPosition):
2624 (khtml::BackgroundLayer::backgroundYPosition):
2625 (khtml::BackgroundLayer::backgroundAttachment):
2626 (khtml::BackgroundLayer::backgroundRepeat):
2627 (khtml::BackgroundLayer::next):
2628 (khtml::BackgroundLayer::isBackgroundImageSet):
2629 (khtml::BackgroundLayer::isBackgroundXPositionSet):
2630 (khtml::BackgroundLayer::isBackgroundYPositionSet):
2631 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
2632 (khtml::BackgroundLayer::isBackgroundRepeatSet):
2633 (khtml::BackgroundLayer::setBackgroundImage):
2634 (khtml::BackgroundLayer::setBackgroundXPosition):
2635 (khtml::BackgroundLayer::setBackgroundYPosition):
2636 (khtml::BackgroundLayer::setBackgroundAttachment):
2637 (khtml::BackgroundLayer::setBackgroundRepeat):
2638 (khtml::BackgroundLayer::clearBackgroundImage):
2639 (khtml::BackgroundLayer::clearBackgroundXPosition):
2640 (khtml::BackgroundLayer::clearBackgroundYPosition):
2641 (khtml::BackgroundLayer::clearBackgroundAttachment):
2642 (khtml::BackgroundLayer::clearBackgroundRepeat):
2643 (khtml::BackgroundLayer::setNext):
2644 (khtml::BackgroundLayer::operator!=):
2645 (khtml::BackgroundLayer::containsImage):
2646 (khtml::BackgroundLayer::hasImage):
2647 (khtml::BackgroundLayer::hasFixedImage):
2648 (khtml::RenderStyle::setBitDefaults):
2649 (khtml::RenderStyle::hasBackground):
2650 (khtml::RenderStyle::hasFixedBackgroundImage):
2651 (khtml::RenderStyle::outlineWidth):
2652 (khtml::RenderStyle::outlineStyle):
2653 (khtml::RenderStyle::outlineStyleIsAuto):
2654 (khtml::RenderStyle::outlineColor):
2655 (khtml::RenderStyle::backgroundColor):
2656 (khtml::RenderStyle::backgroundImage):
2657 (khtml::RenderStyle::backgroundRepeat):
2658 (khtml::RenderStyle::backgroundAttachment):
2659 (khtml::RenderStyle::backgroundXPosition):
2660 (khtml::RenderStyle::backgroundYPosition):
2661 (khtml::RenderStyle::accessBackgroundLayers):
2662 (khtml::RenderStyle::backgroundLayers):
2663 (khtml::RenderStyle::outlineOffset):
2664 (khtml::RenderStyle::resetOutline):
2665 (khtml::RenderStyle::setBackgroundColor):
2666 (khtml::RenderStyle::setOutlineWidth):
2667 (khtml::RenderStyle::setOutlineStyle):
2668 (khtml::RenderStyle::setOutlineColor):
2669 (khtml::RenderStyle::clearBackgroundLayers):
2670 (khtml::RenderStyle::inheritBackgroundLayers):
2671 (khtml::RenderStyle::setOutlineOffset):
2672 * khtml/rendering/render_table.cpp:
2673 (RenderTable::paintBoxDecorations):
2674 (RenderTableCell::paintBoxDecorations):
2676 2004-11-04 David Hyatt <hyatt@apple.com>
2678 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
2679 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
2683 * kwq/KWQTextCodec.mm:
2684 (KWQTextDecoder::convertLatin1):
2685 (KWQTextDecoder::convertUTF16):
2686 (KWQTextDecoder::convertUsingTEC):
2687 (KWQTextDecoder::toUnicode):
2689 2004-11-04 David Hyatt <hyatt@apple.com>
2691 Make sure line-height returns the correct value for normal.
2695 * khtml/css/css_computedstyle.cpp:
2696 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2698 2004-11-04 David Harrison <harrison@apple.com>
2700 Reviewed by Ken Kocienda.
2702 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
2704 * khtml/editing/htmlediting.cpp:
2705 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
2706 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
2707 Fixed to insert after the destination subtree, rather than the destination element. Handles
2708 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
2709 * khtml/xml/dom_nodeimpl.cpp:
2710 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
2711 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
2712 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
2713 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
2715 2004-11-03 Ken Kocienda <kocienda@apple.com>
2721 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
2722 * layout-tests/editing/deleting/delete-br-008.html: Added.
2723 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
2724 * layout-tests/editing/deleting/delete-br-009.html: Added.
2725 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
2726 * layout-tests/editing/deleting/delete-br-010.html: Added.
2728 2004-11-03 Maciej Stachowiak <mjs@apple.com>
2730 Fix by Yasuo Kida, reviewed by me.
2732 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
2734 * kwq/KWQKHTMLPart.mm:
2735 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
2736 same as a nil range - setting an empty marked range should clear
2737 the marked range entirely.
2739 2004-11-02 Maciej Stachowiak <mjs@apple.com>
2741 Reviewed by Dave Hyatt (when I originally coded it).
2743 WebCore part of fix for:
2745 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
2747 * kwq/WebCoreBridge.h:
2748 * kwq/WebCoreBridge.mm:
2749 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
2750 DOMRange, or if the range is split into multiple lines, the rect for the part on
2751 the first line only.
2753 * khtml/rendering/render_object.cpp:
2754 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
2755 for the overrides below.
2756 * khtml/rendering/render_object.h:
2757 * khtml/rendering/render_box.cpp:
2758 (RenderBox::caretRect):
2759 * khtml/rendering/render_box.h:
2760 * khtml/rendering/render_br.cpp:
2761 (RenderBR::caretRect):
2762 * khtml/rendering/render_br.h:
2763 * khtml/rendering/render_flow.cpp:
2764 (RenderFlow::caretRect):
2765 * khtml/rendering/render_flow.h:
2766 * khtml/rendering/render_text.cpp:
2767 (RenderText::caretRect):
2769 2004-11-02 Ken Kocienda <kocienda@apple.com>
2773 Implemented command to insert a block in response to typing a return key (even though
2774 I am not turning that on by default with this patch....that will come later).
2776 This new command is called InsertParagraphSeparatorCommand.
2778 Reworked the command and function names associated with inserting content into a
2779 document. Before this patch, there were inputXXX and insertXXX variants, with the
2780 former used for more high-level actions and the latter used for lower-level stuff.
2781 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
2782 in an insertXXX command going through an inputXXX WebCore step and then finally to an
2783 insertXXX WebCore step. To make this less confusing, I have changes all the names to
2784 be insertXXX, and modified the lower-level operations so that it is clear what they do.
2786 * khtml/editing/htmlediting.cpp:
2787 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
2788 (khtml::EditCommand::isInsertTextCommand): Ditto.
2789 (khtml::CompositeEditCommand::inputText): Ditto.
2790 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
2791 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
2792 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
2793 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
2794 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
2795 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
2796 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
2797 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
2798 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
2799 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
2800 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2801 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2802 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
2803 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
2804 (khtml::InsertIntoTextNode::doApply): Ditto.
2805 (khtml::InsertIntoTextNode::doUnapply): Ditto.
2806 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
2807 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
2808 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
2809 (khtml::InsertLineBreakCommand::doApply):
2810 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
2811 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
2812 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
2813 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
2814 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
2815 (khtml::InsertParagraphSeparatorCommand::doApply):
2816 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2817 Class name change, was InsertNewlineCommandInQuotedContentCommand.
2818 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
2819 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
2820 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2821 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
2822 (khtml::InsertTextCommand::doApply): Ditto.
2823 (khtml::InsertTextCommand::deleteCharacter): Ditto.
2824 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2825 (khtml::InsertTextCommand::input): Ditto.
2826 (khtml::InsertTextCommand::insertSpace): Ditto.
2827 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
2828 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
2829 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
2830 (khtml::TypingCommand::insertParagraphSeparator): New function.
2831 (khtml::TypingCommand::doApply): Name changes, as above.
2832 (khtml::TypingCommand::insertText): Ditto.
2833 (khtml::TypingCommand::deleteKeyPressed): Ditto.
2834 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2835 * khtml/editing/htmlediting.h:
2836 (khtml::DeleteFromTextNodeCommand::node): Name change.
2837 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
2838 (khtml::DeleteFromTextNodeCommand::count): Ditto.
2839 (khtml::InsertIntoTextNode::text): Ditto.
2840 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
2841 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
2842 (khtml::TypingCommand::): Ditto.
2843 * khtml/editing/jsediting.cpp: Name changes, as above.
2844 * kwq/WebCoreBridge.h:
2845 * kwq/WebCoreBridge.mm:
2846 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
2847 (-[WebCoreBridge insertParagraphSeparator]): New function.
2848 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
2850 2004-11-01 Kevin Decker <kdecker@apple.com>
2854 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
2857 * khtml/ecma/kjs_window.cpp:
2858 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
2860 2004-11-01 Darin Adler <darin@apple.com>
2864 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
2866 * khtml/css/html4.css: Use color: initial for textarea and related ones.
2868 2004-11-01 Ken Kocienda <kocienda@apple.com>
2874 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
2876 * khtml/css/css_computedstyle.cpp:
2877 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
2878 implementation here into new copyPropertiesInSet helper. This now calls the
2879 generalized copyPropertiesInSet function with the arguments needed to make copying
2881 * khtml/css/css_computedstyle.h:
2882 * khtml/css/css_valueimpl.cpp:
2883 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
2884 In order to do apply block properties, "regular" style declarations need to do style
2886 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
2887 except that it uses a different set of properties that apply only to blocks.
2888 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
2889 and copies out those properties listed in a pre-defined set.
2890 * khtml/css/css_valueimpl.h:
2891 * khtml/editing/htmlediting.cpp:
2892 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
2893 block, factoring out some of the special case code that should now only run in the inline case.
2894 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
2895 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
2896 special handling for "legacy" HTML styles like <B> and <I>.
2897 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
2898 style changes into different kinds. CSS specifies certain properties only apply to certain
2899 element types. This set of changes now recognizes two such separate cases: styles that apply
2900 to blocks, and styles that apply to inlines.
2901 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
2902 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
2903 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
2904 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
2905 done so that the function can be passed a portion of the styles being applied so that block styles
2906 and inline styles can be handled separately.
2907 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2908 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
2909 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
2910 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
2911 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
2912 * khtml/editing/htmlediting.h:
2913 (khtml::StyleChange::): Changed as described above.
2914 (khtml::StyleChange::usesLegacyStyles):
2915 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
2916 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
2917 when text align changes.
2918 * khtml/khtml_part.cpp:
2919 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
2920 the passed-in argument.
2921 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
2922 is a caret. Formerly, this just set typing style and made no visible changes to the document.
2926 * layout-tests/editing/editing.js: Added some glue to change text align.
2927 * layout-tests/editing/style/block-style-001-expected.txt: Added.
2928 * layout-tests/editing/style/block-style-001.html: Added.
2929 * layout-tests/editing/style/block-style-002-expected.txt: Added.
2930 * layout-tests/editing/style/block-style-002.html: Added.
2931 * layout-tests/editing/style/block-style-003-expected.txt: Added.
2932 * layout-tests/editing/style/block-style-003.html: Added.
2936 2004-10-29 Darin Adler <darin@apple.com>
2940 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
2942 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
2943 before advancing one character; before it did it backwards.
2945 2004-10-29 Chris Blumenberg <cblu@apple.com>
2947 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
2949 Reviewed by kocienda, adele.
2951 * khtml/rendering/render_frames.cpp:
2952 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
2954 2004-10-29 Darin Adler <darin@apple.com>
2958 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
2960 * khtml/khtmlview.cpp:
2961 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
2962 deleted before this function finishes running.
2963 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
2964 (KHTMLView::viewportMouseReleaseEvent): Ditto.
2965 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
2966 is guaranteed to do ref/deref as needed.
2968 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
2970 2004-10-28 Chris Blumenberg <cblu@apple.com>
2972 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
2976 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
2977 * WebCorePrefix.h: always use XSLT
2979 2004-10-28 Ken Kocienda <kocienda@apple.com>
2985 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
2986 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
2988 * khtml/editing/htmlediting.cpp:
2989 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
2990 to initialization list, zeroing them out.
2991 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
2992 handle a delete of content in special cases where the only thing selected is a BR. This
2993 code path is much simpler than the newly-named performGeneralDelete, and detects when no
2994 content merging should be done between blocks. This aspect of the change fixes 3854848.
2995 One of the special cases added fixes 3803832.
2996 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
2997 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
2998 like the other helpers in this class.
2999 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
3000 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
3001 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
3003 2004-10-28 Chris Blumenberg <cblu@apple.com>
3005 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
3009 * kwq/KWQKHTMLPart.mm:
3010 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
3012 2004-10-28 Ken Kocienda <kocienda@apple.com>
3014 Reviewed by Harrison
3016 Reorganization of delete command functionality so that doApply is not
3017 several hundred lines long. This is not a squeaky-clean cleanup, but
3018 it is a step in the right direction. No functionality changes.
3020 * khtml/editing/htmlediting.cpp:
3021 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
3022 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
3023 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
3024 (khtml::DeleteSelectionCommand::performDelete): Ditto.
3025 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3026 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3027 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
3028 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
3029 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
3030 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
3031 * khtml/editing/htmlediting.h:
3033 2004-10-28 Ken Kocienda <kocienda@apple.com>
3037 * khtml/editing/htmlediting.cpp:
3038 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
3039 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
3041 2004-10-27 Ken Kocienda <kocienda@apple.com>
3045 * khtml/editing/htmlediting.cpp:
3046 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
3047 whether content not in the block containing the start of the selection is moved to that block
3048 after the selection is deleted.
3049 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
3050 (khtml::DeleteSelectionCommand::doApply): Ditto.
3051 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
3052 to handle the case of inserting a newline when in quoted content in Mail.
3053 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
3054 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
3055 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
3056 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
3057 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
3058 (khtml::TypingCommand::doApply): Ditto.
3059 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3060 * khtml/editing/htmlediting.h: Add new delclarations.
3061 (khtml::TypingCommand::): Ditto.
3062 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
3063 * kwq/WebCoreBridge.mm:
3064 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
3066 2004-10-26 Chris Blumenberg <cblu@apple.com>
3068 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
3072 * khtml/ecma/kjs_dom.cpp:
3073 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
3074 * khtml/ecma/kjs_dom.h:
3075 (KJS::DOMElement::):
3076 * khtml/ecma/kjs_dom.lut.h:
3079 2004-10-26 David Hyatt <hyatt@apple.com>
3081 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
3084 Reviewed by kocienda
3086 * khtml/rendering/bidi.cpp:
3087 (khtml::RenderBlock::layoutInlineChildren):
3089 2004-10-26 David Hyatt <hyatt@apple.com>
3091 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
3092 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
3094 Reviewed by kocienda
3096 * khtml/rendering/render_canvas.cpp:
3097 (RenderCanvas::selectionRect):
3098 * khtml/rendering/render_object.h:
3099 (khtml::RenderObject::hasSelectedChildren):
3101 2004-10-26 Ken Kocienda <kocienda@apple.com>
3107 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
3109 * khtml/editing/htmlediting.cpp:
3110 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
3111 let the caller know if a placeholder was removed.
3112 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
3113 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
3114 some cases, the selection was still set on the removed BR, and this was the cause of the
3116 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
3118 2004-10-26 Darin Adler <darin@apple.com>
3122 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
3124 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
3126 2004-10-26 Ken Kocienda <kocienda@apple.com>
3130 * khtml/editing/htmlediting.cpp:
3131 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
3132 with a zero-length string. That triggers an assert. Call deleteText instead,
3133 using the same indices that are passed to replaceText.
3135 Cleaned up the asserts in these three functions below, making them
3136 more consistent. This is not needed for the fix, but I tripped over
3137 these in the course of debugging.
3139 (khtml::InsertTextCommand::InsertTextCommand):
3140 (khtml::InsertTextCommand::doApply):
3141 (khtml::InsertTextCommand::doUnapply):
3143 2004-10-25 Adele Amchan <adele@apple.com>
3147 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
3148 * khtml/xml/dom_docimpl.h:
3150 2004-10-25 Adele Amchan <adele@apple.com>
3152 Reviewed by me, code change by Darin.
3154 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
3156 2004-10-25 Ken Kocienda <kocienda@apple.com>
3158 Oops. These two test results changed with my last checkin, for the better.
3160 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3161 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
3163 2004-10-25 Ken Kocienda <kocienda@apple.com>
3169 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
3171 * khtml/editing/htmlediting.cpp:
3172 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
3173 expand the selection outwards when the selection is on the visible boundary of a root
3174 editable element. This fixes the bug. Note that this function also contains a little code
3175 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
3176 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3177 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
3178 * khtml/editing/htmlediting.h: Declare new helpers.
3179 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
3180 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
3181 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
3182 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
3183 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
3184 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
3186 2004-10-25 Ken Kocienda <kocienda@apple.com>
3188 Added some more editing layout tests.
3190 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
3191 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
3192 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
3193 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
3194 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
3195 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
3196 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
3197 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
3198 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
3199 * layout-tests/editing/inserting/typing-003.html: Added.
3201 2004-10-25 Ken Kocienda <kocienda@apple.com>
3205 * khtml/rendering/bidi.cpp:
3206 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
3207 yesterday quite right: words that should have been placed on the next line were instead
3208 appearing on the line before, beyond the right margin. This was a one-word only error
3209 based on moving the line break object when it should have stayed put. Here is the rule:
3210 The line break object only moves to after the whitespace on the end of a line if that
3211 whitespace caused line overflow when its width is added in.
3213 2004-10-25 Adele Amchan <adele@apple.com>
3217 Fix for <rdar://problem/3619890> Feature request: designMode
3219 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
3220 This will enable more JS editing compatibility.
3222 * khtml/ecma/kjs_html.cpp:
3223 (KJS::HTMLDocument::tryGet): added case for designMode
3224 (KJS::HTMLDocument::putValue): added case for designMode
3225 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
3226 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
3227 * khtml/xml/dom_docimpl.cpp:
3228 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
3229 (DocumentImpl::setDesignMode): added function to assign m_designMode value
3230 (DocumentImpl::getDesignMode): return m_designMode value
3231 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
3232 Otherwise, it will just return the m_designMode value.
3233 (DocumentImpl::parentDocument):
3234 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
3235 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
3237 2004-10-22 Ken Kocienda <kocienda@apple.com>
3243 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
3245 * khtml/editing/htmlediting.cpp:
3246 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
3247 everything that could be affected.
3248 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
3249 braces, making it act as a comma operator, with a zero value as the right value!!! This made
3250 an important check always fail!!! It turns out that we do not want the constant at all, since
3251 that constant is only needed when checking a computed style, not an inline style as is being
3253 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
3254 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
3255 RangeImpl::compareBoundaryPoints to perform the required check.
3256 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
3258 2004-10-22 Ken Kocienda <kocienda@apple.com>
3264 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
3265 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
3267 * khtml/rendering/bidi.cpp:
3268 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
3269 it is when we are editing, add in the space of the current character when calculating the width
3270 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
3271 the line break object and call skipWhitespace to move past the end of the whitespace.
3275 2004-10-22 Ken Kocienda <kocienda@apple.com>
3277 * WebCore.pbproj/project.pbxproj:
3278 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
3280 2004-10-21 David Hyatt <hyatt@apple.com>
3284 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
3286 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
3287 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
3289 * khtml/rendering/render_block.cpp:
3290 (khtml::getInlineRun):
3291 (khtml::RenderBlock::makeChildrenNonInline):
3293 2004-10-21 David Hyatt <hyatt@apple.com>
3295 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
3296 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
3300 * khtml/rendering/render_inline.cpp:
3301 (RenderInline::splitFlow):
3303 2004-10-21 Ken Kocienda <kocienda@apple.com>
3307 Significant improvement to the way that whitespace is handled during editing.
3309 * khtml/editing/htmlediting.cpp:
3310 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually