1 2004-12-06 Ken Kocienda <kocienda@apple.com>
7 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
9 * khtml/editing/htmlediting.cpp:
10 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
11 check for one of the special cases being checked for in this function. The specific case
12 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
13 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
14 case where a selection ended in a <br> after a block and would not delete any part of the
15 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
18 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
19 new use of the function exposed this bug:
21 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
23 * khtml/xml/dom_position.cpp:
24 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
25 not have this fatal flaw. It is a much better design as well.
27 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
28 have what I consider to be a better result. Going with it.
30 2004-12-06 Chris Blumenberg <cblu@apple.com>
32 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
37 (-[DOMElement _font]): new SPI for AppKit
40 2004-12-06 Darin Adler <darin@apple.com>
44 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
46 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
47 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
49 2004-12-06 John Sullivan <sullivan@apple.com>
51 Darin found what appears to be the real leak that we were falsely blaming
52 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
55 * khtml/css/cssparser.cpp:
56 (CSSParser::parseValue):
57 call clearProperties() instead of just setting numParsedProperties to 0
58 (CSSParser::parseDeclaration):
60 (CSSParser::createStyleDeclaration):
63 2004-12-06 Ken Kocienda <kocienda@apple.com>
69 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
70 * layout-tests/editing/inserting/insert-div-001.html: Added.
71 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
72 * layout-tests/editing/inserting/insert-div-002.html: Added.
73 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
74 * layout-tests/editing/inserting/insert-div-003.html: Added.
75 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
76 * layout-tests/editing/inserting/insert-div-004.html: Added.
77 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
78 * layout-tests/editing/inserting/insert-div-005.html: Added.
79 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
80 * layout-tests/editing/inserting/insert-div-006.html: Added.
81 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
82 * layout-tests/editing/inserting/insert-div-007.html: Added.
83 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
84 * layout-tests/editing/inserting/insert-div-008.html: Added.
85 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
86 * layout-tests/editing/inserting/insert-div-009.html: Added.
88 2004-12-06 Ken Kocienda <kocienda@apple.com>
94 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
96 * khtml/editing/htmlediting.cpp:
97 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
98 being added to this function. This ensures that the added block has a height.
99 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
101 2004-12-06 Ken Kocienda <kocienda@apple.com>
105 * khtml/dom/dom_string.cpp:
106 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
107 * khtml/dom/dom_string.h: Ditto.
108 * khtml/editing/htmlediting.cpp:
109 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
110 RebalanceWhitespaceCommand instance.
111 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
112 (khtml::InsertLineBreakCommand::doApply): Ditto.
113 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
114 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
115 (khtml::InsertTextCommand::input): Ditto.
116 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
117 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
118 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
119 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
120 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
121 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
122 * khtml/editing/htmlediting.h: Ditto.
123 (khtml::RebalanceWhitespaceCommand::): Ditto.
125 2004-12-05 Darin Adler <darin@apple.com>
127 - fixed small problem in my check-in from yesterday
130 (positionForEvent): Get location from event without raising exception if it's the wrong type.
131 (clickCountForEvent): Same, for clickCount.
132 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
133 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
134 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
136 2004-12-04 Darin Adler <darin@apple.com>
140 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
142 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
143 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
144 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
146 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
148 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
149 * khtml/rendering/render_form.cpp:
150 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
151 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
152 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
154 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
155 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
156 Added a fixState helper method so the constructors can save code.
158 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
159 and added a third constructor that uses the "current event" from AppKit (used above).
160 (QMouseEvent::fixState): Compute state and click count based on event type.
162 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
164 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
165 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
166 underlying cause in CSS.
168 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
170 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
171 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
173 2004-12-03 Chris Blumenberg <cblu@apple.com>
176 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
177 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
178 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
179 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
181 Reviewed by darin, rjw, kocienda.
183 * khtml/misc/loader.cpp:
184 (CachedObject::~CachedObject):
185 (CachedCSSStyleSheet::checkNotify):
186 (Loader::servePendingRequests):
187 (Loader::slotFinished):
188 (Loader::slotReceivedResponse):
189 (Cache::requestImage):
190 (Cache::requestScript):
191 * khtml/misc/loader.h:
192 (khtml::CachedObject::CachedObject):
193 (khtml::CachedObject::response):
194 (khtml::CachedObject::allData):
195 * kwq/KWQKJobClasses.h:
196 * kwq/KWQKJobClasses.mm:
197 (KIO::TransferJobPrivate::TransferJobPrivate):
198 (KIO::TransferJobPrivate::~TransferJobPrivate):
199 (KIO::TransferJob::TransferJob):
200 (KIO::TransferJob::assembleResponseHeaders):
201 (KIO::TransferJob::retrieveCharset):
202 (KIO::TransferJob::emitResult):
203 (KIO::TransferJob::emitReceivedResponse):
206 (KWQHeaderStringFromDictionary):
207 (KWQCheckCacheObjectStatus):
208 (KWQIsResponseURLEqualToURL):
210 (KWQResponseMIMEType):
211 (KWQCacheObjectExpiresTime):
212 (khtml::CachedObject::setResponse):
213 (khtml::CachedObject::setAllData):
217 * kwq/KWQResourceLoader.mm:
218 (-[KWQResourceLoader finishJobAndHandle:]):
219 (-[KWQResourceLoader cancel]):
220 (-[KWQResourceLoader reportError]):
221 (-[KWQResourceLoader finishWithData:]):
229 * kwq/WebCoreBridge.h:
230 * kwq/WebCoreResourceLoader.h:
232 2004-12-04 Darin Adler <darin@apple.com>
236 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
238 * khtml/rendering/render_form.cpp:
239 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
240 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
241 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
242 (RenderSlider::slotSliderValueChanged): Ditto.
244 2004-12-03 John Sullivan <sullivan@apple.com>
248 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
249 khtml::BackgroundLayer::cullEmptyLayers
251 * khtml/rendering/render_style.cpp:
252 (BackgroundLayer::cullEmptyLayers):
253 added missing nil check
257 2004-12-03 Ken Kocienda <kocienda@apple.com>
261 Roll out some recent changes by Chris that caused a performance regression.
262 Fix is in hand, but it is a little risky this close to a submission. So,
263 we have decided to roll back the change with the regression and roll in
264 the new code after we submit.
266 * khtml/css/cssproperties.c:
269 * khtml/css/cssvalues.c:
272 * khtml/misc/htmlattrs.c:
275 * khtml/misc/htmltags.c:
278 * khtml/misc/loader.cpp:
279 (CachedObject::~CachedObject):
280 (CachedObject::setResponse):
281 (CachedCSSStyleSheet::checkNotify):
282 (Loader::servePendingRequests):
283 (Loader::slotFinished):
284 (Loader::slotReceivedResponse):
285 (Cache::requestImage):
286 (Cache::requestScript):
287 * khtml/misc/loader.h:
288 (khtml::CachedObject::CachedObject):
289 (khtml::CachedObject::response):
290 * kwq/KWQKJobClasses.h:
291 * kwq/KWQKJobClasses.mm:
292 (KIO::TransferJobPrivate::TransferJobPrivate):
293 (KIO::TransferJobPrivate::~TransferJobPrivate):
294 (KIO::TransferJob::TransferJob):
295 (KIO::TransferJob::assembleResponseHeaders):
296 (KIO::TransferJob::retrieveCharset):
297 (KIO::TransferJob::emitResult):
298 (KIO::TransferJob::emitReceivedResponse):
301 (KWQHeaderStringFromDictionary):
302 (KWQCheckCacheObjectStatus):
304 (KWQReleaseResponse):
305 (KWQIsResponseURLEqualToURL):
307 (KWQResponseMIMEType):
308 (KWQResponseTextEncodingName):
309 (KWQResponseHeaderString):
310 (KWQCacheObjectExpiresTime):
311 (KWQLoader::KWQLoader):
315 * kwq/KWQResourceLoader.mm:
316 (-[KWQResourceLoader finishJobAndHandle]):
317 (-[KWQResourceLoader cancel]):
318 (-[KWQResourceLoader reportError]):
319 (-[KWQResourceLoader finish]):
327 * kwq/WebCoreBridge.h:
328 * kwq/WebCoreResourceLoader.h:
330 2004-12-03 John Sullivan <sullivan@apple.com>
334 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
336 * kwq/KWQKHTMLPart.mm:
337 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
338 when checking whether we moved the focus to another view, make sure we didn't "move" it to
339 our documentView, because that's no move at all.
341 2004-12-03 Darin Adler <darin@apple.com>
345 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
347 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
348 Added missing initialization for base class and node pointer.
350 - fixed a few places that could leave dangling node pointers
352 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
353 Clear out the node pointer when the node is destroyed.
354 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
356 2004-12-03 Chris Blumenberg <cblu@apple.com>
358 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.
359 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
363 * khtml/misc/loader.cpp:
364 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
365 (Loader::slotFinished): take data param
366 * khtml/misc/loader.h:
367 * kwq/KWQKJobClasses.h:
368 * kwq/KWQKJobClasses.mm:
369 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
370 (KIO::TransferJob::emitResult): take data param and pass it
371 * kwq/KWQResourceLoader.mm:
372 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
373 (-[KWQResourceLoader cancel]): pass nil for data
374 (-[KWQResourceLoader reportError]): ditto
375 (-[KWQResourceLoader finishWithData:]): pass data
377 (KWQSlot::KWQSlot): pass data param to slotFinished
378 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
380 2004-12-03 Ken Kocienda <kocienda@apple.com>
384 Did some clean up in the Position class as a result of trying to write some new layout
385 tests and discovering a bug along the way.
387 I removed these three functions from the Position class:
389 1. bool isFirstRenderedPositionOnLine() const;
390 2. bool isLastRenderedPositionOnLine() const;
391 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
392 4. bool inFirstEditableInRootEditableElement() const;
394 The first two have replacements in the VisiblePosition class, and some code has been
395 moved to use these new variants. The third function was a helper used only by these
396 first two function, and can be removed as well. The fourth function was not used by anyone.
398 * khtml/editing/htmlediting.cpp:
399 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
400 * khtml/editing/visible_position.cpp:
401 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
402 Incorrect results were being returned when asking about positions at the starts of blocks.
403 * khtml/xml/dom_position.cpp:
404 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
405 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
406 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
407 * khtml/xml/dom_position.h: Update header for deletions.
409 2004-12-03 Ken Kocienda <kocienda@apple.com>
413 Terminology change in execCommand command identifiers. Specifically, the name of
414 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
415 terminology used by AppKit. It is also more accurate, since the insertion of a
416 "br" element is what the command does. The inspiration for this change is so the
417 -insertNewline AppKit method can be mapped to insert a new "div" element in
418 a document and avoid ambiguity with what the javascript editing command does.
420 * khtml/editing/jsediting.cpp
421 * layout-tests/editing/deleting/delete-tab-004.html
422 * layout-tests/editing/editing.js
423 * layout-tests/editing/inserting/insert-3654864-fix.html
424 * layout-tests/editing/inserting/insert-3659587-fix.html
425 * layout-tests/editing/inserting/insert-3775316-fix.html
426 * layout-tests/editing/inserting/insert-3800346-fix.html
427 * layout-tests/editing/inserting/insert-br-001.html
428 * layout-tests/editing/inserting/insert-br-002.html
429 * layout-tests/editing/inserting/insert-br-003.html
430 * layout-tests/editing/inserting/insert-br-004.html
431 * layout-tests/editing/inserting/insert-br-005.html
432 * layout-tests/editing/inserting/insert-br-006.html
433 * layout-tests/editing/inserting/insert-br-007.html
434 * layout-tests/editing/inserting/insert-br-008.html
435 * layout-tests/editing/inserting/insert-tab-004.html
436 * layout-tests/editing/inserting/insert-text-with-newlines.html
437 * layout-tests/editing/pasteboard/paste-text-010.html
439 2004-12-02 Ken Kocienda <kocienda@apple.com>
445 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
447 * khtml/editing/htmlediting.cpp:
448 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
449 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
450 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
451 in a block and the document is in quirks mode, add an additional br to make the one in the
452 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
453 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
454 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
456 2004-12-02 Richard Williamson <rjw@apple.com>
458 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
460 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
461 the b/f cache won't incorrectly trash the previous state when restoring.
465 * kwq/WebCoreBridge.h:
466 * kwq/WebCoreBridge.mm:
467 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
468 (-[WebCoreBridge canCachePage]):
469 (-[WebCoreBridge clear]):
471 2004-12-02 Ken Kocienda <kocienda@apple.com>
477 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
479 * khtml/xml/dom2_rangeimpl.cpp:
480 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
481 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
482 of this bug where there is content after the body tag). Did a little code clean up as well.
483 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
485 2004-12-02 Ken Kocienda <kocienda@apple.com>
491 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
493 * khtml/khtml_part.cpp:
494 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
495 to figure out which end of the selection to extend.
497 2004-12-02 David Harrison <harrison@apple.com>
499 Reviewed by Ken Kocienda.
501 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
502 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
504 * khtml/editing/visible_text.cpp:
505 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
506 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
507 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
508 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
509 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
510 Distinguish BR from whitespace.
511 * khtml/editing/visible_text.h:
512 Distinguish BR from whitespace.
513 * khtml/editing/visible_units.cpp:
514 (khtml::previousWordBoundary):
515 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.
517 2004-12-02 Ken Kocienda <kocienda@apple.com>
523 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
525 * khtml/xml/dom_position.cpp:
526 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
527 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
528 exception trying to use a Position returned from this function to set the boundary point of a Range (which
529 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
530 contract to return a range-compliant position, hence the need for this fix.
532 2004-12-01 Ken Kocienda <kocienda@apple.com>
538 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
539 regard to other editing commands. The class had a name change ages ago, and it was never
541 * khtml/editing/htmlediting.h: Ditto.
543 2004-12-01 Ken Kocienda <kocienda@apple.com>
547 Some improvements for paste, including some new code to annotate
548 whitespace when writing to the pasteboard to ensure that the meaning
549 of the markup on the pasteboard is unambiguous.
551 There is also new code for reading this annotated markup from the pasteboard,
552 removing the nodes that were added only to prevent ambiguity.
554 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
555 The header should have been added earlier, but I did not do so.
556 * khtml/editing/html_interchange.cpp: Added.
557 (convertHTMLTextToInterchangeFormat):
558 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
559 * khtml/editing/htmlediting.cpp:
560 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
561 Also fixed a bug in the code that counts blocks in a fragment.
562 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
563 (khtml::ReplacementFragment::insertNodeBefore): New helper.
564 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
565 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
566 * khtml/editing/htmlediting.h: Add some new declarations.
567 * khtml/xml/dom2_rangeimpl.cpp:
568 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
569 * khtml/xml/dom_nodeimpl.cpp:
570 (NodeImpl::stringValueForRange): New helper.
571 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
572 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
573 should be added. Called by the paste code.
574 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
576 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
577 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
578 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
580 2004-11-30 Chris Blumenberg <cblu@apple.com>
582 * ChangeLog: removed conflict marker
584 2004-11-30 Chris Blumenberg <cblu@apple.com>
587 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
588 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
592 * khtml/misc/loader.cpp:
593 (CachedObject::~CachedObject): release m_allData
594 (CachedObject::setAllData): new
595 (Loader::servePendingRequests): connect slotAllData
596 (Loader::slotAllData): new
597 (Cache::requestImage): tweak
598 * khtml/misc/loader.h:
599 (khtml::CachedObject::CachedObject): set allData to 0
600 (khtml::CachedObject::allData): new
601 * kwq/KWQKJobClasses.h:
602 * kwq/KWQKJobClasses.mm:
603 (KIO::TransferJob::TransferJob): set m_allData
604 (KIO::TransferJob::emitAllData): new
606 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
607 * kwq/KWQResourceLoader.mm:
608 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
610 (KWQSlot::KWQSlot): support for slotAllData
612 * kwq/WebCoreBridge.h:
613 * kwq/WebCoreResourceLoader.h:
615 2004-11-30 Maciej Stachowiak <mjs@apple.com>
619 2004-11-30 Maciej Stachowiak <mjs@apple.com>
623 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
625 * khtml/khtml_part.cpp:
626 (KHTMLPart::begin): call setParsing on document here after opening
627 - from now on we'll only set parsing to true for a document open
628 caused by page loading, not a programmatic one.
629 * khtml/xml/dom_docimpl.cpp:
630 (DocumentImpl::open): don't setParsing to true here any more.
632 2004-11-30 Maciej Stachowiak <mjs@apple.com>
636 - fix recent regression from collection perf fixes.
638 * khtml/html/html_miscimpl.cpp:
639 (HTMLFormCollectionImpl::updateNameCache): Look up the name
640 attribute in the name cache, not the id cache (d'oh!)
642 2004-11-30 Darin Adler <darin@apple.com>
646 - rolled in a KDE fix for a problem that may underlie a number of crashes
648 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
649 the KDE guys to fix a subtle problem. Code said "n = n =".
651 - rolled in a KDE fix for a containingBlock crash
653 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
654 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
657 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
660 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
661 (-[KWQButton detachQButton]): Added.
662 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
663 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
664 (-[KWQButton widget]): Added.
665 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
666 (-[KWQButton resignFirstResponder]): Ditto.
667 (-[KWQButton canBecomeKeyView]): Ditto.
668 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
669 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
671 * kwq/KWQComboBox.mm:
672 (QComboBox::~QComboBox): Call detachQComboBox.
673 (-[KWQPopUpButtonCell detachQComboBox]): Added.
674 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
675 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
676 (-[KWQPopUpButton action:]): Ditto.
677 (-[KWQPopUpButton widget]): Tweaked.
678 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
679 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
680 (-[KWQPopUpButton resignFirstResponder]): Ditto.
681 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
683 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
686 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
688 * kwq/KWQScrollBar.h: Removed m_scroller field.
689 * kwq/KWQScrollBar.mm:
690 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
691 (-[KWQScrollBar detachQScrollBar]): Added.
692 (-[KWQScrollBar widget]): Added.
693 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
694 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
695 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
696 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
697 (QScrollBar::setKnobProportion): Ditto.
698 (QScrollBar::scrollbarHit): Ditto.
700 * kwq/KWQScrollView.mm:
701 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
702 hack where we don't remove right away when doing mouse tracking.
703 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
704 the hack where we don't add right away when doing mouse tracking.
706 * kwq/KWQSlider.h: Added destructor.
708 (-[KWQSlider initWithQSlider:]): Tweaked a little.
709 (-[KWQSlider detachQSlider]): Added.
710 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
711 (-[KWQSlider widget]): Added.
712 (QSlider::~QSlider): Added. Calls detachQSlider.
714 * kwq/KWQTextArea.h: Added detachQTextEdit method.
715 * kwq/KWQTextArea.mm:
716 (-[KWQTextArea detachQTextEdit]): Added.
717 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
718 (-[KWQTextArea becomeFirstResponder]): Ditto.
719 (-[KWQTextArea nextKeyView]): Ditto.
720 (-[KWQTextArea previousKeyView]): Ditto.
721 (-[KWQTextArea drawRect:]): Ditto.
722 (-[KWQTextAreaTextView insertTab:]): Ditto.
723 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
724 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
725 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
726 (-[KWQTextAreaTextView mouseDown:]): Ditto.
727 (-[KWQTextAreaTextView keyDown:]): Ditto.
728 (-[KWQTextAreaTextView keyUp:]): Ditto.
730 * kwq/KWQTextEdit.h: Added ~QTextEdit.
731 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
733 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
734 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
736 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
737 Added beforeMouseDown and afterMouseDown for use in widget implementations.
738 Removed unused hasMouseTracking function.
740 (QWidget::QWidget): Initialize two new fields.
741 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
742 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
743 (QWidget::addToSuperview): Added.
744 (QWidget::removeFromSuperview): Added.
745 (QWidget::beforeMouseDown): Added.
746 (QWidget::afterMouseDown): Added.
748 * khtml/rendering/render_layer.cpp:
749 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
750 (RenderLayer::setHasVerticalScrollbar): Ditto.
752 2004-11-30 Ken Kocienda <kocienda@apple.com>
758 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
760 * khtml/khtml_part.cpp:
761 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
762 with no blink if it is.
764 2004-11-30 Ken Kocienda <kocienda@apple.com>
770 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
772 * khtml/khtml_part.cpp:
773 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
774 or <input type=image> was checked for focus since these elements are keyboard-focusable,
775 but not mouse focusable. Also, this function did not work hard enough to set the focused
776 node, and was content to clear it if the first element checked failed the test, rather
777 than looking more at parents. This would have the effect of clearing, then resetting the
778 focus on a DIV containing a button or image with content on either side of it in the
779 process of arrowing over such content.
781 2004-11-30 Ken Kocienda <kocienda@apple.com>
785 * khtml/editing/htmlediting.cpp:
786 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
787 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
788 * khtml/khtml_part.cpp:
789 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
790 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
791 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
792 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
793 isCharacterSmartReplaceExempt virtual.
795 2004-11-30 Ken Kocienda <kocienda@apple.com>
799 * khtml/editing/htmlediting.cpp:
800 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
801 Seemed simple enough to land without review.
803 2004-11-29 Ken Kocienda <kocienda@apple.com>
807 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
808 are handled correctly now, including selections that span multiple blocks, and cases
809 where content on the pasteboard ends in newlines (or what appear to be newlines to a
810 user, really block ends or BRs). I also made one small, but important change in the
811 copy code to annotate the markup written to the pasteboard to support these selections
814 New header that defines a couple of constants used in copying and pasting.
816 * ForwardingHeaders/editing/html_interchange.h: Added.
817 * khtml/editing/html_interchange.h: Added.
819 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
820 as a new helper class, ReplacementFragment, which encapsulates information and functions
821 pertaining to a document fragment that is being inserted into a document.
823 * khtml/editing/htmlediting.cpp:
824 (khtml::ReplacementFragment::ReplacementFragment):
825 (khtml::ReplacementFragment::~ReplacementFragment):
826 (khtml::ReplacementFragment::firstChild): Simple accessor.
827 (khtml::ReplacementFragment::lastChild): Ditto.
828 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
829 the starting node to use for merging into the block containing the start of the selection.
830 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
831 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
832 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
833 special annotation comment added in by the copy code.
834 (khtml::ReplacementFragment::removeNode): Simple helper.
835 (khtml::isComment): Simple helper.
836 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
837 I would like to do better than this some day, but this check will hold us until I can do better.
838 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
839 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
840 (khtml::ReplaceSelectionCommand::doApply):
841 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
842 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
843 (khtml::ReplacementFragment::root):
844 (khtml::ReplacementFragment::type):
845 (khtml::ReplacementFragment::isEmpty):
846 (khtml::ReplacementFragment::isSingleTextNode):
847 (khtml::ReplacementFragment::isTreeFragment):
848 (khtml::ReplacementFragment::hasMoreThanOneBlock):
849 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
851 This smaller set of changes markup generation to add the newline annotation described in the
852 comment at the start of this entry.
854 * khtml/xml/dom2_rangeimpl.cpp:
855 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
856 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
857 comment annotations are added to the markup generated.
858 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
859 * kwq/WebCoreBridge.mm:
860 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
861 DOM::RangeImpl::toHTML uses annotations when generating.
865 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
866 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
867 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
868 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
869 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
870 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
871 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
872 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
873 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
874 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
875 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
876 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
877 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
878 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
879 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
880 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
881 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
882 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
884 2004-11-29 Ken Kocienda <kocienda@apple.com>
888 Made two small changes that make it possible for comments to have DOM nodes made for them
889 when pasting. This relies on some earlier work I did some days ago.
891 * khtml/xml/dom_nodeimpl.cpp:
892 (NodeImpl::startMarkup): Get the string from the comment.
893 * kwq/WebCoreBridge.mm:
894 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
895 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
896 be included in the DOM.
898 2004-11-29 Ken Kocienda <kocienda@apple.com>
902 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
903 my improved paste code.
905 * khtml/editing/visible_position.cpp:
906 (khtml::blockRelationship)
907 (khtml::visiblePositionsInDifferentBlocks)
908 (khtml::isFirstVisiblePositionInBlock)
909 (khtml::isFirstVisiblePositionInNode)
910 (khtml::isLastVisiblePositionInBlock)
911 * khtml/editing/visible_position.h
913 2004-11-29 Ken Kocienda <kocienda@apple.com>
917 * khtml/xml/dom_position.cpp:
918 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
919 specified from obeying that directive. The old code would stop at an outer block boundary in
920 the case where that block had a block as its first child. The correct behavior is to drill into
921 that inner block (and continue on drilling down, if possible), to find the correct position.
923 2004-11-29 Ken Kocienda <kocienda@apple.com>
927 Small improvements to the node-display debugging helpers.
929 * khtml/xml/dom_nodeimpl.cpp:
930 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
931 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
933 2004-11-29 Ken Kocienda <kocienda@apple.com>
937 * khtml/editing/htmlediting.cpp:
938 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
939 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
940 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
941 place after the delete.
943 2004-11-29 Ken Kocienda <kocienda@apple.com>
947 Add a new helper function to insert a paragraph separator. Will be used in my
948 upcoming paste improvments.
950 * khtml/editing/htmlediting.cpp: Added function
951 (khtml::CompositeEditCommand::insertParagraphSeparator)
952 * khtml/editing/htmlediting.h: Ditto.
954 2004-11-23 David Harrison <harrison@apple.com>
956 Added various comments.
958 * khtml/editing/htmlediting.cpp:
959 (khtml::StyleChange::init):
960 (khtml::ApplyStyleCommand::doApply):
961 (khtml::ApplyStyleCommand::applyBlockStyle):
962 (khtml::ApplyStyleCommand::applyInlineStyle):
964 2004-11-23 David Hyatt <hyatt@apple.com>
966 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
967 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
969 * khtml/rendering/render_block.cpp:
970 (khtml::RenderBlock::nodeAtPoint):
972 2004-11-22 David Hyatt <hyatt@apple.com>
974 Make sure you can use document.createElement to make a <canvas> element.
976 * khtml/xml/dom_docimpl.cpp:
977 (DocumentImpl::createHTMLElement):
979 2004-11-22 Maciej Stachowiak <mjs@apple.com>
983 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
984 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
985 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
986 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
988 * khtml/ecma/kjs_html.cpp:
989 (KJS::HTMLDocument::tryGet):
990 * khtml/html/html_formimpl.cpp:
991 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
992 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
993 * khtml/html/html_formimpl.h:
994 * khtml/html/html_miscimpl.cpp:
995 (HTMLCollectionImpl::HTMLCollectionImpl):
996 (HTMLCollectionImpl::~HTMLCollectionImpl):
997 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
998 (HTMLCollectionImpl::CollectionInfo::reset):
999 (HTMLCollectionImpl::resetCollectionInfo):
1000 (HTMLCollectionImpl::checkForNameMatch):
1002 (HTMLCollectionImpl::updateNameCache):
1003 (HTMLCollectionImpl::namedItems):
1004 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
1005 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1006 (HTMLFormCollectionImpl::item):
1007 (HTMLFormCollectionImpl::updateNameCache):
1008 * khtml/html/html_miscimpl.h:
1010 2004-11-22 David Hyatt <hyatt@apple.com>
1012 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
1017 * khtml/misc/loader.cpp:
1018 (CachedObject::finish):
1021 * khtml/misc/loader.h:
1022 (khtml::Cache::maxCacheableObjectSize):
1024 2004-11-22 David Hyatt <hyatt@apple.com>
1026 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
1027 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
1028 that lets us short circuit earlier when painting and hit testing.
1032 * khtml/khtml_part.cpp:
1033 (KHTMLPart::isPointInsideSelection):
1034 * khtml/rendering/render_block.cpp:
1035 (khtml::RenderBlock::paint):
1036 (khtml::RenderBlock::paintChildren):
1037 (khtml::RenderBlock::paintObject):
1038 (khtml::RenderBlock::paintFloats):
1039 (khtml::RenderBlock::nodeAtPoint):
1040 * khtml/rendering/render_block.h:
1041 * khtml/rendering/render_box.cpp:
1042 (RenderBox::nodeAtPoint):
1043 * khtml/rendering/render_box.h:
1044 * khtml/rendering/render_br.h:
1045 * khtml/rendering/render_canvas.cpp:
1046 (RenderCanvas::paint):
1047 * khtml/rendering/render_flow.cpp:
1048 (RenderFlow::paintLines):
1049 (RenderFlow::hitTestLines):
1050 (RenderFlow::caretRect):
1051 (RenderFlow::addFocusRingRects):
1052 (RenderFlow::paintFocusRing):
1053 (RenderFlow::paintOutlines):
1054 (RenderFlow::paintOutlineForLine):
1055 * khtml/rendering/render_flow.h:
1056 * khtml/rendering/render_frames.cpp:
1057 (RenderFrameSet::nodeAtPoint):
1058 * khtml/rendering/render_frames.h:
1059 * khtml/rendering/render_image.cpp:
1060 (RenderImage::nodeAtPoint):
1061 * khtml/rendering/render_image.h:
1062 * khtml/rendering/render_inline.cpp:
1063 (RenderInline::paint):
1064 (RenderInline::nodeAtPoint):
1065 * khtml/rendering/render_inline.h:
1066 * khtml/rendering/render_layer.cpp:
1067 (RenderLayer::paintLayer):
1068 (RenderLayer::hitTest):
1069 (RenderLayer::hitTestLayer):
1070 * khtml/rendering/render_layer.h:
1071 * khtml/rendering/render_line.cpp:
1072 (khtml::InlineBox::paint):
1073 (khtml::InlineBox::nodeAtPoint):
1074 (khtml::InlineFlowBox::flowObject):
1075 (khtml::InlineFlowBox::nodeAtPoint):
1076 (khtml::InlineFlowBox::paint):
1077 (khtml::InlineFlowBox::paintBackgrounds):
1078 (khtml::InlineFlowBox::paintBackground):
1079 (khtml::InlineFlowBox::paintBackgroundAndBorder):
1080 (khtml::InlineFlowBox::paintDecorations):
1081 (khtml::EllipsisBox::paint):
1082 (khtml::EllipsisBox::nodeAtPoint):
1083 (khtml::RootInlineBox::paintEllipsisBox):
1084 (khtml::RootInlineBox::paint):
1085 (khtml::RootInlineBox::nodeAtPoint):
1086 * khtml/rendering/render_line.h:
1087 (khtml::InlineRunBox::paintBackgroundAndBorder):
1088 * khtml/rendering/render_object.cpp:
1089 (RenderObject::hitTest):
1090 (RenderObject::setInnerNode):
1091 (RenderObject::nodeAtPoint):
1092 * khtml/rendering/render_object.h:
1093 (khtml::RenderObject::PaintInfo::PaintInfo):
1094 (khtml::RenderObject::PaintInfo::~PaintInfo):
1095 (khtml::RenderObject::paintingRootForChildren):
1096 (khtml::RenderObject::shouldPaintWithinRoot):
1097 * khtml/rendering/render_table.cpp:
1098 (RenderTable::layout):
1099 (RenderTable::paint):
1100 * khtml/rendering/render_text.cpp:
1101 (simpleDifferenceBetweenColors):
1102 (correctedTextColor):
1103 (InlineTextBox::nodeAtPoint):
1104 (InlineTextBox::paint):
1105 (InlineTextBox::selectionStartEnd):
1106 (InlineTextBox::paintSelection):
1107 (InlineTextBox::paintMarkedTextBackground):
1108 (InlineTextBox::paintDecoration):
1109 (RenderText::posOfChar):
1110 * khtml/rendering/render_text.h:
1111 (khtml::RenderText::paint):
1112 (khtml::RenderText::layout):
1113 (khtml::RenderText::nodeAtPoint):
1114 * khtml/xml/dom2_eventsimpl.cpp:
1115 (MouseEventImpl::computeLayerPos):
1116 * khtml/xml/dom_docimpl.cpp:
1117 (DocumentImpl::prepareMouseEvent):
1118 * kwq/KWQAccObject.mm:
1119 (-[KWQAccObject accessibilityHitTest:]):
1120 * kwq/KWQKHTMLPart.mm:
1121 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
1122 (KWQKHTMLPart::eventMayStartDrag):
1123 (KWQKHTMLPart::khtmlMouseMoveEvent):
1124 * kwq/WebCoreBridge.mm:
1125 (-[WebCoreBridge elementAtPoint:]):
1126 (-[WebCoreBridge _positionForPoint:]):
1128 2004-11-22 Maciej Stachowiak <mjs@apple.com>
1132 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
1133 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
1135 This avoids the O(N^2) penalty for named item traversal for form collections.
1137 It also combines the item traversal logic for all non-form
1138 collection operations into a single traverseNextItem
1139 function. This avoids having 5 copies of the big switch statement
1142 Also fixed a bug that prevented the last form element from being removed properly.
1144 * khtml/html/html_formimpl.cpp:
1145 (DOM::removeFromVector):
1146 * khtml/dom/html_misc.cpp:
1147 (HTMLCollection::namedItems):
1148 * khtml/dom/html_misc.h:
1149 * khtml/ecma/kjs_html.cpp:
1150 (KJS::HTMLCollection::getNamedItems):
1151 * khtml/html/html_miscimpl.cpp:
1152 (HTMLCollectionImpl::traverseNextItem):
1153 (HTMLCollectionImpl::calcLength):
1154 (HTMLCollectionImpl::length):
1155 (HTMLCollectionImpl::item):
1156 (HTMLCollectionImpl::nextItem):
1157 (HTMLCollectionImpl::checkForNameMatch):
1158 (HTMLCollectionImpl::namedItem):
1159 (HTMLCollectionImpl::namedItems):
1160 (HTMLCollectionImpl::nextNamedItem):
1161 (HTMLFormCollectionImpl::calcLength):
1162 (HTMLFormCollectionImpl::namedItem):
1163 (HTMLFormCollectionImpl::nextNamedItem):
1164 (HTMLFormCollectionImpl::namedItems):
1165 * khtml/html/html_miscimpl.h:
1167 2004-11-22 Ken Kocienda <kocienda@apple.com>
1169 Reviewed by Harrison
1171 Change around the way we block the Javascript "Paste" command identifier from
1172 being available. Formerly, this was done with an ifdef we never compiled in.
1173 Now, this is done with a couple of cheap runtime checks. The advantage is that
1174 we can now compile this command into development builds, and still yet switch
1175 on the command in deployment builds through the use of WebCore SPI so we can
1176 write and run layout tests with all of our builds.
1178 * khtml/editing/jsediting.cpp:
1179 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
1180 command being queried is the paste command.
1181 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
1182 * khtml/editing/jsediting.h: Ditto.
1183 * khtml/khtml_part.cpp:
1184 (KHTMLPart::pasteFromPasteboard): Added.
1185 (KHTMLPart::canPaste): Added.
1186 * kwq/KWQKHTMLPart.mm:
1187 (KHTMLPart::canPaste): Added.
1188 * kwq/KWQRenderTreeDebug.cpp:
1189 (externalRepresentation): Turn on paste command.
1190 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
1192 2004-11-21 Maciej Stachowiak <mjs@apple.com>
1194 Reviewed by Richard.
1196 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
1198 * khtml/html/html_miscimpl.cpp:
1199 (HTMLCollectionImpl::calcLength):
1200 (HTMLCollectionImpl::getItem):
1201 (HTMLCollectionImpl::item):
1202 (HTMLCollectionImpl::nextItem):
1203 (HTMLCollectionImpl::getNamedItem):
1204 (HTMLCollectionImpl::namedItem):
1205 (HTMLCollectionImpl::nextNamedItemInternal):
1206 (HTMLFormCollectionImpl::nextNamedItemInternal):
1208 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1212 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
1213 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
1214 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
1216 Many optimizations to HTMLFormCollection. Iterating it should not
1217 be N^2 any more, though finding items by name could still be.
1219 * khtml/html/html_formimpl.cpp:
1220 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1221 (DOM::HTMLFormElementImpl::length):
1222 (DOM::HTMLFormElementImpl::submitClick):
1223 (DOM::HTMLFormElementImpl::formData):
1224 (DOM::HTMLFormElementImpl::submit):
1225 (DOM::HTMLFormElementImpl::reset):
1226 (DOM::HTMLFormElementImpl::radioClicked):
1227 (DOM::appendToVector):
1228 (DOM::removeFromVector):
1229 (DOM::HTMLFormElementImpl::registerFormElement):
1230 (DOM::HTMLFormElementImpl::removeFormElement):
1231 (DOM::HTMLFormElementImpl::makeFormElementDormant):
1232 (DOM::HTMLFormElementImpl::registerImgElement):
1233 (DOM::HTMLFormElementImpl::removeImgElement):
1234 * khtml/html/html_formimpl.h:
1235 * khtml/html/html_miscimpl.cpp:
1236 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
1237 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
1238 (HTMLFormCollectionImpl::resetCollectionInfo):
1239 (HTMLFormCollectionImpl::calcLength):
1240 (HTMLFormCollectionImpl::item):
1241 (HTMLFormCollectionImpl::getNamedItem):
1242 (HTMLFormCollectionImpl::getNamedFormItem):
1243 (HTMLFormCollectionImpl::firstItem):
1244 (HTMLFormCollectionImpl::nextItem):
1245 * khtml/html/html_miscimpl.h:
1246 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
1247 * khtml/xml/dom_elementimpl.cpp:
1248 (ElementImpl::setAttribute):
1249 (ElementImpl::setAttributeMap):
1250 * kwq/KWQPtrVector.h:
1251 (QPtrVector::findRef):
1252 * kwq/KWQVectorImpl.h:
1253 * kwq/KWQVectorImpl.mm:
1254 (KWQVectorImpl::findRef):
1255 * kwq/WebCoreBridge.mm:
1256 (-[WebCoreBridge elementWithName:inForm:]):
1257 (-[WebCoreBridge controlsInForm:]):
1259 2004-11-19 David Harrison <harrison@apple.com>
1261 Reviewed by Ken and Darin.
1263 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
1265 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
1266 for the existing style, but in this case (hitting cmd-B with caret at top of
1267 file) there is nothing upstream. Changed this to use the VisiblePosition
1268 deepEquivalent instead.
1270 * khtml/khtml_part.cpp:
1271 (KHTMLPart::computeAndSetTypingStyle):
1275 2004-11-19 Maciej Stachowiak <mjs@apple.com>
1279 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
1281 * khtml/xml/dom_docimpl.cpp:
1282 (DocumentImpl::close): Don't fire the onload handler if there is a
1283 redirect pending. This is a very long-standing bug that was masked
1284 by our previously incorrect redirect logic. It used to be that an
1285 older redirect would always win. Recently we changed things so
1286 that a newer redirect would win, but a script that causes a
1287 redirect would stop parsing once complete (so if there are two
1288 redirects in the same script, the latter wins). However, we should
1289 have also prevented onload in this case. Testing with other
1290 browsers shows that onload handlers do not run at all when there
1291 is a pending redirect.
1293 2004-11-19 Ken Kocienda <kocienda@apple.com>
1295 Reviewed by Harrison
1297 Fix some object lifetime issues in these two commands. This fixes some crashes
1298 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
1300 * khtml/editing/htmlediting.cpp:
1301 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
1302 in the ancestor list. They are not ref'ed when put on list. D'uh.
1303 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
1304 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
1305 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
1307 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
1309 2004-11-19 Ken Kocienda <kocienda@apple.com>
1311 Reviewed by Harrison
1315 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
1317 * khtml/khtml_part.cpp:
1318 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
1319 declaration given the current selection, and then sets the minimum necessary style as the typing
1321 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
1322 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
1324 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
1325 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
1326 * kwq/WebCoreBridge.mm:
1327 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
1328 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
1330 2004-11-18 David Harrison <harrison@apple.com>
1334 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
1335 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
1338 (-[DOMCSSStyleDeclaration setProperty:::]):
1340 2004-11-18 Chris Blumenberg <cblu@apple.com>
1342 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
1346 * kwq/KWQKHTMLPart.mm:
1347 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
1349 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1353 - fix recursive item traversal, use traverseNextNode() instead of
1354 the buggy hand-rolled traversal.
1356 * khtml/xml/dom_nodeimpl.cpp:
1357 (NodeListImpl::recursiveItem):
1359 2004-11-17 Darin Adler <darin@apple.com>
1363 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)
1365 * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::slotFinished):
1366 Rolled in fix from KDE; make sure to set job to 0 before calling changeState.
1368 - fixed <rdar://problem/3885729> attempting to modify a computed style does nothing, but should raise a DOM exception
1369 - fixed <rdar://problem/3885731> style declarations use too many malloc blocks; switch to QValueList
1370 - fixed <rdar://problem/3885739> DOM::NodeImpl accessor in DOM::Node class is hot; should be inlined
1371 - changed NodeImpl calls like replaceChild to always ref/deref the parameter; this is a better way to fix
1372 an entire category of leaks we have been fixing one by one recently
1373 - changed computed styles so they hold a reference to the DOM node; the old code could end up with a
1374 stale RenderObject pointer, although I never saw it do that in practice
1375 - implemented the length and item methods for computed styles
1376 - implemented querying additional properties in computed styles (29 more)
1378 * khtml/khtml_part.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1379 now a separate class rather than a typedef. Changed the parameter type of setTypingStyle to
1380 take a mutable style.
1381 * khtml/khtml_part.cpp:
1382 (KHTMLPart::setTypingStyle): Change parameter to take a mutable style.
1383 (KHTMLPart::applyStyle): Add code to make a mutable style in case we are passed
1384 a computed style; also change some types to mutable style.
1385 (updateState): Update iteration of CSSProperty objects in a style declaration to use
1386 the new valuesIterator interface.
1387 (KHTMLPart::selectionHasStyle): Add a call to makeMutable.
1388 (KHTMLPart::selectionStartHasStyle): Add call to makeMutable and update iteration.
1389 (editingStyle): Change type to mutable style, and simplify the style-creation calls,
1390 including accomodating the exception code that setCssText has now.
1391 (KHTMLPart::applyEditingStyleToElement): Change types to mutable style.
1392 (KHTMLPart::removeEditingStyleFromElement): Change code to call setChanged only if removing
1393 the style attributes really was a change, although it's not an important optimization it's
1394 good to do it right.
1396 * khtml/css/css_base.h: Remove unneeded setParsedValue method.
1397 * khtml/css/css_base.cpp: Remove unneeded setParsedValue method. All the places that were
1398 calling it were already removing the old property explicitly, so the code in here to remove
1399 the property again was redundant.
1401 * khtml/css/css_computedstyle.h: Updated virtual functions for changes to parameters in base class.
1402 Moved all the "set"-type functions so they are private. Store a node pointer instead of a renderer.
1403 * khtml/css/css_computedstyle.cpp:
1404 (DOM::CSSComputedStyleDeclarationImpl::CSSComputedStyleDeclarationImpl): Hold a reference to
1405 the node we compute style for, so we don't end up with a pointer to a deallocated RenderObject.
1406 Before we had no guarantee the object would outlast us.
1407 (DOM::CSSComputedStyleDeclarationImpl::setCssText): Add exception parameter, and set the
1408 exception to NO_MODIFICATION_ALLOWED_ERR.
1409 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Update to use node pointer rather
1410 than renderer pointer. Added implementation for box-align, box-direction, box-flex, box-flex-group,
1411 box-lines, box-ordinal-group, box-orient, box-pack, caption-side, clear, cursor, direction,
1412 list-style-image, list-style-position, list-style-type, marquee-direction, marquee-repetition,
1413 marquee-style, user-modify, opacity, orphans, outline-style, page-break-after, page-break-before,
1414 page-break-inside, position, unicode-bidi, widows, z-index.
1415 (DOM::CSSComputedStyleDeclarationImpl::removeProperty): Add exception parameter, and set the
1416 exception to NO_MODIFICATION_ALLOWED_ERR.
1417 (DOM::CSSComputedStyleDeclarationImpl::setProperty): Ditto.
1418 (DOM::CSSComputedStyleDeclarationImpl::length): Implemented.
1419 (DOM::CSSComputedStyleDeclarationImpl::item): Implemented, calls getPropertyValue.
1420 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Changed return type to
1421 CSSMutableStyleDeclarationImpl.
1422 (DOM::CSSComputedStyleDeclarationImpl::copy): Added.
1423 (DOM::CSSComputedStyleDeclarationImpl::makeMutable): Added.
1425 * khtml/css/css_ruleimpl.h: Update forward declaration of CSSMutableStyleDeclarationImpl since it's
1426 now a separate class rather than a typedef.
1427 * khtml/css/cssparser.h: Ditto.
1429 * khtml/css/css_valueimpl.h: Refactor CSSStyleDeclarationImpl into two classes. New derived class
1430 CSSMutableStyleDeclarationImpl has the guts, and the base class has only some virtual functions.
1431 Removed a bunch of redundant stuff from other classes in this file too.
1432 (DOM::DashboardRegionImpl::setNext): Ref new before deref'ing old to handle the set-to-same case.
1433 (DOM::CSSProperty::CSSProperty): Added new overload so you can create a CSSProperty with initial values.
1434 (DOM::CSSProperty::operator=): Added.
1435 (DOM::CSSProperty::setValue): Use ref-before-deref pattern to simplify slightly.
1437 * khtml/css/css_valueimpl.cpp:
1438 (DOM::CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Remove uneeded things.
1439 (DOM::CSSStyleDeclarationImpl::isStyleDeclaration): Put here now that it's no longer inline.
1440 (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl): Added.
1441 (DOM::CSSMutableStyleDeclarationImpl::operator=): Added.
1442 (DOM::CSSMutableStyleDeclarationImpl::~CSSMutableStyleDeclarationImpl): Updated.
1443 (DOM::CSSMutableStyleDeclarationImpl::getPropertyValue): Removed now-uneeded check.
1444 (DOM::CSSMutableStyleDeclarationImpl::get4Values): Moved here from base class.
1445 (DOM::CSSMutableStyleDeclarationImpl::getShortHandValue): Ditto.
1446 (DOM::CSSMutableStyleDeclarationImpl::getPropertyCSSValue): Update to use QValueList instead of QPtrList.
1447 (DOM::CSSMutableStyleDeclarationImpl::removeProperty): Added exception parameter, updated for QValueList.
1448 (DOM::CSSMutableStyleDeclarationImpl::setChanged): Moved here from base class.
1449 (DOM::CSSMutableStyleDeclarationImpl::getPropertyPriority): Update to use QValueList.
1450 (DOM::CSSMutableStyleDeclarationImpl::setProperty): Added more overloads to match new parameters.
1451 (DOM::CSSMutableStyleDeclarationImpl::setStringProperty): Update to use QValueList.
1452 (DOM::CSSMutableStyleDeclarationImpl::setImageProperty): Ditto.
1453 (DOM::CSSMutableStyleDeclarationImpl::parseProperty): Remove unneeded initialization code due to QValueList.
1454 (DOM::CSSMutableStyleDeclarationImpl::addParsedProperties): Added.
1455 (DOM::CSSMutableStyleDeclarationImpl::setLengthProperty): Moved here from base class.
1456 (DOM::CSSMutableStyleDeclarationImpl::length): Update to use QValueList.
1457 (DOM::CSSMutableStyleDeclarationImpl::item): Moved here from base class.
1458 (DOM::CSSMutableStyleDeclarationImpl::cssText): Return empty string rather than null string when there are
1459 no styles in the list. Update to use QValueList.
1460 (DOM::CSSMutableStyleDeclarationImpl::setCssText): Update to use QValueList and to take an exceptionCode
1461 parameter and set it.
1462 (DOM::CSSMutableStyleDeclarationImpl::merge): Update to use QValueList.
1463 (DOM::CSSStyleDeclarationImpl::diff): Update to use QValueList.
1464 (DOM::CSSMutableStyleDeclarationImpl::copyBlockProperties): Moved here from base class. Change return type.
1465 (DOM::CSSStyleDeclarationImpl::copyPropertiesInSet): Update to use QValueList and use stack, not new/delete.
1466 (DOM::CSSMutableStyleDeclarationImpl::makeMutable): Added.
1467 (DOM::CSSMutableStyleDeclarationImpl::copy): Added.
1469 * khtml/css/cssparser.cpp:
1470 (CSSParser::parseValue): Changed to use addParsedProperties.
1471 (CSSParser::parseDeclaration): Ditto.
1472 (CSSParser::createStyleDeclaration): Use new constructor to create declaration in a more efficient manner.
1474 * khtml/css/cssproperties.in: Removed unused font-size-adjust and -khtml-flow-mode.
1475 * khtml/css/cssproperties.c: Regenerated.
1476 * khtml/css/cssproperties.h: Regenerated.
1478 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::applyDeclarations):
1479 Updated to use QValueList interface to CSSMutableStyleDeclarationImpl.
1481 * khtml/dom/css_value.cpp:
1482 (DOM::CSSStyleDeclaration::cssText): Removed unneeded cast.
1483 (DOM::CSSStyleDeclaration::setCssText): Added exception code handling.
1484 (DOM::CSSStyleDeclaration::getPropertyValue): Changed to call getPropertyValue directly instead of
1485 first doing getPropertyCSSValue and then doing cssText.
1486 (DOM::CSSStyleDeclaration::getPropertyCSSValue): Removed unneeded cast.
1487 (DOM::CSSStyleDeclaration::removeProperty): Added exception code handling.
1488 (DOM::CSSStyleDeclaration::setProperty): Added exception code handling.
1489 (DOM::CSSStyleDeclaration::length): Removed unneeded cast.
1490 (DOM::CSSStyleDeclaration::item): Removed unneeded cast.
1491 (DOM::CSSStyleDeclaration::parentRule): Removed unneeded cast.
1492 (DOM::CSSValue::setCssText): Removed strange non-implementation (still not implemented).
1494 * khtml/dom/dom_node.h: Made isNull and handle functions inline.
1495 * khtml/dom/dom_node.cpp: Ditto.
1497 * khtml/editing/htmlediting.h: Change some types to mutable style.
1498 * khtml/editing/htmlediting.cpp:
1499 (khtml::EditCommandPtr::typingStyle): Change return type to mutable style.
1500 (khtml::EditCommandPtr::setTypingStyle): Change parameter to mutable style.
1501 (khtml::StyleChange::init): Convert parameter to mutable style. Update to use QValueList.
1502 (khtml::EditCommand::assignTypingStyle): Change parameter to mutable type.
1503 (khtml::EditCommand::setTypingStyle): Ditto.
1504 (khtml::ApplyStyleCommand::ApplyStyleCommand): Convert parameter to mutable style.
1505 (khtml::ApplyStyleCommand::doApply): Change local variables to mutable style.
1506 (khtml::ApplyStyleCommand::applyBlockStyle): Change parameter to mutable style.
1507 (khtml::ApplyStyleCommand::applyInlineStyle): Ditto.
1508 (khtml::ApplyStyleCommand::isHTMLStyleNode): Ditto.
1509 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto. Also update to use QValueList.
1510 (khtml::ApplyStyleCommand::removeBlockStyle): Change parameter to mutable style.
1511 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
1512 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
1513 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
1514 (khtml::InsertLineBreakCommand::doApply): Convert locals to mutable style.
1515 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
1516 (khtml::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Convert parameter to mutable style.
1518 * khtml/editing/jsediting.cpp: Convert types to mutable styles where we create styles.
1519 * khtml/html/html_baseimpl.h: Change type to mutable style.
1520 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::createLinkDecl): Ditto.
1522 * khtml/html/html_elementimpl.h: Make CSSMappedAttributeDeclarationImpl use the mutable style
1523 class as a base class, and change types to mutable style as needed.
1524 * khtml/html/html_elementimpl.cpp:
1525 (HTMLElementImpl::createInlineStyleDecl): Change type to mutable style.
1526 (HTMLElementImpl::parseHTMLAttribute): Call parseProperty method.
1527 (HTMLElementImpl::getInlineStyleDecl): Change type to mutable style.
1528 (HTMLElementImpl::additionalAttributeStyleDecl): Ditto.
1529 (HTMLElementImpl::createContextualFragment): Add ref/deref to fix potential node leak.
1530 (HTMLElementImpl::setInnerHTML): Remove ref/deref pair because this leak is now fixed by changes
1532 (HTMLElementImpl::setOuterHTML): Remove ref/deref pair because this leak is now fixed by changes
1535 * khtml/html/html_tableimpl.h: Change types to mutable style.
1536 * khtml/html/html_tableimpl.cpp:
1537 (HTMLTableElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1538 (HTMLTableElementImpl::getSharedCellDecl): Change type to mutable style.
1539 (HTMLTableCellElementImpl::additionalAttributeStyleDecl): Change type to mutable style.
1541 * khtml/html/htmlparser.cpp:
1542 (KHTMLParser::parseToken): Use a local variable to protect the node by ref'ing it. This is better
1543 than using an explicit delete to make the node go away, and is required for compatibility with the
1544 changes to the NodeImpl functions.
1545 (KHTMLParser::insertNode): Ditto.
1546 (KHTMLParser::createHead): Get rid of explicit delete, no longer needed because of changes to
1547 the NodeImpl functions.
1549 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createCSSStyleDeclaration): Call simpler constructor
1550 now that there's no need to make the property list explictly.
1553 (-[DOMCSSStyleDeclaration setCssText:]): Raise exception when appropriate.
1554 (-[DOMCSSStyleDeclaration removeProperty:]): Ditto.
1555 (-[DOMCSSStyleDeclaration setProperty:::]): Dito.
1557 * khtml/xml/dom_nodeimpl.cpp:
1558 (NodeImpl::insertBefore): Always do a ref/deref, so callers don't have to worry about whether the
1559 function succeeded or not for ownership purposes.
1560 (NodeImpl::replaceChild): Ditto.
1561 (NodeImpl::appendChild): Ditto.
1562 (NodeBaseImpl::insertBefore): Ditto.
1563 (NodeBaseImpl::replaceChild): Ditto.
1564 (NodeBaseImpl::appendChild): Ditto.
1565 (NodeBaseImpl::addChild): Ditto.
1567 * WebCore-tests.exp: Removed CSSStyleDeclaration::length; not sure why it was in here.
1568 * WebCore-combined.exp: Regenerated.
1570 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1572 still even more build fixing
1574 * khtml/html/html_miscimpl.cpp:
1575 (HTMLCollectionImpl::resetCollectionInfo):
1577 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1581 * khtml/html/html_miscimpl.cpp:
1582 (HTMLCollectionImpl::resetCollectionInfo):
1584 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1586 Fixed build problem.
1588 * khtml/html/html_miscimpl.h:
1589 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo): it's haslength, not hasLenght.
1591 2004-11-18 Maciej Stachowiak <mjs@apple.com>
1595 - merged and cleaned up HTMLCollection and HTMLFormCollection speedups from konqueror
1597 <rdar://problem/3822992> VIP: Program listings pages at directv.com take a really long time to load [HTMLCollection]
1598 <rdar://problem/3701991> Safari unresponsive loading (www.maxim-ic.com) (HTMLCollection)
1600 This is also a start on fixing 5 other bugs, but those need additional work to make
1601 HTMLFormCollection fast.
1603 * khtml/html/html_documentimpl.h:
1604 (DOM::HTMLDocumentImpl::collectionInfo):
1605 * khtml/html/html_formimpl.cpp:
1606 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
1607 (DOM::HTMLFormElementImpl::isURLAttribute):
1608 (DOM::HTMLFormElementImpl::registerImgElement):
1609 (DOM::HTMLFormElementImpl::removeImgElement):
1610 * khtml/html/html_formimpl.h:
1611 * khtml/html/html_imageimpl.cpp:
1612 (HTMLImageElementImpl::HTMLImageElementImpl):
1613 (HTMLImageElementImpl::~HTMLImageElementImpl):
1614 * khtml/html/html_imageimpl.h:
1615 * khtml/html/html_miscimpl.cpp:
1616 (HTMLCollectionImpl::HTMLCollectionImpl):
1617 (HTMLCollectionImpl::~HTMLCollectionImpl):
1618 (HTMLCollectionImpl::updateCollectionInfo):
1619 (HTMLCollectionImpl::length):
1620 (HTMLCollectionImpl::item):
1621 (HTMLCollectionImpl::firstItem):
1622 (HTMLCollectionImpl::nextItem):
1623 (HTMLCollectionImpl::namedItem):
1624 (HTMLCollectionImpl::nextNamedItemInternal):
1625 (HTMLFormCollectionImpl::getNamedFormItem):
1626 * khtml/html/html_miscimpl.h:
1627 (DOM::HTMLCollectionImpl::):
1628 (DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo):
1629 * khtml/html/htmlparser.cpp:
1630 (KHTMLParser::getElement):
1631 * khtml/xml/dom_docimpl.cpp:
1632 (DocumentImpl::DocumentImpl):
1633 * khtml/xml/dom_docimpl.h:
1634 (DOM::DocumentImpl::incDOMTreeVersion):
1635 (DOM::DocumentImpl::domTreeVersion):
1636 * khtml/xml/dom_nodeimpl.cpp:
1640 2004-11-18 Kevin Decker <kdecker@apple.com>
1644 fixed: <rdar://problem/3841842> getPropertyID expensive
1647 (getPropertyID): avoid unnecessary memory allocations by using a fixed-sized stack based buffer.
1649 2004-11-17 David Hyatt <hyatt@apple.com>
1651 Improve responsiveness by being willing to break out of the tokenizer. (This patch was landed already
1652 and subsequently backed out).
1654 Reviewed by kocienda
1656 * khtml/html/html_baseimpl.cpp:
1657 (HTMLBodyElementImpl::insertedIntoDocument):
1658 * khtml/html/htmltokenizer.cpp:
1659 (khtml::HTMLTokenizer::reset):
1660 (khtml::HTMLTokenizer::scriptHandler):
1661 (khtml::HTMLTokenizer::scriptExecution):
1662 (khtml::HTMLTokenizer::write):
1663 (khtml::HTMLTokenizer::continueProcessing):
1664 (khtml::HTMLTokenizer::timerEvent):
1665 (khtml::HTMLTokenizer::notifyFinished):
1666 * khtml/html/htmltokenizer.h:
1667 * khtml/khtmlview.cpp:
1668 (KHTMLViewPrivate::KHTMLViewPrivate):
1669 (KHTMLViewPrivate::reset):
1671 (KHTMLView::layout):
1672 (KHTMLView::timerEvent):
1673 (KHTMLView::scheduleRelayout):
1674 (KHTMLView::layoutPending):
1675 (KHTMLView::haveDelayedLayoutScheduled):
1676 (KHTMLView::unscheduleRelayout):
1677 * khtml/khtmlview.h:
1678 * khtml/xml/dom_docimpl.cpp:
1679 (DocumentImpl::DocumentImpl):
1680 (DocumentImpl::close):
1681 (DocumentImpl::setParsing):
1682 (DocumentImpl::shouldScheduleLayout):
1683 (DocumentImpl::minimumLayoutDelay):
1684 (DocumentImpl::write):
1685 (DocumentImpl::finishParsing):
1686 (DocumentImpl::stylesheetLoaded):
1687 (DocumentImpl::updateStyleSelector):
1688 * khtml/xml/dom_docimpl.h:
1689 (DOM::DocumentImpl::parsing):
1690 * kwq/KWQDateTime.mm:
1691 (KWQUIEventTime::uiEventPending):
1693 2004-11-17 David Harrison <harrison@apple.com>
1695 Reviewed by Ken Kocienda.
1697 Make sure previousLineStart is non-null before calling compareBoundaryPoints.
1698 Treat null case as meaning no post-move merge is needed.
1700 * khtml/editing/htmlediting.cpp:
1701 (khtml::DeleteSelectionCommand::initializePositionData):
1703 2004-11-17 David Harrison <harrison@apple.com>
1705 Added displayNode and displayTree methods for debugging. Fixed comment typo in dispatchChildRemovalEvents.
1706 * khtml/xml/dom_nodeimpl.cpp:
1707 (NodeImpl::displayNode):
1708 (NodeImpl::displayTree):
1709 (NodeBaseImpl::dispatchChildRemovalEvents):
1710 * khtml/xml/dom_nodeimpl.h:
1712 2004-11-16 John Sullivan <sullivan@apple.com>
1714 Reviewed by Richard.
1716 - fixed <rdar://problem/3881929> 32 byte leak in editingStyle() in KHTMLPart (one-time only)
1718 * khtml/khtml_part.cpp:
1720 delete the list we created when we're done with it
1722 2004-11-16 Ken Kocienda <kocienda@apple.com>
1726 It is unwise to use the QPtrList autodelete feature on shared objects like DOM nodes.
1727 Instead, I replaced this with a helper function that derefs DOM nodes stored in a
1728 QPtrList when the list goes out of scope.
1730 * khtml/editing/htmlediting.cpp:
1731 (khtml::derefNodesInList): New helper to deref DOM nodes stored in a QPtrList.
1732 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): No longer set lists to autodelete.
1733 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Call new derefNodesInList helper.
1734 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
1735 No longer set lists to autodelete.
1736 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand):
1737 Call new derefNodesInList helper.
1738 * khtml/editing/htmlediting.h: Add virtual destructor for InsertParagraphSeparatorCommand. It had no need
1739 of one before, but now it does.
1741 2004-11-15 David Harrison <harrison@apple.com>
1743 Reviewed by Chris and Darin.
1745 <rdar://problem/3880304> Non-linear performance hit for style changes
1747 * khtml/xml/dom_nodeimpl.cpp:
1748 (NodeImpl::traverseNextNode):
1749 (NodeImpl::traverseNextSibling):
1750 (NodeImpl::traversePreviousNodePostOrder):
1751 Return 0 rather than traversing beyond stayWithin when this == stayWithin.
1752 Add asserts that stayWithin is an ancestor of the returned node.
1754 2004-11-15 Darin Adler <darin@apple.com>
1758 - fixed <rdar://problem/3880036> Many leaks from CSSComputedStyleDeclarationImpl::getPropertyCSSValue, seen in Mail and Blot
1760 * khtml/css/css_computedstyle.cpp:
1761 (DOM::CSSComputedStyleDeclarationImpl::getPropertyValue): Ref and deref the value returned from getPropertyCSSValue,
1762 since there's no guarantee it's already ref'd.
1763 * khtml/css/css_valueimpl.cpp:
1764 (CSSStyleDeclarationImpl::getPropertyValue): Wrap result in a CSSValue to ref/deref.
1765 (CSSStyleDeclarationImpl::get4Values): Ref/deref explicitly.
1766 (CSSStyleDeclarationImpl::getShortHandValue): Ditto.
1767 (CSSStyleDeclarationImpl::merge): Ditto.
1768 (CSSStyleDeclarationImpl::diff): Ditto.
1769 * khtml/editing/htmlediting.cpp:
1770 (khtml::StyleChange::currentlyHasStyle): Ditto.
1771 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
1772 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::parseHTMLAttribute): Ditto.
1773 * khtml/html/html_tableimpl.cpp: (HTMLTableElementImpl::parseHTMLAttribute): Ditto.
1775 2004-11-15 Darin Adler <darin@apple.com>
1779 Use separate mutable style and computed style types as appropriate.
1780 For now this should have no effect, but it prepares us for refactoring later.
1781 Also remove some unnecessary "DOM::" prefixes and in one case factor out
1784 * khtml/khtml_part.cpp:
1785 (KHTMLPart::typingStyle):
1786 (KHTMLPart::setTypingStyle):
1788 (KHTMLPart::selectionHasStyle):
1789 (KHTMLPart::selectionStartHasStyle):
1790 (KHTMLPart::selectionComputedStyle):
1791 * khtml/khtml_part.h:
1792 * khtml/khtmlpart_p.h:
1794 * khtml/css/css_base.h:
1795 * khtml/css/css_ruleimpl.cpp:
1796 (CSSStyleRuleImpl::setDeclaration):
1797 * khtml/css/css_ruleimpl.h:
1798 (DOM::CSSFontFaceRuleImpl::style):
1799 (DOM::CSSPageRuleImpl::style):
1800 (DOM::CSSStyleRuleImpl::style):
1801 (DOM::CSSStyleRuleImpl::declaration):
1802 * khtml/css/css_valueimpl.h:
1803 (DOM::CSSPrimitiveValueImpl::):
1804 * khtml/css/cssparser.cpp:
1805 (CSSParser::parseValue):
1806 (CSSParser::parseColor):
1807 (CSSParser::parseDeclaration):
1808 (CSSParser::createStyleDeclaration):
1809 * khtml/css/cssparser.h:
1810 * khtml/css/cssstyleselector.cpp:
1811 (khtml::CSSStyleSelector::addMatchedDeclaration):
1812 (khtml::CSSStyleSelector::matchRulesForList):
1813 (khtml::CSSStyleSelector::styleForElement):
1814 (khtml::CSSStyleSelector::applyDeclarations):
1815 * khtml/css/cssstyleselector.h:
1816 * khtml/css/parser.cpp:
1817 * khtml/css/parser.y:
1818 * khtml/dom/css_rule.h:
1819 * khtml/dom/css_stylesheet.h:
1820 * khtml/dom/css_value.h:
1821 * khtml/dom/dom2_views.cpp:
1822 * khtml/xml/dom2_viewsimpl.cpp:
1823 (DOM::AbstractViewImpl::getComputedStyle):
1824 * khtml/xml/dom_docimpl.cpp:
1825 (DocumentImpl::importNode):
1826 (DocumentImpl::setStyleSheet):
1827 * khtml/xml/dom_docimpl.h:
1828 * khtml/xml/dom_xmlimpl.cpp:
1829 (DOM::ProcessingInstructionImpl::setStyleSheet):
1830 * khtml/xml/dom_xmlimpl.h:
1832 * khtml/dom/css_value.cpp:
1833 (DOM::throwException): Added.
1834 (DOM::CSSStyleDeclaration::setCssText): Call throwException, but always on 0 for now.
1835 The real thing is coming with the next change to refactor.
1836 (DOM::CSSPrimitiveValue::setFloatValue): Call throwException.
1837 (DOM::CSSPrimitiveValue::setStringValue): Ditto.
1839 2004-11-15 Darin Adler <darin@apple.com>
1843 - fixed <rdar://problem/3878489> REGRESSION: modifying attribute of <textarea> blows away edited text (breaks simplemachines.org forum)
1845 * khtml/xml/dom_nodeimpl.h: Added boolean "children changed" parameter to
1846 dispatchSubtreeModifiedEvent, so it can be called in cases where only the
1847 node's attributes changed without sending a misleading childrenChanged call,
1848 but the childrenChanged call can happen at the exact right moment.
1849 * khtml/xml/dom_nodeimpl.cpp: Removed some uneeded "DOM::".
1850 (NodeImpl::dispatchSubtreeModifiedEvent): Only call "children changed" if
1851 the boolean true is passed in.
1853 * khtml/xml/dom_elementimpl.cpp:
1854 (NamedAttrMapImpl::addAttribute): Pass false for "children changed".
1855 (NamedAttrMapImpl::removeAttribute): Ditto.
1857 2004-11-15 John Sullivan <sullivan@apple.com>
1861 - fixed <rdar://problem/3880075> leak in CSSStyleDeclarationImpl::copyPropertiesInSet,
1862 seen often in Mail and Blot
1864 * khtml/css/css_valueimpl.cpp:
1865 (CSSStyleDeclarationImpl::copyPropertiesInSet):
1866 delete temporary list after we're done using it
1868 2004-11-15 Richard Williamson <rjw@apple.com>
1870 Fixed leak (3879883) that John found. Early return leaked
1875 * khtml/css/css_computedstyle.cpp:
1876 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
1878 2004-11-15 Ken Kocienda <kocienda@apple.com>
1884 <rdar://problem/3879569> Many leaks in EditCommand mechanism, seen in Mail
1886 Fixed a couple of object lifetime issues. The EditCommand class used to hold an
1887 EditCommandPtr to its parent, but this caused a a reference cycle in composite
1888 commands as the children held a ref to their parent. Now, the parent variable
1889 is a non-retained reference to an EditCommand *. It would be nice to have a
1890 weak reference to the parent or even override deref in composite commands (but I
1891 can't since deref() is not virtual). However, this should be OK since any
1892 dangling parent pointer is a sign of a bigger object lifetime problem that
1893 would need to be addressed anyway.
1895 * khtml/css/css_valueimpl.cpp:
1896 (CSSStyleDeclarationImpl::CSSStyleDeclarationImpl): Fix bug in constructor that takes a
1897 QPtrList<CSSProperty> *. List values must be copied into newly-allocated list, rather than
1898 just assigning the list variable passed in to the local list variable, or the list will be
1900 * khtml/editing/htmlediting.cpp:
1901 (khtml::EditCommand::setStartingSelection): No longer call get(). m_parent is no longer a smart pointer.
1902 (khtml::EditCommand::setEndingSelection): Ditto.
1903 (khtml::EditCommand::assignTypingStyle): Short-circuit if passed in style is identical to current style.
1904 Unrelated to the change, but saves some ref's and deref's.
1905 (khtml::EditCommand::setTypingStyle): No longer call get(). m_parent is no longer a smart pointer.
1906 * khtml/editing/htmlediting.h: Change m_parent to a EditCommand *. Was an EditCommandPtr. Using an
1907 EditCommandPtr caused a reference cycle in composite commands as the children held a ref to their parent.
1908 (khtml::EditCommand::parent): No longer call get(). m_parent is no longer a smart pointer.
1910 2004-11-15 Maciej Stachowiak <mjs@apple.com>
1914 <rdar://problem/3807080> Safari so slow it seems like a hang accessing a page on an IBM website
1916 * khtml/xml/dom_nodeimpl.cpp:
1917 (NodeListImpl::NodeListImpl): Initialize isItemCacheValid, renamed isCacheValid to
1919 (NodeListImpl::recursiveLength): Adjusted for rename.
1920 (NodeListImpl::recursiveItem): Cache the last item accessed and its offset.
1921 If the same offset is looked up again, just return it, otherwise, if looking up
1922 a later offset, start at the last item and proceed from there.
1923 (NodeListImpl::itemById): Apply the special document optimization to all
1924 nodes that are either a document or in a document - just walk up to make
1925 sure the node found by ID has the root node as an ancestor.
1926 (NodeListImpl::rootNodeSubtreeModified): Adjust both cache bits.
1927 * khtml/xml/dom_nodeimpl.h: Prototype new stuff.
1929 2004-11-15 John Sullivan <sullivan@apple.com>
1933 - fixed <rdar://problem/3879539> leak of NSString after pasting into editable HTML (e.g. Mail)
1935 * kwq/KWQKHTMLPart.mm:
1936 (KWQKHTMLPart::documentFragmentWithText):
1937 release mutable copy of string after we're done using it
1939 2004-11-14 Kevin Decker <kdecker@apple.com>
1943 fixed: <rdar://problem/3823038> LEAK: huge leak in DOM::HTMLElementImpl::createContextualFragment(DOM::DOMString const&, bool)
1945 * khtml/html/html_elementimpl.cpp:
1946 (HTMLElementImpl::setInnerHTML): uses the ref counting system to deallocate fragments instead of explicitly invoking a destructor.
1947 (HTMLElementImpl::setOuterHTML): function is responsible for derefing the fragment prior to returning. Now it does.
1949 2004-11-13 Maciej Stachowiak <mjs@apple.com>
1953 <rdar://problem/3878766> VIP: Program listings pages at directv.com takes 75% of time traversing NodeLists
1955 * khtml/dom/dom_node.cpp:
1956 (NodeList::itemById): New method, just forward to impl.
1957 * khtml/dom/dom_node.h: Prototype it.
1958 * khtml/ecma/kjs_dom.cpp:
1959 (DOMNodeList::tryGet): Instead of looping over the whole list to do by-id access,
1960 let the NodeList do it. The NodeList might be able to do it more efficiently.
1961 * khtml/xml/dom_nodeimpl.cpp:
1962 (NodeListImpl::itemById): Optimize for the case where the NodeList
1963 covers the whole document. In this case, just use getElementById,
1964 then check that the element satisfies the list criteria.
1965 (ChildNodeListImpl::nodeMatches): Return true only if the node is our child.
1966 (TagNodeListImpl::TagNodeListImpl): Irrelevant change to reformat initializers.
1967 * khtml/xml/dom_nodeimpl.h:
1969 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1973 - fixed another bug in the last checkin, isCacheValid was unitialized, resulting in
1974 sometimes using a huge bogus length value.
1976 * khtml/xml/dom_nodeimpl.cpp:
1977 (NodeListImpl::NodeListImpl): Initialize isCacheValid.
1979 2004-11-12 Darin Adler <darin@apple.com>
1983 - fixed an infinite loop in that last check-in
1985 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::notifyLocalNodeListsSubtreeModified):
1986 Added a ++i to the loop so it won't get stuck on the first element in the list.
1988 2004-11-12 Maciej Stachowiak <mjs@apple.com>
1992 - fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length
1994 I fixed this by changing NodeLists to cache their length, but
1995 invalidate it whenever there is a change in the DOM subtree at
1996 which they are rooted. This makes NodeListImpl::recursiveLength()
1997 drop completely off the profile, since we were repeatedly getting
1998 a length for the same NodeList over and over.
2000 * khtml/xml/dom_nodeimpl.cpp:
2001 (NodeImpl::NodeImpl):
2002 (NodeImpl::~NodeImpl):
2003 (NodeImpl::registerNodeList):
2004 (NodeImpl::unregisterNodeList):
2005 (NodeImpl::notifyLocalNodeListsSubtreeModified):
2006 (NodeImpl::notifyNodeListsSubtreeModified):
2007 (NodeImpl::dispatchSubtreeModifiedEvent):
2008 (NodeListImpl::NodeListImpl):
2009 (NodeListImpl::~NodeListImpl):
2010 (NodeListImpl::recursiveLength):
2011 (NodeListImpl::recursiveItem):
2012 (NodeListImpl::rootNodeSubtreeModified):
2013 (ChildNodeListImpl::ChildNodeListImpl):
2014 (ChildNodeListImpl::length):
2015 (ChildNodeListImpl::item):
2016 (TagNodeListImpl::TagNodeListImpl):
2017 (TagNodeListImpl::length):
2018 (TagNodeListImpl::item):
2019 (NameNodeListImpl::NameNodeListImpl):
2020 (NameNodeListImpl::length):
2021 (NameNodeListImpl::item):
2022 * khtml/xml/dom_nodeimpl.h:
2024 2004-11-12 Darin Adler <darin@apple.com>
2028 - various small cleanups
2030 * khtml/xml/dom_docimpl.h: Added policyBaseURL and setPolicyBaseURL.
2031 * khtml/html/html_documentimpl.h: Removed policyBaseURL and setPolicyBaseURL.
2033 * khtml/xml/xml_tokenizer.h: Marked isWaitingForScripts const.
2034 * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::isWaitingForScripts): Marked const.
2035 * khtml/html/htmltokenizer.h: Marked isWaitingForScripts const.
2036 * khtml/html/htmltokenizer.cpp:
2037 (khtml::HTMLTokenizer::isWaitingForScripts): Marked const.
2038 (khtml::HTMLTokenizer::setOnHold): Took out extraneous line of code.
2040 * khtml/khtml_part.h: Removed docImpl function.
2041 * khtml/khtml_part.cpp: Ditto.
2043 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close): Simplified code that implements
2044 the "redirect during onload" optimization. Now uses isScheduledLocationChangePending.
2046 * kwq/KWQKHTMLPart.h: Removed now-unused _firstResponderAtMouseDownTime.
2047 * kwq/KWQKHTMLPart.mm: Removed _firstResponderAtMouseDownTime (forgot to land this
2048 part of the change last time, which is why the build broke).
2049 (KWQKHTMLPart::updatePolicyBaseURL): Use xmlDocImpl instead of docImpl.
2050 (KWQKHTMLPart::setPolicyBaseURL): Ditto.
2051 (KWQKHTMLPart::keyEvent): Ditto.
2052 (KWQKHTMLPart::dispatchCPPEvent): Ditto.
2053 (KWQKHTMLPart::bodyBackgroundColor): Ditto.
2055 2004-11-12 Chris Blumenberg <cblu@apple.com>
2057 <rdar://problem/3843312> REGRESSION: Tabbing into content area puts insertion point at start, should go to where it last was
2061 * kwq/KWQKHTMLPart.mm:
2062 (KWQKHTMLPart::nextKeyViewInFrameHierarchy): only blow away selection when another view is focused
2066 2004-11-12 Darin Adler <darin@apple.com>
2070 - fixed a couple places that would not work for XML documents
2072 * khtml/ecma/kjs_window.cpp:
2073 (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
2074 is present on the base class.
2075 (WindowFunc::tryCall): More of the same.
2077 2004-11-12 Darin Adler <darin@apple.com>
2079 - land versions of these files generated by the newer gperf
2081 People building on Panther will continue to see these files modified.
2082 A workaround would be to install the newer gperf on our Tiger build machines.
2084 * khtml/css/cssproperties.c: Regenerated.
2085 * khtml/css/cssvalues.c: Regenerated.
2086 * khtml/html/doctypes.cpp: Regenerated.
2087 * khtml/html/kentities.c: Regenerated.
2088 * khtml/misc/htmlattrs.c: Regenerated.
2089 * khtml/misc/htmltags.c: Regenerated.
2090 * kwq/KWQColorData.c: Regenerated.
2092 2004-11-11 Richard Williamson <rjw@apple.com>
2094 Fix build horkage from previous checkin.
2096 * kwq/KWQKHTMLPart.h:
2098 2004-11-11 Darin Adler <darin@apple.com>
2102 - fixed <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields
2104 * kwq/WebCoreBridge.h: Added wasFirstResponderAtMouseDownTime: method.
2106 * kwq/KWQKHTMLPart.h: Removed _firstResponderAtMouseDownTime.
2107 * kwq/KWQKHTMLPart.mm:
2108 (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Use the new wasFirstResponderAtMouseDownTime:
2109 method on the bridge instead of _firstResponderAtMouseDownTime. This will return YES for the case where
2110 we started with the NSTextField as first responder, and then took focus away and gave it back, which
2111 makes dragging text work again.
2112 (KWQKHTMLPart::mouseDown): Removed code to set _firstResponderAtMouseDownTime.
2114 2004-11-11 David Hyatt <hyatt@apple.com>
2116 Disable the tokenizer deferral, since it hurts the PLT by 3% or so.
2120 * khtml/html/htmltokenizer.cpp:
2121 (khtml::HTMLTokenizer::continueProcessing):
2123 2004-11-11 Ken Kocienda <kocienda@apple.com>
2127 * khtml/editing/htmlediting.cpp:
2128 (khtml::InsertLineBreakCommand::doApply): Use new isLastVisiblePositionInBlock() helper instead
2129 of old isLastInBlock() member function on VisiblePosition. This is a cosmetic change in keeping
2130 with the prevailing style for the VisiblePosition class.
2131 * khtml/editing/htmlediting.h: Move isLastVisiblePositionInNode() function to visible_position.[cpp|h] files.
2132 * khtml/editing/visible_position.cpp: Removed isLastInBlock() helper. Renamed to isLastVisiblePositionInBlock().
2133 (khtml::visiblePositionsInDifferentBlocks): New helper method.
2134 (khtml::isLastVisiblePositionInBlock): Ditto.
2135 (khtml::isLastVisiblePositionInNode): Ditto.
2136 * khtml/editing/visible_position.h: Add declarations for new functions.
2138 2004-11-11 Ken Kocienda <kocienda@apple.com>
2142 * khtml/editing/htmlediting.cpp:
2143 (khtml::CompositeEditCommand::deleteInsignificantText): Call new compareBoundaryPoints convenience.
2144 (khtml::ApplyStyleCommand::removeBlockStyle): Ditto.
2145 (khtml::ApplyStyleCommand::removeInlineStyle): Ditto.
2146 (khtml::ApplyStyleCommand::nodeFullySelected): Ditto.
2147 (khtml::DeleteSelectionCommand::initializePositionData): Ditto.
2148 * khtml/xml/dom2_rangeimpl.cpp:
2149 (DOM::RangeImpl::compareBoundaryPoints): New convenience variant of this function which takes two Position objects.
2150 * khtml/xml/dom2_rangeimpl.h: Ditto.
2152 2004-11-11 Ken Kocienda <kocienda@apple.com>
2154 Reviewed by Harrison
2156 Some improvements to deleting when complete lines are selected.
2158 * khtml/editing/htmlediting.cpp:
2159 (khtml::DeleteSelectionCommand::initializePositionData): Detect when the line containing
2160 the end of a selection is fully selected. Turn off block merging in this case.
2161 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fix a bug in the check for
2162 whether a BR immediately followed a block. The old code could erroneously skip nodes.
2163 (khtml::DeleteSelectionCommand::handleGeneralDelete): Add a case for when the entire
2164 start block is selected. This new code will now delete this block in one call, rather
2165 than iterating over each child.
2166 * khtml/editing/visible_position.cpp:
2167 (khtml::visiblePositionsOnDifferentLines): New helper called in initializePositionData()
2168 to do the work mentioned above in the comment for that function.
2169 (khtml::isFirstVisiblePositionOnLine): Ditto.
2170 (khtml::isLastVisiblePositionOnLine): Ditto.
2171 * khtml/editing/visible_position.h: Add new functions.
2172 * layout-tests/editing/deleting/delete-line-001-expected.txt: Added.
2173 * layout-tests/editing/deleting/delete-line-001.html: Added.
2174 * layout-tests/editing/deleting/delete-line-002-expected.txt: Added.
2175 * layout-tests/editing/deleting/delete-line-002.html: Added.
2176 * layout-tests/editing/deleting/delete-line-003-expected.txt: Added.
2177 * layout-tests/editing/deleting/delete-line-003.html: Added.
2178 * layout-tests/editing/deleting/delete-line-004-expected.txt: Added.
2179 * layout-tests/editing/deleting/delete-line-004.html: Added.
2180 * layout-tests/editing/deleting/delete-line-005-expected.txt: Added.
2181 * layout-tests/editing/deleting/delete-line-005.html: Added.
2182 * layout-tests/editing/deleting/delete-line-006-expected.txt: Added.
2183 * layout-tests/editing/deleting/delete-line-006.html: Added.
2184 * layout-tests/editing/deleting/delete-line-007-expected.txt: Added.
2185 * layout-tests/editing/deleting/delete-line-007.html: Added.
2186 * layout-tests/editing/deleting/delete-line-008-expected.txt: Added.
2187 * layout-tests/editing/deleting/delete-line-008.html: Added.
2188 * layout-tests/editing/deleting/delete-line-009-expected.txt: Added.
2189 * layout-tests/editing/deleting/delete-line-009.html: Added.
2190 * layout-tests/editing/deleting/delete-line-010-expected.txt: Added.
2191 * layout-tests/editing/deleting/delete-line-010.html: Added.
2192 * layout-tests/editing/deleting/delete-line-011-expected.txt: Added.
2193 * layout-tests/editing/deleting/delete-line-011.html: Added.
2194 * layout-tests/editing/deleting/delete-line-012-expected.txt: Added.
2195 * layout-tests/editing/deleting/delete-line-012.html: Added.
2197 2004-11-11 Ken Kocienda <kocienda@apple.com>
2201 * khtml/editing/htmlediting.cpp:
2202 (khtml::DeleteSelectionCommand::initializePositionData): Add some comments and a new piece of debugging output.
2204 2004-11-11 Ken Kocienda <kocienda@apple.com>
2210 <rdar://problem/3875618> REGRESSION (Mail): Hitting down arrow with full line selected skips line (br case)
2211 <rdar://problem/3875641> REGRESSION (Mail): Hitting down arrow with full line selected skips line (div case)
2213 * khtml/editing/selection.cpp:
2214 (khtml::Selection::modifyMovingRightForward): Fixed by juggling the position as the starting point for
2215 the next line position when necessary.
2216 * layout-tests/editing/selection/move-3875618-fix-expected.txt: Added.
2217 * layout-tests/editing/selection/move-3875618-fix.html: Added.
2218 * layout-tests/editing/selection/move-3875641-fix-expected.txt: Added.
2219 * layout-tests/editing/selection/move-3875641-fix.html: Added.
2221 2004-11-11 Ken Kocienda <kocienda@apple.com>
2225 Improved some function names, at John's urging. No changes to the
2226 functions themselves.
2228 canPerformSpecialCaseAllContentDelete() --> handleSpecialCaseAllContentDelete()
2229 canPerformSpecialCaseBRDelete() --> handleSpecialCaseBRDelete()
2230 performGeneralDelete() --> handleGeneralDelete()
2232 * khtml/editing/htmlediting.cpp:
2233 (khtml::DeleteSelectionCommand::handleSpecialCaseAllContentDelete)
2234 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete)
2235 (khtml::DeleteSelectionCommand::handleGeneralDelete)
2236 (khtml::DeleteSelectionCommand::doApply)
2237 * khtml/editing/htmlediting.h
2239 2004-11-11 Ken Kocienda <kocienda@apple.com>
2243 Updated some layout test results that changed as a result of my last checking.
2244 Added a new test that has been in my tree for a few days.
2246 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt:
2247 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt:
2248 * layout-tests/editing/inserting/insert-3851164-fix-expected.txt: Added.
2249 * layout-tests/editing/inserting/insert-3851164-fix.html: Added.
2251 2004-11-11 Ken Kocienda <kocienda@apple.com>
2255 * khtml/editing/htmlediting.cpp:
2256 (khtml::debugNode): New debugging helper.
2257 (khtml::DeleteSelectionCommand::initializePositionData): No longer call obsoleted
2258 startPositionForDelete() and endPositionForDelete() functions. Just use the
2259 m_selectionToDelete object to determine start and end positions for the delete.
2260 (khtml::DeleteSelectionCommand::canPerformSpecialCaseAllContentDelete): New
2261 function that creates a special case for deleting all the content in a root
2263 (khtml::DeleteSelectionCommand::doApply): Call canPerformSpecialCaseAllContentDelete()
2264 function before BR special case and the general case delete functions.
2265 * khtml/editing/htmlediting.h: Updated for changed functions.
2267 2004-11-10 Kevin Decker <kdecker@apple.com>
2271 Fixed <rdar://problem/3875011> DOMNodeList::tryGet() performs unnecessary (and expensive) dom tree traversals. Improved a loop from 2-n-squared to just n-squared.
2273 * khtml/ecma/kjs_dom.cpp:
2274 (DOMNodeList::tryGet): Got rid of an unnecessary node traversal.
2276 2004-11-10 Ken Kocienda <kocienda@apple.com>
2280 * khtml/editing/htmlediting.cpp:
2281 (khtml::DeleteSelectionCommand::initializePositionData): Move position adjustments for
2282 smart delete from the two functions below to here. There was an unnecessary double
2283 calculation of the leading and trailing whitespace positions. Also refined the trailing
2284 case so it only acts when the leading position is null (which seems to match TextEdit in
2285 my tests). Also removed some unnecessary copying of Position objects.
2286 (khtml::DeleteSelectionCommand::startPositionForDelete): Move out smart delete adjustment
2288 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
2290 2004-11-10 Ken Kocienda <kocienda@apple.com>
2292 Reviewed by Harrison
2294 (khtml::DeleteSelectionCommand::performGeneralDelete): Add some more comments to
2295 make things more clear.
2296 * khtml/editing/selection.cpp:
2297 (khtml::Selection::toRange): Fixed the upstream and downstream calls so that the
2298 resulting positions do not cross block boundaries. This was a bug and caused some
2299 delete problems when whole blocks were selected. I will be addressing that issue
2300 more fully in upcoming changes.
2302 2004-11-10 Ken Kocienda <kocienda@apple.com>
2304 Reviewed by Harrison
2306 Some cleanups and fixes in upstream and downstream functions.
2308 Removed redundant checks for isBlockFlow() when calling enclosingBlockFlowElement().
2309 Blocks do not need to skip the call to enclosingBlockFlowElement() for fear that the
2310 block's enclosing block will be returned.
2312 Remove code from upstream that confined the serach to block boundaries outside of
2313 the code which runs in the StayInBlock case. This code was redundant, and caused
2314 incorrect results to be returned in the DoNotStayInBlock case.
2316 In downstream, the check for crossing into a new block should use the equivalentDeepPosition()
2317 node, not the the this pointer's node.
2319 * khtml/xml/dom_position.cpp:
2320 (DOM::Position::upstream)
2321 (DOM::Position::downstream)
2323 2004-11-09 David Hyatt <hyatt@apple.com>
2325 Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when
2326 loading large local files.
2330 * khtml/html/htmltokenizer.cpp:
2331 (khtml::HTMLTokenizer::HTMLTokenizer):
2332 (khtml::HTMLTokenizer::reset):
2333 (khtml::HTMLTokenizer::write):
2334 (khtml::HTMLTokenizer::stopped):
2335 (khtml::HTMLTokenizer::processingData):
2336 (khtml::HTMLTokenizer::continueProcessing):
2337 (khtml::HTMLTokenizer::timerEvent):
2338 (khtml::HTMLTokenizer::allDataProcessed):
2339 (khtml::HTMLTokenizer::end):
2340 (khtml::HTMLTokenizer::finish):
2341 (khtml::HTMLTokenizer::notifyFinished):
2342 * khtml/html/htmltokenizer.h:
2343 * khtml/khtml_part.cpp:
2344 (KHTMLPart::slotFinished):
2347 * khtml/khtml_part.h:
2348 (KHTMLPart::tokenizerProcessedData):
2349 * khtml/khtmlview.cpp:
2350 * khtml/xml/dom_docimpl.cpp:
2351 * khtml/xml/xml_tokenizer.h:
2352 (khtml::Tokenizer::stopped):
2353 (khtml::Tokenizer::processingData):
2354 * kwq/KWQDateTime.h:
2355 * kwq/KWQDateTime.mm:
2356 (QDateTime::secsTo):
2357 (KWQUIEventTime::uiEventPending):
2358 * kwq/KWQKHTMLPart.h:
2359 * kwq/KWQKHTMLPart.mm:
2360 (KWQKHTMLPart::tokenizerProcessedData):
2361 * kwq/WebCoreBridge.h:
2362 * kwq/WebCoreBridge.mm:
2363 (-[WebCoreBridge stop]):
2364 (-[WebCoreBridge numPendingOrLoadingRequests]):
2365 (-[WebCoreBridge doneProcessingData]):
2367 2004-11-09 David Harrison <harrison@apple.com>
2369 Reviewed by Ken Kocienda.
2371 <rdar://problem/3865837> Wrong text style after delete to start of document
2373 * khtml/editing/htmlediting.cpp:
2374 (khtml::DeleteSelectionCommand::saveTypingStyleState):
2375 Sample computedStyle of m_selectionToDelete.start instead of m_downstreamStart.
2377 2004-11-09 Richard Williamson <rjw@apple.com>
2379 Fixed <rdar://problem/3872440> NSTimer prematurely released.
2388 2004-11-09 Chris Blumenberg <cblu@apple.com>
2392 * WebCore.pbproj/project.pbxproj: explicitly link against libxml2.2.6.14.dylib since the version number has been bumped
2394 2004-11-08 David Harrison <harrison@apple.com>
2396 Reviewed by Ken Kocienda.
2398 <rdar://problem/3865854> Deleting first line deletes all lines
2400 * khtml/editing/htmlediting.cpp:
2401 (khtml::DeleteSelectionCommand::performGeneralDelete):
2402 Problem was that the code that deletes fully selected m_downstreamEnd.node() by deleting one
2403 of its ancestors, failed to end the loop that deletes all fully selected nodes. Also,
2404 fixed this code to clear m_trailingWhitespaceValid. Also removed dead m_endingPosition
2405 update because it is handled in calculateEndingPosition now.
2406 * layout-tests/editing/deleting/delete-3865854-fix-expected.txt: Added.
2407 * layout-tests/editing/deleting/delete-3865854-fix.html: Added.
2409 2004-11-08 Ken Kocienda <kocienda@apple.com>
2413 * khtml/html/html_elementimpl.cpp:
2414 (HTMLElementImpl::createContextualFragment): Now takes flag to control whether comments
2415 are added to the DOM.
2416 * khtml/html/html_elementimpl.h: Ditto.
2417 * khtml/html/htmlparser.cpp:
2418 (KHTMLParser::KHTMLParser): Ditto.
2419 (KHTMLParser::getElement): Remove ifdef for comment processing. Replace with flag check.
2420 * khtml/html/htmlparser.h: Add flag to constructor so callers can request comment nodes.
2421 * khtml/html/htmltokenizer.cpp:
2422 (khtml::HTMLTokenizer::HTMLTokenizer): Add flag to constructor so callers can request comment nodes.
2423 (khtml::HTMLTokenizer::parseComment): Fix code to handle parsing out comment text correctly.
2424 There were a couple of indexing errors that resulted in the comment text containing part of the
2426 (khtml::HTMLTokenizer::processToken): Don't let token id be reset to ID_TEXT if token is a comment.
2427 * khtml/html/htmltokenizer.h: Add flag to constructor so callers can request comment nodes.
2429 2004-11-08 Chris Blumenberg <cblu@apple.com>
2431 Fixed: <rdar://problem/3870907> WebCore unnecessary links against JavaVM and Security
2435 * WebCore.pbproj/project.pbxproj: stop unnecessary linking
2436 * khtml/html/html_objectimpl.h: don't unnecessarily include JavaVM header
2437 * kwq/KWQKHTMLPart.h: ditto
2439 2004-11-08 Darin Adler <darin@apple.com>
2443 - fixed <rdar://problem/3825966> 8A274 Safari crashes closing window: QTimer::fire() with MallocStackLogging and MallocScribble enabled
2445 * kwq/KWQTimer.mm: (QTimer::fire): Rearrange so we don't access the QTimer object after calling code
2446 that possibly deletes the QTimer.
2448 2004-11-08 Chris Blumenberg <cblu@apple.com>
2450 Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus
2454 * kwq/KWQTextField.mm:
2455 (-[KWQTextFieldController textView:shouldHandleEvent:]): let the bridge have a crack at the event so that it can swallow the newline if it wants to
2456 * kwq/WebCoreBridge.h:
2458 2004-11-08 David Harrison <harrison@apple.com>
2462 Renamed NodeImpl::enclosingNonBlockFlowElement to NodeImpl::enclosingInlineElement, per Hyatt.
2464 * khtml/editing/htmlediting.cpp:
2465 (khtml::DeleteSelectionCommand::moveNodesAfterNode):
2466 * khtml/xml/dom_nodeimpl.cpp:
2467 (NodeImpl::enclosingInlineElement):
2468 * khtml/xml/dom_nodeimpl.h:
2470 2004-11-05 Chris Blumenberg <cblu@apple.com>
2472 Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters
2476 * khtml/editing/htmlediting.cpp:
2477 (khtml::ReplaceSelectionCommand::doApply): call isCharacterSmartReplaceExempt on the part to see if a space should be inserted
2478 * khtml/editing/visible_position.cpp:
2479 (khtml::VisiblePosition::character): new, returns the character for the position
2480 * khtml/editing/visible_position.h:
2481 * kwq/KWQKHTMLPart.h:
2482 * kwq/KWQKHTMLPart.mm:
2483 (KWQKHTMLPart::isCharacterSmartReplaceExempt): new, calls the bridge
2484 * kwq/WebCoreBridge.h:
2488 2004-11-05 Adele Amchan <adele@apple.com>
2492 Fix for <rdar://problem/3854383> REGRESSION(166-168) input fields show black background when background color is set to transparent
2493 and a workaround for displaying transparent backgrounds for textareas.
2495 * kwq/KWQLineEdit.mm: (QLineEdit::setPalette): If the background color is transparent (we check the alpha value) then we set the background to white
2496 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): If the background color is transparent, then we don't draw the background
2497 * kwq/KWQTextArea.mm: (-[KWQTextArea setDrawsBackground:]): added setDrawsBackground function which calls setDrawsBackground on the super class,
2498 on the contentView, and on the textView.
2500 2004-11-04 David Hyatt <hyatt@apple.com>
2502 Fix for relpositioned inlines. This was reviewed a long time ago, but I can't recall who reviewed it (either
2505 Reviewed by darin or ken
2507 * khtml/rendering/bidi.cpp:
2508 (khtml::appendRunsForObject):
2509 (khtml::RenderBlock::skipWhitespace):
2510 (khtml::RenderBlock::findNextLineBreak):
2511 * khtml/rendering/render_block.cpp:
2512 (khtml::RenderBlock::lowestPosition):
2513 (khtml::RenderBlock::rightmostPosition):
2514 (khtml::RenderBlock::leftmostPosition):
2515 * khtml/rendering/render_box.cpp:
2516 (RenderBox::position):
2517 * khtml/rendering/render_box.h:
2518 (khtml::RenderBox::staticX):
2519 (khtml::RenderBox::staticY):
2520 * khtml/rendering/render_layer.cpp:
2521 (RenderLayer::updateLayerPosition):
2522 (RenderLayer::convertToLayerCoords):
2523 * khtml/rendering/render_line.cpp:
2524 (khtml::InlineFlowBox::placeBoxesHorizontally):
2525 * khtml/rendering/render_object.h:
2526 (khtml::RenderObject::staticX):
2527 (khtml::RenderObject::staticY):
2529 Finish turning on XSLT. Make sure child stylesheets can load.
2531 * khtml/xsl/xslt_processorimpl.cpp:
2532 (DOM::stylesheetLoadFunc):
2533 (DOM::XSLTProcessorImpl::transformDocument):
2535 2004-11-04 David Hyatt <hyatt@apple.com>
2537 Implement CSS3 support for multiple backgrounds. Also fix a bug with background propagation so that it only
2538 happens (from the <body> to the root) for HTML documents. Fixed background-position to handle a mixture of
2539 keyword and length values.
2543 * khtml/css/cssparser.cpp:
2544 (CSSParser::parseValue):
2545 (CSSParser::addBackgroundValue):
2546 (CSSParser::parseBackgroundShorthand):
2547 (CSSParser::parseBackgroundColor):
2548 (CSSParser::parseBackgroundImage):
2549 (CSSParser::parseBackgroundPositionXY):
2550 (CSSParser::parseBackgroundPosition):
2551 (CSSParser::parseBackgroundProperty):
2552 (CSSParser::parseColorFromValue):
2553 * khtml/css/cssparser.h:
2554 * khtml/css/cssstyleselector.cpp:
2555 (khtml::CSSStyleSelector::adjustRenderStyle):
2556 (khtml::CSSStyleSelector::applyProperty):
2557 (khtml::CSSStyleSelector::mapBackgroundAttachment):
2558 (khtml::CSSStyleSelector::mapBackgroundImage):
2559 (khtml::CSSStyleSelector::mapBackgroundRepeat):
2560 (khtml::CSSStyleSelector::mapBackgroundXPosition):
2561 (khtml::CSSStyleSelector::mapBackgroundYPosition):
2562 * khtml/css/cssstyleselector.h:
2563 * khtml/rendering/render_box.cpp:
2564 (RenderBox::paintRootBoxDecorations):
2565 (RenderBox::paintBoxDecorations):
2566 (RenderBox::paintBackgrounds):
2567 (RenderBox::paintBackground):
2568 (RenderBox::paintBackgroundExtended):
2569 * khtml/rendering/render_box.h:
2570 * khtml/rendering/render_form.cpp:
2571 (RenderFieldset::paintBoxDecorations):
2572 * khtml/rendering/render_line.cpp:
2573 (khtml::InlineFlowBox::paintBackgrounds):
2574 (khtml::InlineFlowBox::paintBackground):
2575 (khtml::InlineFlowBox::paintBackgroundAndBorder):
2576 * khtml/rendering/render_line.h:
2577 * khtml/rendering/render_object.cpp:
2578 (RenderObject::setStyle):
2579 (RenderObject::updateBackgroundImages):
2580 (RenderObject::getVerticalPosition):
2581 * khtml/rendering/render_object.h:
2582 (khtml::RenderObject::paintBackgroundExtended):
2583 * khtml/rendering/render_style.cpp:
2585 (BackgroundLayer::BackgroundLayer):
2586 (BackgroundLayer::~BackgroundLayer):
2587 (BackgroundLayer::operator=):
2588 (BackgroundLayer::operator==):
2589 (BackgroundLayer::fillUnsetProperties):
2590 (BackgroundLayer::cullEmptyLayers):
2591 (StyleBackgroundData::StyleBackgroundData):
2592 (StyleBackgroundData::operator==):
2593 (RenderStyle::diff):
2594 (RenderStyle::adjustBackgroundLayers):
2595 * khtml/rendering/render_style.h:
2596 (khtml::OutlineValue::operator==):
2597 (khtml::OutlineValue::operator!=):
2598 (khtml::BackgroundLayer::backgroundImage):
2599 (khtml::BackgroundLayer::backgroundXPosition):
2600 (khtml::BackgroundLayer::backgroundYPosition):
2601 (khtml::BackgroundLayer::backgroundAttachment):
2602 (khtml::BackgroundLayer::backgroundRepeat):
2603 (khtml::BackgroundLayer::next):
2604 (khtml::BackgroundLayer::isBackgroundImageSet):
2605 (khtml::BackgroundLayer::isBackgroundXPositionSet):
2606 (khtml::BackgroundLayer::isBackgroundYPositionSet):
2607 (khtml::BackgroundLayer::isBackgroundAttachmentSet):
2608 (khtml::BackgroundLayer::isBackgroundRepeatSet):
2609 (khtml::BackgroundLayer::setBackgroundImage):
2610 (khtml::BackgroundLayer::setBackgroundXPosition):
2611 (khtml::BackgroundLayer::setBackgroundYPosition):
2612 (khtml::BackgroundLayer::setBackgroundAttachment):
2613 (khtml::BackgroundLayer::setBackgroundRepeat):
2614 (khtml::BackgroundLayer::clearBackgroundImage):
2615 (khtml::BackgroundLayer::clearBackgroundXPosition):
2616 (khtml::BackgroundLayer::clearBackgroundYPosition):
2617 (khtml::BackgroundLayer::clearBackgroundAttachment):
2618 (khtml::BackgroundLayer::clearBackgroundRepeat):
2619 (khtml::BackgroundLayer::setNext):
2620 (khtml::BackgroundLayer::operator!=):
2621 (khtml::BackgroundLayer::containsImage):
2622 (khtml::BackgroundLayer::hasImage):
2623 (khtml::BackgroundLayer::hasFixedImage):
2624 (khtml::RenderStyle::setBitDefaults):
2625 (khtml::RenderStyle::hasBackground):
2626 (khtml::RenderStyle::hasFixedBackgroundImage):
2627 (khtml::RenderStyle::outlineWidth):
2628 (khtml::RenderStyle::outlineStyle):
2629 (khtml::RenderStyle::outlineStyleIsAuto):
2630 (khtml::RenderStyle::outlineColor):
2631 (khtml::RenderStyle::backgroundColor):
2632 (khtml::RenderStyle::backgroundImage):
2633 (khtml::RenderStyle::backgroundRepeat):
2634 (khtml::RenderStyle::backgroundAttachment):
2635 (khtml::RenderStyle::backgroundXPosition):
2636 (khtml::RenderStyle::backgroundYPosition):
2637 (khtml::RenderStyle::accessBackgroundLayers):
2638 (khtml::RenderStyle::backgroundLayers):
2639 (khtml::RenderStyle::outlineOffset):
2640 (khtml::RenderStyle::resetOutline):
2641 (khtml::RenderStyle::setBackgroundColor):
2642 (khtml::RenderStyle::setOutlineWidth):
2643 (khtml::RenderStyle::setOutlineStyle):
2644 (khtml::RenderStyle::setOutlineColor):
2645 (khtml::RenderStyle::clearBackgroundLayers):
2646 (khtml::RenderStyle::inheritBackgroundLayers):
2647 (khtml::RenderStyle::setOutlineOffset):
2648 * khtml/rendering/render_table.cpp:
2649 (RenderTable::paintBoxDecorations):
2650 (RenderTableCell::paintBoxDecorations):
2652 2004-11-04 David Hyatt <hyatt@apple.com>
2654 Make sure the text decoder returns empty strings rather than null strings when the utf8 char ptr is non-null.
2655 Ensures that <a href=""> works with libxml (which returns data in utf-8 buffers).
2659 * kwq/KWQTextCodec.mm:
2660 (KWQTextDecoder::convertLatin1):
2661 (KWQTextDecoder::convertUTF16):
2662 (KWQTextDecoder::convertUsingTEC):
2663 (KWQTextDecoder::toUnicode):
2665 2004-11-04 David Hyatt <hyatt@apple.com>
2667 Make sure line-height returns the correct value for normal.
2671 * khtml/css/css_computedstyle.cpp:
2672 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2674 2004-11-04 David Harrison <harrison@apple.com>
2676 Reviewed by Ken Kocienda.
2678 <rdar://problem/3857753> REGRESSION (Mail): Delete incorrectly causes text to take on new style
2680 * khtml/editing/htmlediting.cpp:
2681 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Fixed to move entire source subtree (up
2682 to, but not including, the enclosingBlockFlowElement) rather than just the source element.
2683 Fixed to insert after the destination subtree, rather than the destination element. Handles
2684 edge case of deleting back to the top of the tree, where there is nothing left to insert after.
2685 * khtml/xml/dom_nodeimpl.cpp:
2686 (NodeImpl::enclosingNonBlockFlowElement): New method to support moveNodesAfterNode changes.
2687 * khtml/xml/dom_nodeimpl.h: Declare NodeImpl::enclosingNonBlockFlowElement
2688 * layout-tests/editing/deleting/delete-3857753-fix-expected.txt: Added.
2689 * layout-tests/editing/deleting/delete-3857753-fix.html: Added.
2691 2004-11-03 Ken Kocienda <kocienda@apple.com>
2697 * layout-tests/editing/deleting/delete-br-008-expected.txt: Added.
2698 * layout-tests/editing/deleting/delete-br-008.html: Added.
2699 * layout-tests/editing/deleting/delete-br-009-expected.txt: Added.
2700 * layout-tests/editing/deleting/delete-br-009.html: Added.
2701 * layout-tests/editing/deleting/delete-br-010-expected.txt: Added.
2702 * layout-tests/editing/deleting/delete-br-010.html: Added.
2704 2004-11-03 Maciej Stachowiak <mjs@apple.com>
2706 Fix by Yasuo Kida, reviewed by me.
2708 <rdar://problem/3819004> REGRESSION (Mail): Can't move cursor / delete character after deleting the active input area
2710 * kwq/KWQKHTMLPart.mm:
2711 (KWQKHTMLPart::setMarkedTextRange): Treat a collapsed range the
2712 same as a nil range - setting an empty marked range should clear
2713 the marked range entirely.
2715 2004-11-02 Maciej Stachowiak <mjs@apple.com>
2717 Reviewed by Dave Hyatt (when I originally coded it).
2719 WebCore part of fix for:
2721 <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange:
2723 * kwq/WebCoreBridge.h:
2724 * kwq/WebCoreBridge.mm:
2725 (-[WebCoreBridge firstRectForDOMRange:]): New method to compute the rect for a
2726 DOMRange, or if the range is split into multiple lines, the rect for the part on
2727 the first line only.
2729 * khtml/rendering/render_object.cpp:
2730 (RenderObject::caretRect): Added extraWidthToEndOfLine parameter and ditto
2731 for the overrides below.
2732 * khtml/rendering/render_object.h:
2733 * khtml/rendering/render_box.cpp:
2734 (RenderBox::caretRect):
2735 * khtml/rendering/render_box.h:
2736 * khtml/rendering/render_br.cpp:
2737 (RenderBR::caretRect):
2738 * khtml/rendering/render_br.h:
2739 * khtml/rendering/render_flow.cpp:
2740 (RenderFlow::caretRect):
2741 * khtml/rendering/render_flow.h:
2742 * khtml/rendering/render_text.cpp:
2743 (RenderText::caretRect):
2745 2004-11-02 Ken Kocienda <kocienda@apple.com>
2749 Implemented command to insert a block in response to typing a return key (even though
2750 I am not turning that on by default with this patch....that will come later).
2752 This new command is called InsertParagraphSeparatorCommand.
2754 Reworked the command and function names associated with inserting content into a
2755 document. Before this patch, there were inputXXX and insertXXX variants, with the
2756 former used for more high-level actions and the latter used for lower-level stuff.
2757 However, this was confusing as the AppKit uses insertXXX for everything. This resulted
2758 in an insertXXX command going through an inputXXX WebCore step and then finally to an
2759 insertXXX WebCore step. To make this less confusing, I have changes all the names to
2760 be insertXXX, and modified the lower-level operations so that it is clear what they do.
2762 * khtml/editing/htmlediting.cpp:
2763 (khtml::EditCommandPtr::isInsertTextCommand): Name change.
2764 (khtml::EditCommand::isInsertTextCommand): Ditto.
2765 (khtml::CompositeEditCommand::inputText): Ditto.
2766 (khtml::CompositeEditCommand::insertTextIntoNode): Ditto.
2767 (khtml::CompositeEditCommand::deleteTextFromNode): Ditto.
2768 (khtml::CompositeEditCommand::replaceTextInNode): Ditto.
2769 (khtml::CompositeEditCommand::deleteInsignificantText): Name changes in implementation.
2770 (khtml::CompositeEditCommand::isLastVisiblePositionInNode): Ditto.
2771 (khtml::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Class name change, was DeleteTextCommand.
2772 (khtml::DeleteFromTextNodeCommand::~DeleteFromTextNodeCommand): Ditto.
2773 (khtml::DeleteFromTextNodeCommand::doApply): Ditto.
2774 (khtml::DeleteFromTextNodeCommand::doUnapply): Ditto.
2775 (khtml::DeleteSelectionCommand::performGeneralDelete): Ditto.
2776 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
2777 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
2778 (khtml::InsertIntoTextNode::InsertIntoTextNode): Class name change.
2779 (khtml::InsertIntoTextNode::~InsertIntoTextNode): Ditto.
2780 (khtml::InsertIntoTextNode::doApply): Ditto.
2781 (khtml::InsertIntoTextNode::doUnapply): Ditto.
2782 (khtml::InsertLineBreakCommand::InsertLineBreakCommand): Class name change, was InsertNewlineCommand.
2783 (khtml::InsertLineBreakCommand::insertNodeAfterPosition):
2784 (khtml::InsertLineBreakCommand::insertNodeBeforePosition):
2785 (khtml::InsertLineBreakCommand::doApply):
2786 (khtml::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Code moved. No changes.
2787 (khtml::InsertNodeBeforeCommand::~InsertNodeBeforeCommand): Ditto.
2788 (khtml::InsertNodeBeforeCommand::doApply): Ditto.
2789 (khtml::InsertNodeBeforeCommand::doUnapply): Ditto.
2790 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): New command.
2791 (khtml::InsertParagraphSeparatorCommand::doApply):
2792 (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand):
2793 Class name change, was InsertNewlineCommandInQuotedContentCommand.
2794 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto.
2795 (khtml::InsertParagraphSeparatorInQuotedContentCommand::isMailBlockquote): Ditto.
2796 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2797 (khtml::InsertTextCommand::InsertTextCommand): Class name change, was InputTextCommand.
2798 (khtml::InsertTextCommand::doApply): Ditto.
2799 (khtml::InsertTextCommand::deleteCharacter): Ditto.
2800 (khtml::InsertTextCommand::prepareForTextInsertion): Ditto.
2801 (khtml::InsertTextCommand::input): Ditto.
2802 (khtml::InsertTextCommand::insertSpace): Ditto.
2803 (khtml::InsertTextCommand::isInsertTextCommand): Ditto.
2804 (khtml::TypingCommand::insertLineBreak): Name change, was insertNewline.
2805 (khtml::TypingCommand::insertParagraphSeparatorInQuotedContent): Name change, was insertNewlineInQuotedContent.
2806 (khtml::TypingCommand::insertParagraphSeparator): New function.
2807 (khtml::TypingCommand::doApply): Name changes, as above.
2808 (khtml::TypingCommand::insertText): Ditto.
2809 (khtml::TypingCommand::deleteKeyPressed): Ditto.
2810 (khtml::TypingCommand::preservesTypingStyle): Ditto.
2811 * khtml/editing/htmlediting.h:
2812 (khtml::DeleteFromTextNodeCommand::node): Name change.
2813 (khtml::DeleteFromTextNodeCommand::offset): Ditto.
2814 (khtml::DeleteFromTextNodeCommand::count): Ditto.
2815 (khtml::InsertIntoTextNode::text): Ditto.
2816 (khtml::InsertNodeBeforeCommand::insertChild): Ditto.
2817 (khtml::InsertNodeBeforeCommand::refChild): Ditto.
2818 (khtml::TypingCommand::): Ditto.
2819 * khtml/editing/jsediting.cpp: Name changes, as above.
2820 * kwq/WebCoreBridge.h:
2821 * kwq/WebCoreBridge.mm:
2822 (-[WebCoreBridge insertLineBreak]): Name change, was insertNewline.
2823 (-[WebCoreBridge insertParagraphSeparator]): New function.
2824 (-[WebCoreBridge insertParagraphSeparatorInQuotedContent]): Name change, was insertNewlineInQuotedContent.
2826 2004-11-01 Kevin Decker <kdecker@apple.com>
2830 fixed <rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
2833 * khtml/ecma/kjs_window.cpp:
2834 (WindowFunc::tryCall): Added a nil check in the case of an empty document lacking a baseURL().
2836 2004-11-01 Darin Adler <darin@apple.com>
2840 - fixed <rdar://problem/3859381> REGRESSION (167-168): text in form fields should not use body's text color
2842 * khtml/css/html4.css: Use color: initial for textarea and related ones.
2844 2004-11-01 Ken Kocienda <kocienda@apple.com>
2850 <rdar://problem/3775920> REGRESSION (Mail): Centering doesn't work in HTML mail
2852 * khtml/css/css_computedstyle.cpp:
2853 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties): Factor out the
2854 implementation here into new copyPropertiesInSet helper. This now calls the
2855 generalized copyPropertiesInSet function with the arguments needed to make copying
2857 * khtml/css/css_computedstyle.h:
2858 * khtml/css/css_valueimpl.cpp:
2859 (CSSStyleDeclarationImpl::diff): Move this function here from css_computedstyle.cpp.
2860 In order to do apply block properties, "regular" style declarations need to do style
2862 (CSSStyleDeclarationImpl::copyBlockProperties): New helper. Just like copyInheritableProperties
2863 except that it uses a different set of properties that apply only to blocks.
2864 (CSSStyleDeclarationImpl::copyPropertiesInSet): New helper that looks at a style declaration
2865 and copies out those properties listed in a pre-defined set.
2866 * khtml/css/css_valueimpl.h:
2867 * khtml/editing/htmlediting.cpp:
2868 (khtml::StyleChange::StyleChange): Modified to work with style changes that apply to a whole
2869 block, factoring out some of the special case code that should now only run in the inline case.
2870 (khtml::StyleChange::init): Factored out the code that now is in checkForLegacyHTMLStyleChange.
2871 (khtml::StyleChange::checkForLegacyHTMLStyleChange): New helper for case where we want
2872 special handling for "legacy" HTML styles like <B> and <I>.
2873 (khtml::ApplyStyleCommand::doApply): Much refactoring in this class to divide up the work of
2874 style changes into different kinds. CSS specifies certain properties only apply to certain
2875 element types. This set of changes now recognizes two such separate cases: styles that apply
2876 to blocks, and styles that apply to inlines.
2877 (khtml::ApplyStyleCommand::applyBlockStyle): New function to handle apply styles to whole blocks.
2878 (khtml::ApplyStyleCommand::applyInlineStyle): New function to handle apply styles to inlines.
2879 (khtml::ApplyStyleCommand::isHTMLStyleNode): Is now passed a CSSStyleDeclarationImpl to work
2880 with rather than working on the CSSStyleDeclarationImpl member variable of the class. This is
2881 done so that the function can be passed a portion of the styles being applied so that block styles
2882 and inline styles can be handled separately.
2883 (khtml::ApplyStyleCommand::removeCSSStyle): Ditto.
2884 (khtml::ApplyStyleCommand::removeBlockStyle): New function to handle removing styles from whole blocks.
2885 (khtml::ApplyStyleCommand::removeInlineStyle): New function to removing styles from inlines.
2886 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): New function to handle applying style to whole blocks.
2887 (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): New function to handle applying style to inlines.
2888 * khtml/editing/htmlediting.h:
2889 (khtml::StyleChange::): Changed as described above.
2890 (khtml::StyleChange::usesLegacyStyles):
2891 (khtml::EditCommand::setEndingSelectionNeedsLayout): New function to that tells the ending selection
2892 it needs to layout, even though it has not changed position in the DOM. For instance, this is needed
2893 when text align changes.
2894 * khtml/khtml_part.cpp:
2895 (KHTMLPart::setTypingStyle): Put in an early bail-out in the case where the current style matches
2896 the passed-in argument.
2897 (KHTMLPart::applyStyle): Modify this function so that block styles are applied when the selection
2898 is a caret. Formerly, this just set typing style and made no visible changes to the document.
2902 * layout-tests/editing/editing.js: Added some glue to change text align.
2903 * layout-tests/editing/style/block-style-001-expected.txt: Added.
2904 * layout-tests/editing/style/block-style-001.html: Added.
2905 * layout-tests/editing/style/block-style-002-expected.txt: Added.
2906 * layout-tests/editing/style/block-style-002.html: Added.
2907 * layout-tests/editing/style/block-style-003-expected.txt: Added.
2908 * layout-tests/editing/style/block-style-003.html: Added.
2912 2004-10-29 Darin Adler <darin@apple.com>
2916 - fixed <rdar://problem/3751619> Safari crash in khtml::CircularSearchBuffer::append(QChar const&)
2918 * khtml/editing/visible_text.cpp: (khtml::findPlainText): Fix exit condition to check for break
2919 before advancing one character; before it did it backwards.
2921 2004-10-29 Chris Blumenberg <cblu@apple.com>
2923 Fixed: <rdar://problem/3853262> REGRESSION(166-168) gmail gets blank page when loading
2925 Reviewed by kocienda, adele.
2927 * khtml/rendering/render_frames.cpp:
2928 (RenderPartObject::updateWidget): remove infinite frame recursion check for iframes
2930 2004-10-29 Darin Adler <darin@apple.com>
2934 - fixed <rdar://problem/3857395> clicking on calendar in Apple Travel site crashes Safari in invalidateClick (getthere.net)
2936 * khtml/khtmlview.cpp:
2937 (KHTMLView::viewportMousePressEvent): Use a SharedPtr<KHTMLView> to make sure the KHTMLView is not
2938 deleted before this function finishes running.
2939 (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
2940 (KHTMLView::viewportMouseReleaseEvent): Ditto.
2941 (KHTMLView::dispatchMouseEvent): Removed ref/deref pairs that aren't needed since dispatchEvent
2942 is guaranteed to do ref/deref as needed.
2944 * kwq/KWQObject.mm: (QObject::startTimer): Fixed a comment.
2946 2004-10-28 Chris Blumenberg <cblu@apple.com>
2948 Enabled XSLT on Panther. See intrigue mail for compiling instructions.
2952 * WebCore.pbproj/project.pbxproj: link against xslt unconditionally, link against specific version of libxml on Panther
2953 * WebCorePrefix.h: always use XSLT
2955 2004-10-28 Ken Kocienda <kocienda@apple.com>
2961 <rdar://problem/3854848> Tiger Mail Crash in WebCore - khtml::CompositeEditCommand::insertNodeAfter
2962 <rdar://problem/3803832> REGRESSION (Mail): incorrect behavior after Return + Delete in quoted text
2964 * khtml/editing/htmlediting.cpp:
2965 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Added node pointer class members
2966 to initialization list, zeroing them out.
2967 (khtml::DeleteSelectionCommand::canPerformSpecialCaseBRDelete): New special-case helper to
2968 handle a delete of content in special cases where the only thing selected is a BR. This
2969 code path is much simpler than the newly-named performGeneralDelete, and detects when no
2970 content merging should be done between blocks. This aspect of the change fixes 3854848.
2971 One of the special cases added fixes 3803832.
2972 (khtml::DeleteSelectionCommand::performGeneralDelete): Renamed, from performDelete.
2973 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Made this helper be a no-arg function, just
2974 like the other helpers in this class.
2975 (khtml::DeleteSelectionCommand::clearTransientState): Fix cut and paste error in deref code.
2976 (khtml::DeleteSelectionCommand::doApply): Updated for changed helpers.
2977 * khtml/editing/htmlediting.h: Added new helper and changed an old one.
2979 2004-10-28 Chris Blumenberg <cblu@apple.com>
2981 Fixed: <rdar://problem/3856913> Panther-only crash in QString code copying front page of store.apple.com
2985 * kwq/KWQKHTMLPart.mm:
2986 (KWQKHTMLPart::attributedString): check that the renderer is a list item before making list item calls on it
2988 2004-10-28 Ken Kocienda <kocienda@apple.com>
2990 Reviewed by Harrison
2992 Reorganization of delete command functionality so that doApply is not
2993 several hundred lines long. This is not a squeaky-clean cleanup, but
2994 it is a step in the right direction. No functionality changes.
2996 * khtml/editing/htmlediting.cpp:
2997 (khtml::DeleteSelectionCommand::DeleteSelectionCommand):
2998 (khtml::DeleteSelectionCommand::initializePositionData): New helper.
2999 (khtml::DeleteSelectionCommand::saveTypingStyleState): Ditto.
3000 (khtml::DeleteSelectionCommand::performDelete): Ditto.
3001 (khtml::DeleteSelectionCommand::fixupWhitespace): Ditto.
3002 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Ditto.
3003 (khtml::DeleteSelectionCommand::calculateEndingPosition): Ditto.
3004 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
3005 (khtml::DeleteSelectionCommand::clearTransientState): Ditto.
3006 (khtml::DeleteSelectionCommand::doApply): Factor out code into new helpers.
3007 * khtml/editing/htmlediting.h:
3009 2004-10-28 Ken Kocienda <kocienda@apple.com>
3013 * khtml/editing/htmlediting.cpp:
3014 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Typo in initializer caused
3015 new mergeBlocksAfterDelete flag to be set improperly, causing layout regressions.
3017 2004-10-27 Ken Kocienda <kocienda@apple.com>
3021 * khtml/editing/htmlediting.cpp:
3022 (khtml::CompositeEditCommand::deleteSelection): Added new mergeBlocksAfterDelete flag to control
3023 whether content not in the block containing the start of the selection is moved to that block
3024 after the selection is deleted.
3025 (khtml::DeleteSelectionCommand::DeleteSelectionCommand): Ditto.
3026 (khtml::DeleteSelectionCommand::doApply): Ditto.
3027 (khtml::InputNewlineInQuotedContentCommand::InputNewlineInQuotedContentCommand): New command
3028 to handle the case of inserting a newline when in quoted content in Mail.
3029 (khtml::InputNewlineInQuotedContentCommand::~InputNewlineInQuotedContentCommand): Ditto.
3030 (khtml::InputNewlineInQuotedContentCommand::isMailBlockquote): Ditto.
3031 (khtml::InputNewlineInQuotedContentCommand::isLastVisiblePositionInBlockquote): Ditto.
3032 (khtml::InputNewlineInQuotedContentCommand::doApply): Ditto.
3033 (khtml::TypingCommand::insertNewlineInQuotedContent): Support for new newline command.
3034 (khtml::TypingCommand::doApply): Ditto.
3035 (khtml::TypingCommand::preservesTypingStyle): Ditto.
3036 * khtml/editing/htmlediting.h: Add new delclarations.
3037 (khtml::TypingCommand::): Ditto.
3038 * kwq/WebCoreBridge.h: Added new bridge method called from WebKit.
3039 * kwq/WebCoreBridge.mm:
3040 (-[WebCoreBridge insertNewlineInQuotedContent]): Ditto.
3042 2004-10-26 Chris Blumenberg <cblu@apple.com>
3044 Fixed: <rdar://problem/3774243> page up/down, arrow up/down, etc in Safari RSS should scroll main content
3048 * khtml/ecma/kjs_dom.cpp:
3049 (DOMElementProtoFunc::tryCall): added scrollByLines and scrollByPages to HTML element for Safari RSS
3050 * khtml/ecma/kjs_dom.h:
3051 (KJS::DOMElement::):
3052 * khtml/ecma/kjs_dom.lut.h:
3055 2004-10-26 David Hyatt <hyatt@apple.com>
3057 Fix for 3848214, deleting a partial word left a repaint artifact if the partial word was pulled back onto
3060 Reviewed by kocienda
3062 * khtml/rendering/bidi.cpp:
3063 (khtml::RenderBlock::layoutInlineChildren):
3065 2004-10-26 David Hyatt <hyatt@apple.com>
3067 Convert selectionRect() from using a list to a dict and patch it to be like setSelection. It was still trying
3068 to use the old dirty bit optimization (which had been removed), and so it was pathologically slow on large documents.
3070 Reviewed by kocienda
3072 * khtml/rendering/render_canvas.cpp:
3073 (RenderCanvas::selectionRect):
3074 * khtml/rendering/render_object.h:
3075 (khtml::RenderObject::hasSelectedChildren):
3077 2004-10-26 Ken Kocienda <kocienda@apple.com>
3083 <rdar://problem/3851164> mail crashed when I pasted a large amount of text into a reply
3085 * khtml/editing/htmlediting.cpp:
3086 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): This now returns bool to
3087 let the caller know if a placeholder was removed.
3088 (khtml::ReplaceSelectionCommand::doApply): Use the bool return value from the call to
3089 removeBlockPlaceholderIfNeeded. If true, shift the selection to the now-empty block. In
3090 some cases, the selection was still set on the removed BR, and this was the cause of the
3092 * khtml/editing/htmlediting.h: Change removeBlockPlaceholderIfNeeded return type.
3094 2004-10-26 Darin Adler <darin@apple.com>
3098 - fixed <rdar://problem/3851301> leak of one NSCFDictionary for each XMLHttpRequest issued
3100 * kwq/KWQLoader.mm: (KWQServeSynchronousRequest): Add a release.
3102 2004-10-26 Ken Kocienda <kocienda@apple.com>
3106 * khtml/editing/htmlediting.cpp:
3107 (khtml::CompositeEditCommand::deleteInsignificantText): Do not call replaceText
3108 with a zero-length string. That triggers an assert. Call deleteText instead,
3109 using the same indices that are passed to replaceText.
3111 Cleaned up the asserts in these three functions below, making them
3112 more consistent. This is not needed for the fix, but I tripped over
3113 these in the course of debugging.
3115 (khtml::InsertTextCommand::InsertTextCommand):
3116 (khtml::InsertTextCommand::doApply):
3117 (khtml::InsertTextCommand::doUnapply):
3119 2004-10-25 Adele Amchan <adele@apple.com>
3123 * khtml/xml/dom_docimpl.cpp: (DocumentImpl::inDesignMode): made inDesignMode const
3124 * khtml/xml/dom_docimpl.h:
3126 2004-10-25 Adele Amchan <adele@apple.com>
3128 Reviewed by me, code change by Darin.
3130 * khtml/xml/dom_docimpl.cpp: Moved design mode code outside the XSLT ifdef.
3132 2004-10-25 Ken Kocienda <kocienda@apple.com>
3134 Oops. These two test results changed with my last checkin, for the better.
3136 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3137 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt
3139 2004-10-25 Ken Kocienda <kocienda@apple.com>
3145 <rdar://problem/3820349> REGRESSION (Mail): select all, delete does not always delete everything
3147 * khtml/editing/htmlediting.cpp:
3148 (khtml::DeleteSelectionCommand::startPositionForDelete): New helper that determines when to
3149 expand the selection outwards when the selection is on the visible boundary of a root
3150 editable element. This fixes the bug. Note that this function also contains a little code
3151 I factored out of doApply: it also takes care of adjusting the selection in the smart delete case.
3152 (khtml::DeleteSelectionCommand::endPositionForDelete): Ditto.
3153 (khtml::DeleteSelectionCommand::doApply): Call new helpers. Refactored out the code as described.
3154 * khtml/editing/htmlediting.h: Declare new helpers.
3155 * layout-tests/editing/deleting/delete-select-all-001-expected.txt: Added.
3156 * layout-tests/editing/deleting/delete-select-all-001.html: Added.
3157 * layout-tests/editing/deleting/delete-select-all-002-expected.txt: Added.
3158 * layout-tests/editing/deleting/delete-select-all-002.html: Added.
3159 * layout-tests/editing/deleting/delete-select-all-003-expected.txt: Added.
3160 * layout-tests/editing/deleting/delete-select-all-003.html: Added.
3162 2004-10-25 Ken Kocienda <kocienda@apple.com>
3164 Added some more editing layout tests.
3166 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: Added.
3167 * layout-tests/editing/deleting/delete-ws-fixup-001.html: Added.
3168 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: Added.
3169 * layout-tests/editing/deleting/delete-ws-fixup-002.html: Added.
3170 * layout-tests/editing/deleting/delete-ws-fixup-003-expected.txt: Added.
3171 * layout-tests/editing/deleting/delete-ws-fixup-003.html: Added.
3172 * layout-tests/editing/deleting/delete-ws-fixup-004-expected.txt: Added.
3173 * layout-tests/editing/deleting/delete-ws-fixup-004.html: Added.
3174 * layout-tests/editing/inserting/typing-003-expected.txt: Added.
3175 * layout-tests/editing/inserting/typing-003.html: Added.
3177 2004-10-25 Ken Kocienda <kocienda@apple.com>
3181 * khtml/rendering/bidi.cpp:
3182 (khtml::RenderBlock::findNextLineBreak): I did not get my fix for 3848343 and 3848224
3183 yesterday quite right: words that should have been placed on the next line were instead
3184 appearing on the line before, beyond the right margin. This was a one-word only error
3185 based on moving the line break object when it should have stayed put. Here is the rule:
3186 The line break object only moves to after the whitespace on the end of a line if that
3187 whitespace caused line overflow when its width is added in.
3189 2004-10-25 Adele Amchan <adele@apple.com>
3193 Fix for <rdar://problem/3619890> Feature request: designMode
3195 This change implements the designMode property of a document. This is an IE property that is also supported by Mozilla.
3196 This will enable more JS editing compatibility.
3198 * khtml/ecma/kjs_html.cpp:
3199 (KJS::HTMLDocument::tryGet): added case for designMode
3200 (KJS::HTMLDocument::putValue): added case for designMode
3201 * khtml/ecma/kjs_html.lut.h: (KJS::): regenerated
3202 * khtml/khtml_part.cpp: (KHTMLPart::isContentEditable): Now returns designMode value
3203 * khtml/xml/dom_docimpl.cpp:
3204 (DocumentImpl::DocumentImpl): initialize m_designMode member variable
3205 (DocumentImpl::setDesignMode): added function to assign m_designMode value
3206 (DocumentImpl::getDesignMode): return m_designMode value
3207 (DocumentImpl::inDesignMode): if designMode is inherited, this will find the appropriate parent document designMode and return that value.
3208 Otherwise, it will just return the m_designMode value.
3209 (DocumentImpl::parentDocument):
3210 * khtml/xml/dom_docimpl.h: (DOM::DocumentImpl::): added InheritedBool enum, prototypes, and m_designMode member variable.
3211 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::isContentEditable): added check for isContentEditable function in KHTMLPart
3213 2004-10-22 Ken Kocienda <kocienda@apple.com>
3219 <rdar://problem/3844662> REGRESSION (Mail): Style changes can affect adjacent, unselected text
3221 * khtml/editing/htmlediting.cpp:
3222 (khtml::ApplyStyleCommand::doApply): Move end position downstream to be sure we remove style from
3223 everything that could be affected.
3224 (khtml::ApplyStyleCommand::removeCSSStyle): Comma in intended function call was outside the
3225 braces, making it act as a comma operator, with a zero value as the right value!!! This made
3226 an important check always fail!!! It turns out that we do not want the constant at all, since
3227 that constant is only needed when checking a computed style, not an inline style as is being
3229 (khtml::ApplyStyleCommand::removeStyle): Call nodeFullySelected with new interface.
3230 (khtml::ApplyStyleCommand::nodeFullySelected): Change interface and implementation to rely on
3231 RangeImpl::compareBoundaryPoints to perform the required check.
3232 * khtml/editing/htmlediting.h: Changed nodeFullySelected function interface.
3234 2004-10-22 Ken Kocienda <kocienda@apple.com>
3240 <rdar://problem/3848343> REGRESSION (Mail, 166-168u): Typed text after space at end of line before block quote does not appear
3241 <rdar://problem/3848224> REGRESSION (Mail): space typed at end of line vanishes after typing next character
3243 * khtml/rendering/bidi.cpp:
3244 (khtml::RenderBlock::findNextLineBreak): When the khtmlLineBreak is in AFTER_WHITE_SPACE mode, as
3245 it is when we are editing, add in the space of the current character when calculating the width
3246 of committed plus uncommitted characters. If this value exceeds the width of the line, move up
3247 the line break object and call skipWhitespace to move past the end of the whitespace.
3251 2004-10-22 Ken Kocienda <kocienda@apple.com>
3253 * WebCore.pbproj/project.pbxproj:
3254 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
3256 2004-10-21 David Hyatt <hyatt@apple.com>
3260 Clean up the inline run function so that it doesn't return incorrect answers when making children non-inline.
3262 <rdar://problem/3848724> REGRESSION (166-168u): RenderText::layout called, firing assertion that kills Mail
3263 <rdar://problem/3848357> RenderText::layout called, firing assertion that kills Safari (www.apple.com/downloads/macosx)
3265 * khtml/rendering/render_block.cpp:
3266 (khtml::getInlineRun):
3267 (khtml::RenderBlock::makeChildrenNonInline):
3269 2004-10-21 David Hyatt <hyatt@apple.com>
3271 Fix for 3810389, crash because of continuation() craziness. Revert back to the old behavior of
3272 making sure that all line boxes get deleted and recreated when inlines are split because of a block.
3276 * khtml/rendering/render_inline.cpp:
3277 (RenderInline::splitFlow):
3279 2004-10-21 Ken Kocienda <kocienda@apple.com>
3283 Significant improvement to the way that whitespace is handled during editing.
3285 * khtml/editing/htmlediting.cpp:
3286 (khtml::CompositeEditCommand::deleteInsignificantText): New functions (there are actually
3287 two being added with this name) that delete "insignificant" unrendered text.
3288 (khtml::CompositeEditCommand::deleteInsignificantTextDownstream): Takes a position,
3289 calculates the downstream position to use as the endpoint for the deletion, and
3290 then calls deleteInsignificantText with this start and end.
3291 (khtml::DeleteSelectionCommand::doApply): Call new deleteInsignificantTextDownstream function.
3292 (khtml::InputNewlineCommand::doApply): Ditto.
3293 (khtml::InputTextCommand::input): Ditto.
3294 * khtml/editing/htmlediting.h: Add new declarations.
3296 Modified layout test results:
3297 * layout-tests/editing/deleting/delete-block-merge-contents-016-expected.txt:
3298 * layout-tests/editing/deleting/delete-block-merge-contents-017-expected.txt:
3299 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt:
3300 * layout-tests/editing/deleting/delete-selection-001-expected.txt:
3301 * layout-tests/editing/deleting/delete-tab-001-expected.txt:
3302 * layout-tests/editing/deleting/delete-tab-004-expected.txt:
3303 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt:
3304 * layout-tests/editing/inserting/insert-3659587-fix-expected.txt:
3305 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt:
3306 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt:
3307 * layout-tests/editing/inserting/insert-br-001-expected.txt:
3308 * layout-tests/editing/inserting/insert-br-004-expected.txt:
3309 * layout-tests/editing/inserting/insert-br-005-expected.txt:
3310 * layout-tests/editing/inserting/insert-br-006-expected.txt:
3311 * layout-tests/editing/inserting/insert-tab-001-expected.txt:
3312 * layout-tests/editing/inserting/insert-tab-002-expected.txt:
3313 * layout-tests/editing/inserting/insert-tab-004-expected.txt:
3314 * layout-tests/editing/inserting/insert-text-with-newlines-expected.txt:
3315 * layout-tests/editing/inserting/typing-001-expected.txt:
3316 * layout-tests/editing/inserting/typing-around-br-001-expected.txt:
3317 * layout-tests/editing/inserting/typing-around-image-001-expected.txt:
3318 * layout-tests/editing/style/typing-style-003-expected.txt:
3319 * layout-tests/editing/undo/redo-typing-001-expected.txt:
3320 * layout-tests/editing/undo/undo-typing-001-expected.txt:
3322 2004-10-21 David Hyatt <hyatt@apple.com>
3324 Fix for 3847054, assertion failure in RenderText::layout() on news.com page. Fix getInlineRun so that
3325 it no longer breaks early (thus causing some children not to get properly wrapped by anonymous blocks).
3329 * khtml/rendering/render_block.cpp:
3330 (khtml::getInlineRun):
3332 2004-10-20 David Hyatt <hyatt@apple.com>
3334 Add better dumping of overflow information for scrolling regions.
3336 Fix for 3726524, crash in updateLayerPosition. Make sure anonymous elements properly remove themselves
3337 from the render tree so that layers and so forth are cleaned up.
3341 * khtml/rendering/render_container.cpp:
3342 (RenderContainer::detach):
3343 * khtml/rendering/render_layer.h:
3344 (khtml::RenderLayer::scrollXOffset):
3345 (khtml::RenderLayer::scrollYOffset):
3346 * kwq/KWQRenderTreeDebug.cpp:
3349 2004-10-20 David Hyatt <hyatt@apple.com>
3351 Fix for 3791146, make sure all lines are checked when computing overflow.
3353 Reviewed by kocienda
3355 * khtml/rendering/bidi.cpp:
3356 (khtml::RenderBlock::computeHorizontalPositionsForLine):
3357 (khtml::RenderBlock::layoutInlineChildren):
3358 (khtml::RenderBlock::findNextLineBreak):
3359 (khtml::RenderBlock::checkLinesForOverflow):
3360 * khtml/rendering/render_block.h:
3362 2004-10-20 David Hyatt <hyatt@apple.com>
3364 Fix for 3790936, make the unicode-breaking on the layout tests match Panther.
3366 Reviewed by kocienda
3368 * khtml/rendering/break_lines.cpp:
3369 (khtml::isBreakable):
3371 2004-10-20 Darin Adler <darin@apple.com>
3375 - fixed <rdar://problem/3317107> text input fields and text areas don't respect background color and text color CSS properties
3377 * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
3378 Create a palette with the background and foreground colors in it and set it on the widget.
3380 * khtml/rendering/render_style.h: (khtml::StyleVisualData::operator==): No palette to compare
3381 with APPLE_CHANGES. Removed palette and palette-related function members.
3382 * khtml/rendering/render_style.cpp:
3383 (StyleVisualData::StyleVisualData): No palette to initialize with APPLE_CHANGES.
3384 (RenderStyle::diff): No palette to compare.
3386 * kwq/KWQLineEdit.h: Added setPalette override. Made text function const.
3387 * kwq/KWQLineEdit.mm:
3388 (QLineEdit::setPalette): Added. Sets foreground and background color based on palette.
3389 (QLineEdit::text): Made const.
3391 * kwq/KWQTextEdit.h: Added setPalette override.
3392 * kwq/KWQTextEdit.mm: (QTextEdit::setPalette): Added. Sets foreground and background color
3395 * kwq/KWQPalette.h: Removed most things, leaving only background and foreground colors
3396 per color group, and only a single color group per palette.
3397 * kwq/KWQColorGroup.mm: Removed.
3398 * kwq/KWQPalette.mm: Removed.
3399 * WebCore.pbproj/project.pbxproj: Removed KWQColorGroup.mm and KWQPalette.mm.
3401 * kwq/KWQApplication.h: Removed unused palette function.
3402 * kwq/KWQApplication.mm: Ditto.
3404 * kwq/KWQWidget.h: Removed unsetPalette.
3405 * kwq/KWQWidget.mm: Ditto.
3407 - fixed storage leak
3409 * khtml/html/html_formimpl.cpp: (DOM::HTMLGenericFormElementImpl::~HTMLGenericFormElementImpl):
3410 Roll in storage leak fix from KDE guys.
3412 2004-10-19 David Hyatt <hyatt@apple.com>
3414 Reviewed by kocienda
3416 More cleanup of block layout. Eliminates the separate step for tables that dont fit on a line with a float
3417 and consolidates it with clearing.
3419 Also patch dom_textimpl.cpp to reduce further the # of RenderTexts created.
3421 * khtml/rendering/render_block.cpp:
3422 (khtml::getInlineRun):
3423 (khtml::RenderBlock::layoutBlock):
3424 (khtml::RenderBlock::adjustFloatingBlock):
3425 (khtml::RenderBlock::collapseMargins):
3426 (khtml::RenderBlock::clearFloatsIfNeeded):
3427 (khtml::RenderBlock::estimateVerticalPosition):
3428 (khtml::RenderBlock::layoutBlockChildren):
3429 (khtml::RenderBlock::markAllDescendantsWithFloatsForLayout):
3430 (khtml::RenderBlock::getClearDelta):
3431 (khtml::RenderBlock::calcBlockMinMaxWidth):
3432 * khtml/rendering/render_block.h:
3433 * khtml/rendering/render_frames.cpp:
3434 (RenderFrameSet::layout):
3435 * khtml/xml/dom_textimpl.cpp:
3436 (TextImpl::rendererIsNeeded):
3438 Fix for 3841060, regression with * in frames. Reviewed by kocienda.
3440 * layout-tests/fast/frames/002-expected.txt: Added.
3441 * layout-tests/fast/frames/002.html: Added.
3443 2004-10-19 Darin Adler <darin@apple.com>
3447 - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
3449 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
3450 scripts being loaded here. If the current code being run is the external script itself, then we don't want
3451 to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
3452 assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
3453 wrong since there can be a script loading in that case too. Layout tests check for both problems.
3455 * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
3456 * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
3457 * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
3459 * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
3461 2004-10-18 Darin Adler <darin@apple.com>
3463 Reviewed by Dave Hyatt.
3465 - fixed <rdar://problem/3807234> REGRESSION (152-153): can't get element by ID that was just written with document.write in separate JS file (lacoccinelle.net)
3467 * khtml/html/htmltokenizer.cpp:
3468 (khtml::HTMLTokenizer::scriptHandler): Use !isEmpty instead of count != 0, since it's cheaper.
3469 (khtml::HTMLTokenizer::write): Roll back to the old version of the check here. The fix is that
3470 we only want to look at loadingExtScript if m_executingScript is 0.
3472 2004-10-18 Ken Kocienda <kocienda@apple.com>
3478 <rdar://problem/3840907> textedit doesn't render italic or bold text in html documents
3480 * khtml/css/css_valueimpl.cpp:
3481 (CSSPrimitiveValueImpl::getStringValue): This function did not return string values for idents.
3482 Also changed the return value to be DOMString, rather than DOMStringImpl, to deal with the
3483 lifecycle issues associated with creating a string to be returned in the ident case.
3484 * khtml/css/css_valueimpl.h: Change getStringValue to return DOMString rather than DOMStringImpl.
3485 * khtml/css/cssstyleselector.cpp:
3486 (khtml::CSSStyleSelector::applyProperty): Two calls of getStringValue needed updating.
3488 2004-10-18 Chris Blumenberg <cblu@apple.com>
3490 Fixed: <rdar://problem/3770135> hang loading page with EMBED tag pointing to same page (tridentantennas.co.uk)
3492 Reviewed by kocienda.
3494 * khtml/rendering/render_frames.cpp:
3495 (RenderPartObject::updateWidget): use completeURL before comparing the URL of the plug-in with the base URL of the document when avoiding frame recursion
3497 2004-10-15 Chris Blumenberg <cblu@apple.com>
3499 Fixed: <rdar://problem/3841774> would like to get NSColor from DOM-CSS
3504 (-[DOMRGBColor _color]): new, returns getNSColor on KWQColor
3507 2004-10-15 Ken Kocienda <kocienda@apple.com>
3511 * khtml/rendering/bidi.cpp:
3512 (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
3513 skipping after a clean line break, in addition to the cases already
3515 * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
3516 * layout-tests/editing/inserting/insert-br-007.html: Added.
3517 * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
3518 * layout-tests/editing/inserting/insert-br-008.html: Added.
3522 2004-10-14 Ken Kocienda <kocienda@apple.com>
3528 <rdar://problem/3839989> REGRESSION (Mail): Left arrow does nothing after inserting attachment
3530 * khtml/editing/visible_position.cpp:
3531 (khtml::VisiblePosition::deepEquivalent): Remove code that attempted to bridge old-style
3532 position code to new-style VisiblePosition code. In retrospect, this code was misguided.
3533 Since we do a good job of insulating external code from the internal workings of
3534 VisiblePosition, the "hop ahead" being done here was not doing anyone any real good, and
3535 in the case of this bug, was doing harm. Simply removing this code makes the bug
3536 go away and does not cause any editing layout test regresssions.
3538 2004-10-14 Ken Kocienda <kocienda@apple.com>
3542 * khtml/rendering/bidi.cpp:
3543 (khtml::skipNonBreakingSpace): New helper.
3544 (khtml::RenderBlock::skipWhitespace): Do not skip non-breaking spaces that are
3545 at the start of a block. This was preventing users from typing spaces in empty
3547 * layout-tests/editing/inserting/insert-space-in-empty-doc-expected.txt: Added.
3548 * layout-tests/editing/inserting/insert-space-in-empty-doc.html: Added.
3550 2004-10-14 Adele Amchan <adele@apple.com>
3552 Reviewed by Darin and Ken.
3554 fix for <rdar://problem/3821070> null de-ref in DelectSelectionCommand::doApply()
3556 This change shifts some code around so that the code that determines what typing style
3557 is in effect is called before deleteUnrenderedText is called. Two asserts are also added
3558 to ensure that start and end nodes of the selection are in the document.
3560 * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::doApply):
3562 2004-10-14 Adele Amchan <adele@apple.com>
3566 This change makes these three functions virtual so that the work is being done in KWQHTMLPart
3567 instead of khtml_part, eliminating the need for the "#if APPLE_CHANGES" statements in the khtml code.
3569 * khtml/khtml_part.cpp:
3570 (KHTMLPart::shouldBeginEditing):
3571 (KHTMLPart::shouldEndEditing):
3572 (KHTMLPart::isContentEditable):
3573 * khtml/khtml_part.h:
3574 * kwq/KWQKHTMLPart.h:
3576 2004-10-14 Ken Kocienda <kocienda@apple.com>
3580 Final fix for these bugs:
3582 <rdar://problem/3806306> HTML editing puts spaces at start of line
3583 <rdar://problem/3814252> HTML editing groups space with word causing wrapping
3585 This change sets some new CSS properties that have been added to WebCore to
3586 enable whitespace-handling and line-breaking features that make WebView work
3587 more like a text editor.
3589 * khtml/css/cssstyleselector.cpp:
3590 (khtml::CSSStyleSelector::applyProperty): Add and remove special editing CSS properties
3591 based on property value.
3592 * khtml/html/html_elementimpl.cpp:
3593 (HTMLElementImpl::setContentEditable): Add and remove special editing CSS properties
3594 based on attribute value.
3595 * khtml/khtml_part.cpp:
3596 (KHTMLPart::applyEditingStyleToBodyElement): New helper. Calls applyEditingStyleToElement on
3598 (KHTMLPart::removeEditingStyleFromBodyElement): New helper. Calls removeEditingStyleFromElement on
3600 (KHTMLPart::applyEditingStyleToElement): Adds special editing CSS properties to passed in element.
3601 (KHTMLPart::removeEditingStyleFromElement): Removes special editing CSS properties from passed in element.
3602 * khtml/khtml_part.h: Add new declarations.
3603 * kwq/WebCoreBridge.h: Ditto.
3604 * kwq/WebCoreBridge.mm:
3605 (-[WebCoreBridge applyEditingStyleToBodyElement]): Call through to similarly-named function on KHTMLPart.
3606 (-[WebCoreBridge removeEditingStyleFromBodyElement]): Ditto.
3607 (-[WebCoreBridge applyEditingStyleToElement:]): Ditto.
3608 (-[WebCoreBridge removeEditingStyleFromElement:]): Ditto.
3610 2004-10-14 John Sullivan <sullivan@apple.com>
3614 - fixed <rdar://problem/3840052> Crash in removeBlockPlaceholderIfNeeded attaching file to empty document
3616 * khtml/editing/htmlediting.cpp:
3617 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded):
3618 needed a nil check to handle empty document case
3620 2004-10-13 Maciej Stachowiak <mjs@apple.com>
3624 <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown
3626 - I fixed this by turning off all colormatching for WebKit
3627 content. We might turn it back on later. For now, it's possible to
3628 turn it on temporarily by defining COLORMATCH_EVERYTHING.
3631 * khtml/ecma/kjs_html.cpp:
3632 (KJS::Context2DFunction::tryCall):
3633 (Context2D::colorRefFromValue):
3634 (Gradient::getShading):
3635 * khtml/rendering/render_canvasimage.cpp:
3636 (RenderCanvasImage::createDrawingContext):
3638 (QColor::getNSColor):
3640 * kwq/KWQPainter.mm:
3641 (CGColorFromNSColor):
3642 (QPainter::selectedTextBackgroundColor):
3643 (QPainter::rgbColorSpace):
3644 (QPainter::grayColorSpace):
3645 (QPainter::cmykColorSpace):
3646 * kwq/WebCoreGraphicsBridge.h:
3647 * kwq/WebCoreGraphicsBridge.m:
3648 (-[WebCoreGraphicsBridge createRGBColorSpace]):
3649 (-[WebCoreGraphicsBridge createGrayColorSpace]):
3650 (-[WebCoreGraphicsBridge createCMYKColorSpace]):
3652 2004-10-13 Ken Kocienda <kocienda@apple.com>
3656 * khtml/css/css_valueimpl.cpp:
3657 (CSSStyleDeclarationImpl::merge): A little cleanup. Also, make sure m_lstValues
3658 is non-null before appending.
3660 2004-10-13 Ken Kocienda <kocienda@apple.com>
3662 Update expected results for improved behavior as a result of fix to 3816768.
3664 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt
3665 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt
3666 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt
3668 2004-10-13 Ken Kocienda <kocienda@apple.com>
3672 * khtml/css/css_computedstyle.cpp:
3673 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Add support to computed style
3674 for getting -khtml-line-break and -khml-nbsp-mode.
3676 2004-10-13 Ken Kocienda <kocienda@apple.com>
3682 <rdar://problem/3816768> REGRESSION (Mail): Deleting last character in block incorrectly
3683 moves caret out of block.
3685 The issue here is that an empty block with no explicit height set by style collapses
3686 to zero height, and does so immediately after the last bit of content is removed from
3687 it (as a result of deleting text with the delete key for instance). Since zero-height
3688 blocks are not eligible caret positions, the caret jumped to the closest eligible spot.
3690 The fix is to detect when a block has not been removed itself, but has had all its
3691 contents removed. In this case, a BR element is placed in the block, one that is
3692 specially marked as a placeholder. Later, if the block ever receives content, this
3693 placeholder is removed.
3695 * khtml/editing/htmlediting.cpp:
3696 (khtml::blockPlaceholerClassString): String which acts as a placeholder marker class.
3697 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Adds a placeholder BR if needed.
3698 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Removes a placeholder BR if needed.
3699 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Call removeBlockPlaceholderIfNeeded.
3700 Also, do some cleanup on some old, crufty code in the move logic that is just so clearly wrong
3701 (it's very clear that we needs to be able to move more than just text nodes). This may expose
3702 bugs, but these bugs needs to be filed and fixed, not ducked. Besides, undoing this silliness
3703 made the test case in the bug work.
3704 (khtml::DeleteSelectionCommand::doApply): Call insertBlockPlaceholderIfNeeded and
3705 removeBlockPlaceholderIfNeeded.
3706 (khtml::InputTextCommand::input): Call removeBlockPlaceholderIfNeeded.
3707 (khtml::ReplaceSelectionCommand::doApply): Call removeBlockPlaceholderIfNeeded.
3708 * khtml/editing/htmlediting.h: Declare new functions.
3710 2004-10-13 Richard Williamson <rjw@apple.com>
3712 Added support for -apple-dashboard-region:none. And fixed
3713 a few computed style problems.
3715 Fixed <rdar://problem/3833532> -apple-dashboard-region: none; is needed
3718 * khtml/css/css_computedstyle.cpp:
3719 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
3720 * khtml/css/css_valueimpl.cpp:
3721 (CSSPrimitiveValueImpl::cssText):
3722 * khtml/css/cssparser.cpp:
3723 (CSSParser::parseValue):
3724 (CSSParser::parseDashboardRegions):
3725 * khtml/css/cssstyleselector.cpp:
3726 (khtml::CSSStyleSelector::applyProperty):
3727 * khtml/rendering/render_style.cpp:
3728 (RenderStyle::noneDashboardRegions):
3729 * khtml/rendering/render_style.h:
3730 * kwq/KWQKHTMLPart.mm:
3731 (KWQKHTMLPart::dashboardRegionsDictionary):
3733 2004-10-13 David Hyatt <hyatt@apple.com>
3735 Rework block layout to clean it up and simplify it (r=kocienda).
3737 Also fixing the style sharing bug (r=mjs).
3739 * khtml/rendering/render_block.cpp:
3740 (khtml::RenderBlock::MarginInfo::MarginInfo):
3741 (khtml::RenderBlock::layoutBlock):
3742 (khtml::RenderBlock::adjustPositionedBlock):
3743 (khtml::RenderBlock::adjustFloatingBlock):
3744 (khtml::RenderBlock::handleSpecialChild):
3745 (khtml::RenderBlock::handleFloatingOrPositionedChild):
3746 (khtml::RenderBlock::handleCompactChild):
3747 (khtml::RenderBlock::insertCompactIfNeeded):
3748 (khtml::RenderBlock::handleRunInChild):
3749 (khtml::RenderBlock::collapseMargins):
3750 (khtml::RenderBlock::clearFloatsIfNeeded):
3751 (khtml::RenderBlock::estimateVerticalPosition):
3752 (khtml::RenderBlock::determineHorizontalPosition):
3753 (khtml::RenderBlock::setCollapsedBottomMargin):
3754 (khtml::RenderBlock::adjustChildIfOverhangingFloatsExist):
3755 (khtml::RenderBlock::handleBottomOfBlock):
3756 (khtml::RenderBlock::layoutBlockChildren):
3757 (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
3758 (khtml::RenderBlock::addOverHangingFloats):
3759 * khtml/rendering/render_block.h:
3760 (khtml::RenderBlock::maxTopMargin):
3761 (khtml::RenderBlock::maxBottomMargin):
3762 (khtml::RenderBlock::CompactInfo::compact):
3763 (khtml::RenderBlock::CompactInfo::block):
3764 (khtml::RenderBlock::CompactInfo::matches):
3765 (khtml::RenderBlock::CompactInfo::clear):
3766 (khtml::RenderBlock::CompactInfo::set):
3767 (khtml::RenderBlock::CompactInfo::CompactInfo):
3768 (khtml::RenderBlock::MarginInfo::setAtTopOfBlock):
3769 (khtml::RenderBlock::MarginInfo::setAtBottomOfBlock):
3770 (khtml::RenderBlock::MarginInfo::clearMargin):
3771 (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):
3772 (khtml::RenderBlock::MarginInfo::setTopQuirk):
3773 (khtml::RenderBlock::MarginInfo::setBottomQuirk):
3774 (khtml::RenderBlock::MarginInfo::setDeterminedTopQuirk):
3775 (khtml::RenderBlock::MarginInfo::setPosMargin):
3776 (khtml::RenderBlock::MarginInfo::setNegMargin):
3777 (khtml::RenderBlock::MarginInfo::setPosMarginIfLarger):
3778 (khtml::RenderBlock::MarginInfo::setNegMarginIfLarger):
3779 (khtml::RenderBlock::MarginInfo::setMargin):
3780 (khtml::RenderBlock::MarginInfo::atTopOfBlock):
3781 (khtml::RenderBlock::MarginInfo::canCollapseWithTop):
3782 (khtml::RenderBlock::MarginInfo::canCollapseWithBottom):
3783 (khtml::RenderBlock::MarginInfo::canCollapseTopWithChildren):
3784 (khtml::RenderBlock::MarginInfo::canCollapseBottomWithChildren):
3785 (khtml::RenderBlock::MarginInfo::selfCollapsingBlockClearedFloat):
3786 (khtml::RenderBlock::MarginInfo::quirkContainer):
3787 (khtml::RenderBlock::MarginInfo::determinedTopQuirk):
3788 (khtml::RenderBlock::MarginInfo::topQuirk):
3789 (khtml::RenderBlock::MarginInfo::bottomQuirk):
3790 (khtml::RenderBlock::MarginInfo::posMargin):
3791 (khtml::RenderBlock::MarginInfo::negMargin):
3792 (khtml::RenderBlock::MarginInfo::margin):
3793 * khtml/rendering/render_box.cpp:
3794 (RenderBox::calcAbsoluteVertical):
3795 * khtml/rendering/render_box.h:
3796 (khtml::RenderBox::marginTop):
3797 (khtml::RenderBox::marginBottom):
3798 (khtml::RenderBox::marginLeft):
3799 (khtml::RenderBox::marginRight):
3800 * khtml/rendering/render_image.cpp:
3801 (RenderImage::setImage):
3802 * khtml/rendering/render_object.cpp:
3803 (RenderObject::sizesToMaxWidth):
3804 * khtml/rendering/render_object.h:
3805 (khtml::RenderObject::collapsedMarginTop):
3806 (khtml::RenderObject::collapsedMarginBottom):
3807 (khtml::RenderObject::maxTopMargin):
3808 (khtml::RenderObject::maxBottomMargin):
3809 (khtml::RenderObject::marginTop):
3810 (khtml::RenderObject::marginBottom):
3811 (khtml::RenderObject::marginLeft):
3812 (khtml::RenderObject::marginRight):
3813 * khtml/rendering/render_text.h:
3814 (khtml::RenderText::marginLeft):
3815 (khtml::RenderText::marginRight):
3816 * khtml/xml/dom_elementimpl.cpp:
3817 (ElementImpl::recalcStyle):
3819 2004-10-12 Ken Kocienda <kocienda@apple.com>
3825 <rdar://problem/3836158> REGRESSION (Mail): command-right-arrow moves to beginning of next line
3827 * khtml/editing/selection.cpp:
3828 (khtml::endOfLastRunAt): Do not let the end of the last run on a line be a BR.
3829 This will make it seem like the run ends on the next line.
3831 2004-10-12 Ken Kocienda <kocienda@apple.com>
3837 <rdar://problem/3836986> Delete code removes elements of table structure; can result in very broken-looking web pages
3839 * khtml/editing/htmlediting.cpp:
3840 (khtml::isTableStructureNode): New helper. Determines whether a node is a table cell,
3841 row, section, or column.
3842 (khtml::CompositeEditCommand::removeFullySelectedNode): New helper that recurses into elements
3843 of table structure when doing deletes, rather than deleting the structure elements themselves.
3844 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Do not move content between elements
3845 of table structure. We may want to revisit this some day, but this seems like the best behavior
3847 (khtml::DeleteSelectionCommand::doApply): Call removeFullySelectedNode instead of removeNode
3849 * khtml/editing/htmlediting.h: Add declarations for new functions.
3851 2004-10-12 Richard Williamson <rjw@apple.com>
3853 Fixed access to DOM object via WebScriptObject API.
3854 The execution context for DOM objects wasn't being found.
3855 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.