1 2005-01-07 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
7 * Khtml/khtml_part.cpp:
8 (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
9 not started loading yet so it could not possibly be finishing here...
10 (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
11 no document, in this case we must have hit an error or been loading a non-HTML
15 2005-01-08 David Harrison <harrison@apple.com>
19 <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
21 * khtml/editing/selection.cpp:
22 (khtml::Selection::validate):
23 Tune word selections left/right choice to use right if on empty last line.
25 2005-01-07 David Harrison <harrison@apple.com>
29 <rdar://problem/3942619> AX: Support sentence ax attributes
31 Needed to use the unicode utilities properly. Twas lame before.
33 * khtml/editing/visible_units.cpp:
34 (khtml::previousBoundary):
35 (khtml::nextBoundary):
38 (khtml::previousWordPosition):
39 (khtml::nextWordPosition):
40 (khtml::startOfSentence):
41 (khtml::endOfSentence):
42 (khtml::previousSentencePosition):
43 (khtml::nextSentencePosition):
44 * kwq/KWQAccObject.mm:
45 (-[KWQAccObject accessibilityAttributeNames]):
46 (-[KWQAccObject accessibilityAttributeValue:]):
47 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
48 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
49 * kwq/KWQTextUtilities.mm:
50 (currentTextBreakLocaleID):
51 (KWQFindSentenceBoundary):
52 (KWQFindNextSentenceFromIndex):
54 2005-01-07 Ken Kocienda <kocienda@apple.com>
60 <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
61 <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
63 * khtml/editing/htmlediting.cpp:
64 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
65 Merge the typing style with the computed style for the current position. Fixes both bugs.
66 * khtml/editing/htmlediting.h:
67 * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
68 * layout-tests/editing/inserting/insert-div-023.html: Added.
69 * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
70 * layout-tests/editing/inserting/insert-div-024.html: Added.
72 2005-01-07 David Hyatt <hyatt@apple.com>
74 Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling
75 behavior on worldofwarcraft.com.
80 * khtml/rendering/render_table.cpp:
81 (RenderTable::layout):
83 2005-01-06 David Hyatt <hyatt@apple.com>
85 Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to
86 ignore inline flows in this case.
90 * khtml/rendering/render_block.cpp:
91 (khtml::RenderBlock::nodeAtPoint):
93 2005-01-07 Ken Kocienda <kocienda@apple.com>
99 <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
101 * kwq/KWQKHTMLPart.mm:
102 (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
103 in the document, or if it is not a descendent of the document element. In the case of the bug,
104 since the selection has not yet been set up, the focus node passed here is the HTML element, and
105 that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
107 2005-01-06 Kevin Decker <kdecker@apple.com>
111 Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
113 * khtml/khtml_part.cpp:
114 (KHTMLPart::processObjectRequest): m_bComplete was never true for frames generated by Javascript due to our synchronous loading and as a result, scheduled redirects wouldn't fire in KHTMLPart::scheduleLocationChange(). By virtue of being an empty document, a document is complete. In this special case it's safe at this point to call checkCompleted() which sets m_bComplete true.
118 2005-01-06 David Harrison <harrison@apple.com>
122 (addendum to previous checkin for this bug)
123 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
125 Fix line navigation. Add AXUIElementForTextMarker.
128 * kwq/KWQAccObject.mm:
129 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
130 (-[KWQAccObject doAXUIElementForTextMarker:]):
131 (-[KWQAccObject doAXLineForTextMarker:]):
132 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
133 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
134 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
135 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
136 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
138 2004-12-23 Darin Adler <darin@apple.com>
142 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
144 (turns out the PLT regression was a false alarm)
146 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
147 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
149 * khtml/html/htmlparser.cpp:
150 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
151 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
152 to eliminate code that used ID_CLOSE_TAG for an array size.
153 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
154 that manages isindex to use deref instead of delete.
155 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
156 mistake of using ID_CLOSE_TAG for the array size too.
157 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
158 there and it would prevent custom tags from working. Added range check before using the forbidden
159 tag array with the token ID since custom tags will use index values past the end of the array.
160 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
161 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
162 createElement call is still here. Last time I left out a few form element types from this switch;
164 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
165 document if getTagID fails; this creates a unique per-document ID.
167 * khtml/misc/htmltags.c: Regenerated.
168 * khtml/misc/htmltags.h: Regenerated.
170 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
171 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
172 Also rewrote getTagName to work with the new scheme.
174 2005-01-06 David Harrison <harrison@apple.com>
176 Fixed Panther build. Also, do not advertize sentence support since it is incomplete.
178 * kwq/KWQAccObject.mm:
179 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
180 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
181 (-[KWQAccObject accessibilityIsAttributeSettable:]):
183 2005-01-06 David Harrison <harrison@apple.com>
185 Reviewed by Dave Hyatt.
187 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
188 <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
190 Many more AX attributes supported. Numerous fixes to previous AX work.
192 * khtml/editing/visible_units.cpp:
193 (khtml::startSentenceBoundary):
194 (khtml::startOfSentence):
195 (khtml::endSentenceBoundary):
196 (khtml::endOfSentence):
197 (khtml::previousSentencePositionBoundary):
198 (khtml::previousSentencePosition):
199 (khtml::nextSentencePositionBoundary):
200 (khtml::nextSentencePosition):
201 * khtml/editing/visible_units.h:
202 * khtml/khtmlview.cpp:
204 * khtml/misc/helper.cpp:
205 (khtml::findSentenceBoundary):
206 (khtml::nextSentenceFromIndex):
207 * khtml/misc/helper.h:
208 * khtml/misc/htmltags.c:
211 * khtml/rendering/render_container.cpp:
212 (RenderContainer::removeChildNode):
213 (RenderContainer::appendChildNode):
214 (RenderContainer::insertChildNode):
215 * khtml/rendering/render_object.cpp:
216 (RenderObject::remove):
217 * khtml/xml/dom_docimpl.cpp:
218 (DocumentImpl::getAccObjectCache):
219 (DocumentImpl::updateSelection):
220 (DocumentImpl::close):
221 (DocumentImpl::setFocusNode):
222 (DocumentImpl::parentDocument):
223 (DocumentImpl::topDocument):
224 * khtml/xml/dom_docimpl.h:
225 * kwq/KWQAccObject.mm:
226 (-[KWQAccObject accessibilityShouldUseUniqueId]):
227 (-[KWQAccObject detach]):
228 (-[KWQAccObject anchorElement]):
229 (-[KWQAccObject firstChild]):
230 (-[KWQAccObject lastChild]):
231 (-[KWQAccObject previousSibling]):
232 (-[KWQAccObject nextSibling]):
233 (-[KWQAccObject parentObject]):
234 (-[KWQAccObject value]):
235 (-[KWQAccObject accessibilityAttributeNames]):
236 (-[KWQAccObject accessibilityPerformAction:]):
237 (-[KWQAccObject textMarkerForVisiblePosition:]):
238 (-[KWQAccObject visiblePositionForTextMarker:]):
239 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
240 (-[KWQAccObject topDocument]):
241 (-[KWQAccObject topRenderer]):
242 (-[KWQAccObject topView]):
243 (-[KWQAccObject accessibilityAttributeValue:]):
244 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
245 (-[KWQAccObject doAXLineForTextMarker:]):
246 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
247 (-[KWQAccObject doAXStringForTextMarkerRange:]):
248 (-[KWQAccObject doAXTextMarkerForPosition:]):
249 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
250 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
251 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
252 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
253 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
254 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
255 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
256 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
257 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
258 (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
259 (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
260 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
261 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
262 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
263 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
264 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
265 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
266 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
267 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
268 (-[KWQAccObject doAXLengthForTextMarkerRange:]):
269 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
270 (-[KWQAccObject accessibilityHitTest:]):
271 (-[KWQAccObject accessibilityFocusedUIElement]):
272 (-[KWQAccObject accessibilityIsAttributeSettable:]):
273 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
274 (-[KWQAccObject setAccObjectID:]):
275 (-[KWQAccObject removeAccObjectID]):
276 * kwq/KWQAccObjectCache.h:
277 * kwq/KWQAccObjectCache.mm:
278 (KWQAccObjectCache::setAccObject):
279 (KWQAccObjectCache::removeAccObject):
280 (KWQAccObjectCache::visiblePositionForTextMarker):
281 (KWQAccObjectCache::postNotificationToTopWebArea):
282 (KWQAccObjectCache::postNotification):
283 (KWQAccObjectCache::handleFocusedUIElementChanged):
284 * kwq/KWQKHTMLPart.mm:
285 (KWQKHTMLPart::respondToChangedContents):
286 * kwq/KWQTextUtilities.h:
287 * kwq/KWQTextUtilities.mm:
288 (KWQFindNextWordFromIndex):
289 (KWQFindSentenceBoundary):
290 (KWQFindNextSentenceFromIndex):
291 * kwq/WebCoreBridge.mm:
292 (-[WebCoreBridge accessibilityTree]):
294 2005-01-05 Darin Adler <darin@apple.com>
298 - re-landing a subset of my custom tag change that does not fix the bug, but also does
299 not introduce a performance regression
301 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
302 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
304 * khtml/editing/htmlediting.cpp:
305 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
306 per-document tags and is just better all around for things like the document.
307 (khtml::debugNode): Ditto.
308 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
309 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
310 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
311 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
313 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
314 non-HTML elements to be nested as desired.
316 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
317 * khtml/misc/htmlhashes.cpp:
318 (khtml::getTagID): Changed return type to unsigned short.
319 (khtml::getAttrID): Ditto.
321 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
322 * khtml/xml/dom_docimpl.cpp:
323 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
324 Also updated for a few tags that the parser handled but this did not.
326 * kwq/KWQRenderTreeDebug.cpp:
327 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
328 the tag ID directly, which only works for standard nodes.
329 (operator<<): Update to call getTagName.
330 (nodePositionRelativeToRoot): Ditto.
331 (writeSelection): Ditto.
333 2005-01-05 Ken Kocienda <kocienda@apple.com>
339 <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
341 * khtml/editing/htmlediting.cpp:
342 (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
343 this operation work correctly, particularly in the logic to figure out whether to merge content, and
344 also performing merges.
345 * khtml/editing/visible_position.cpp:
346 (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
347 * khtml/editing/visible_units.cpp:
348 (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
349 (khtml::isEndOfParagraph): Ditto.
350 * khtml/editing/visible_units.h: Declare new functions.
352 2005-01-04 Ken Kocienda <kocienda@apple.com>
358 <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
360 * khtml/editing/htmlediting.cpp:
361 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
362 for the block we are adding was being done at the wrong time, which led to the placeholder remaining
363 in the document when it was not needed. This resulted in the extra space reported in the bug.
365 2005-01-04 Kevin Decker <kdecker@apple.com>
369 Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
371 * khtml/rendering/render_block.cpp:
372 (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash.
374 2005-01-04 David Hyatt <hyatt@apple.com>
376 Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
380 * khtml/rendering/render_layer.cpp:
381 (RenderLayer::updateScrollInfoAfterLayout):
383 2005-01-04 Ken Kocienda <kocienda@apple.com>
387 Fix for these two bugs:
389 <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
390 <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
392 * khtml/editing/htmlediting.cpp:
393 (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
394 neither start nor end. For 3939148, improve the code which adjusts the insertion point during
395 the process of pasting. It formerly handled only one of the possible cases.
396 * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
397 * layout-tests/editing/pasteboard/paste-text-015.html: Added.
399 2005-01-04 David Hyatt <hyatt@apple.com>
401 Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
405 * khtml/rendering/render_form.cpp:
406 (RenderLineEdit::updateFromElement):
407 * kwq/KWQLineEdit.mm:
408 (QLineEdit::setPlaceholderString):
410 2005-01-04 David Hyatt <hyatt@apple.com>
412 Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when
413 returning pseudo-styles.
417 * khtml/css/cssstyleselector.cpp:
418 (khtml::CSSStyleSelector::matchRulesForList):
419 (khtml::CSSStyleSelector::pseudoStyleForElement):
420 * khtml/rendering/render_style.cpp:
421 (RenderStyle::addPseudoStyle):
423 2005-01-04 Darin Adler <darin@apple.com>
425 - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
427 * khtml/css/cssstyleselector.cpp:
428 * khtml/editing/htmlediting.cpp:
429 * khtml/editing/selection.cpp:
430 * khtml/editing/visible_position.cpp:
431 * khtml/html/dtd.cpp:
432 * khtml/html/htmlparser.cpp:
433 * khtml/html/htmlparser.h:
434 * khtml/html/htmltokenizer.cpp:
435 * khtml/misc/htmlhashes.cpp:
436 * khtml/misc/htmlhashes.h:
437 * khtml/misc/htmltags.c:
438 * khtml/misc/htmltags.h:
439 * khtml/misc/maketags:
440 * khtml/xml/dom_docimpl.cpp:
441 * khtml/xml/dom_docimpl.h:
442 * khtml/xml/dom_nodeimpl.cpp:
443 * khtml/xml/dom_position.cpp:
444 * kwq/KWQRenderTreeDebug.cpp:
446 2005-01-04 Ken Kocienda <kocienda@apple.com>
452 <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
454 * khtml/editing/htmlediting.cpp:
455 (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
456 a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
457 to be applied. Now the code will detect when at the end of a style run and will not move and apply
458 that ending style to the new paragraph, though it will place that style into the typing style. This
459 seems to match NSText behavior.
460 * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed
461 here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
462 not have any visible effect on the document.
463 * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
464 * layout-tests/editing/inserting/insert-div-022.html: Added.
466 2005-01-04 David Hyatt <hyatt@apple.com>
468 Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
473 * khtml/rendering/render_flow.cpp:
474 (RenderFlow::paintLines):
476 2005-01-03 David Hyatt <hyatt@apple.com>
478 Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more
479 robust and make it work regardless of which objects get a layout or not.
483 * khtml/rendering/render_block.cpp:
484 (khtml::RenderBlock::insertFloatingObject):
485 (khtml::RenderBlock::addOverhangingFloats):
486 (khtml::RenderBlock::addIntrudingFloats):
487 * khtml/rendering/render_block.h:
488 (khtml::RenderBlock::FloatingObject::FloatingObject):
490 2005-01-03 Maciej Stachowiak <mjs@apple.com>
494 <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
496 * khtml/html/html_miscimpl.cpp:
497 (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
498 it should not ever be (now).
499 (HTMLCollectionImpl::item): When traversing items stop when we hit
500 nil, meaning the end to avoid triggering above assert (formerly crash).
502 2005-01-03 Maciej Stachowiak <mjs@apple.com>
504 Reviewed by John and Kevin.
506 <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
508 * khtml/ecma/kjs_window.cpp:
509 (Window::get): Look up frame names before buitin window properties
510 to match other browsers. This regressed because we added a builtin
511 "toolbar" property but this site had a frame with that name.
513 2004-12-21 Maciej Stachowiak <mjs@apple.com>
517 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
519 Added opener bridge method to help WebKit implement security check
520 for named frame visibility.
522 * khtml/khtml_part.h:
523 * kwq/WebCoreBridge.h:
524 * kwq/WebCoreBridge.mm:
525 (-[WebCoreBridge opener]):
527 2005-01-03 Ken Kocienda <kocienda@apple.com>
533 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
535 * kwq/WebCoreBridge.mm:
536 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
538 2005-01-03 David Hyatt <hyatt@apple.com>
540 Fix for 3936881, make sure positioned objects prooperly update y-position.
544 * khtml/rendering/render_block.cpp:
545 (khtml::RenderBlock::layoutPositionedObjects):
547 2005-01-03 Ken Kocienda <kocienda@apple.com>
553 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
555 * khtml/editing/htmlediting.cpp:
556 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
557 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
558 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
559 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
560 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
561 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
562 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
563 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
564 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
565 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
566 * khtml/editing/htmlediting.h: Declare new functions.
568 2004-12-25 Kevin Decker <kdecker@apple.com>
572 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
574 * khtml/html/dtd.cpp: <label> needed a much higher priority such that it will close block elements. Malformed HTML (ugh) is the only reason why we need to do this.
576 2004-12-23 Darin Adler <darin@apple.com>
580 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
582 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
583 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
585 * khtml/editing/htmlediting.cpp:
586 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
587 per-document tags and is just better all around for things like the document.
588 (khtml::debugNode): Ditto.
589 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
590 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
591 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
592 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
594 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
595 non-HTML elements to be nested as desired.
597 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
598 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
600 * khtml/html/htmlparser.cpp:
601 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
602 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
603 to eliminate code that used ID_CLOSE_TAG for an array size.
604 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
605 that manages isindex to use deref instead of delete.
606 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
607 mistake of using ID_CLOSE_TAG for the array size too.
608 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
609 there and it would prevent custom tags from working. Added range check before using the forbidden
610 tag array with the token ID since custom tags will use index values past the end of the array.
611 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
612 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
613 createElement call is still here. Last time I left out a few form element types from this switch;
615 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
616 document if getTagID fails; this creates a unique per-document ID.
618 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
619 * khtml/misc/htmlhashes.cpp:
620 (khtml::getTagID): Changed return type to unsigned short.
621 (khtml::getAttrID): Ditto.
623 * khtml/misc/htmltags.c: Regenerated.
624 * khtml/misc/htmltags.h: Regenerated.
626 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
627 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
628 Also rewrote getTagName to work with the new scheme.
630 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
631 * khtml/xml/dom_docimpl.cpp:
632 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
633 Also updated for a few tags that the parser handled but this did not.
635 * kwq/KWQRenderTreeDebug.cpp:
636 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
637 the tag ID directly, which only works for standard nodes.
638 (operator<<): Update to call getTagName.
639 (nodePositionRelativeToRoot): Ditto.
640 (writeSelection): Ditto.
644 2004-12-22 Darin Adler <darin@apple.com>
646 - rolled out my custom tag name change -- it broke amazon.com
648 * khtml/css/cssstyleselector.cpp:
649 * khtml/editing/htmlediting.cpp:
650 * khtml/editing/selection.cpp:
651 * khtml/editing/visible_position.cpp:
652 * khtml/html/dtd.cpp:
653 * khtml/html/htmlparser.cpp:
654 * khtml/html/htmlparser.h:
655 * khtml/html/htmltokenizer.cpp:
656 * khtml/misc/htmlhashes.cpp:
657 * khtml/misc/htmlhashes.h:
658 * khtml/misc/htmltags.c:
659 * khtml/misc/htmltags.h:
660 * khtml/misc/maketags:
661 * khtml/xml/dom_docimpl.cpp:
662 * khtml/xml/dom_docimpl.h:
663 * khtml/xml/dom_nodeimpl.cpp:
664 * khtml/xml/dom_position.cpp:
665 * kwq/KWQRenderTreeDebug.cpp:
667 2004-12-22 David Harrison <harrison@apple.com>
669 Reviewed by Darin Adler.
671 * khtml/editing/selection.cpp:
672 (khtml::Selection::validate):
673 The selecting/deselecting bad behavior is because the Selection code that expands by words
674 had an inaccurate test for being at the end of the document (where double-clicking needs
675 to select the last word). Fixed that check.
677 2004-12-22 Adele Amchan <adele@apple.com>
681 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
683 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
684 so that we match Firefox and WinIE behavior.
686 2004-12-22 Darin Adler <darin@apple.com>
690 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
692 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
693 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
695 * khtml/editing/htmlediting.cpp:
696 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
697 per-document tags and is just better all around for things like the document.
698 (khtml::debugNode): Ditto.
699 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
700 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
701 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
702 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
704 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
705 non-HTML elements to be nested as desired.
707 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
708 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
710 * khtml/html/htmlparser.cpp:
711 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
712 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
713 to eliminate code that used ID_CLOSE_TAG for an array size.
714 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
715 that manages isindex to use deref instead of delete.
716 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
717 mistake of using ID_CLOSE_TAG for the array size too.
718 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
719 there and it would prevent custom tags from working. Added range check before using the forbidden
720 tag array with the token ID since custom tags will use index values past the end of the array.
721 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
722 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
723 createElement call is still here.
724 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
725 document if getTagID fails; this creates a unique per-document ID.
727 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
728 * khtml/misc/htmlhashes.cpp:
729 (khtml::getTagID): Changed return type to unsigned short.
730 (khtml::getAttrID): Ditto.
732 * khtml/misc/htmltags.c: Regenerated.
733 * khtml/misc/htmltags.h: Regenerated.
735 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
736 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
737 Also rewrote getTagName to work with the new scheme.
739 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
740 * khtml/xml/dom_docimpl.cpp:
741 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
742 Also updated for a few tags that the parser handled but this did not.
744 * kwq/KWQRenderTreeDebug.cpp:
745 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
746 the tag ID directly, which only works for standard nodes.
747 (operator<<): Update to call getTagName.
748 (nodePositionRelativeToRoot): Ditto.
749 (writeSelection): Ditto.
751 2004-12-21 David Harrison <harrison@apple.com>
753 Reviewed by Ken Kocienda.
755 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
757 Problem was the TextIterator was not handling exitNode() from a P block properly.
759 * khtml/editing/visible_text.cpp:
760 (khtml::TextIterator::TextIterator):
761 Add new param that specifies whether the iterator is for content or for searching.
762 Search iterators do not prevent newlines at the beginning.
763 (khtml::TextIterator::advance):
765 (khtml::TextIterator::handleTextNode):
767 (khtml::TextIterator::exitNode):
768 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
769 (khtml::TextIterator::emitCharacter):
771 (khtml::TextIterator::range):
773 (khtml::CharacterIterator::CharacterIterator):
774 Specify search type TextIterator.
775 (khtml::CharacterIterator::advance):
776 * khtml/editing/visible_text.h:
778 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
779 * khtml/editing/visible_units.cpp:
780 (khtml::nextWordBoundary):
781 Specify search type TextIterator.
783 2004-12-21 David Harrison <harrison@apple.com>
785 Reviewed by Ken Kocienda.
787 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
789 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
790 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
792 * khtml/rendering/render_text.cpp:
793 (RenderText::setSelectionState)
795 2004-12-21 Maciej Stachowiak <mjs@apple.com>
799 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
801 * khtml/ecma/kjs_window.cpp:
802 (Window::get): Change most window functions to be restricted by
805 2004-12-21 Ken Kocienda <kocienda@apple.com>
811 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
813 * khtml/editing/htmlediting.cpp:
814 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
815 formerly undetected and unhandled. This is the crux of the bug fix.
816 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
817 execution of command.
818 * khtml/editing/htmlediting.h: Declare new function.
819 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
820 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
822 2004-12-21 Ken Kocienda <kocienda@apple.com>
826 * khtml/editing/htmlediting.cpp:
827 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
828 checking in (aka must return false from function returning bool).
830 2004-12-21 Ken Kocienda <kocienda@apple.com>
836 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
838 * khtml/editing/htmlediting.cpp:
839 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
840 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
842 2004-12-21 Ken Kocienda <kocienda@apple.com>
846 * khtml/editing/htmlediting.cpp:
847 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
848 further experiements.
849 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
850 be done if the insertion point is in an empty block.
851 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
852 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
853 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
854 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
855 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
856 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
858 2004-12-21 Darin Adler <darin@apple.com>
862 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
864 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
865 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
866 * khtml/editing/visible_text.cpp:
867 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
868 using the node's index. We only compute the node index if actually asked for the range.
869 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
871 (khtml::TextIterator::handleTextBox): Ditto.
872 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
874 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
875 (khtml::TextIterator::exitNode): More of the same.
876 (khtml::TextIterator::emitCharacter): Ditto.
877 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
878 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
882 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
886 2004-12-20 Ken Kocienda <kocienda@apple.com>
890 * khtml/editing/htmlediting.cpp:
891 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
892 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
893 Rolling out until I can develop a real fix.
895 2004-12-20 David Harrison <harrison@apple.com>
897 Reviewed by Dave Hyatt.
899 Initial checkin of AXTextMarkerRef support.
901 * khtml/xml/dom_docimpl.cpp:
902 (DocumentImpl::updateSelection):
903 (DocumentImpl::setFocusNode):
904 * kwq/KWQAccObject.h:
905 * kwq/KWQAccObject.mm:
906 (-[KWQAccObject detach]):
907 (-[KWQAccObject anchorElement]):
908 (-[KWQAccObject addChildrenToArray:]):
909 (-[KWQAccObject accessibilityAttributeNames]):
910 (-[KWQAccObject accessibilityActionDescription:]):
911 (-[KWQAccObject accessibilityPerformAction:]):
912 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
913 (-[KWQAccObject textMarkerForVisiblePosition:]):
914 (-[KWQAccObject visiblePositionForTextMarker:]):
915 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
916 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
917 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
918 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
919 (-[KWQAccObject accessibilityAttributeValue:]):
920 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
921 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
922 (-[KWQAccObject getSelectedTextMarkerRange]):
923 (-[KWQAccObject doAXLineForTextMarker:]):
924 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
925 (-[KWQAccObject doAXStringForTextMarkerRange:]):
926 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
927 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
928 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
929 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
930 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
931 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
932 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
933 (-[KWQAccObject accessibilityFocusedUIElement]):
934 (-[KWQAccObject clearChildren]):
935 (-[KWQAccObject accObjectID]):
936 (-[KWQAccObject setAccObjectID:]):
937 (-[KWQAccObject removeAccObjectID]):
938 * kwq/KWQAccObjectCache.h:
939 * kwq/KWQAccObjectCache.mm:
940 (KWQAccObjectCache::KWQAccObjectCache):
941 (KWQAccObjectCache::~KWQAccObjectCache):
942 (KWQAccObjectCache::getAccObjectID):
943 (KWQAccObjectCache::removeAccObjectID):
944 (KWQAccObjectCache::textMarkerForVisiblePosition):
945 (KWQAccObjectCache::visiblePositionForTextMarker):
947 2004-12-19 Darin Adler <darin@apple.com>
949 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
951 2004-12-19 Darin Adler <darin@apple.com>
955 - a garbage collection fix
957 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
958 #ifndef to use #if (in practice, either is OK).
959 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
961 2004-12-17 David Hyatt <hyatt@apple.com>
963 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
967 * khtml/rendering/render_box.cpp:
968 (RenderBox::calcPercentageHeight):
969 * khtml/rendering/render_table.cpp:
970 (RenderTableSection::layoutRows):
972 2004-12-17 David Harrison <harrison@apple.com>
974 Reviewed by Ken Kocienda.
976 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
978 * khtml/editing/visible_units.cpp:
979 (khtml::endOfParagraph):
980 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
982 2004-12-17 Ken Kocienda <kocienda@apple.com>
986 * khtml/editing/htmlediting.cpp:
987 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
988 codes when I added the createBreakElement() function.
990 2004-12-17 Richard Williamson <rjw@apple.com>
992 Set the floor of max cacheable object size to 40K. This restores
993 the long standing floor. Lower floor deleteriously impacts the PLT.
996 * khtml/khtml_part.cpp:
997 (KHTMLPart::checkCompleted):
998 * khtml/misc/loader.cpp:
1001 2004-12-17 Ken Kocienda <kocienda@apple.com>
1007 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1009 * khtml/editing/htmlediting.cpp:
1010 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
1011 Formerly checked only for block boundary.
1013 2004-12-17 David Harrison <harrison@apple.com>
1017 Add KWQCFAutorelease for autoreleasing CF objects.
1018 * kwq/KWQFoundationExtras.h:
1022 2004-12-17 David Harrison <harrison@apple.com>
1026 Fix GC compatibility in getNSString.
1029 (QString::getNSString):
1030 Use NSString allocator instead of CFString, so that autorelease works under GC.
1032 2004-12-17 Ken Kocienda <kocienda@apple.com>
1038 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
1040 * khtml/editing/htmlediting.cpp:
1041 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
1042 move it after the <body> element.
1044 2004-12-17 Ken Kocienda <kocienda@apple.com>
1048 Added new layout tests covering cases from recent bug fixes.
1050 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
1051 * layout-tests/editing/inserting/insert-div-018.html: Added.
1052 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
1053 * layout-tests/editing/inserting/insert-div-019.html: Added.
1054 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
1055 * layout-tests/editing/inserting/insert-div-020.html: Added.
1056 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
1057 * layout-tests/editing/inserting/insert-div-021.html: Added.
1059 2004-12-17 Ken Kocienda <kocienda@apple.com>
1063 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
1065 * layout-tests/editing/inserting/insert-div-013-expected.txt
1066 * layout-tests/editing/inserting/insert-div-014-expected.txt
1068 2004-12-17 Ken Kocienda <kocienda@apple.com>
1074 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
1076 * khtml/editing/htmlediting.cpp:
1077 (khtml::InsertParagraphSeparatorCommand::doApply):
1078 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
1079 block as the reference node for the insertion of the new block.
1080 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
1081 I worked this all out on the whiteboard this time. This should be the last tweak.
1083 2004-12-17 Kevin Decker <kdecker@apple.com>
1087 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
1089 * khtml/xml/xml_tokenizer.cpp:
1090 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
1092 2004-12-16 Ken Kocienda <kocienda@apple.com>
1098 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
1100 * khtml/editing/htmlediting.cpp:
1101 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
1102 it checks the downstream node for the starting position.
1104 2004-12-16 Ken Kocienda <kocienda@apple.com>
1108 Added new createBreakElement() function that makes creating a <br> element a one-liner.
1109 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
1110 over to this new helper.
1112 * khtml/editing/htmlediting.cpp:
1113 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
1114 (khtml::InsertLineBreakCommand::doApply): Ditto.
1115 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1116 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1117 (khtml::ReplaceSelectionCommand::doApply): Ditto.
1118 (khtml::createBreakElement): New helper.
1119 * khtml/editing/htmlediting.h: Ditto.
1121 2004-12-16 David Hyatt <hyatt@apple.com>
1123 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
1124 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
1126 Reviewed by kocienda
1128 * khtml/rendering/render_object.cpp:
1129 (RenderObject::getVerticalPosition):
1131 2004-12-16 Ken Kocienda <kocienda@apple.com>
1137 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
1138 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
1140 * khtml/editing/htmlediting.cpp:
1141 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
1142 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
1143 a check which may move the node used as the reference node for the insertion. Also change this code to
1144 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
1145 to want to shift into the new <p>.
1147 2004-12-16 Darin Adler <darin@apple.com>
1151 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
1152 after talking this over with Dave and Ken
1154 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
1155 * khtml/editing/htmlediting.cpp:
1156 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
1157 helper so this can share code with the plain-text conversion code.
1158 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
1159 helper so this can share code with the plain-text conversion code.
1160 (khtml::createDefaultParagraphElement): Added.
1161 (khtml::createBlockPlaceholderElement): Added.
1163 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
1164 <br> elements for pasting plain text.
1166 - regenerated these files with the newer gperf
1168 * khtml/css/cssproperties.c: Regenerated.
1169 * khtml/css/cssvalues.c: Regenerated.
1170 * khtml/misc/htmlattrs.c: Regenerated.
1171 * khtml/misc/htmltags.c: Regenerated.
1173 2004-12-16 Ken Kocienda <kocienda@apple.com>
1179 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
1181 * khtml/xml/dom_nodeimpl.cpp:
1182 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
1183 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
1184 it stops looking in this situation. This problem eventually caused the delete code to try to
1185 merge a node under a descendent.
1187 2004-12-16 Adele Amchan <adele@apple.com>
1189 Change by Richard, reviewed by me.
1191 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
1193 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
1195 2004-12-16 Adele Amchan <adele@apple.com>
1199 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
1201 Added a call to ObjectImp::get before Window::get just returns Undefined.
1202 This was preventing us from getting the toString function from a Window object.
1204 * khtml/ecma/kjs_window.cpp: (Window::get):
1206 2004-12-16 Ken Kocienda <kocienda@apple.com>
1212 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
1214 * khtml/editing/htmlediting.cpp:
1215 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
1216 to do a better job than it was doing before. Added several test cases to prove I am on a
1218 * khtml/editing/visible_position.cpp:
1219 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
1220 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
1221 This function was returning true for the first position in "bar". Wrong. Also tightened up other
1222 rule: Should not report true when relationship between blocks cannot be determined.
1223 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
1224 when relationship between blocks cannot be determined.
1225 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
1226 * layout-tests/editing/inserting/insert-div-010.html: Added.
1227 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
1228 * layout-tests/editing/inserting/insert-div-011.html: Added.
1229 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
1230 * layout-tests/editing/inserting/insert-div-012.html: Added.
1231 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
1232 * layout-tests/editing/inserting/insert-div-013.html: Added.
1233 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
1234 * layout-tests/editing/inserting/insert-div-014.html: Added.
1235 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
1236 * layout-tests/editing/inserting/insert-div-015.html: Added.
1237 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
1238 * layout-tests/editing/inserting/insert-div-016.html: Added.
1239 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
1240 * layout-tests/editing/inserting/insert-div-017.html: Added.
1242 2004-12-16 Ken Kocienda <kocienda@apple.com>
1246 Added a layout test based on my last checkin.
1248 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
1249 * layout-tests/editing/selection/move-by-word-001.html: Added.
1251 2004-12-16 Ken Kocienda <kocienda@apple.com>
1257 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
1259 * khtml/editing/visible_text.cpp:
1260 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
1261 backwards into a different block that is an descendent of the block containing the text node (as in leaving
1262 the "bar" node in this example: <p>foo</p>bar).
1263 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
1264 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
1265 it is called from there, and now also from advance().
1267 2004-12-15 Darin Adler <darin@apple.com>
1271 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
1273 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
1274 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
1275 type altogether and use the render tree instead.
1277 2004-12-14 John Sullivan <sullivan@apple.com>
1281 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
1282 in the menu, no specific action names
1284 * khtml/editing/edit_actions.h: new header, contains EditAction enum
1285 (renamed from HTMLEditAction, formerly in htmlediting.h)
1287 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
1289 * khtml/editing/htmlediting.h:
1290 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
1291 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
1293 * khtml/editing/htmlediting.cpp:
1294 (khtml::EditCommandPtr::editingAction):
1295 update for enum name change
1296 (khtml::EditCommand::editingAction):
1298 (khtml::ApplyStyleCommand::ApplyStyleCommand):
1299 added editingAction parameter to this constructor
1300 (khtml::ApplyStyleCommand::editingAction):
1302 (khtml::DeleteSelectionCommand::editingAction):
1303 update for enum name change
1304 (khtml::MoveSelectionCommand::editingAction):
1306 (khtml::TypingCommand::editingAction):
1308 (khtml::ReplaceSelectionCommand::editingAction):
1311 * khtml/khtml_part.h:
1312 added EditAction parameter to applyStyle and computeAndSetTypingStyle
1313 * khtml/khtml_part.cpp:
1314 (KHTMLPart::computeAndSetTypingStyle):
1315 added EditAction parameter
1316 (KHTMLPart::applyStyle):
1319 * kwq/KWQKHTMLPart.mm:
1320 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1321 do the cast from EditAction to WebUndoAction a different way to match other code
1323 * kwq/WebCoreBridge.h:
1324 * kwq/WebCoreBridge.mm:
1325 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
1326 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
1327 (-[WebCoreBridge applyStyle:withUndoAction:]):
1330 * WebCore.pbproj/project.pbxproj:
1331 updated for new files
1333 2004-12-14 David Hyatt <hyatt@apple.com>
1335 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
1336 the ridiculous 1024 limit on the span values.
1338 * khtml/html/html_tableimpl.cpp:
1339 (HTMLTableCellElementImpl::parseHTMLAttribute):
1340 * khtml/rendering/render_table.cpp:
1341 (RenderTableCell::collapsedBottomBorder):
1342 * khtml/rendering/render_table.h:
1343 (khtml::RenderTableCell::colSpan):
1344 (khtml::RenderTableCell::setColSpan):
1345 (khtml::RenderTableCell::rowSpan):
1346 (khtml::RenderTableCell::setRowSpan):
1347 (khtml::RenderTableCol::span):
1348 (khtml::RenderTableCol::setSpan):
1350 2004-12-14 David Hyatt <hyatt@apple.com>
1352 Make sure <col> and <colgroup> can have spans updated dynamically as well.
1356 * khtml/html/html_tableimpl.cpp:
1357 (HTMLTableColElementImpl::parseHTMLAttribute):
1358 * khtml/rendering/render_table.cpp:
1359 (RenderTableCell::updateFromElement):
1360 (RenderTableCol::updateFromElement):
1362 2004-12-14 David Hyatt <hyatt@apple.com>
1364 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
1368 * khtml/html/html_tableimpl.cpp:
1369 (HTMLTableCellElementImpl::parseHTMLAttribute):
1370 * khtml/rendering/render_table.cpp:
1371 (RenderTableCell::RenderTableCell):
1372 (RenderTableCell::updateFromElement):
1374 2004-12-14 Chris Blumenberg <cblu@apple.com>
1376 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1380 * khtml/editing/markup.cpp:
1381 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
1383 2004-12-14 David Hyatt <hyatt@apple.com>
1385 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
1386 This is actually a regression from my positioned object DHTML optimization.
1388 Reviewed by kocienda
1390 * khtml/rendering/render_object.cpp:
1391 (RenderObject::setStyle):
1393 2004-12-14 David Hyatt <hyatt@apple.com>
1395 Make sure the class attribute works when newlines are present in the attribute.
1397 Reviewed by kocienda
1399 * khtml/html/html_elementimpl.cpp:
1400 (HTMLNamedAttrMapImpl::parseClassAttribute):
1402 2004-12-14 David Hyatt <hyatt@apple.com>
1404 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
1405 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
1406 read by splitting it into two separate functions.
1408 Reviewed by kocienda
1410 * khtml/rendering/render_block.cpp:
1411 (khtml::RenderBlock::layoutBlockChildren):
1412 (khtml::RenderBlock::clearFloats):
1413 (khtml::RenderBlock::addOverhangingFloats):
1414 (khtml::RenderBlock::addIntrudingFloats):
1415 * khtml/rendering/render_block.h:
1417 2004-12-14 John Sullivan <sullivan@apple.com>
1421 - added Undo action names for Cut, Paste, and Drag
1423 * khtml/editing/htmlediting.h:
1424 * khtml/editing/htmlediting.cpp:
1425 (khtml::DeleteSelectionCommand::editingAction):
1426 overridden to return HTMLEditActionCut
1427 (khtml::MoveSelectionCommand::editingAction):
1428 overridden to return HTMLEditActionDrag
1429 (khtml::ReplaceSelectionCommand::editingAction):
1430 overridden to return HTMLEditActionPaste
1432 2004-12-14 John Sullivan <sullivan@apple.com>
1436 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
1437 no specific action names
1439 The remaining step is to make each EditCommand subclass override editingAction() to return an
1440 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
1441 is not completely straightforward, so this next step isn't trivial.)
1443 * khtml/editing/htmlediting.h:
1444 new enum for HTMLEditAction
1446 * khtml/editing/htmlediting.cpp:
1447 (khtml::EditCommandPtr::editingAction):
1448 new method, calls through to EditCommand
1449 (khtml::EditCommand::editingAction):
1450 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
1451 (khtml::TypingCommand::editingAction):
1452 proof of concept override, returns HTMLEditActionTyping
1454 * kwq/KWQKHTMLPart.h:
1455 declare new private bottleneck method registerCommandForUndoOrRedo
1456 * kwq/KWQKHTMLPart.mm:
1457 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1458 new bottleneck method to reduce code duplication; now calls over the bridge
1459 to get the localized string to use for the Undo action name
1460 (KWQKHTMLPart::registerCommandForUndo):
1461 now calls new bottleneck method
1462 (KWQKHTMLPart::registerCommandForRedo):
1463 now calls new bottleneck method
1465 * kwq/WebCoreBridge.h:
1466 new enum for WebUndoAction, maps directly to HTMLEditAction.
1467 Declaration of nameForUndoAction:
1469 2004-12-14 Darin Adler <darin@apple.com>
1473 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
1475 * khtml/rendering/render_frames.cpp:
1476 (RenderPart::~RenderPart): Check widget for nil.
1477 (RenderPart::setWidget): Ditto.
1478 (RenderFrame::slotViewCleared): Ditto.
1479 (RenderPartObject::slotViewCleared): Ditto.
1481 2004-12-13 Darin Adler <darin@apple.com>
1485 - moved markup-related functions into new sources files in the editing directory
1486 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
1488 * ForwardingHeaders/editing/markup.h: Added.
1489 * khtml/editing/markup.h: Added.
1490 * khtml/editing/markup.cpp: Added.
1492 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
1494 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
1495 * khtml/html/html_elementimpl.cpp:
1496 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
1497 (HTMLElementImpl::outerHTML): Ditto.
1499 * khtml/ecma/kjs_window.cpp:
1500 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
1501 (Window::retrieveActive): Ditto.
1503 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
1504 * khtml/xml/dom_docimpl.h: Ditto.
1506 * khtml/khtml_part.cpp:
1507 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
1508 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
1510 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
1511 still works even with the additional replace overloads added to QString.
1512 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
1514 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
1515 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
1516 * khtml/rendering/render_object.cpp: Ditto.
1517 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
1519 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
1520 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
1521 the support code into markup.cpp.
1523 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
1524 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1526 * khtml/xml/dom_position.cpp:
1527 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
1528 so these return null positions rather than raising exceptions.
1529 (DOM::endPosition): Ditto.
1531 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
1532 * kwq/KWQFrame.h: Ditto.
1533 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
1534 * kwq/KWQKPartsPart.h: Ditto.
1535 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
1536 * kwq/KWQScrollView.h: Ditto.
1537 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
1538 * kwq/KWQKHTMLPart.h: Ditto.
1539 * kwq/KWQKHTMLPart.mm:
1540 (KHTMLView::isKHTMLView): Ditto.
1541 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
1542 replace overloads added to QString.
1543 (KWQKHTMLPart::setStatusBarText): Ditto.
1544 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
1545 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
1546 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
1547 (KWQKHTMLPart::attributedString): Ditto.
1548 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
1549 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
1551 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
1553 (QObject::inherits): Changed to not use dynamic cast.
1554 (QObject::isKHTMLPart): Added. Returns false.
1555 (QObject::isKHTMLView): Ditto.
1556 (QObject::isKPartsReadOnlyPart): Ditto.
1557 (QObject::isQFrame): Ditto.
1558 (QObject::isQScrollView): Ditto.
1560 * kwq/KWQRenderTreeDebug.cpp:
1561 (write): Changed to use inherits rather than dynamic_cast.
1562 (writeSelection): Ditto.
1564 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
1565 than going straight on to the "no parameters at all" version.
1568 * kwq/KWQString.mm: (QString::replace): Added overloads.
1569 * kwq/WebCoreBridge.mm:
1570 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
1571 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
1572 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
1573 the additional replace overloads added to QString.
1574 (-[WebCoreBridge stringForRange:]): Ditto.
1575 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
1576 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
1577 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
1578 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
1580 2004-12-13 Ken Kocienda <kocienda@apple.com>
1586 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
1588 * khtml/editing/htmlediting.cpp:
1589 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
1590 leading and trailing whitespace positions was reversed! I must have introduced this error recently
1591 when changing around this code.
1593 2004-12-13 David Hyatt <hyatt@apple.com>
1595 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
1596 and painting was using the wrong rect when setting up the x/y of the rect.
1600 * khtml/rendering/render_block.cpp:
1601 (khtml::RenderBlock::paint):
1602 (khtml::RenderBlock::nodeAtPoint):
1603 * khtml/rendering/render_object.h:
1604 (khtml::RenderObject::floatRect):
1606 2004-12-13 Ken Kocienda <kocienda@apple.com>
1612 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
1614 Code to figuire out the end node to merge was missing the font tag in the second paragraph
1615 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
1617 * khtml/editing/htmlediting.cpp:
1618 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
1619 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
1620 insufficiently powerful.
1621 (khtml::ReplacementFragment::enclosingBlock): New helper function.
1622 * khtml/editing/htmlediting.h: Add declaration for new helper function.
1623 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
1624 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
1626 2004-12-13 Ken Kocienda <kocienda@apple.com>
1630 WebCore side of fix for this bug:
1632 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
1634 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
1635 bug. This change involves our half of the needed changes.
1637 Note that a lot of this change has to do with changing code to use a <br> element instead of
1638 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
1639 other places, code to handle comments in markup can be removed since we do not use comments for
1640 such annotations after this change.
1642 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
1643 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
1644 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
1645 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
1646 convertedSpaceSpanClassString to match other uses of the idiom used here.
1647 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1648 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
1649 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1650 * khtml/html/html_elementimpl.cpp:
1651 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
1652 annotate fragments with comments any longer.
1653 * khtml/html/html_elementimpl.h: Ditto.
1654 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
1655 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
1656 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
1657 spurious semi-colon.
1658 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
1659 * kwq/WebCoreBridge.mm:
1660 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
1661 in DOM when calling createContextualFragment().
1663 2004-12-10 John Sullivan <sullivan@apple.com>
1665 fixed deployment build bustage that John Louch ran into
1667 * kwq/KWQTextEdit.mm:
1668 (QTextEdit::setScrollBarModes):
1669 move bool declaration inside exception-handling block to avoid obscure
1672 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1674 Reviewed by Richard.
1676 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
1679 (QWidget::setFocus): Handle the case where setting focus removed
1680 us from the superview - this can happen due to style changes on
1683 2004-12-10 Ken Kocienda <kocienda@apple.com>
1689 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
1691 There are a number of interesting things we could do to fix this bug, including SPI and involving
1692 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
1693 will fix the bug in the general case until such time as we can come up with more specific
1696 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
1699 * khtml/editing/htmlediting.cpp:
1700 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
1701 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
1702 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
1703 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
1705 2004-12-10 Darin Adler <darin@apple.com>
1709 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
1711 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
1712 * khtml/rendering/render_form.cpp:
1713 (RenderSubmitButton::rawText): Convert to QChar explicitly.
1714 (RenderLineEdit::updateFromElement): Ditto.
1715 (RenderLineEdit::slotTextChanged): Ditto.
1716 (RenderSelect::updateFromElement): Ditto.
1717 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
1718 that requires a derived class. Now we don't use this class at all for WebCore, but they still
1720 (TextAreaWidget::event): Moved out the ifdefs.
1721 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
1722 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
1723 now done in setStyle.
1724 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
1725 that's needed and WebCore no longer has TextAreaWidget.
1726 (RenderTextArea::calcMinMaxWidth): Ditto.
1727 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
1729 (RenderTextArea::updateFromElement): Use type QTextEdit.
1730 (RenderTextArea::text): Ditto.
1731 (RenderTextArea::select): Ditto.
1733 * kwq/KWQTextArea.mm:
1734 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
1735 since it's now handled by QTextEdit.
1736 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
1738 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
1739 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
1740 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
1742 2004-12-10 Ken Kocienda <kocienda@apple.com>
1748 <rdar://problem/3915047> HItting return in empty document inserts <p> but
1749 insertion point does not move
1751 * khtml/editing/htmlediting.cpp:
1752 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
1753 code to insert the <p> element for the return is not detecting the fact
1754 that the document is empty. Inserting a <p> into an empty body will not
1755 "add a new line" as the user expects. With this change, we'll add a second
1756 <p> when the root editable element has no rendered kids.
1758 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1762 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
1764 * khtml/html/html_miscimpl.cpp:
1765 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
1766 the initial one step, otherwise we might inadvertantly step
1767 outside the collection base, thereby causing assertion failures or
1768 other badness later.
1770 2004-12-10 Ken Kocienda <kocienda@apple.com>
1774 * khtml/editing/htmlediting.cpp:
1775 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
1776 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
1777 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
1778 should do nothing if the starting point for the selection is itself the starting block.
1779 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
1780 function, though the names and concepts are slightly different.
1782 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1786 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
1788 * khtml/dom/html_document.cpp:
1789 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
1790 * khtml/dom/html_document.h:
1791 * khtml/ecma/kjs_html.cpp:
1792 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
1793 * khtml/html/html_miscimpl.cpp:
1794 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
1795 the items that can be accessed directly as a document propery, in particular forms, images,
1796 objects, applets and embeds.
1797 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
1798 (HTMLFormCollectionImpl::updateNameCache): Ditto.
1799 * khtml/html/html_miscimpl.h:
1800 (DOM::HTMLCollectionImpl::): Added new type.
1802 2004-12-10 Ken Kocienda <kocienda@apple.com>
1808 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
1810 * khtml/rendering/render_text.cpp:
1811 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
1813 2004-12-10 Ken Kocienda <kocienda@apple.com>
1819 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
1821 * khtml/editing/htmlediting.cpp:
1822 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
1823 that was removed from the document when pasting. This caused the disappearance. Now this
1824 is detected, and the selection is shifted to a node that is in the document.
1826 2004-12-09 Richard Williamson <rjw@apple.com>
1828 Check to disable threaded decoding during
1829 layout tests wasn't invoking function, just checking address of
1830 function, which would always return true.
1832 * kwq/WebCoreImageRendererFactory.m:
1833 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1835 2004-12-09 David Hyatt <hyatt@apple.com>
1837 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
1840 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
1841 all inlines when repainting.
1845 * khtml/rendering/render_block.cpp:
1846 (khtml::RenderBlock::layoutBlockChildren):
1847 * khtml/rendering/render_flow.cpp:
1848 (RenderFlow::getAbsoluteRepaintRect):
1850 2004-12-09 David Hyatt <hyatt@apple.com>
1852 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
1853 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
1854 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
1855 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
1859 * khtml/rendering/render_block.cpp:
1860 (khtml::RenderBlock::getClearDelta):
1861 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
1862 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
1863 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
1864 * layout-tests/fast/block/margin-collapse/102-expected.txt:
1865 * layout-tests/fast/block/margin-collapse/102.html:
1867 2004-12-09 Richard Williamson <rjw@apple.com>
1869 Fixed <rdar://problem/3914078> worldclock crashing gc related
1871 Use ProtectedValue for Context2D instance members.
1875 * khtml/ecma/kjs_html.h:
1877 2004-12-09 John Sullivan <sullivan@apple.com>
1881 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
1883 * kwq/KWQAccObject.mm:
1884 (-[KWQAccObject title]): moved image alt tag code out of here
1885 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
1886 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
1887 that ordinary elements return; this means that ordinary elements that aren't images will return
1888 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
1890 (-[KWQAccObject accessibilityAttributeValue:]):
1891 call accessibilityDescription when asked for AXDescription
1893 2004-12-09 Ken Kocienda <kocienda@apple.com>
1895 Reviewed by Harrison
1899 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
1901 * khtml/editing/htmlediting.cpp:
1902 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
1903 been deleted. If this is the case, set the destination to the node the delete command provides in
1904 its ending selection.
1908 2004-12-09 Ken Kocienda <kocienda@apple.com>
1914 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
1916 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
1917 callback may not be delivered before the program asks for the dimensions of an image in order to
1918 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
1919 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
1921 * kwq/KWQRenderTreeDebug.cpp:
1922 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
1923 (externalRepresentation): Sets debuggingRenderTree flag to true;
1924 * kwq/KWQRenderTreeDebug.h:
1925 * kwq/WebCoreImageRendererFactory.m:
1926 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
1927 do threaded decoding in any case if the flag is set.
1929 2004-12-09 Chris Blumenberg <cblu@apple.com>
1931 Fix for busting XMLHTTPRequest.
1933 Reviewed by kocienda.
1935 * khtml/misc/loader.cpp:
1936 (Loader::servePendingRequests): pass true for deliverAllData
1938 (KIO::get): take deliverAllData param
1939 (KIO::http_post): ditto
1940 * kwq/KWQKJobClasses.h:
1941 * kwq/KWQKJobClasses.mm:
1942 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
1943 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
1945 2004-12-09 Ken Kocienda <kocienda@apple.com>
1949 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
1951 * khtml/xml/dom_nodeimpl.cpp:
1952 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
1954 2004-12-07 Richard Williamson <rjw@apple.com>
1956 Support threaded image decoding on machines w/ > 2 CPUs.
1958 Reviewed by Maciej and Chris.
1960 * khtml/misc/loader.cpp:
1961 (CachedImageCallback::notifyUpdate):
1962 (CachedImageCallback::notifyFinished):
1963 (CachedImageCallback::notifyDecodingError):
1964 (CachedImageCallback::handleError):
1965 (CachedImageCallback::clear):
1966 (CachedImage::CachedImage):
1967 (CachedImage::clear):
1968 (CachedImage::data):
1969 (CachedImage::checkNotify):
1970 (Loader::servePendingRequests):
1971 (Loader::slotFinished):
1972 (Loader::numRequests):
1973 (Loader::cancelRequests):
1974 (Loader::removeBackgroundDecodingRequest):
1975 * khtml/misc/loader.h:
1976 (khtml::CachedImageCallback::CachedImageCallback):
1977 (khtml::CachedImageCallback::ref):
1978 (khtml::CachedImageCallback::deref):
1979 (khtml::CachedImage::decoderCallback):
1980 * khtml/rendering/render_object.cpp:
1981 (RenderObject::setPixmap):
1984 (-[WebImageCallback initWithCallback:khtml::]):
1985 (-[WebImageCallback _commonTermination]):
1986 (-[WebImageCallback dealloc]):
1987 (-[WebImageCallback finalize]):
1988 (-[WebImageCallback notify]):
1989 (-[WebImageCallback setImageSourceStatus:]):
1990 (-[WebImageCallback status]):
1991 (QPixmap::shouldUseThreadedDecoding):
1992 (QPixmap::receivedData):
1993 * kwq/WebCoreImageRenderer.h:
1994 * kwq/WebCoreImageRendererFactory.h:
1995 * kwq/WebCoreImageRendererFactory.m:
1996 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
1997 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
1999 2004-12-07 Ken Kocienda <kocienda@apple.com>
2003 * khtml/editing/htmlediting.cpp:
2004 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
2005 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
2006 after new block has been inserted, otherwise a crash can result. Shuffle down call
2007 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
2010 2004-12-07 Ken Kocienda <kocienda@apple.com>
2016 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
2018 * khtml/editing/htmlediting.cpp:
2019 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
2020 for determining the location for inserting content. Do not allow an insert before or after if the
2021 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
2022 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
2023 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
2025 2004-12-07 Darin Adler <darin@apple.com>
2029 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
2031 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
2033 2004-12-07 Ken Kocienda <kocienda@apple.com>
2037 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
2038 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
2040 * khtml/editing/html_interchange.h: Name change, as described above.
2041 * khtml/editing/htmlediting.cpp:
2042 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
2043 * khtml/xml/dom2_rangeimpl.cpp:
2044 (DOM::RangeImpl::toHTML): Ditto.
2046 2004-12-07 Ken Kocienda <kocienda@apple.com>
2050 Added a couple more layout tests.
2052 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
2053 * layout-tests/editing/deleting/delete-line-013.html: Added.
2054 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
2055 * layout-tests/editing/deleting/delete-line-014.html: Added.
2057 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2061 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
2063 * kwq/KWQListBox.mm:
2064 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
2065 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
2066 (-[KWQListBoxScrollView widget]): See above.
2067 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
2068 afterMouseDown, to avoid triggering an assertion failure.
2070 2004-12-06 David Hyatt <hyatt@apple.com>
2072 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
2073 made by me, kocienda and harrison to just remove it.
2077 * khtml/rendering/bidi.cpp:
2078 (khtml::RenderBlock::layoutInlineChildren):
2079 * khtml/rendering/render_block.cpp:
2080 (khtml:::RenderFlow):
2081 * khtml/rendering/render_block.h:
2082 * khtml/rendering/render_flow.cpp:
2083 (RenderFlow::dirtyLinesFromChangedChild):
2085 2004-12-06 David Hyatt <hyatt@apple.com>
2087 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
2088 not a damage rect that can be changed when intersected with the clip regions of the web page.
2092 * khtml/rendering/render_canvas.h:
2093 (khtml::RenderCanvas::printRect):
2094 (khtml::RenderCanvas::setPrintRect):
2095 * khtml/rendering/render_flow.cpp:
2096 (RenderFlow::paintLines):
2097 * khtml/rendering/render_list.cpp:
2098 (RenderListMarker::paint):
2099 * kwq/KWQKHTMLPart.mm:
2100 (KWQKHTMLPart::adjustPageHeight):
2102 2004-12-06 David Harrison <harrison@apple.com>
2104 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
2106 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
2109 * khtml/rendering/render_flow.cpp:
2110 (RenderFlow::dirtyLinesFromChangedChild):
2111 Dirty the line above because new child can inval the cached line break position of previous line.
2113 2004-12-06 David Hyatt <hyatt@apple.com>
2115 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
2116 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
2117 3126929, handle top/left overflow.
2119 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
2121 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
2122 regions and web pages) has been fixed.
2126 * khtml/rendering/bidi.cpp:
2127 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2128 (khtml::RenderBlock::checkLinesForOverflow):
2129 * khtml/rendering/render_block.cpp:
2130 (khtml:::RenderFlow):
2131 (khtml::RenderBlock::overflowHeight):
2132 (khtml::RenderBlock::overflowWidth):
2133 (khtml::RenderBlock::overflowLeft):
2134 (khtml::RenderBlock::overflowTop):
2135 (khtml::RenderBlock::overflowRect):
2136 (khtml::RenderBlock::layoutBlock):
2137 (khtml::RenderBlock::layoutBlockChildren):
2138 (khtml::RenderBlock::paint):
2139 (khtml::RenderBlock::floatRect):
2140 (khtml::RenderBlock::lowestPosition):
2141 (khtml::RenderBlock::rightmostPosition):
2142 (khtml::RenderBlock::leftmostPosition):
2143 (khtml::RenderBlock::nodeAtPoint):
2144 * khtml/rendering/render_block.h:
2145 * khtml/rendering/render_box.h:
2146 (khtml::RenderBox::borderBox):
2147 (khtml::RenderBox::borderTopExtra):
2148 (khtml::RenderBox::borderBottomExtra):
2149 * khtml/rendering/render_layer.cpp:
2150 (RenderLayer::paintScrollbars):
2151 (mustExamineRenderer):
2152 (RenderLayer::intersectsDamageRect):
2153 (RenderLayer::containsPoint):
2154 * khtml/rendering/render_line.cpp:
2155 (khtml::InlineFlowBox::placeBoxesHorizontally):
2156 (khtml::InlineFlowBox::verticallyAlignBoxes):
2157 * khtml/rendering/render_line.h:
2158 (khtml::InlineBox::leftOverflow):
2159 (khtml::InlineBox::rightOverflow):
2160 (khtml::InlineFlowBox::setVerticalOverflowPositions):
2161 (khtml::RootInlineBox::RootInlineBox):
2162 (khtml::RootInlineBox::leftOverflow):
2163 (khtml::RootInlineBox::rightOverflow):
2164 (khtml::RootInlineBox::setVerticalOverflowPositions):
2165 (khtml::RootInlineBox::setHorizontalOverflowPositions):
2166 * khtml/rendering/render_object.h:
2167 (khtml::RenderObject::borderBox):
2168 (khtml::RenderObject::overflowLeft):
2169 (khtml::RenderObject::overflowTop):
2170 (khtml::RenderObject::overflowRect):
2171 (khtml::RenderObject::floatRect):
2172 * khtml/rendering/render_table.cpp:
2173 (RenderTable::layout):
2174 (RenderTable::paint):
2175 (RenderTable::paintBoxDecorations):
2176 (RenderTable::calcMinMaxWidth):
2177 * khtml/rendering/render_table.h:
2178 (khtml::RenderTableCell::borderTopExtra):
2179 (khtml::RenderTableCell::borderBottomExtra):
2184 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2188 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
2190 I changed all unprotected places that can navigate a different
2191 window or frame from script to check for a javascript: URL, and if
2192 found, to check for safety using cross-site-script rules.
2194 I considered a few other possible exploits and made no change:
2196 - document.location is already protected because the document
2197 object itself is protected
2199 - frame.src, frame.location, iframe.src and targetted links are
2200 all safe because setting the URL of a frame to a javascript: URL
2201 executes the script in the context of the parent
2203 * khtml/ecma/kjs_window.cpp:
2204 (WindowFunc::tryCall):
2206 (LocationFunc::tryCall):
2208 2004-12-06 Ken Kocienda <kocienda@apple.com>
2214 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
2216 * khtml/editing/htmlediting.cpp:
2217 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
2218 check for one of the special cases being checked for in this function. The specific case
2219 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
2220 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
2221 case where a selection ended in a <br> after a block and would not delete any part of the
2222 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
2225 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
2226 new use of the function exposed this bug:
2228 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
2230 * khtml/xml/dom_position.cpp:
2231 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
2232 not have this fatal flaw. It is a much better design as well.
2234 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
2235 have what I consider to be a better result. Going with it.
2237 2004-12-06 Chris Blumenberg <cblu@apple.com>
2239 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
2244 (-[DOMElement _font]): new SPI for AppKit
2247 2004-12-06 Darin Adler <darin@apple.com>
2251 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
2253 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
2254 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
2256 2004-12-06 John Sullivan <sullivan@apple.com>
2258 Darin found what appears to be the real leak that we were falsely blaming
2259 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
2260 sure nothing barfed.
2262 * khtml/css/cssparser.cpp:
2263 (CSSParser::parseValue):
2264 call clearProperties() instead of just setting numParsedProperties to 0
2265 (CSSParser::parseDeclaration):
2267 (CSSParser::createStyleDeclaration):
2270 2004-12-06 Ken Kocienda <kocienda@apple.com>
2276 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
2277 * layout-tests/editing/inserting/insert-div-001.html: Added.
2278 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
2279 * layout-tests/editing/inserting/insert-div-002.html: Added.
2280 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
2281 * layout-tests/editing/inserting/insert-div-003.html: Added.
2282 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
2283 * layout-tests/editing/inserting/insert-div-004.html: Added.
2284 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
2285 * layout-tests/editing/inserting/insert-div-005.html: Added.
2286 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
2287 * layout-tests/editing/inserting/insert-div-006.html: Added.
2288 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
2289 * layout-tests/editing/inserting/insert-div-007.html: Added.
2290 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
2291 * layout-tests/editing/inserting/insert-div-008.html: Added.
2292 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
2293 * layout-tests/editing/inserting/insert-div-009.html: Added.
2295 2004-12-06 Ken Kocienda <kocienda@apple.com>
2297 Reviewed by Harrison
2301 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
2303 * khtml/editing/htmlediting.cpp:
2304 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
2305 being added to this function. This ensures that the added block has a height.
2306 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2308 2004-12-06 Ken Kocienda <kocienda@apple.com>
2312 * khtml/dom/dom_string.cpp:
2313 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
2314 * khtml/dom/dom_string.h: Ditto.
2315 * khtml/editing/htmlediting.cpp:
2316 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
2317 RebalanceWhitespaceCommand instance.
2318 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
2319 (khtml::InsertLineBreakCommand::doApply): Ditto.
2320 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2321 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2322 (khtml::InsertTextCommand::input): Ditto.
2323 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
2324 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
2325 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2326 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
2327 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
2328 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
2329 * khtml/editing/htmlediting.h: Ditto.
2330 (khtml::RebalanceWhitespaceCommand::): Ditto.
2332 2004-12-05 Darin Adler <darin@apple.com>
2334 - fixed small problem in my check-in from yesterday
2337 (positionForEvent): Get location from event without raising exception if it's the wrong type.
2338 (clickCountForEvent): Same, for clickCount.
2339 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
2340 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
2341 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
2343 2004-12-04 Darin Adler <darin@apple.com>
2347 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
2349 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
2350 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
2351 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
2353 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
2355 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
2356 * khtml/rendering/render_form.cpp:
2357 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
2358 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
2359 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
2361 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
2362 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
2363 Added a fixState helper method so the constructors can save code.
2365 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
2366 and added a third constructor that uses the "current event" from AppKit (used above).
2367 (QMouseEvent::fixState): Compute state and click count based on event type.
2369 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
2371 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
2372 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
2373 underlying cause in CSS.
2375 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
2377 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
2378 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
2380 2004-12-03 Chris Blumenberg <cblu@apple.com>
2383 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2384 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2385 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2386 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
2388 Reviewed by darin, rjw, kocienda.
2390 * khtml/misc/loader.cpp:
2391 (CachedObject::~CachedObject):
2392 (CachedCSSStyleSheet::checkNotify):
2393 (Loader::servePendingRequests):
2394 (Loader::slotFinished):
2395 (Loader::slotReceivedResponse):
2396 (Cache::requestImage):
2397 (Cache::requestScript):
2398 * khtml/misc/loader.h:
2399 (khtml::CachedObject::CachedObject):
2400 (khtml::CachedObject::response):
2401 (khtml::CachedObject::allData):
2402 * kwq/KWQKJobClasses.h:
2403 * kwq/KWQKJobClasses.mm:
2404 (KIO::TransferJobPrivate::TransferJobPrivate):
2405 (KIO::TransferJobPrivate::~TransferJobPrivate):
2406 (KIO::TransferJob::TransferJob):
2407 (KIO::TransferJob::assembleResponseHeaders):
2408 (KIO::TransferJob::retrieveCharset):
2409 (KIO::TransferJob::emitResult):
2410 (KIO::TransferJob::emitReceivedResponse):
2413 (KWQHeaderStringFromDictionary):
2414 (KWQCheckCacheObjectStatus):
2415 (KWQIsResponseURLEqualToURL):
2417 (KWQResponseMIMEType):
2418 (KWQCacheObjectExpiresTime):
2419 (khtml::CachedObject::setResponse):
2420 (khtml::CachedObject::setAllData):
2424 * kwq/KWQResourceLoader.mm:
2425 (-[KWQResourceLoader finishJobAndHandle:]):
2426 (-[KWQResourceLoader cancel]):
2427 (-[KWQResourceLoader reportError]):
2428 (-[KWQResourceLoader finishWithData:]):
2436 * kwq/WebCoreBridge.h:
2437 * kwq/WebCoreResourceLoader.h:
2439 2004-12-04 Darin Adler <darin@apple.com>
2443 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
2445 * khtml/rendering/render_form.cpp:
2446 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
2447 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
2448 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
2449 (RenderSlider::slotSliderValueChanged): Ditto.
2451 2004-12-03 John Sullivan <sullivan@apple.com>
2455 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
2456 khtml::BackgroundLayer::cullEmptyLayers
2458 * khtml/rendering/render_style.cpp:
2459 (BackgroundLayer::cullEmptyLayers):
2460 added missing nil check
2464 2004-12-03 Ken Kocienda <kocienda@apple.com>
2468 Roll out some recent changes by Chris that caused a performance regression.
2469 Fix is in hand, but it is a little risky this close to a submission. So,
2470 we have decided to roll back the change with the regression and roll in
2471 the new code after we submit.
2473 * khtml/css/cssproperties.c:
2476 * khtml/css/cssvalues.c:
2479 * khtml/misc/htmlattrs.c:
2482 * khtml/misc/htmltags.c:
2485 * khtml/misc/loader.cpp:
2486 (CachedObject::~CachedObject):
2487 (CachedObject::setResponse):
2488 (CachedCSSStyleSheet::checkNotify):
2489 (Loader::servePendingRequests):
2490 (Loader::slotFinished):
2491 (Loader::slotReceivedResponse):
2492 (Cache::requestImage):
2493 (Cache::requestScript):
2494 * khtml/misc/loader.h:
2495 (khtml::CachedObject::CachedObject):
2496 (khtml::CachedObject::response):
2497 * kwq/KWQKJobClasses.h:
2498 * kwq/KWQKJobClasses.mm:
2499 (KIO::TransferJobPrivate::TransferJobPrivate):
2500 (KIO::TransferJobPrivate::~TransferJobPrivate):
2501 (KIO::TransferJob::TransferJob):
2502 (KIO::TransferJob::assembleResponseHeaders):
2503 (KIO::TransferJob::retrieveCharset):
2504 (KIO::TransferJob::emitResult):
2505 (KIO::TransferJob::emitReceivedResponse):
2508 (KWQHeaderStringFromDictionary):
2509 (KWQCheckCacheObjectStatus):
2510 (KWQRetainResponse):
2511 (KWQReleaseResponse):
2512 (KWQIsResponseURLEqualToURL):
2514 (KWQResponseMIMEType):
2515 (KWQResponseTextEncodingName):
2516 (KWQResponseHeaderString):
2517 (KWQCacheObjectExpiresTime):
2518 (KWQLoader::KWQLoader):
2522 * kwq/KWQResourceLoader.mm:
2523 (-[KWQResourceLoader finishJobAndHandle]):
2524 (-[KWQResourceLoader cancel]):
2525 (-[KWQResourceLoader reportError]):
2526 (-[KWQResourceLoader finish]):
2534 * kwq/WebCoreBridge.h:
2535 * kwq/WebCoreResourceLoader.h:
2537 2004-12-03 John Sullivan <sullivan@apple.com>
2541 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
2543 * kwq/KWQKHTMLPart.mm:
2544 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
2545 when checking whether we moved the focus to another view, make sure we didn't "move" it to
2546 our documentView, because that's no move at all.
2548 2004-12-03 Darin Adler <darin@apple.com>
2552 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
2554 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
2555 Added missing initialization for base class and node pointer.
2557 - fixed a few places that could leave dangling node pointers
2559 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
2560 Clear out the node pointer when the node is destroyed.
2561 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
2563 2004-12-03 Chris Blumenberg <cblu@apple.com>
2565 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.
2566 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2570 * khtml/misc/loader.cpp:
2571 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
2572 (Loader::slotFinished): take data param
2573 * khtml/misc/loader.h:
2574 * kwq/KWQKJobClasses.h:
2575 * kwq/KWQKJobClasses.mm:
2576 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
2577 (KIO::TransferJob::emitResult): take data param and pass it
2578 * kwq/KWQResourceLoader.mm:
2579 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
2580 (-[KWQResourceLoader cancel]): pass nil for data
2581 (-[KWQResourceLoader reportError]): ditto
2582 (-[KWQResourceLoader finishWithData:]): pass data
2584 (KWQSlot::KWQSlot): pass data param to slotFinished
2585 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
2587 2004-12-03 Ken Kocienda <kocienda@apple.com>
2591 Did some clean up in the Position class as a result of trying to write some new layout
2592 tests and discovering a bug along the way.
2594 I removed these three functions from the Position class:
2596 1. bool isFirstRenderedPositionOnLine() const;
2597 2. bool isLastRenderedPositionOnLine() const;
2598 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
2599 4. bool inFirstEditableInRootEditableElement() const;
2601 The first two have replacements in the VisiblePosition class, and some code has been
2602 moved to use these new variants. The third function was a helper used only by these
2603 first two function, and can be removed as well. The fourth function was not used by anyone.
2605 * khtml/editing/htmlediting.cpp:
2606 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2607 * khtml/editing/visible_position.cpp:
2608 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
2609 Incorrect results were being returned when asking about positions at the starts of blocks.
2610 * khtml/xml/dom_position.cpp:
2611 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2612 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
2613 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
2614 * khtml/xml/dom_position.h: Update header for deletions.
2616 2004-12-03 Ken Kocienda <kocienda@apple.com>
2620 Terminology change in execCommand command identifiers. Specifically, the name of
2621 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
2622 terminology used by AppKit. It is also more accurate, since the insertion of a
2623 "br" element is what the command does. The inspiration for this change is so the
2624 -insertNewline AppKit method can be mapped to insert a new "div" element in
2625 a document and avoid ambiguity with what the javascript editing command does.
2627 * khtml/editing/jsediting.cpp
2628 * layout-tests/editing/deleting/delete-tab-004.html
2629 * layout-tests/editing/editing.js
2630 * layout-tests/editing/inserting/insert-3654864-fix.html
2631 * layout-tests/editing/inserting/insert-3659587-fix.html
2632 * layout-tests/editing/inserting/insert-3775316-fix.html
2633 * layout-tests/editing/inserting/insert-3800346-fix.html
2634 * layout-tests/editing/inserting/insert-br-001.html
2635 * layout-tests/editing/inserting/insert-br-002.html
2636 * layout-tests/editing/inserting/insert-br-003.html
2637 * layout-tests/editing/inserting/insert-br-004.html
2638 * layout-tests/editing/inserting/insert-br-005.html
2639 * layout-tests/editing/inserting/insert-br-006.html
2640 * layout-tests/editing/inserting/insert-br-007.html
2641 * layout-tests/editing/inserting/insert-br-008.html
2642 * layout-tests/editing/inserting/insert-tab-004.html
2643 * layout-tests/editing/inserting/insert-text-with-newlines.html
2644 * layout-tests/editing/pasteboard/paste-text-010.html
2646 2004-12-02 Ken Kocienda <kocienda@apple.com>
2652 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2654 * khtml/editing/htmlediting.cpp:
2655 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
2656 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
2657 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
2658 in a block and the document is in quirks mode, add an additional br to make the one in the
2659 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
2660 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
2661 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
2663 2004-12-02 Richard Williamson <rjw@apple.com>
2665 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
2667 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
2668 the b/f cache won't incorrectly trash the previous state when restoring.
2672 * kwq/WebCoreBridge.h:
2673 * kwq/WebCoreBridge.mm:
2674 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
2675 (-[WebCoreBridge canCachePage]):
2676 (-[WebCoreBridge clear]):
2678 2004-12-02 Ken Kocienda <kocienda@apple.com>
2684 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
2686 * khtml/xml/dom2_rangeimpl.cpp:
2687 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
2688 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
2689 of this bug where there is content after the body tag). Did a little code clean up as well.
2690 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
2692 2004-12-02 Ken Kocienda <kocienda@apple.com>
2698 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
2700 * khtml/khtml_part.cpp:
2701 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
2702 to figure out which end of the selection to extend.
2704 2004-12-02 David Harrison <harrison@apple.com>
2706 Reviewed by Ken Kocienda.
2708 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
2709 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
2711 * khtml/editing/visible_text.cpp:
2712 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
2713 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
2714 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
2715 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
2716 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
2717 Distinguish BR from whitespace.
2718 * khtml/editing/visible_text.h:
2719 Distinguish BR from whitespace.
2720 * khtml/editing/visible_units.cpp:
2721 (khtml::previousWordBoundary):
2722 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.
2724 2004-12-02 Ken Kocienda <kocienda@apple.com>
2730 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
2732 * khtml/xml/dom_position.cpp:
2733 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
2734 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
2735 exception trying to use a Position returned from this function to set the boundary point of a Range (which
2736 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
2737 contract to return a range-compliant position, hence the need for this fix.
2739 2004-12-01 Ken Kocienda <kocienda@apple.com>
2745 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
2746 regard to other editing commands. The class had a name change ages ago, and it was never
2748 * khtml/editing/htmlediting.h: Ditto.
2750 2004-12-01 Ken Kocienda <kocienda@apple.com>
2754 Some improvements for paste, including some new code to annotate
2755 whitespace when writing to the pasteboard to ensure that the meaning
2756 of the markup on the pasteboard is unambiguous.
2758 There is also new code for reading this annotated markup from the pasteboard,
2759 removing the nodes that were added only to prevent ambiguity.
2761 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
2762 The header should have been added earlier, but I did not do so.
2763 * khtml/editing/html_interchange.cpp: Added.
2764 (convertHTMLTextToInterchangeFormat):
2765 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
2766 * khtml/editing/htmlediting.cpp:
2767 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
2768 Also fixed a bug in the code that counts blocks in a fragment.
2769 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
2770 (khtml::ReplacementFragment::insertNodeBefore): New helper.
2771 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
2772 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
2773 * khtml/editing/htmlediting.h: Add some new declarations.
2774 * khtml/xml/dom2_rangeimpl.cpp:
2775 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
2776 * khtml/xml/dom_nodeimpl.cpp:
2777 (NodeImpl::stringValueForRange): New helper.
2778 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
2779 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
2780 should be added. Called by the paste code.
2781 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
2783 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
2784 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
2785 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
2787 2004-11-30 Chris Blumenberg <cblu@apple.com>
2789 * ChangeLog: removed conflict marker
2791 2004-11-30 Chris Blumenberg <cblu@apple.com>
2794 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2795 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2799 * khtml/misc/loader.cpp:
2800 (CachedObject::~CachedObject): release m_allData
2801 (CachedObject::setAllData): new
2802 (Loader::servePendingRequests): connect slotAllData
2803 (Loader::slotAllData): new
2804 (Cache::requestImage): tweak
2805 * khtml/misc/loader.h:
2806 (khtml::CachedObject::CachedObject): set allData to 0
2807 (khtml::CachedObject::allData): new
2808 * kwq/KWQKJobClasses.h:
2809 * kwq/KWQKJobClasses.mm:
2810 (KIO::TransferJob::TransferJob): set m_allData
2811 (KIO::TransferJob::emitAllData): new
2813 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
2814 * kwq/KWQResourceLoader.mm:
2815 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
2817 (KWQSlot::KWQSlot): support for slotAllData
2819 * kwq/WebCoreBridge.h:
2820 * kwq/WebCoreResourceLoader.h:
2822 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2826 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2830 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
2832 * khtml/khtml_part.cpp:
2833 (KHTMLPart::begin): call setParsing on document here after opening
2834 - from now on we'll only set parsing to true for a document open
2835 caused by page loading, not a programmatic one.
2836 * khtml/xml/dom_docimpl.cpp:
2837 (DocumentImpl::open): don't setParsing to true here any more.
2839 2004-11-30 Maciej Stachowiak <mjs@apple.com>
2843 - fix recent regression from collection perf fixes.
2845 * khtml/html/html_miscimpl.cpp:
2846 (HTMLFormCollectionImpl::updateNameCache): Look up the name
2847 attribute in the name cache, not the id cache (d'oh!)
2849 2004-11-30 Darin Adler <darin@apple.com>
2853 - rolled in a KDE fix for a problem that may underlie a number of crashes
2855 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
2856 the KDE guys to fix a subtle problem. Code said "n = n =".
2858 - rolled in a KDE fix for a containingBlock crash
2860 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
2861 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
2864 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
2867 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
2868 (-[KWQButton detachQButton]): Added.
2869 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
2870 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
2871 (-[KWQButton widget]): Added.
2872 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
2873 (-[KWQButton resignFirstResponder]): Ditto.
2874 (-[KWQButton canBecomeKeyView]): Ditto.
2875 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
2876 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
2878 * kwq/KWQComboBox.mm:
2879 (QComboBox::~QComboBox): Call detachQComboBox.
2880 (-[KWQPopUpButtonCell detachQComboBox]): Added.
2881 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
2882 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
2883 (-[KWQPopUpButton action:]): Ditto.
2884 (-[KWQPopUpButton widget]): Tweaked.
2885 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2886 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
2887 (-[KWQPopUpButton resignFirstResponder]): Ditto.
2888 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
2890 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
2892 * kwq/KWQListBox.mm:
2893 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
2895 * kwq/KWQScrollBar.h: Removed m_scroller field.
2896 * kwq/KWQScrollBar.mm:
2897 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
2898 (-[KWQScrollBar detachQScrollBar]): Added.
2899 (-[KWQScrollBar widget]): Added.
2900 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
2901 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
2902 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
2903 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
2904 (QScrollBar::setKnobProportion): Ditto.
2905 (QScrollBar::scrollbarHit): Ditto.
2907 * kwq/KWQScrollView.mm:
2908 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
2909 hack where we don't remove right away when doing mouse tracking.
2910 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
2911 the hack where we don't add right away when doing mouse tracking.
2913 * kwq/KWQSlider.h: Added destructor.
2915 (-[KWQSlider initWithQSlider:]): Tweaked a little.
2916 (-[KWQSlider detachQSlider]): Added.
2917 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
2918 (-[KWQSlider widget]): Added.
2919 (QSlider::~QSlider): Added. Calls detachQSlider.
2921 * kwq/KWQTextArea.h: Added detachQTextEdit method.
2922 * kwq/KWQTextArea.mm:
2923 (-[KWQTextArea detachQTextEdit]): Added.
2924 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
2925 (-[KWQTextArea becomeFirstResponder]): Ditto.
2926 (-[KWQTextArea nextKeyView]): Ditto.
2927 (-[KWQTextArea previousKeyView]): Ditto.
2928 (-[KWQTextArea drawRect:]): Ditto.
2929 (-[KWQTextAreaTextView insertTab:]): Ditto.
2930 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
2931 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
2932 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
2933 (-[KWQTextAreaTextView mouseDown:]): Ditto.
2934 (-[KWQTextAreaTextView keyDown:]): Ditto.
2935 (-[KWQTextAreaTextView keyUp:]): Ditto.
2937 * kwq/KWQTextEdit.h: Added ~QTextEdit.
2938 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
2940 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
2941 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
2943 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
2944 Added beforeMouseDown and afterMouseDown for use in widget implementations.
2945 Removed unused hasMouseTracking function.
2947 (QWidget::QWidget): Initialize two new fields.
2948 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
2949 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
2950 (QWidget::addToSuperview): Added.
2951 (QWidget::removeFromSuperview): Added.
2952 (QWidget::beforeMouseDown): Added.
2953 (QWidget::afterMouseDown): Added.
2955 * khtml/rendering/render_layer.cpp:
2956 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
2957 (RenderLayer::setHasVerticalScrollbar): Ditto.
2959 2004-11-30 Ken Kocienda <kocienda@apple.com>
2965 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
2967 * khtml/khtml_part.cpp:
2968 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
2969 with no blink if it is.
2971 2004-11-30 Ken Kocienda <kocienda@apple.com>
2977 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
2979 * khtml/khtml_part.cpp:
2980 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
2981 or <input type=image> was checked for focus since these elements are keyboard-focusable,
2982 but not mouse focusable. Also, this function did not work hard enough to set the focused
2983 node, and was content to clear it if the first element checked failed the test, rather
2984 than looking more at parents. This would have the effect of clearing, then resetting the
2985 focus on a DIV containing a button or image with content on either side of it in the
2986 process of arrowing over such content.
2988 2004-11-30 Ken Kocienda <kocienda@apple.com>
2992 * khtml/editing/htmlediting.cpp:
2993 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
2994 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
2995 * khtml/khtml_part.cpp:
2996 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
2997 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
2998 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
2999 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
3000 isCharacterSmartReplaceExempt virtual.
3002 2004-11-30 Ken Kocienda <kocienda@apple.com>
3006 * khtml/editing/htmlediting.cpp:
3007 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
3008 Seemed simple enough to land without review.
3010 2004-11-29 Ken Kocienda <kocienda@apple.com>
3014 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
3015 are handled correctly now, including selections that span multiple blocks, and cases
3016 where content on the pasteboard ends in newlines (or what appear to be newlines to a
3017 user, really block ends or BRs). I also made one small, but important change in the
3018 copy code to annotate the markup written to the pasteboard to support these selections
3021 New header that defines a couple of constants used in copying and pasting.
3023 * ForwardingHeaders/editing/html_interchange.h: Added.
3024 * khtml/editing/html_interchange.h: Added.
3026 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
3027 as a new helper class, ReplacementFragment, which encapsulates information and functions
3028 pertaining to a document fragment that is being inserted into a document.
3030 * khtml/editing/htmlediting.cpp:
3031 (khtml::ReplacementFragment::ReplacementFragment):
3032 (khtml::ReplacementFragment::~ReplacementFragment):
3033 (khtml::ReplacementFragment::firstChild): Simple accessor.
3034 (khtml::ReplacementFragment::lastChild): Ditto.
3035 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
3036 the starting node to use for merging into the block containing the start of the selection.
3037 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
3038 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
3039 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
3040 special annotation comment added in by the copy code.
3041 (khtml::ReplacementFragment::removeNode): Simple helper.
3042 (khtml::isComment): Simple helper.
3043 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
3044 I would like to do better than this some day, but this check will hold us until I can do better.
3045 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
3046 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
3047 (khtml::ReplaceSelectionCommand::doApply):
3048 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
3049 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
3050 (khtml::ReplacementFragment::root):
3051 (khtml::ReplacementFragment::type):
3052 (khtml::ReplacementFragment::isEmpty):
3053 (khtml::ReplacementFragment::isSingleTextNode):
3054 (khtml::ReplacementFragment::isTreeFragment):
3055 (khtml::ReplacementFragment::hasMoreThanOneBlock):
3056 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
3058 This smaller set of changes markup generation to add the newline annotation described in the
3059 comment at the start of this entry.
3061 * khtml/xml/dom2_rangeimpl.cpp:
3062 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
3063 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
3064 comment annotations are added to the markup generated.
3065 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
3066 * kwq/WebCoreBridge.mm:
3067 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
3068 DOM::RangeImpl::toHTML uses annotations when generating.
3072 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
3073 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
3074 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
3075 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
3076 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
3077 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
3078 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
3079 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
3080 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
3081 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
3082 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
3083 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
3084 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
3085 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
3086 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
3087 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
3088 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
3089 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
3091 2004-11-29 Ken Kocienda <kocienda@apple.com>
3093 Reviewed by Harrison
3095 Made two small changes that make it possible for comments to have DOM nodes made for them
3096 when pasting. This relies on some earlier work I did some days ago.
3098 * khtml/xml/dom_nodeimpl.cpp:
3099 (NodeImpl::startMarkup): Get the string from the comment.
3100 * kwq/WebCoreBridge.mm:
3101 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
3102 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
3103 be included in the DOM.
3105 2004-11-29 Ken Kocienda <kocienda@apple.com>
3107 Reviewed by Harrison
3109 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
3110 my improved paste code.
3112 * khtml/editing/visible_position.cpp:
3113 (khtml::blockRelationship)
3114 (khtml::visiblePositionsInDifferentBlocks)
3115 (khtml::isFirstVisiblePositionInBlock)
3116 (khtml::isFirstVisiblePositionInNode)
3117 (khtml::isLastVisiblePositionInBlock)
3118 * khtml/editing/visible_position.h
3120 2004-11-29 Ken Kocienda <kocienda@apple.com>
3122 Reviewed by Harrison
3124 * khtml/xml/dom_position.cpp:
3125 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
3126 specified from obeying that directive. The old code would stop at an outer block boundary in
3127 the case where that block had a block as its first child. The correct behavior is to drill into
3128 that inner block (and continue on drilling down, if possible), to find the correct position.
3130 2004-11-29 Ken Kocienda <kocienda@apple.com>
3132 Reviewed by Harrison
3134 Small improvements to the node-display debugging helpers.
3136 * khtml/xml/dom_nodeimpl.cpp:
3137 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
3138 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
3140 2004-11-29 Ken Kocienda <kocienda@apple.com>
3142 Reviewed by Harrison
3144 * khtml/editing/htmlediting.cpp:
3145 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
3146 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
3147 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
3148 place after the delete.
3150 2004-11-29 Ken Kocienda <kocienda@apple.com>
3152 Reviewed by Harrison
3154 Add a new helper function to insert a paragraph separator. Will be used in my
3155 upcoming paste improvments.
3157 * khtml/editing/htmlediting.cpp: Added function
3158 (khtml::CompositeEditCommand::insertParagraphSeparator)
3159 * khtml/editing/htmlediting.h: Ditto.
3161 2004-11-23 David Harrison <harrison@apple.com>
3163 Added various comments.
3165 * khtml/editing/htmlediting.cpp:
3166 (khtml::StyleChange::init):
3167 (khtml::ApplyStyleCommand::doApply):
3168 (khtml::ApplyStyleCommand::applyBlockStyle):
3169 (khtml::ApplyStyleCommand::applyInlineStyle):
3171 2004-11-23 David Hyatt <hyatt@apple.com>
3173 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
3174 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
3176 * khtml/rendering/render_block.cpp:
3177 (khtml::RenderBlock::nodeAtPoint):
3179 2004-11-22 David Hyatt <hyatt@apple.com>
3181 Make sure you can use document.createElement to make a <canvas> element.
3183 * khtml/xml/dom_docimpl.cpp:
3184 (DocumentImpl::createHTMLElement):
3186 2004-11-22 Maciej Stachowiak <mjs@apple.com>
3190 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
3191 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
3192 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
3193 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
3195 * khtml/ecma/kjs_html.cpp:
3196 (KJS::HTMLDocument::tryGet):
3197 * khtml/html/html_formimpl.cpp:
3198 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
3199 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3200 * khtml/html/html_formimpl.h:
3201 * khtml/html/html_miscimpl.cpp:
3202 (HTMLCollectionImpl::HTMLCollectionImpl):
3203 (HTMLCollectionImpl::~HTMLCollectionImpl):
3204 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
3205 (HTMLCollectionImpl::CollectionInfo::reset):
3206 (HTMLCollectionImpl::resetCollectionInfo):
3207 (HTMLCollectionImpl::checkForNameMatch):
3209 (HTMLCollectionImpl::updateNameCache):
3210 (HTMLCollectionImpl::namedItems):
3211 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
3212 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
3213 (HTMLFormCollectionImpl::item):
3214 (HTMLFormCollectionImpl::updateNameCache):
3215 * khtml/html/html_miscimpl.h:
3217 2004-11-22 David Hyatt <hyatt@apple.com>
3219 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
3224 * khtml/misc/loader.cpp:
3225 (CachedObject::finish):
3228 * khtml/misc/loader.h:
3229 (khtml::Cache::maxCacheableObjectSize):
3231 2004-11-22 David Hyatt <hyatt@apple.com>
3233 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
3234 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
3235 that lets us short circuit earlier when painting and hit testing.
3239 * khtml/khtml_part.cpp:
3240 (KHTMLPart::isPointInsideSelection):
3241 * khtml/rendering/render_block.cpp:
3242 (khtml::RenderBlock::paint):
3243 (khtml::RenderBlock::paintChildren):
3244 (khtml::RenderBlock::paintObject):
3245 (khtml::RenderBlock::paintFloats):
3246 (khtml::RenderBlock::nodeAtPoint):
3247 * khtml/rendering/render_block.h:
3248 * khtml/rendering/render_box.cpp:
3249 (RenderBox::nodeAtPoint):
3250 * khtml/rendering/render_box.h:
3251 * khtml/rendering/render_br.h:
3252 * khtml/rendering/render_canvas.cpp:
3253 (RenderCanvas::paint):
3254 * khtml/rendering/render_flow.cpp:
3255 (RenderFlow::paintLines):
3256 (RenderFlow::hitTestLines):
3257 (RenderFlow::caretRect):
3258 (RenderFlow::addFocusRingRects):
3259 (RenderFlow::paintFocusRing):
3260 (RenderFlow::paintOutlines):
3261 (RenderFlow::paintOutlineForLine):
3262 * khtml/rendering/render_flow.h:
3263 * khtml/rendering/render_frames.cpp:
3264 (RenderFrameSet::nodeAtPoint):
3265 * khtml/rendering/render_frames.h:
3266 * khtml/rendering/render_image.cpp:
3267 (RenderImage::nodeAtPoint):
3268 * khtml/rendering/render_image.h:
3269 * khtml/rendering/render_inline.cpp:
3270 (RenderInline::paint):
3271 (RenderInline::nodeAtPoint):
3272 * khtml/rendering/render_inline.h:
3273 * khtml/rendering/render_layer.cpp:
3274 (RenderLayer::paintLayer):
3275 (RenderLayer::hitTest):
3276 (RenderLayer::hitTestLayer):
3277 * khtml/rendering/render_layer.h:
3278 * khtml/rendering/render_line.cpp:
3279 (khtml::InlineBox::paint):
3280 (khtml::InlineBox::nodeAtPoint):
3281 (khtml::InlineFlowBox::flowObject):
3282 (khtml::InlineFlowBox::nodeAtPoint):
3283 (khtml::InlineFlowBox::paint):
3284 (khtml::InlineFlowBox::paintBackgrounds):
3285 (khtml::InlineFlowBox::paintBackground):
3286 (khtml::InlineFlowBox::paintBackgroundAndBorder):
3287 (khtml::InlineFlowBox::paintDecorations):
3288 (khtml::EllipsisBox::paint):
3289 (khtml::EllipsisBox::nodeAtPoint):
3290 (khtml::RootInlineBox::paintEllipsisBox):
3291 (khtml::RootInlineBox::paint):
3292 (khtml::RootInlineBox::nodeAtPoint):
3293 * khtml/rendering/render_line.h:
3294 (khtml::InlineRunBox::paintBackgroundAndBorder):
3295 * khtml/rendering/render_object.cpp:
3296 (RenderObject::hitTest):
3297 (RenderObject::setInnerNode):
3298 (RenderObject::nodeAtPoint):
3299 * khtml/rendering/render_object.h:
3300 (khtml::RenderObject::PaintInfo::PaintInfo):
3301 (khtml::RenderObject::PaintInfo::~PaintInfo):
3302 (khtml::RenderObject::paintingRootForChildren):
3303 (khtml::RenderObject::shouldPaintWithinRoot):
3304 * khtml/rendering/render_table.cpp:
3305 (RenderTable::layout):
3306 (RenderTable::paint):
3307 * khtml/rendering/render_text.cpp:
3308 (simpleDifferenceBetweenColors):
3309 (correctedTextColor):
3310 (InlineTextBox::nodeAtPoint):
3311 (InlineTextBox::paint):
3312 (InlineTextBox::selectionStartEnd):
3313 (InlineTextBox::paintSelection):
3314 (InlineTextBox::paintMarkedTextBackground):
3315 (InlineTextBox::paintDecoration):
3316 (RenderText::posOfChar):
3317 * khtml/rendering/render_text.h:
3318 (khtml::RenderText::paint):
3319 (khtml::RenderText::layout):
3320 (khtml::RenderText::nodeAtPoint):
3321 * khtml/xml/dom2_eventsimpl.cpp:
3322 (MouseEventImpl::computeLayerPos):
3323 * khtml/xml/dom_docimpl.cpp:
3324 (DocumentImpl::prepareMouseEvent):
3325 * kwq/KWQAccObject.mm:
3326 (-[KWQAccObject accessibilityHitTest:]):