1 2005-01-10 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
7 * khtml/rendering/render_text.cpp:
8 (InlineTextBox::paint): Support painting custom underline markers for
9 marked text in place of generic yellow.
10 (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
11 * khtml/rendering/render_text.h:
12 * kwq/KWQKHTMLPart.h: Declare new methods and structs.
13 * kwq/KWQKHTMLPart.mm:
14 (KWQKHTMLPart::clear): Clear marked test underlines.
15 (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
16 (convertAttributesToUnderlines): Converts NSAttributedString attributes
17 to simplified and C++-friendly form.
18 (KWQKHTMLPart::markedTextUsesUnderlines): New method.
19 (KWQKHTMLPart::markedTextUnderlines): New method.
21 (QPainter::drawLineForText): Handle pen width.
22 * kwq/WebCoreBridge.h:
23 * kwq/WebCoreBridge.mm:
24 (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
26 * kwq/WebCoreTextRenderer.h:
28 2005-01-12 David Harrison <harrison@apple.com>
30 Reviewed by Dave Hyatt.
32 <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
34 * kwq/KWQAccObject.mm:
35 (-[KWQAccObject addChildrenToArray:]):
36 Use the widget's outer view.
38 2005-01-12 David Harrison <harrison@apple.com>
40 Reviewed by Darin Adler.
42 <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
44 * khtml/xml/dom_nodeimpl.cpp:
45 (NodeImpl::displayNode):
46 Add quotes around text node content.
47 (NodeBaseImpl::childNode):
48 Add nil check to return nil rather than crash when child node not found.
49 * kwq/KWQAccObject.mm:
50 (-[KWQAccObject doAXStringForTextMarkerRange:]):
51 Pass range compliant positions to TextIterator.
53 2005-01-12 David Hyatt <hyatt@apple.com>
55 Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
56 line layout is smarter about including the overflow for both old states and new states.
60 * khtml/rendering/bidi.cpp:
61 (khtml::RenderBlock::layoutInlineChildren):
63 2005-01-12 David Hyatt <hyatt@apple.com>
65 Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move
66 tables/overflows that dont fit within a block only in strict mode.
68 Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific
69 case in editing is hit.
71 Reviewed by darin (first one), kocienda (second one)
73 * khtml/rendering/render_block.cpp:
74 (khtml::RenderBlock::getClearDelta):
75 * khtml/rendering/render_flow.cpp:
76 (RenderFlow::dirtyLinesFromChangedChild):
77 * khtml/rendering/render_line.cpp:
78 (khtml::InlineFlowBox::verticallyAlignBoxes):
80 2005-01-12 Ken Kocienda <kocienda@apple.com>
86 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
88 * khtml/editing/htmlediting.cpp:
89 (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
90 merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
91 added to visible_position files.
92 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
93 tests to determine when to stop moving nodes more complete and correct. Also improved comments.
94 * khtml/editing/visible_position.cpp:
95 (khtml::isFirstVisiblePositionInParagraph): New function.
96 (khtml::isLastVisiblePositionInParagraph): New function.
97 * khtml/editing/visible_position.h: Update header accordingly.
98 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
99 results but still correct.
100 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
101 * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
102 * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
103 * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
104 * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
105 * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
106 * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
107 * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
108 * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
109 * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
111 2005-01-11 Richard Williamson <rjw@apple.com>
113 Fixed 3922875. Fall back to DOM object is EMBED element
114 has no associated runtime object.
118 * khtml/ecma/kjs_dom.cpp:
119 (KJS::getRuntimeObject):
120 * khtml/ecma/kjs_html.cpp:
121 (KJS::HTMLDocument::tryGet):
122 (KJS::HTMLElement::tryGet):
123 (KJS::HTMLCollection::tryGet):
124 (KJS::HTMLCollection::getNamedItems):
126 2005-01-11 David Hyatt <hyatt@apple.com>
128 Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match
133 * khtml/html/htmltokenizer.cpp:
134 (khtml::HTMLTokenizer::parseTag):
136 2005-01-11 Chris Blumenberg <cblu@apple.com>
138 Fixed: <rdar://problem/3930733> Mail prints second page of email blank
142 * khtml/rendering/render_canvas.cpp:
143 (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
144 * khtml/rendering/render_flow.cpp:
145 (RenderFlow::paintLines): removed null check since the print rect should never be null
146 * khtml/rendering/render_list.cpp:
147 (RenderListMarker::paint): ditto
148 * kwq/KWQKHTMLPart.mm:
149 (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
151 2005-01-10 Ken Kocienda <kocienda@apple.com>
157 <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
159 * khtml/editing/htmlediting.cpp:
160 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a
161 simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the
162 result calculated in that deeper scope was not available when tested.
164 2005-01-10 Ken Kocienda <kocienda@apple.com>
170 <rdar://problem/3946852> Option-e goes to next line
172 * khtml/editing/htmlediting.cpp:
173 (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
174 into the start line is done. We plan to change pretty substantially soon to better handle
175 the problem described in <rdar://problem/3937352> Quote level not maintained when copied
176 and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
178 2005-01-10 Ken Kocienda <kocienda@apple.com>
184 <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
186 * khtml/editing/htmlediting.cpp:
187 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
188 to their own blocks if needed so that a block style can be applied.
189 (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
190 (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
191 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
192 This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
194 (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
195 Should remove attributue instead.
196 * khtml/editing/htmlediting.h: Touch function declarations accordingly.
197 * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
198 * layout-tests/editing/style/create-block-for-style-001.html: Added.
199 * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
200 * layout-tests/editing/style/create-block-for-style-002.html: Added.
201 * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
202 * layout-tests/editing/style/create-block-for-style-003.html: Added.
203 * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
204 * layout-tests/editing/style/create-block-for-style-004.html: Added.
205 * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
206 * layout-tests/editing/style/create-block-for-style-005.html: Added.
207 * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
208 * layout-tests/editing/style/create-block-for-style-006.html: Added.
209 * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
210 * layout-tests/editing/style/create-block-for-style-007.html: Added.
211 * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
212 * layout-tests/editing/style/create-block-for-style-008.html: Added.
213 * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
214 * layout-tests/editing/style/create-block-for-style-009.html: Added.
215 * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
216 * layout-tests/editing/style/create-block-for-style-010.html: Added.
217 * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
218 * layout-tests/editing/style/create-block-for-style-011.html: Added.
219 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
220 * layout-tests/editing/style/create-block-for-style-012.html: Added.
221 * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
222 * layout-tests/editing/style/create-block-for-style-013.html: Added.
224 Unrelated updates to these expected results.
225 * layout-tests/editing/inserting/insert-div-007-expected.txt
226 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
228 2005-01-10 Chris Blumenberg <cblu@apple.com>
230 Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
234 * khtml/rendering/render_flow.cpp:
235 (RenderFlow::paintLines): don't do pagination work if printRect is not set
236 * khtml/rendering/render_list.cpp:
237 (RenderListMarker::paint): ditto
239 2005-01-10 David Harrison <harrison@apple.com>
243 * kwq/KWQTextUtilities.mm:
244 (currentTextBreakLocaleID):
245 Return empty string (AKA root locale) if locale pref can not be canonicalized.
247 2005-01-10 John Sullivan <sullivan@apple.com>
249 Fixed broken Panther build.
251 * kwq/KWQTextUtilities.mm:
252 (currentTextBreakLocaleID):
253 This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
254 That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
255 To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
256 function. However, the Tiger-only code was wrong; the string generated using
257 CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
260 2005-01-09 David Harrison <harrison@apple.com>
262 Reviewed by Ken Kocienda.
264 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
266 * khtml/editing/htmlediting.cpp:
267 (khtml::ReplaceSelectionCommand::doApply):
268 Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
270 2005-01-09 Darin Adler <darin@apple.com>
272 Reviewed by Harrison.
274 - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
276 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
277 to a switch statement. Added SEARCH to the set of types that treat the renderer as a
280 2005-01-09 David Harrison <harrison@apple.com>
282 Reviewed by Ken Kocienda.
284 <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
287 Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
288 whitespace to a single non-breaking space when splitting a text node.
290 * khtml/editing/htmlediting.cpp:
291 (khtml::InsertParagraphSeparatorCommand::doApply):
293 2005-01-08 Kevin Decker <kdecker@apple.com>
297 Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
299 * khtml/html/html_elementimpl.cpp:
300 (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
302 2005-01-07 Maciej Stachowiak <mjs@apple.com>
306 <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
308 * Khtml/khtml_part.cpp:
309 (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
310 not started loading yet so it could not possibly be finishing here...
311 (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
312 no document, in this case we must have hit an error or been loading a non-HTML
314 * khtml/khtml_part.h:
316 2005-01-08 David Harrison <harrison@apple.com>
320 <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
322 * khtml/editing/selection.cpp:
323 (khtml::Selection::validate):
324 Tune word selections left/right choice to use right if on empty last line.
326 2005-01-07 David Harrison <harrison@apple.com>
330 <rdar://problem/3942619> AX: Support sentence ax attributes
332 Needed to use the unicode utilities properly. Twas lame before.
334 * khtml/editing/visible_units.cpp:
335 (khtml::previousBoundary):
336 (khtml::nextBoundary):
337 (khtml::startOfWord):
339 (khtml::previousWordPosition):
340 (khtml::nextWordPosition):
341 (khtml::startOfSentence):
342 (khtml::endOfSentence):
343 (khtml::previousSentencePosition):
344 (khtml::nextSentencePosition):
345 * kwq/KWQAccObject.mm:
346 (-[KWQAccObject accessibilityAttributeNames]):
347 (-[KWQAccObject accessibilityAttributeValue:]):
348 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
349 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
350 * kwq/KWQTextUtilities.mm:
351 (currentTextBreakLocaleID):
352 (KWQFindSentenceBoundary):
353 (KWQFindNextSentenceFromIndex):
355 2005-01-07 Ken Kocienda <kocienda@apple.com>
361 <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
362 <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
364 * khtml/editing/htmlediting.cpp:
365 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
366 Merge the typing style with the computed style for the current position. Fixes both bugs.
367 * khtml/editing/htmlediting.h:
368 * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
369 * layout-tests/editing/inserting/insert-div-023.html: Added.
370 * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
371 * layout-tests/editing/inserting/insert-div-024.html: Added.
373 2005-01-07 David Hyatt <hyatt@apple.com>
375 Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling
376 behavior on worldofwarcraft.com.
381 * khtml/rendering/render_table.cpp:
382 (RenderTable::layout):
384 2005-01-06 David Hyatt <hyatt@apple.com>
386 Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to
387 ignore inline flows in this case.
391 * khtml/rendering/render_block.cpp:
392 (khtml::RenderBlock::nodeAtPoint):
394 2005-01-07 Ken Kocienda <kocienda@apple.com>
400 <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
402 * kwq/KWQKHTMLPart.mm:
403 (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
404 in the document, or if it is not a descendent of the document element. In the case of the bug,
405 since the selection has not yet been set up, the focus node passed here is the HTML element, and
406 that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
408 2005-01-06 Kevin Decker <kdecker@apple.com>
412 Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
414 * khtml/khtml_part.cpp:
415 (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.
419 2005-01-06 David Harrison <harrison@apple.com>
423 (addendum to previous checkin for this bug)
424 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
426 Fix line navigation. Add AXUIElementForTextMarker.
429 * kwq/KWQAccObject.mm:
430 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
431 (-[KWQAccObject doAXUIElementForTextMarker:]):
432 (-[KWQAccObject doAXLineForTextMarker:]):
433 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
434 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
435 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
436 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
437 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
439 2004-12-23 Darin Adler <darin@apple.com>
443 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
445 (turns out the PLT regression was a false alarm)
447 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
448 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
450 * khtml/html/htmlparser.cpp:
451 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
452 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
453 to eliminate code that used ID_CLOSE_TAG for an array size.
454 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
455 that manages isindex to use deref instead of delete.
456 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
457 mistake of using ID_CLOSE_TAG for the array size too.
458 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
459 there and it would prevent custom tags from working. Added range check before using the forbidden
460 tag array with the token ID since custom tags will use index values past the end of the array.
461 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
462 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
463 createElement call is still here. Last time I left out a few form element types from this switch;
465 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
466 document if getTagID fails; this creates a unique per-document ID.
468 * khtml/misc/htmltags.c: Regenerated.
469 * khtml/misc/htmltags.h: Regenerated.
471 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
472 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
473 Also rewrote getTagName to work with the new scheme.
475 2005-01-06 David Harrison <harrison@apple.com>
477 Fixed Panther build. Also, do not advertize sentence support since it is incomplete.
479 * kwq/KWQAccObject.mm:
480 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
481 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
482 (-[KWQAccObject accessibilityIsAttributeSettable:]):
484 2005-01-06 David Harrison <harrison@apple.com>
486 Reviewed by Dave Hyatt.
488 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
489 <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
491 Many more AX attributes supported. Numerous fixes to previous AX work.
493 * khtml/editing/visible_units.cpp:
494 (khtml::startSentenceBoundary):
495 (khtml::startOfSentence):
496 (khtml::endSentenceBoundary):
497 (khtml::endOfSentence):
498 (khtml::previousSentencePositionBoundary):
499 (khtml::previousSentencePosition):
500 (khtml::nextSentencePositionBoundary):
501 (khtml::nextSentencePosition):
502 * khtml/editing/visible_units.h:
503 * khtml/khtmlview.cpp:
505 * khtml/misc/helper.cpp:
506 (khtml::findSentenceBoundary):
507 (khtml::nextSentenceFromIndex):
508 * khtml/misc/helper.h:
509 * khtml/misc/htmltags.c:
512 * khtml/rendering/render_container.cpp:
513 (RenderContainer::removeChildNode):
514 (RenderContainer::appendChildNode):
515 (RenderContainer::insertChildNode):
516 * khtml/rendering/render_object.cpp:
517 (RenderObject::remove):
518 * khtml/xml/dom_docimpl.cpp:
519 (DocumentImpl::getAccObjectCache):
520 (DocumentImpl::updateSelection):
521 (DocumentImpl::close):
522 (DocumentImpl::setFocusNode):
523 (DocumentImpl::parentDocument):
524 (DocumentImpl::topDocument):
525 * khtml/xml/dom_docimpl.h:
526 * kwq/KWQAccObject.mm:
527 (-[KWQAccObject accessibilityShouldUseUniqueId]):
528 (-[KWQAccObject detach]):
529 (-[KWQAccObject anchorElement]):
530 (-[KWQAccObject firstChild]):
531 (-[KWQAccObject lastChild]):
532 (-[KWQAccObject previousSibling]):
533 (-[KWQAccObject nextSibling]):
534 (-[KWQAccObject parentObject]):
535 (-[KWQAccObject value]):
536 (-[KWQAccObject accessibilityAttributeNames]):
537 (-[KWQAccObject accessibilityPerformAction:]):
538 (-[KWQAccObject textMarkerForVisiblePosition:]):
539 (-[KWQAccObject visiblePositionForTextMarker:]):
540 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
541 (-[KWQAccObject topDocument]):
542 (-[KWQAccObject topRenderer]):
543 (-[KWQAccObject topView]):
544 (-[KWQAccObject accessibilityAttributeValue:]):
545 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
546 (-[KWQAccObject doAXLineForTextMarker:]):
547 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
548 (-[KWQAccObject doAXStringForTextMarkerRange:]):
549 (-[KWQAccObject doAXTextMarkerForPosition:]):
550 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
551 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
552 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
553 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
554 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
555 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
556 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
557 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
558 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
559 (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
560 (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
561 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
562 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
563 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
564 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
565 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
566 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
567 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
568 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
569 (-[KWQAccObject doAXLengthForTextMarkerRange:]):
570 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
571 (-[KWQAccObject accessibilityHitTest:]):
572 (-[KWQAccObject accessibilityFocusedUIElement]):
573 (-[KWQAccObject accessibilityIsAttributeSettable:]):
574 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
575 (-[KWQAccObject setAccObjectID:]):
576 (-[KWQAccObject removeAccObjectID]):
577 * kwq/KWQAccObjectCache.h:
578 * kwq/KWQAccObjectCache.mm:
579 (KWQAccObjectCache::setAccObject):
580 (KWQAccObjectCache::removeAccObject):
581 (KWQAccObjectCache::visiblePositionForTextMarker):
582 (KWQAccObjectCache::postNotificationToTopWebArea):
583 (KWQAccObjectCache::postNotification):
584 (KWQAccObjectCache::handleFocusedUIElementChanged):
585 * kwq/KWQKHTMLPart.mm:
586 (KWQKHTMLPart::respondToChangedContents):
587 * kwq/KWQTextUtilities.h:
588 * kwq/KWQTextUtilities.mm:
589 (KWQFindNextWordFromIndex):
590 (KWQFindSentenceBoundary):
591 (KWQFindNextSentenceFromIndex):
592 * kwq/WebCoreBridge.mm:
593 (-[WebCoreBridge accessibilityTree]):
595 2005-01-05 Darin Adler <darin@apple.com>
599 - re-landing a subset of my custom tag change that does not fix the bug, but also does
600 not introduce a performance regression
602 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
603 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
605 * khtml/editing/htmlediting.cpp:
606 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
607 per-document tags and is just better all around for things like the document.
608 (khtml::debugNode): Ditto.
609 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
610 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
611 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
612 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
614 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
615 non-HTML elements to be nested as desired.
617 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
618 * khtml/misc/htmlhashes.cpp:
619 (khtml::getTagID): Changed return type to unsigned short.
620 (khtml::getAttrID): Ditto.
622 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
623 * khtml/xml/dom_docimpl.cpp:
624 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
625 Also updated for a few tags that the parser handled but this did not.
627 * kwq/KWQRenderTreeDebug.cpp:
628 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
629 the tag ID directly, which only works for standard nodes.
630 (operator<<): Update to call getTagName.
631 (nodePositionRelativeToRoot): Ditto.
632 (writeSelection): Ditto.
634 2005-01-05 Ken Kocienda <kocienda@apple.com>
640 <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
642 * khtml/editing/htmlediting.cpp:
643 (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
644 this operation work correctly, particularly in the logic to figure out whether to merge content, and
645 also performing merges.
646 * khtml/editing/visible_position.cpp:
647 (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
648 * khtml/editing/visible_units.cpp:
649 (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
650 (khtml::isEndOfParagraph): Ditto.
651 * khtml/editing/visible_units.h: Declare new functions.
653 2005-01-04 Ken Kocienda <kocienda@apple.com>
659 <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
661 * khtml/editing/htmlediting.cpp:
662 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
663 for the block we are adding was being done at the wrong time, which led to the placeholder remaining
664 in the document when it was not needed. This resulted in the extra space reported in the bug.
666 2005-01-04 Kevin Decker <kdecker@apple.com>
670 Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
672 * khtml/rendering/render_block.cpp:
673 (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.
675 2005-01-04 David Hyatt <hyatt@apple.com>
677 Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
681 * khtml/rendering/render_layer.cpp:
682 (RenderLayer::updateScrollInfoAfterLayout):
684 2005-01-04 Ken Kocienda <kocienda@apple.com>
688 Fix for these two bugs:
690 <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
691 <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
693 * khtml/editing/htmlediting.cpp:
694 (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
695 neither start nor end. For 3939148, improve the code which adjusts the insertion point during
696 the process of pasting. It formerly handled only one of the possible cases.
697 * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
698 * layout-tests/editing/pasteboard/paste-text-015.html: Added.
700 2005-01-04 David Hyatt <hyatt@apple.com>
702 Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
706 * khtml/rendering/render_form.cpp:
707 (RenderLineEdit::updateFromElement):
708 * kwq/KWQLineEdit.mm:
709 (QLineEdit::setPlaceholderString):
711 2005-01-04 David Hyatt <hyatt@apple.com>
713 Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when
714 returning pseudo-styles.
718 * khtml/css/cssstyleselector.cpp:
719 (khtml::CSSStyleSelector::matchRulesForList):
720 (khtml::CSSStyleSelector::pseudoStyleForElement):
721 * khtml/rendering/render_style.cpp:
722 (RenderStyle::addPseudoStyle):
724 2005-01-04 Darin Adler <darin@apple.com>
726 - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
728 * khtml/css/cssstyleselector.cpp:
729 * khtml/editing/htmlediting.cpp:
730 * khtml/editing/selection.cpp:
731 * khtml/editing/visible_position.cpp:
732 * khtml/html/dtd.cpp:
733 * khtml/html/htmlparser.cpp:
734 * khtml/html/htmlparser.h:
735 * khtml/html/htmltokenizer.cpp:
736 * khtml/misc/htmlhashes.cpp:
737 * khtml/misc/htmlhashes.h:
738 * khtml/misc/htmltags.c:
739 * khtml/misc/htmltags.h:
740 * khtml/misc/maketags:
741 * khtml/xml/dom_docimpl.cpp:
742 * khtml/xml/dom_docimpl.h:
743 * khtml/xml/dom_nodeimpl.cpp:
744 * khtml/xml/dom_position.cpp:
745 * kwq/KWQRenderTreeDebug.cpp:
747 2005-01-04 Ken Kocienda <kocienda@apple.com>
753 <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
755 * khtml/editing/htmlediting.cpp:
756 (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
757 a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
758 to be applied. Now the code will detect when at the end of a style run and will not move and apply
759 that ending style to the new paragraph, though it will place that style into the typing style. This
760 seems to match NSText behavior.
761 * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed
762 here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
763 not have any visible effect on the document.
764 * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
765 * layout-tests/editing/inserting/insert-div-022.html: Added.
767 2005-01-04 David Hyatt <hyatt@apple.com>
769 Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
774 * khtml/rendering/render_flow.cpp:
775 (RenderFlow::paintLines):
777 2005-01-03 David Hyatt <hyatt@apple.com>
779 Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more
780 robust and make it work regardless of which objects get a layout or not.
784 * khtml/rendering/render_block.cpp:
785 (khtml::RenderBlock::insertFloatingObject):
786 (khtml::RenderBlock::addOverhangingFloats):
787 (khtml::RenderBlock::addIntrudingFloats):
788 * khtml/rendering/render_block.h:
789 (khtml::RenderBlock::FloatingObject::FloatingObject):
791 2005-01-03 Maciej Stachowiak <mjs@apple.com>
795 <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
797 * khtml/html/html_miscimpl.cpp:
798 (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
799 it should not ever be (now).
800 (HTMLCollectionImpl::item): When traversing items stop when we hit
801 nil, meaning the end to avoid triggering above assert (formerly crash).
803 2005-01-03 Maciej Stachowiak <mjs@apple.com>
805 Reviewed by John and Kevin.
807 <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
809 * khtml/ecma/kjs_window.cpp:
810 (Window::get): Look up frame names before buitin window properties
811 to match other browsers. This regressed because we added a builtin
812 "toolbar" property but this site had a frame with that name.
814 2004-12-21 Maciej Stachowiak <mjs@apple.com>
818 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
820 Added opener bridge method to help WebKit implement security check
821 for named frame visibility.
823 * khtml/khtml_part.h:
824 * kwq/WebCoreBridge.h:
825 * kwq/WebCoreBridge.mm:
826 (-[WebCoreBridge opener]):
828 2005-01-03 Ken Kocienda <kocienda@apple.com>
834 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
836 * kwq/WebCoreBridge.mm:
837 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
839 2005-01-03 David Hyatt <hyatt@apple.com>
841 Fix for 3936881, make sure positioned objects prooperly update y-position.
845 * khtml/rendering/render_block.cpp:
846 (khtml::RenderBlock::layoutPositionedObjects):
848 2005-01-03 Ken Kocienda <kocienda@apple.com>
854 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
856 * khtml/editing/htmlediting.cpp:
857 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
858 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
859 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
860 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
861 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
862 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
863 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
864 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
865 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
866 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
867 * khtml/editing/htmlediting.h: Declare new functions.
869 2004-12-25 Kevin Decker <kdecker@apple.com>
873 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
875 * 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.
877 2004-12-23 Darin Adler <darin@apple.com>
881 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
883 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
884 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
886 * khtml/editing/htmlediting.cpp:
887 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
888 per-document tags and is just better all around for things like the document.
889 (khtml::debugNode): Ditto.
890 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
891 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
892 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
893 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
895 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
896 non-HTML elements to be nested as desired.
898 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
899 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
901 * khtml/html/htmlparser.cpp:
902 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
903 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
904 to eliminate code that used ID_CLOSE_TAG for an array size.
905 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
906 that manages isindex to use deref instead of delete.
907 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
908 mistake of using ID_CLOSE_TAG for the array size too.
909 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
910 there and it would prevent custom tags from working. Added range check before using the forbidden
911 tag array with the token ID since custom tags will use index values past the end of the array.
912 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
913 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
914 createElement call is still here. Last time I left out a few form element types from this switch;
916 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
917 document if getTagID fails; this creates a unique per-document ID.
919 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
920 * khtml/misc/htmlhashes.cpp:
921 (khtml::getTagID): Changed return type to unsigned short.
922 (khtml::getAttrID): Ditto.
924 * khtml/misc/htmltags.c: Regenerated.
925 * khtml/misc/htmltags.h: Regenerated.
927 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
928 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
929 Also rewrote getTagName to work with the new scheme.
931 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
932 * khtml/xml/dom_docimpl.cpp:
933 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
934 Also updated for a few tags that the parser handled but this did not.
936 * kwq/KWQRenderTreeDebug.cpp:
937 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
938 the tag ID directly, which only works for standard nodes.
939 (operator<<): Update to call getTagName.
940 (nodePositionRelativeToRoot): Ditto.
941 (writeSelection): Ditto.
945 2004-12-22 Darin Adler <darin@apple.com>
947 - rolled out my custom tag name change -- it broke amazon.com
949 * khtml/css/cssstyleselector.cpp:
950 * khtml/editing/htmlediting.cpp:
951 * khtml/editing/selection.cpp:
952 * khtml/editing/visible_position.cpp:
953 * khtml/html/dtd.cpp:
954 * khtml/html/htmlparser.cpp:
955 * khtml/html/htmlparser.h:
956 * khtml/html/htmltokenizer.cpp:
957 * khtml/misc/htmlhashes.cpp:
958 * khtml/misc/htmlhashes.h:
959 * khtml/misc/htmltags.c:
960 * khtml/misc/htmltags.h:
961 * khtml/misc/maketags:
962 * khtml/xml/dom_docimpl.cpp:
963 * khtml/xml/dom_docimpl.h:
964 * khtml/xml/dom_nodeimpl.cpp:
965 * khtml/xml/dom_position.cpp:
966 * kwq/KWQRenderTreeDebug.cpp:
968 2004-12-22 David Harrison <harrison@apple.com>
970 Reviewed by Darin Adler.
972 * khtml/editing/selection.cpp:
973 (khtml::Selection::validate):
974 The selecting/deselecting bad behavior is because the Selection code that expands by words
975 had an inaccurate test for being at the end of the document (where double-clicking needs
976 to select the last word). Fixed that check.
978 2004-12-22 Adele Amchan <adele@apple.com>
982 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
984 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
985 so that we match Firefox and WinIE behavior.
987 2004-12-22 Darin Adler <darin@apple.com>
991 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
993 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
994 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
996 * khtml/editing/htmlediting.cpp:
997 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
998 per-document tags and is just better all around for things like the document.
999 (khtml::debugNode): Ditto.
1000 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
1001 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
1002 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
1003 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
1005 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
1006 non-HTML elements to be nested as desired.
1008 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
1009 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
1011 * khtml/html/htmlparser.cpp:
1012 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
1013 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
1014 to eliminate code that used ID_CLOSE_TAG for an array size.
1015 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
1016 that manages isindex to use deref instead of delete.
1017 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
1018 mistake of using ID_CLOSE_TAG for the array size too.
1019 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
1020 there and it would prevent custom tags from working. Added range check before using the forbidden
1021 tag array with the token ID since custom tags will use index values past the end of the array.
1022 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
1023 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
1024 createElement call is still here.
1025 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
1026 document if getTagID fails; this creates a unique per-document ID.
1028 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
1029 * khtml/misc/htmlhashes.cpp:
1030 (khtml::getTagID): Changed return type to unsigned short.
1031 (khtml::getAttrID): Ditto.
1033 * khtml/misc/htmltags.c: Regenerated.
1034 * khtml/misc/htmltags.h: Regenerated.
1036 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
1037 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
1038 Also rewrote getTagName to work with the new scheme.
1040 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
1041 * khtml/xml/dom_docimpl.cpp:
1042 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
1043 Also updated for a few tags that the parser handled but this did not.
1045 * kwq/KWQRenderTreeDebug.cpp:
1046 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
1047 the tag ID directly, which only works for standard nodes.
1048 (operator<<): Update to call getTagName.
1049 (nodePositionRelativeToRoot): Ditto.
1050 (writeSelection): Ditto.
1052 2004-12-21 David Harrison <harrison@apple.com>
1054 Reviewed by Ken Kocienda.
1056 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
1058 Problem was the TextIterator was not handling exitNode() from a P block properly.
1060 * khtml/editing/visible_text.cpp:
1061 (khtml::TextIterator::TextIterator):
1062 Add new param that specifies whether the iterator is for content or for searching.
1063 Search iterators do not prevent newlines at the beginning.
1064 (khtml::TextIterator::advance):
1065 Added some comments.
1066 (khtml::TextIterator::handleTextNode):
1067 Added some comments.
1068 (khtml::TextIterator::exitNode):
1069 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
1070 (khtml::TextIterator::emitCharacter):
1071 Added some comments.
1072 (khtml::TextIterator::range):
1073 Added some comments.
1074 (khtml::CharacterIterator::CharacterIterator):
1075 Specify search type TextIterator.
1076 (khtml::CharacterIterator::advance):
1077 * khtml/editing/visible_text.h:
1079 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
1080 * khtml/editing/visible_units.cpp:
1081 (khtml::nextWordBoundary):
1082 Specify search type TextIterator.
1084 2004-12-21 David Harrison <harrison@apple.com>
1086 Reviewed by Ken Kocienda.
1088 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
1090 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
1091 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
1093 * khtml/rendering/render_text.cpp:
1094 (RenderText::setSelectionState)
1096 2004-12-21 Maciej Stachowiak <mjs@apple.com>
1100 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
1102 * khtml/ecma/kjs_window.cpp:
1103 (Window::get): Change most window functions to be restricted by
1106 2004-12-21 Ken Kocienda <kocienda@apple.com>
1112 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
1114 * khtml/editing/htmlediting.cpp:
1115 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
1116 formerly undetected and unhandled. This is the crux of the bug fix.
1117 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
1118 execution of command.
1119 * khtml/editing/htmlediting.h: Declare new function.
1120 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
1121 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
1123 2004-12-21 Ken Kocienda <kocienda@apple.com>
1127 * khtml/editing/htmlediting.cpp:
1128 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
1129 checking in (aka must return false from function returning bool).
1131 2004-12-21 Ken Kocienda <kocienda@apple.com>
1137 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
1139 * khtml/editing/htmlediting.cpp:
1140 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
1141 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
1143 2004-12-21 Ken Kocienda <kocienda@apple.com>
1147 * khtml/editing/htmlediting.cpp:
1148 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
1149 further experiements.
1150 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
1151 be done if the insertion point is in an empty block.
1152 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
1153 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
1154 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
1155 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
1156 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
1157 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
1159 2004-12-21 Darin Adler <darin@apple.com>
1163 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
1165 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
1166 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
1167 * khtml/editing/visible_text.cpp:
1168 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
1169 using the node's index. We only compute the node index if actually asked for the range.
1170 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
1172 (khtml::TextIterator::handleTextBox): Ditto.
1173 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
1175 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
1176 (khtml::TextIterator::exitNode): More of the same.
1177 (khtml::TextIterator::emitCharacter): Ditto.
1178 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
1179 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
1183 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
1187 2004-12-20 Ken Kocienda <kocienda@apple.com>
1191 * khtml/editing/htmlediting.cpp:
1192 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
1193 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1194 Rolling out until I can develop a real fix.
1196 2004-12-20 David Harrison <harrison@apple.com>
1198 Reviewed by Dave Hyatt.
1200 Initial checkin of AXTextMarkerRef support.
1202 * khtml/xml/dom_docimpl.cpp:
1203 (DocumentImpl::updateSelection):
1204 (DocumentImpl::setFocusNode):
1205 * kwq/KWQAccObject.h:
1206 * kwq/KWQAccObject.mm:
1207 (-[KWQAccObject detach]):
1208 (-[KWQAccObject anchorElement]):
1209 (-[KWQAccObject addChildrenToArray:]):
1210 (-[KWQAccObject accessibilityAttributeNames]):
1211 (-[KWQAccObject accessibilityActionDescription:]):
1212 (-[KWQAccObject accessibilityPerformAction:]):
1213 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
1214 (-[KWQAccObject textMarkerForVisiblePosition:]):
1215 (-[KWQAccObject visiblePositionForTextMarker:]):
1216 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
1217 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
1218 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1219 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1220 (-[KWQAccObject accessibilityAttributeValue:]):
1221 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1222 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
1223 (-[KWQAccObject getSelectedTextMarkerRange]):
1224 (-[KWQAccObject doAXLineForTextMarker:]):
1225 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1226 (-[KWQAccObject doAXStringForTextMarkerRange:]):
1227 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
1228 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
1229 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
1230 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
1231 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1232 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1233 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1234 (-[KWQAccObject accessibilityFocusedUIElement]):
1235 (-[KWQAccObject clearChildren]):
1236 (-[KWQAccObject accObjectID]):
1237 (-[KWQAccObject setAccObjectID:]):
1238 (-[KWQAccObject removeAccObjectID]):
1239 * kwq/KWQAccObjectCache.h:
1240 * kwq/KWQAccObjectCache.mm:
1241 (KWQAccObjectCache::KWQAccObjectCache):
1242 (KWQAccObjectCache::~KWQAccObjectCache):
1243 (KWQAccObjectCache::getAccObjectID):
1244 (KWQAccObjectCache::removeAccObjectID):
1245 (KWQAccObjectCache::textMarkerForVisiblePosition):
1246 (KWQAccObjectCache::visiblePositionForTextMarker):
1248 2004-12-19 Darin Adler <darin@apple.com>
1250 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
1252 2004-12-19 Darin Adler <darin@apple.com>
1256 - a garbage collection fix
1258 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
1259 #ifndef to use #if (in practice, either is OK).
1260 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
1262 2004-12-17 David Hyatt <hyatt@apple.com>
1264 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
1266 Reviewed by kocienda
1268 * khtml/rendering/render_box.cpp:
1269 (RenderBox::calcPercentageHeight):
1270 * khtml/rendering/render_table.cpp:
1271 (RenderTableSection::layoutRows):
1273 2004-12-17 David Harrison <harrison@apple.com>
1275 Reviewed by Ken Kocienda.
1277 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
1279 * khtml/editing/visible_units.cpp:
1280 (khtml::endOfParagraph):
1281 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
1283 2004-12-17 Ken Kocienda <kocienda@apple.com>
1287 * khtml/editing/htmlediting.cpp:
1288 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
1289 codes when I added the createBreakElement() function.
1291 2004-12-17 Richard Williamson <rjw@apple.com>
1293 Set the floor of max cacheable object size to 40K. This restores
1294 the long standing floor. Lower floor deleteriously impacts the PLT.
1297 * khtml/khtml_part.cpp:
1298 (KHTMLPart::checkCompleted):
1299 * khtml/misc/loader.cpp:
1302 2004-12-17 Ken Kocienda <kocienda@apple.com>
1308 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1310 * khtml/editing/htmlediting.cpp:
1311 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
1312 Formerly checked only for block boundary.
1314 2004-12-17 David Harrison <harrison@apple.com>
1318 Add KWQCFAutorelease for autoreleasing CF objects.
1319 * kwq/KWQFoundationExtras.h:
1323 2004-12-17 David Harrison <harrison@apple.com>
1327 Fix GC compatibility in getNSString.
1330 (QString::getNSString):
1331 Use NSString allocator instead of CFString, so that autorelease works under GC.
1333 2004-12-17 Ken Kocienda <kocienda@apple.com>
1339 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
1341 * khtml/editing/htmlediting.cpp:
1342 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
1343 move it after the <body> element.
1345 2004-12-17 Ken Kocienda <kocienda@apple.com>
1349 Added new layout tests covering cases from recent bug fixes.
1351 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
1352 * layout-tests/editing/inserting/insert-div-018.html: Added.
1353 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
1354 * layout-tests/editing/inserting/insert-div-019.html: Added.
1355 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
1356 * layout-tests/editing/inserting/insert-div-020.html: Added.
1357 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
1358 * layout-tests/editing/inserting/insert-div-021.html: Added.
1360 2004-12-17 Ken Kocienda <kocienda@apple.com>
1364 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
1366 * layout-tests/editing/inserting/insert-div-013-expected.txt
1367 * layout-tests/editing/inserting/insert-div-014-expected.txt
1369 2004-12-17 Ken Kocienda <kocienda@apple.com>
1375 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
1377 * khtml/editing/htmlediting.cpp:
1378 (khtml::InsertParagraphSeparatorCommand::doApply):
1379 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
1380 block as the reference node for the insertion of the new block.
1381 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
1382 I worked this all out on the whiteboard this time. This should be the last tweak.
1384 2004-12-17 Kevin Decker <kdecker@apple.com>
1388 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
1390 * khtml/xml/xml_tokenizer.cpp:
1391 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
1393 2004-12-16 Ken Kocienda <kocienda@apple.com>
1399 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
1401 * khtml/editing/htmlediting.cpp:
1402 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
1403 it checks the downstream node for the starting position.
1405 2004-12-16 Ken Kocienda <kocienda@apple.com>
1409 Added new createBreakElement() function that makes creating a <br> element a one-liner.
1410 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
1411 over to this new helper.
1413 * khtml/editing/htmlediting.cpp:
1414 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
1415 (khtml::InsertLineBreakCommand::doApply): Ditto.
1416 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1417 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1418 (khtml::ReplaceSelectionCommand::doApply): Ditto.
1419 (khtml::createBreakElement): New helper.
1420 * khtml/editing/htmlediting.h: Ditto.
1422 2004-12-16 David Hyatt <hyatt@apple.com>
1424 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
1425 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
1427 Reviewed by kocienda
1429 * khtml/rendering/render_object.cpp:
1430 (RenderObject::getVerticalPosition):
1432 2004-12-16 Ken Kocienda <kocienda@apple.com>
1438 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
1439 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
1441 * khtml/editing/htmlediting.cpp:
1442 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
1443 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
1444 a check which may move the node used as the reference node for the insertion. Also change this code to
1445 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
1446 to want to shift into the new <p>.
1448 2004-12-16 Darin Adler <darin@apple.com>
1452 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
1453 after talking this over with Dave and Ken
1455 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
1456 * khtml/editing/htmlediting.cpp:
1457 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
1458 helper so this can share code with the plain-text conversion code.
1459 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
1460 helper so this can share code with the plain-text conversion code.
1461 (khtml::createDefaultParagraphElement): Added.
1462 (khtml::createBlockPlaceholderElement): Added.
1464 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
1465 <br> elements for pasting plain text.
1467 - regenerated these files with the newer gperf
1469 * khtml/css/cssproperties.c: Regenerated.
1470 * khtml/css/cssvalues.c: Regenerated.
1471 * khtml/misc/htmlattrs.c: Regenerated.
1472 * khtml/misc/htmltags.c: Regenerated.
1474 2004-12-16 Ken Kocienda <kocienda@apple.com>
1480 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
1482 * khtml/xml/dom_nodeimpl.cpp:
1483 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
1484 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
1485 it stops looking in this situation. This problem eventually caused the delete code to try to
1486 merge a node under a descendent.
1488 2004-12-16 Adele Amchan <adele@apple.com>
1490 Change by Richard, reviewed by me.
1492 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
1494 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
1496 2004-12-16 Adele Amchan <adele@apple.com>
1500 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
1502 Added a call to ObjectImp::get before Window::get just returns Undefined.
1503 This was preventing us from getting the toString function from a Window object.
1505 * khtml/ecma/kjs_window.cpp: (Window::get):
1507 2004-12-16 Ken Kocienda <kocienda@apple.com>
1513 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
1515 * khtml/editing/htmlediting.cpp:
1516 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
1517 to do a better job than it was doing before. Added several test cases to prove I am on a
1519 * khtml/editing/visible_position.cpp:
1520 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
1521 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
1522 This function was returning true for the first position in "bar". Wrong. Also tightened up other
1523 rule: Should not report true when relationship between blocks cannot be determined.
1524 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
1525 when relationship between blocks cannot be determined.
1526 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
1527 * layout-tests/editing/inserting/insert-div-010.html: Added.
1528 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
1529 * layout-tests/editing/inserting/insert-div-011.html: Added.
1530 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
1531 * layout-tests/editing/inserting/insert-div-012.html: Added.
1532 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
1533 * layout-tests/editing/inserting/insert-div-013.html: Added.
1534 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
1535 * layout-tests/editing/inserting/insert-div-014.html: Added.
1536 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
1537 * layout-tests/editing/inserting/insert-div-015.html: Added.
1538 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
1539 * layout-tests/editing/inserting/insert-div-016.html: Added.
1540 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
1541 * layout-tests/editing/inserting/insert-div-017.html: Added.
1543 2004-12-16 Ken Kocienda <kocienda@apple.com>
1547 Added a layout test based on my last checkin.
1549 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
1550 * layout-tests/editing/selection/move-by-word-001.html: Added.
1552 2004-12-16 Ken Kocienda <kocienda@apple.com>
1558 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
1560 * khtml/editing/visible_text.cpp:
1561 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
1562 backwards into a different block that is an descendent of the block containing the text node (as in leaving
1563 the "bar" node in this example: <p>foo</p>bar).
1564 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
1565 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
1566 it is called from there, and now also from advance().
1568 2004-12-15 Darin Adler <darin@apple.com>
1572 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
1574 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
1575 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
1576 type altogether and use the render tree instead.
1578 2004-12-14 John Sullivan <sullivan@apple.com>
1582 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
1583 in the menu, no specific action names
1585 * khtml/editing/edit_actions.h: new header, contains EditAction enum
1586 (renamed from HTMLEditAction, formerly in htmlediting.h)
1588 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
1590 * khtml/editing/htmlediting.h:
1591 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
1592 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
1594 * khtml/editing/htmlediting.cpp:
1595 (khtml::EditCommandPtr::editingAction):
1596 update for enum name change
1597 (khtml::EditCommand::editingAction):
1599 (khtml::ApplyStyleCommand::ApplyStyleCommand):
1600 added editingAction parameter to this constructor
1601 (khtml::ApplyStyleCommand::editingAction):
1603 (khtml::DeleteSelectionCommand::editingAction):
1604 update for enum name change
1605 (khtml::MoveSelectionCommand::editingAction):
1607 (khtml::TypingCommand::editingAction):
1609 (khtml::ReplaceSelectionCommand::editingAction):
1612 * khtml/khtml_part.h:
1613 added EditAction parameter to applyStyle and computeAndSetTypingStyle
1614 * khtml/khtml_part.cpp:
1615 (KHTMLPart::computeAndSetTypingStyle):
1616 added EditAction parameter
1617 (KHTMLPart::applyStyle):
1620 * kwq/KWQKHTMLPart.mm:
1621 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1622 do the cast from EditAction to WebUndoAction a different way to match other code
1624 * kwq/WebCoreBridge.h:
1625 * kwq/WebCoreBridge.mm:
1626 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
1627 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
1628 (-[WebCoreBridge applyStyle:withUndoAction:]):
1631 * WebCore.pbproj/project.pbxproj:
1632 updated for new files
1634 2004-12-14 David Hyatt <hyatt@apple.com>
1636 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
1637 the ridiculous 1024 limit on the span values.
1639 * khtml/html/html_tableimpl.cpp:
1640 (HTMLTableCellElementImpl::parseHTMLAttribute):
1641 * khtml/rendering/render_table.cpp:
1642 (RenderTableCell::collapsedBottomBorder):
1643 * khtml/rendering/render_table.h:
1644 (khtml::RenderTableCell::colSpan):
1645 (khtml::RenderTableCell::setColSpan):
1646 (khtml::RenderTableCell::rowSpan):
1647 (khtml::RenderTableCell::setRowSpan):
1648 (khtml::RenderTableCol::span):
1649 (khtml::RenderTableCol::setSpan):
1651 2004-12-14 David Hyatt <hyatt@apple.com>
1653 Make sure <col> and <colgroup> can have spans updated dynamically as well.
1657 * khtml/html/html_tableimpl.cpp:
1658 (HTMLTableColElementImpl::parseHTMLAttribute):
1659 * khtml/rendering/render_table.cpp:
1660 (RenderTableCell::updateFromElement):
1661 (RenderTableCol::updateFromElement):
1663 2004-12-14 David Hyatt <hyatt@apple.com>
1665 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
1669 * khtml/html/html_tableimpl.cpp:
1670 (HTMLTableCellElementImpl::parseHTMLAttribute):
1671 * khtml/rendering/render_table.cpp:
1672 (RenderTableCell::RenderTableCell):
1673 (RenderTableCell::updateFromElement):
1675 2004-12-14 Chris Blumenberg <cblu@apple.com>
1677 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1681 * khtml/editing/markup.cpp:
1682 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
1684 2004-12-14 David Hyatt <hyatt@apple.com>
1686 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
1687 This is actually a regression from my positioned object DHTML optimization.
1689 Reviewed by kocienda
1691 * khtml/rendering/render_object.cpp:
1692 (RenderObject::setStyle):
1694 2004-12-14 David Hyatt <hyatt@apple.com>
1696 Make sure the class attribute works when newlines are present in the attribute.
1698 Reviewed by kocienda
1700 * khtml/html/html_elementimpl.cpp:
1701 (HTMLNamedAttrMapImpl::parseClassAttribute):
1703 2004-12-14 David Hyatt <hyatt@apple.com>
1705 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
1706 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
1707 read by splitting it into two separate functions.
1709 Reviewed by kocienda
1711 * khtml/rendering/render_block.cpp:
1712 (khtml::RenderBlock::layoutBlockChildren):
1713 (khtml::RenderBlock::clearFloats):
1714 (khtml::RenderBlock::addOverhangingFloats):
1715 (khtml::RenderBlock::addIntrudingFloats):
1716 * khtml/rendering/render_block.h:
1718 2004-12-14 John Sullivan <sullivan@apple.com>
1722 - added Undo action names for Cut, Paste, and Drag
1724 * khtml/editing/htmlediting.h:
1725 * khtml/editing/htmlediting.cpp:
1726 (khtml::DeleteSelectionCommand::editingAction):
1727 overridden to return HTMLEditActionCut
1728 (khtml::MoveSelectionCommand::editingAction):
1729 overridden to return HTMLEditActionDrag
1730 (khtml::ReplaceSelectionCommand::editingAction):
1731 overridden to return HTMLEditActionPaste
1733 2004-12-14 John Sullivan <sullivan@apple.com>
1737 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
1738 no specific action names
1740 The remaining step is to make each EditCommand subclass override editingAction() to return an
1741 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
1742 is not completely straightforward, so this next step isn't trivial.)
1744 * khtml/editing/htmlediting.h:
1745 new enum for HTMLEditAction
1747 * khtml/editing/htmlediting.cpp:
1748 (khtml::EditCommandPtr::editingAction):
1749 new method, calls through to EditCommand
1750 (khtml::EditCommand::editingAction):
1751 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
1752 (khtml::TypingCommand::editingAction):
1753 proof of concept override, returns HTMLEditActionTyping
1755 * kwq/KWQKHTMLPart.h:
1756 declare new private bottleneck method registerCommandForUndoOrRedo
1757 * kwq/KWQKHTMLPart.mm:
1758 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1759 new bottleneck method to reduce code duplication; now calls over the bridge
1760 to get the localized string to use for the Undo action name
1761 (KWQKHTMLPart::registerCommandForUndo):
1762 now calls new bottleneck method
1763 (KWQKHTMLPart::registerCommandForRedo):
1764 now calls new bottleneck method
1766 * kwq/WebCoreBridge.h:
1767 new enum for WebUndoAction, maps directly to HTMLEditAction.
1768 Declaration of nameForUndoAction:
1770 2004-12-14 Darin Adler <darin@apple.com>
1774 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
1776 * khtml/rendering/render_frames.cpp:
1777 (RenderPart::~RenderPart): Check widget for nil.
1778 (RenderPart::setWidget): Ditto.
1779 (RenderFrame::slotViewCleared): Ditto.
1780 (RenderPartObject::slotViewCleared): Ditto.
1782 2004-12-13 Darin Adler <darin@apple.com>
1786 - moved markup-related functions into new sources files in the editing directory
1787 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
1789 * ForwardingHeaders/editing/markup.h: Added.
1790 * khtml/editing/markup.h: Added.
1791 * khtml/editing/markup.cpp: Added.
1793 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
1795 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
1796 * khtml/html/html_elementimpl.cpp:
1797 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
1798 (HTMLElementImpl::outerHTML): Ditto.
1800 * khtml/ecma/kjs_window.cpp:
1801 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
1802 (Window::retrieveActive): Ditto.
1804 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
1805 * khtml/xml/dom_docimpl.h: Ditto.
1807 * khtml/khtml_part.cpp:
1808 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
1809 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
1811 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
1812 still works even with the additional replace overloads added to QString.
1813 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
1815 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
1816 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
1817 * khtml/rendering/render_object.cpp: Ditto.
1818 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
1820 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
1821 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
1822 the support code into markup.cpp.
1824 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
1825 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1827 * khtml/xml/dom_position.cpp:
1828 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
1829 so these return null positions rather than raising exceptions.
1830 (DOM::endPosition): Ditto.
1832 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
1833 * kwq/KWQFrame.h: Ditto.
1834 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
1835 * kwq/KWQKPartsPart.h: Ditto.
1836 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
1837 * kwq/KWQScrollView.h: Ditto.
1838 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
1839 * kwq/KWQKHTMLPart.h: Ditto.
1840 * kwq/KWQKHTMLPart.mm:
1841 (KHTMLView::isKHTMLView): Ditto.
1842 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
1843 replace overloads added to QString.
1844 (KWQKHTMLPart::setStatusBarText): Ditto.
1845 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
1846 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
1847 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
1848 (KWQKHTMLPart::attributedString): Ditto.
1849 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
1850 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
1852 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
1854 (QObject::inherits): Changed to not use dynamic cast.
1855 (QObject::isKHTMLPart): Added. Returns false.
1856 (QObject::isKHTMLView): Ditto.
1857 (QObject::isKPartsReadOnlyPart): Ditto.
1858 (QObject::isQFrame): Ditto.
1859 (QObject::isQScrollView): Ditto.
1861 * kwq/KWQRenderTreeDebug.cpp:
1862 (write): Changed to use inherits rather than dynamic_cast.
1863 (writeSelection): Ditto.
1865 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
1866 than going straight on to the "no parameters at all" version.
1869 * kwq/KWQString.mm: (QString::replace): Added overloads.
1870 * kwq/WebCoreBridge.mm:
1871 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
1872 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
1873 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
1874 the additional replace overloads added to QString.
1875 (-[WebCoreBridge stringForRange:]): Ditto.
1876 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
1877 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
1878 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
1879 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
1881 2004-12-13 Ken Kocienda <kocienda@apple.com>
1887 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
1889 * khtml/editing/htmlediting.cpp:
1890 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
1891 leading and trailing whitespace positions was reversed! I must have introduced this error recently
1892 when changing around this code.
1894 2004-12-13 David Hyatt <hyatt@apple.com>
1896 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
1897 and painting was using the wrong rect when setting up the x/y of the rect.
1901 * khtml/rendering/render_block.cpp:
1902 (khtml::RenderBlock::paint):
1903 (khtml::RenderBlock::nodeAtPoint):
1904 * khtml/rendering/render_object.h:
1905 (khtml::RenderObject::floatRect):
1907 2004-12-13 Ken Kocienda <kocienda@apple.com>
1913 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
1915 Code to figuire out the end node to merge was missing the font tag in the second paragraph
1916 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
1918 * khtml/editing/htmlediting.cpp:
1919 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
1920 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
1921 insufficiently powerful.
1922 (khtml::ReplacementFragment::enclosingBlock): New helper function.
1923 * khtml/editing/htmlediting.h: Add declaration for new helper function.
1924 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
1925 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
1927 2004-12-13 Ken Kocienda <kocienda@apple.com>
1931 WebCore side of fix for this bug:
1933 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
1935 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
1936 bug. This change involves our half of the needed changes.
1938 Note that a lot of this change has to do with changing code to use a <br> element instead of
1939 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
1940 other places, code to handle comments in markup can be removed since we do not use comments for
1941 such annotations after this change.
1943 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
1944 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
1945 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
1946 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
1947 convertedSpaceSpanClassString to match other uses of the idiom used here.
1948 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1949 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
1950 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1951 * khtml/html/html_elementimpl.cpp:
1952 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
1953 annotate fragments with comments any longer.
1954 * khtml/html/html_elementimpl.h: Ditto.
1955 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
1956 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
1957 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
1958 spurious semi-colon.
1959 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
1960 * kwq/WebCoreBridge.mm:
1961 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
1962 in DOM when calling createContextualFragment().
1964 2004-12-10 John Sullivan <sullivan@apple.com>
1966 fixed deployment build bustage that John Louch ran into
1968 * kwq/KWQTextEdit.mm:
1969 (QTextEdit::setScrollBarModes):
1970 move bool declaration inside exception-handling block to avoid obscure
1973 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1975 Reviewed by Richard.
1977 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
1980 (QWidget::setFocus): Handle the case where setting focus removed
1981 us from the superview - this can happen due to style changes on
1984 2004-12-10 Ken Kocienda <kocienda@apple.com>
1990 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
1992 There are a number of interesting things we could do to fix this bug, including SPI and involving
1993 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
1994 will fix the bug in the general case until such time as we can come up with more specific
1997 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
2000 * khtml/editing/htmlediting.cpp:
2001 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
2002 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
2003 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
2004 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
2006 2004-12-10 Darin Adler <darin@apple.com>
2010 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
2012 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
2013 * khtml/rendering/render_form.cpp:
2014 (RenderSubmitButton::rawText): Convert to QChar explicitly.
2015 (RenderLineEdit::updateFromElement): Ditto.
2016 (RenderLineEdit::slotTextChanged): Ditto.
2017 (RenderSelect::updateFromElement): Ditto.
2018 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
2019 that requires a derived class. Now we don't use this class at all for WebCore, but they still
2021 (TextAreaWidget::event): Moved out the ifdefs.
2022 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
2023 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
2024 now done in setStyle.
2025 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
2026 that's needed and WebCore no longer has TextAreaWidget.
2027 (RenderTextArea::calcMinMaxWidth): Ditto.
2028 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
2030 (RenderTextArea::updateFromElement): Use type QTextEdit.
2031 (RenderTextArea::text): Ditto.
2032 (RenderTextArea::select): Ditto.
2034 * kwq/KWQTextArea.mm:
2035 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
2036 since it's now handled by QTextEdit.
2037 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
2039 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
2040 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
2041 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
2043 2004-12-10 Ken Kocienda <kocienda@apple.com>
2049 <rdar://problem/3915047> HItting return in empty document inserts <p> but
2050 insertion point does not move
2052 * khtml/editing/htmlediting.cpp:
2053 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
2054 code to insert the <p> element for the return is not detecting the fact
2055 that the document is empty. Inserting a <p> into an empty body will not
2056 "add a new line" as the user expects. With this change, we'll add a second
2057 <p> when the root editable element has no rendered kids.
2059 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2063 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
2065 * khtml/html/html_miscimpl.cpp:
2066 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
2067 the initial one step, otherwise we might inadvertantly step
2068 outside the collection base, thereby causing assertion failures or
2069 other badness later.
2071 2004-12-10 Ken Kocienda <kocienda@apple.com>
2075 * khtml/editing/htmlediting.cpp:
2076 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
2077 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
2078 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
2079 should do nothing if the starting point for the selection is itself the starting block.
2080 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
2081 function, though the names and concepts are slightly different.
2083 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2087 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
2089 * khtml/dom/html_document.cpp:
2090 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
2091 * khtml/dom/html_document.h:
2092 * khtml/ecma/kjs_html.cpp:
2093 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
2094 * khtml/html/html_miscimpl.cpp:
2095 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
2096 the items that can be accessed directly as a document propery, in particular forms, images,
2097 objects, applets and embeds.
2098 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
2099 (HTMLFormCollectionImpl::updateNameCache): Ditto.
2100 * khtml/html/html_miscimpl.h:
2101 (DOM::HTMLCollectionImpl::): Added new type.
2103 2004-12-10 Ken Kocienda <kocienda@apple.com>
2109 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
2111 * khtml/rendering/render_text.cpp:
2112 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
2114 2004-12-10 Ken Kocienda <kocienda@apple.com>
2120 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
2122 * khtml/editing/htmlediting.cpp:
2123 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
2124 that was removed from the document when pasting. This caused the disappearance. Now this
2125 is detected, and the selection is shifted to a node that is in the document.
2127 2004-12-09 Richard Williamson <rjw@apple.com>
2129 Check to disable threaded decoding during
2130 layout tests wasn't invoking function, just checking address of
2131 function, which would always return true.
2133 * kwq/WebCoreImageRendererFactory.m:
2134 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2136 2004-12-09 David Hyatt <hyatt@apple.com>
2138 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
2141 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
2142 all inlines when repainting.
2146 * khtml/rendering/render_block.cpp:
2147 (khtml::RenderBlock::layoutBlockChildren):
2148 * khtml/rendering/render_flow.cpp:
2149 (RenderFlow::getAbsoluteRepaintRect):
2151 2004-12-09 David Hyatt <hyatt@apple.com>
2153 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
2154 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
2155 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
2156 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
2160 * khtml/rendering/render_block.cpp:
2161 (khtml::RenderBlock::getClearDelta):
2162 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
2163 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
2164 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
2165 * layout-tests/fast/block/margin-collapse/102-expected.txt:
2166 * layout-tests/fast/block/margin-collapse/102.html:
2168 2004-12-09 Richard Williamson <rjw@apple.com>
2170 Fixed <rdar://problem/3914078> worldclock crashing gc related
2172 Use ProtectedValue for Context2D instance members.
2176 * khtml/ecma/kjs_html.h:
2178 2004-12-09 John Sullivan <sullivan@apple.com>
2182 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
2184 * kwq/KWQAccObject.mm:
2185 (-[KWQAccObject title]): moved image alt tag code out of here
2186 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
2187 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
2188 that ordinary elements return; this means that ordinary elements that aren't images will return
2189 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
2191 (-[KWQAccObject accessibilityAttributeValue:]):
2192 call accessibilityDescription when asked for AXDescription
2194 2004-12-09 Ken Kocienda <kocienda@apple.com>
2196 Reviewed by Harrison
2200 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
2202 * khtml/editing/htmlediting.cpp:
2203 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
2204 been deleted. If this is the case, set the destination to the node the delete command provides in
2205 its ending selection.
2209 2004-12-09 Ken Kocienda <kocienda@apple.com>
2215 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
2217 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
2218 callback may not be delivered before the program asks for the dimensions of an image in order to
2219 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
2220 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
2222 * kwq/KWQRenderTreeDebug.cpp:
2223 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
2224 (externalRepresentation): Sets debuggingRenderTree flag to true;
2225 * kwq/KWQRenderTreeDebug.h:
2226 * kwq/WebCoreImageRendererFactory.m:
2227 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
2228 do threaded decoding in any case if the flag is set.
2230 2004-12-09 Chris Blumenberg <cblu@apple.com>
2232 Fix for busting XMLHTTPRequest.
2234 Reviewed by kocienda.
2236 * khtml/misc/loader.cpp:
2237 (Loader::servePendingRequests): pass true for deliverAllData
2239 (KIO::get): take deliverAllData param
2240 (KIO::http_post): ditto
2241 * kwq/KWQKJobClasses.h:
2242 * kwq/KWQKJobClasses.mm:
2243 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
2244 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
2246 2004-12-09 Ken Kocienda <kocienda@apple.com>
2250 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
2252 * khtml/xml/dom_nodeimpl.cpp:
2253 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
2255 2004-12-07 Richard Williamson <rjw@apple.com>
2257 Support threaded image decoding on machines w/ > 2 CPUs.
2259 Reviewed by Maciej and Chris.
2261 * khtml/misc/loader.cpp:
2262 (CachedImageCallback::notifyUpdate):
2263 (CachedImageCallback::notifyFinished):
2264 (CachedImageCallback::notifyDecodingError):
2265 (CachedImageCallback::handleError):
2266 (CachedImageCallback::clear):
2267 (CachedImage::CachedImage):
2268 (CachedImage::clear):
2269 (CachedImage::data):
2270 (CachedImage::checkNotify):
2271 (Loader::servePendingRequests):
2272 (Loader::slotFinished):
2273 (Loader::numRequests):
2274 (Loader::cancelRequests):
2275 (Loader::removeBackgroundDecodingRequest):
2276 * khtml/misc/loader.h:
2277 (khtml::CachedImageCallback::CachedImageCallback):
2278 (khtml::CachedImageCallback::ref):
2279 (khtml::CachedImageCallback::deref):
2280 (khtml::CachedImage::decoderCallback):
2281 * khtml/rendering/render_object.cpp:
2282 (RenderObject::setPixmap):
2285 (-[WebImageCallback initWithCallback:khtml::]):
2286 (-[WebImageCallback _commonTermination]):
2287 (-[WebImageCallback dealloc]):
2288 (-[WebImageCallback finalize]):
2289 (-[WebImageCallback notify]):
2290 (-[WebImageCallback setImageSourceStatus:]):
2291 (-[WebImageCallback status]):
2292 (QPixmap::shouldUseThreadedDecoding):
2293 (QPixmap::receivedData):
2294 * kwq/WebCoreImageRenderer.h:
2295 * kwq/WebCoreImageRendererFactory.h:
2296 * kwq/WebCoreImageRendererFactory.m:
2297 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2298 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
2300 2004-12-07 Ken Kocienda <kocienda@apple.com>
2304 * khtml/editing/htmlediting.cpp:
2305 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
2306 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
2307 after new block has been inserted, otherwise a crash can result. Shuffle down call
2308 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
2311 2004-12-07 Ken Kocienda <kocienda@apple.com>
2317 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
2319 * khtml/editing/htmlediting.cpp:
2320 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
2321 for determining the location for inserting content. Do not allow an insert before or after if the
2322 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
2323 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
2324 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
2326 2004-12-07 Darin Adler <darin@apple.com>
2330 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
2332 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
2334 2004-12-07 Ken Kocienda <kocienda@apple.com>
2338 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
2339 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
2341 * khtml/editing/html_interchange.h: Name change, as described above.
2342 * khtml/editing/htmlediting.cpp:
2343 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
2344 * khtml/xml/dom2_rangeimpl.cpp:
2345 (DOM::RangeImpl::toHTML): Ditto.
2347 2004-12-07 Ken Kocienda <kocienda@apple.com>
2351 Added a couple more layout tests.
2353 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
2354 * layout-tests/editing/deleting/delete-line-013.html: Added.
2355 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
2356 * layout-tests/editing/deleting/delete-line-014.html: Added.
2358 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2362 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
2364 * kwq/KWQListBox.mm:
2365 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
2366 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
2367 (-[KWQListBoxScrollView widget]): See above.
2368 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
2369 afterMouseDown, to avoid triggering an assertion failure.
2371 2004-12-06 David Hyatt <hyatt@apple.com>
2373 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
2374 made by me, kocienda and harrison to just remove it.
2378 * khtml/rendering/bidi.cpp:
2379 (khtml::RenderBlock::layoutInlineChildren):
2380 * khtml/rendering/render_block.cpp:
2381 (khtml:::RenderFlow):
2382 * khtml/rendering/render_block.h:
2383 * khtml/rendering/render_flow.cpp:
2384 (RenderFlow::dirtyLinesFromChangedChild):
2386 2004-12-06 David Hyatt <hyatt@apple.com>
2388 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
2389 not a damage rect that can be changed when intersected with the clip regions of the web page.
2393 * khtml/rendering/render_canvas.h:
2394 (khtml::RenderCanvas::printRect):
2395 (khtml::RenderCanvas::setPrintRect):
2396 * khtml/rendering/render_flow.cpp:
2397 (RenderFlow::paintLines):
2398 * khtml/rendering/render_list.cpp:
2399 (RenderListMarker::paint):
2400 * kwq/KWQKHTMLPart.mm:
2401 (KWQKHTMLPart::adjustPageHeight):
2403 2004-12-06 David Harrison <harrison@apple.com>
2405 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
2407 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
2410 * khtml/rendering/render_flow.cpp:
2411 (RenderFlow::dirtyLinesFromChangedChild):
2412 Dirty the line above because new child can inval the cached line break position of previous line.
2414 2004-12-06 David Hyatt <hyatt@apple.com>
2416 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
2417 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
2418 3126929, handle top/left overflow.
2420 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
2422 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
2423 regions and web pages) has been fixed.
2427 * khtml/rendering/bidi.cpp:
2428 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2429 (khtml::RenderBlock::checkLinesForOverflow):
2430 * khtml/rendering/render_block.cpp:
2431 (khtml:::RenderFlow):
2432 (khtml::RenderBlock::overflowHeight):
2433 (khtml::RenderBlock::overflowWidth):
2434 (khtml::RenderBlock::overflowLeft):
2435 (khtml::RenderBlock::overflowTop):
2436 (khtml::RenderBlock::overflowRect):
2437 (khtml::RenderBlock::layoutBlock):
2438 (khtml::RenderBlock::layoutBlockChildren):
2439 (khtml::RenderBlock::paint):
2440 (khtml::RenderBlock::floatRect):
2441 (khtml::RenderBlock::lowestPosition):
2442 (khtml::RenderBlock::rightmostPosition):
2443 (khtml::RenderBlock::leftmostPosition):
2444 (khtml::RenderBlock::nodeAtPoint):
2445 * khtml/rendering/render_block.h:
2446 * khtml/rendering/render_box.h:
2447 (khtml::RenderBox::borderBox):
2448 (khtml::RenderBox::borderTopExtra):
2449 (khtml::RenderBox::borderBottomExtra):
2450 * khtml/rendering/render_layer.cpp:
2451 (RenderLayer::paintScrollbars):
2452 (mustExamineRenderer):
2453 (RenderLayer::intersectsDamageRect):
2454 (RenderLayer::containsPoint):
2455 * khtml/rendering/render_line.cpp:
2456 (khtml::InlineFlowBox::placeBoxesHorizontally):
2457 (khtml::InlineFlowBox::verticallyAlignBoxes):
2458 * khtml/rendering/render_line.h:
2459 (khtml::InlineBox::leftOverflow):
2460 (khtml::InlineBox::rightOverflow):
2461 (khtml::InlineFlowBox::setVerticalOverflowPositions):
2462 (khtml::RootInlineBox::RootInlineBox):
2463 (khtml::RootInlineBox::leftOverflow):
2464 (khtml::RootInlineBox::rightOverflow):
2465 (khtml::RootInlineBox::setVerticalOverflowPositions):
2466 (khtml::RootInlineBox::setHorizontalOverflowPositions):
2467 * khtml/rendering/render_object.h:
2468 (khtml::RenderObject::borderBox):
2469 (khtml::RenderObject::overflowLeft):
2470 (khtml::RenderObject::overflowTop):
2471 (khtml::RenderObject::overflowRect):
2472 (khtml::RenderObject::floatRect):
2473 * khtml/rendering/render_table.cpp:
2474 (RenderTable::layout):
2475 (RenderTable::paint):
2476 (RenderTable::paintBoxDecorations):
2477 (RenderTable::calcMinMaxWidth):
2478 * khtml/rendering/render_table.h:
2479 (khtml::RenderTableCell::borderTopExtra):
2480 (khtml::RenderTableCell::borderBottomExtra):
2485 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2489 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
2491 I changed all unprotected places that can navigate a different
2492 window or frame from script to check for a javascript: URL, and if
2493 found, to check for safety using cross-site-script rules.
2495 I considered a few other possible exploits and made no change:
2497 - document.location is already protected because the document
2498 object itself is protected
2500 - frame.src, frame.location, iframe.src and targetted links are
2501 all safe because setting the URL of a frame to a javascript: URL
2502 executes the script in the context of the parent
2504 * khtml/ecma/kjs_window.cpp:
2505 (WindowFunc::tryCall):
2507 (LocationFunc::tryCall):
2509 2004-12-06 Ken Kocienda <kocienda@apple.com>
2515 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
2517 * khtml/editing/htmlediting.cpp:
2518 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
2519 check for one of the special cases being checked for in this function. The specific case
2520 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
2521 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
2522 case where a selection ended in a <br> after a block and would not delete any part of the
2523 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
2526 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
2527 new use of the function exposed this bug:
2529 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
2531 * khtml/xml/dom_position.cpp:
2532 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
2533 not have this fatal flaw. It is a much better design as well.
2535 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
2536 have what I consider to be a better result. Going with it.
2538 2004-12-06 Chris Blumenberg <cblu@apple.com>
2540 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
2545 (-[DOMElement _font]): new SPI for AppKit
2548 2004-12-06 Darin Adler <darin@apple.com>
2552 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
2554 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
2555 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
2557 2004-12-06 John Sullivan <sullivan@apple.com>
2559 Darin found what appears to be the real leak that we were falsely blaming
2560 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
2561 sure nothing barfed.
2563 * khtml/css/cssparser.cpp:
2564 (CSSParser::parseValue):
2565 call clearProperties() instead of just setting numParsedProperties to 0
2566 (CSSParser::parseDeclaration):
2568 (CSSParser::createStyleDeclaration):
2571 2004-12-06 Ken Kocienda <kocienda@apple.com>
2577 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
2578 * layout-tests/editing/inserting/insert-div-001.html: Added.
2579 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
2580 * layout-tests/editing/inserting/insert-div-002.html: Added.
2581 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
2582 * layout-tests/editing/inserting/insert-div-003.html: Added.
2583 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
2584 * layout-tests/editing/inserting/insert-div-004.html: Added.
2585 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
2586 * layout-tests/editing/inserting/insert-div-005.html: Added.
2587 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
2588 * layout-tests/editing/inserting/insert-div-006.html: Added.
2589 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
2590 * layout-tests/editing/inserting/insert-div-007.html: Added.
2591 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
2592 * layout-tests/editing/inserting/insert-div-008.html: Added.
2593 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
2594 * layout-tests/editing/inserting/insert-div-009.html: Added.
2596 2004-12-06 Ken Kocienda <kocienda@apple.com>
2598 Reviewed by Harrison
2602 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
2604 * khtml/editing/htmlediting.cpp:
2605 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
2606 being added to this function. This ensures that the added block has a height.
2607 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2609 2004-12-06 Ken Kocienda <kocienda@apple.com>
2613 * khtml/dom/dom_string.cpp:
2614 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
2615 * khtml/dom/dom_string.h: Ditto.
2616 * khtml/editing/htmlediting.cpp:
2617 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
2618 RebalanceWhitespaceCommand instance.
2619 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
2620 (khtml::InsertLineBreakCommand::doApply): Ditto.
2621 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2622 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2623 (khtml::InsertTextCommand::input): Ditto.
2624 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
2625 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
2626 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2627 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
2628 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
2629 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
2630 * khtml/editing/htmlediting.h: Ditto.
2631 (khtml::RebalanceWhitespaceCommand::): Ditto.
2633 2004-12-05 Darin Adler <darin@apple.com>
2635 - fixed small problem in my check-in from yesterday
2638 (positionForEvent): Get location from event without raising exception if it's the wrong type.
2639 (clickCountForEvent): Same, for clickCount.
2640 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
2641 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
2642 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
2644 2004-12-04 Darin Adler <darin@apple.com>
2648 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
2650 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
2651 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
2652 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
2654 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
2656 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
2657 * khtml/rendering/render_form.cpp:
2658 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
2659 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
2660 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
2662 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
2663 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
2664 Added a fixState helper method so the constructors can save code.
2666 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
2667 and added a third constructor that uses the "current event" from AppKit (used above).
2668 (QMouseEvent::fixState): Compute state and click count based on event type.
2670 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
2672 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
2673 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
2674 underlying cause in CSS.
2676 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
2678 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
2679 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
2681 2004-12-03 Chris Blumenberg <cblu@apple.com>
2684 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2685 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2686 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2687 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
2689 Reviewed by darin, rjw, kocienda.
2691 * khtml/misc/loader.cpp:
2692 (CachedObject::~CachedObject):
2693 (CachedCSSStyleSheet::checkNotify):
2694 (Loader::servePendingRequests):
2695 (Loader::slotFinished):
2696 (Loader::slotReceivedResponse):
2697 (Cache::requestImage):
2698 (Cache::requestScript):
2699 * khtml/misc/loader.h:
2700 (khtml::CachedObject::CachedObject):
2701 (khtml::CachedObject::response):
2702 (khtml::CachedObject::allData):
2703 * kwq/KWQKJobClasses.h:
2704 * kwq/KWQKJobClasses.mm:
2705 (KIO::TransferJobPrivate::TransferJobPrivate):
2706 (KIO::TransferJobPrivate::~TransferJobPrivate):
2707 (KIO::TransferJob::TransferJob):
2708 (KIO::TransferJob::assembleResponseHeaders):
2709 (KIO::TransferJob::retrieveCharset):
2710 (KIO::TransferJob::emitResult):
2711 (KIO::TransferJob::emitReceivedResponse):
2714 (KWQHeaderStringFromDictionary):
2715 (KWQCheckCacheObjectStatus):
2716 (KWQIsResponseURLEqualToURL):
2718 (KWQResponseMIMEType):
2719 (KWQCacheObjectExpiresTime):
2720 (khtml::CachedObject::setResponse):
2721 (khtml::CachedObject::setAllData):
2725 * kwq/KWQResourceLoader.mm:
2726 (-[KWQResourceLoader finishJobAndHandle:]):
2727 (-[KWQResourceLoader cancel]):
2728 (-[KWQResourceLoader reportError]):
2729 (-[KWQResourceLoader finishWithData:]):
2737 * kwq/WebCoreBridge.h:
2738 * kwq/WebCoreResourceLoader.h:
2740 2004-12-04 Darin Adler <darin@apple.com>
2744 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
2746 * khtml/rendering/render_form.cpp:
2747 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
2748 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
2749 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
2750 (RenderSlider::slotSliderValueChanged): Ditto.
2752 2004-12-03 John Sullivan <sullivan@apple.com>
2756 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
2757 khtml::BackgroundLayer::cullEmptyLayers
2759 * khtml/rendering/render_style.cpp:
2760 (BackgroundLayer::cullEmptyLayers):
2761 added missing nil check
2765 2004-12-03 Ken Kocienda <kocienda@apple.com>
2769 Roll out some recent changes by Chris that caused a performance regression.
2770 Fix is in hand, but it is a little risky this close to a submission. So,
2771 we have decided to roll back the change with the regression and roll in
2772 the new code after we submit.
2774 * khtml/css/cssproperties.c:
2777 * khtml/css/cssvalues.c:
2780 * khtml/misc/htmlattrs.c:
2783 * khtml/misc/htmltags.c:
2786 * khtml/misc/loader.cpp:
2787 (CachedObject::~CachedObject):
2788 (CachedObject::setResponse):
2789 (CachedCSSStyleSheet::checkNotify):
2790 (Loader::servePendingRequests):
2791 (Loader::slotFinished):
2792 (Loader::slotReceivedResponse):
2793 (Cache::requestImage):
2794 (Cache::requestScript):
2795 * khtml/misc/loader.h:
2796 (khtml::CachedObject::CachedObject):
2797 (khtml::CachedObject::response):
2798 * kwq/KWQKJobClasses.h:
2799 * kwq/KWQKJobClasses.mm:
2800 (KIO::TransferJobPrivate::TransferJobPrivate):
2801 (KIO::TransferJobPrivate::~TransferJobPrivate):
2802 (KIO::TransferJob::TransferJob):
2803 (KIO::TransferJob::assembleResponseHeaders):
2804 (KIO::TransferJob::retrieveCharset):
2805 (KIO::TransferJob::emitResult):
2806 (KIO::TransferJob::emitReceivedResponse):
2809 (KWQHeaderStringFromDictionary):
2810 (KWQCheckCacheObjectStatus):
2811 (KWQRetainResponse):
2812 (KWQReleaseResponse):
2813 (KWQIsResponseURLEqualToURL):
2815 (KWQResponseMIMEType):
2816 (KWQResponseTextEncodingName):
2817 (KWQResponseHeaderString):
2818 (KWQCacheObjectExpiresTime):
2819 (KWQLoader::KWQLoader):
2823 * kwq/KWQResourceLoader.mm:
2824 (-[KWQResourceLoader finishJobAndHandle]):
2825 (-[KWQResourceLoader cancel]):
2826 (-[KWQResourceLoader reportError]):
2827 (-[KWQResourceLoader finish]):
2835 * kwq/WebCoreBridge.h:
2836 * kwq/WebCoreResourceLoader.h:
2838 2004-12-03 John Sullivan <sullivan@apple.com>
2842 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
2844 * kwq/KWQKHTMLPart.mm:
2845 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
2846 when checking whether we moved the focus to another view, make sure we didn't "move" it to
2847 our documentView, because that's no move at all.
2849 2004-12-03 Darin Adler <darin@apple.com>
2853 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
2855 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
2856 Added missing initialization for base class and node pointer.
2858 - fixed a few places that could leave dangling node pointers
2860 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
2861 Clear out the node pointer when the node is destroyed.
2862 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
2864 2004-12-03 Chris Blumenberg <cblu@apple.com>
2866 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.
2867 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2871 * khtml/misc/loader.cpp:
2872 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
2873 (Loader::slotFinished): take data param
2874 * khtml/misc/loader.h:
2875 * kwq/KWQKJobClasses.h:
2876 * kwq/KWQKJobClasses.mm:
2877 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
2878 (KIO::TransferJob::emitResult): take data param and pass it
2879 * kwq/KWQResourceLoader.mm:
2880 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
2881 (-[KWQResourceLoader cancel]): pass nil for data
2882 (-[KWQResourceLoader reportError]): ditto
2883 (-[KWQResourceLoader finishWithData:]): pass data
2885 (KWQSlot::KWQSlot): pass data param to slotFinished
2886 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
2888 2004-12-03 Ken Kocienda <kocienda@apple.com>
2892 Did some clean up in the Position class as a result of trying to write some new layout
2893 tests and discovering a bug along the way.
2895 I removed these three functions from the Position class:
2897 1. bool isFirstRenderedPositionOnLine() const;
2898 2. bool isLastRenderedPositionOnLine() const;
2899 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
2900 4. bool inFirstEditableInRootEditableElement() const;
2902 The first two have replacements in the VisiblePosition class, and some code has been
2903 moved to use these new variants. The third function was a helper used only by these
2904 first two function, and can be removed as well. The fourth function was not used by anyone.
2906 * khtml/editing/htmlediting.cpp:
2907 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2908 * khtml/editing/visible_position.cpp:
2909 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
2910 Incorrect results were being returned when asking about positions at the starts of blocks.
2911 * khtml/xml/dom_position.cpp:
2912 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2913 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
2914 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
2915 * khtml/xml/dom_position.h: Update header for deletions.
2917 2004-12-03 Ken Kocienda <kocienda@apple.com>
2921 Terminology change in execCommand command identifiers. Specifically, the name of
2922 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
2923 terminology used by AppKit. It is also more accurate, since the insertion of a
2924 "br" element is what the command does. The inspiration for this change is so the
2925 -insertNewline AppKit method can be mapped to insert a new "div" element in
2926 a document and avoid ambiguity with what the javascript editing command does.
2928 * khtml/editing/jsediting.cpp
2929 * layout-tests/editing/deleting/delete-tab-004.html
2930 * layout-tests/editing/editing.js
2931 * layout-tests/editing/inserting/insert-3654864-fix.html
2932 * layout-tests/editing/inserting/insert-3659587-fix.html
2933 * layout-tests/editing/inserting/insert-3775316-fix.html
2934 * layout-tests/editing/inserting/insert-3800346-fix.html
2935 * layout-tests/editing/inserting/insert-br-001.html
2936 * layout-tests/editing/inserting/insert-br-002.html
2937 * layout-tests/editing/inserting/insert-br-003.html
2938 * layout-tests/editing/inserting/insert-br-004.html
2939 * layout-tests/editing/inserting/insert-br-005.html
2940 * layout-tests/editing/inserting/insert-br-006.html
2941 * layout-tests/editing/inserting/insert-br-007.html
2942 * layout-tests/editing/inserting/insert-br-008.html
2943 * layout-tests/editing/inserting/insert-tab-004.html
2944 * layout-tests/editing/inserting/insert-text-with-newlines.html
2945 * layout-tests/editing/pasteboard/paste-text-010.html
2947 2004-12-02 Ken Kocienda <kocienda@apple.com>
2953 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2955 * khtml/editing/htmlediting.cpp:
2956 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
2957 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
2958 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
2959 in a block and the document is in quirks mode, add an additional br to make the one in the
2960 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
2961 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
2962 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
2964 2004-12-02 Richard Williamson <rjw@apple.com>
2966 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
2968 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
2969 the b/f cache won't incorrectly trash the previous state when restoring.
2973 * kwq/WebCoreBridge.h:
2974 * kwq/WebCoreBridge.mm:
2975 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
2976 (-[WebCoreBridge canCachePage]):
2977 (-[WebCoreBridge clear]):
2979 2004-12-02 Ken Kocienda <kocienda@apple.com>
2985 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
2987 * khtml/xml/dom2_rangeimpl.cpp:
2988 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
2989 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
2990 of this bug where there is content after the body tag). Did a little code clean up as well.
2991 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
2993 2004-12-02 Ken Kocienda <kocienda@apple.com>
2999 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
3001 * khtml/khtml_part.cpp:
3002 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
3003 to figure out which end of the selection to extend.
3005 2004-12-02 David Harrison <harrison@apple.com>
3007 Reviewed by Ken Kocienda.
3009 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
3010 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
3012 * khtml/editing/visible_text.cpp:
3013 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3014 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
3015 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
3016 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
3017 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
3018 Distinguish BR from whitespace.
3019 * khtml/editing/visible_text.h:
3020 Distinguish BR from whitespace.
3021 * khtml/editing/visible_units.cpp:
3022 (khtml::previousWordBoundary):
3023 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.
3025 2004-12-02 Ken Kocienda <kocienda@apple.com>
3031 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
3033 * khtml/xml/dom_position.cpp:
3034 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
3035 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
3036 exception trying to use a Position returned from this function to set the boundary point of a Range (which
3037 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
3038 contract to return a range-compliant position, hence the need for this fix.
3040 2004-12-01 Ken Kocienda <kocienda@apple.com>
3046 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
3047 regard to other editing commands. The class had a name change ages ago, and it was never
3049 * khtml/editing/htmlediting.h: Ditto.
3051 2004-12-01 Ken Kocienda <kocienda@apple.com>
3055 Some improvements for paste, including some new code to annotate
3056 whitespace when writing to the pasteboard to ensure that the meaning
3057 of the markup on the pasteboard is unambiguous.
3059 There is also new code for reading this annotated markup from the pasteboard,
3060 removing the nodes that were added only to prevent ambiguity.
3062 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
3063 The header should have been added earlier, but I did not do so.
3064 * khtml/editing/html_interchange.cpp: Added.
3065 (convertHTMLTextToInterchangeFormat):
3066 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
3067 * khtml/editing/htmlediting.cpp:
3068 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
3069 Also fixed a bug in the code that counts blocks in a fragment.
3070 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
3071 (khtml::ReplacementFragment::insertNodeBefore): New helper.
3072 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
3073 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
3074 * khtml/editing/htmlediting.h: Add some new declarations.
3075 * khtml/xml/dom2_rangeimpl.cpp:
3076 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
3077 * khtml/xml/dom_nodeimpl.cpp:
3078 (NodeImpl::stringValueForRange): New helper.
3079 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
3080 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
3081 should be added. Called by the paste code.
3082 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
3084 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
3085 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
3086 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
3088 2004-11-30 Chris Blumenberg <cblu@apple.com>
3090 * ChangeLog: removed conflict marker
3092 2004-11-30 Chris Blumenberg <cblu@apple.com>
3095 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
3096 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
3100 * khtml/misc/loader.cpp:
3101 (CachedObject::~CachedObject): release m_allData
3102 (CachedObject::setAllData): new
3103 (Loader::servePendingRequests): connect slotAllData
3104 (Loader::slotAllData): new
3105 (Cache::requestImage): tweak
3106 * khtml/misc/loader.h:
3107 (khtml::CachedObject::CachedObject): set allData to 0
3108 (khtml::CachedObject::allData): new
3109 * kwq/KWQKJobClasses.h:
3110 * kwq/KWQKJobClasses.mm:
3111 (KIO::TransferJob::TransferJob): set m_allData
3112 (KIO::TransferJob::emitAllData): new
3114 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
3115 * kwq/KWQResourceLoader.mm:
3116 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
3118 (KWQSlot::KWQSlot): support for slotAllData
3120 * kwq/WebCoreBridge.h:
3121 * kwq/WebCoreResourceLoader.h:
3123 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3127 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3131 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
3133 * khtml/khtml_part.cpp:
3134 (KHTMLPart::begin): call setParsing on document here after opening
3135 - from now on we'll only set parsing to true for a document open
3136 caused by page loading, not a programmatic one.
3137 * khtml/xml/dom_docimpl.cpp:
3138 (DocumentImpl::open): don't setParsing to true here any more.
3140 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3144 - fix recent regression from collection perf fixes.
3146 * khtml/html/html_miscimpl.cpp:
3147 (HTMLFormCollectionImpl::updateNameCache): Look up the name
3148 attribute in the name cache, not the id cache (d'oh!)
3150 2004-11-30 Darin Adler <darin@apple.com>
3154 - rolled in a KDE fix for a problem that may underlie a number of crashes
3156 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
3157 the KDE guys to fix a subtle problem. Code said "n = n =".
3159 - rolled in a KDE fix for a containingBlock crash
3161 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
3162 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
3165 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
3168 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
3169 (-[KWQButton detachQButton]): Added.
3170 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
3171 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
3172 (-[KWQButton widget]): Added.
3173 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
3174 (-[KWQButton resignFirstResponder]): Ditto.
3175 (-[KWQButton canBecomeKeyView]): Ditto.
3176 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
3177 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
3179 * kwq/KWQComboBox.mm:
3180 (QComboBox::~QComboBox): Call detachQComboBox.
3181 (-[KWQPopUpButtonCell detachQComboBox]): Added.
3182 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
3183 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
3184 (-[KWQPopUpButton action:]): Ditto.
3185 (-[KWQPopUpButton widget]): Tweaked.
3186 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
3187 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
3188 (-[KWQPopUpButton resignFirstResponder]): Ditto.
3189 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
3191 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
3193 * kwq/KWQListBox.mm:
3194 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
3196 * kwq/KWQScrollBar.h: Removed m_scroller field.
3197 * kwq/KWQScrollBar.mm:
3198 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
3199 (-[KWQScrollBar detachQScrollBar]): Added.
3200 (-[KWQScrollBar widget]): Added.
3201 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
3202 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
3203 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
3204 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
3205 (QScrollBar::setKnobProportion): Ditto.
3206 (QScrollBar::scrollbarHit): Ditto.
3208 * kwq/KWQScrollView.mm:
3209 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
3210 hack where we don't remove right away when doing mouse tracking.
3211 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
3212 the hack where we don't add right away when doing mouse tracking.
3214 * kwq/KWQSlider.h: Added destructor.
3216 (-[KWQSlider initWithQSlider:]): Tweaked a little.
3217 (-[KWQSlider detachQSlider]): Added.
3218 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
3219 (-[KWQSlider widget]): Added.
3220 (QSlider::~QSlider): Added. Calls detachQSlider.
3222 * kwq/KWQTextArea.h: Added detachQTextEdit method.
3223 * kwq/KWQTextArea.mm:
3224 (-[KWQTextArea detachQTextEdit]): Added.
3225 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
3226 (-[KWQTextArea becomeFirstResponder]): Ditto.
3227 (-[KWQTextArea nextKeyView]): Ditto.
3228 (-[KWQTextArea previousKeyView]): Ditto.
3229 (-[KWQTextArea drawRect:]): Ditto.
3230 (-[KWQTextAreaTextView insertTab:]): Ditto.
3231 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
3232 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
3233 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
3234 (-[KWQTextAreaTextView mouseDown:]): Ditto.
3235 (-[KWQTextAreaTextView keyDown:]): Ditto.
3236 (-[KWQTextAreaTextView keyUp:]): Ditto.
3238 * kwq/KWQTextEdit.h: Added ~QTextEdit.
3239 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
3241 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
3242 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
3244 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
3245 Added beforeMouseDown and afterMouseDown for use in widget implementations.
3246 Removed unused hasMouseTracking function.
3248 (QWidget::QWidget): Initialize two new fields.
3249 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
3250 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
3251 (QWidget::addToSuperview): Added.
3252 (QWidget::removeFromSuperview): Added.
3253 (QWidget::beforeMouseDown): Added.
3254 (QWidget::afterMouseDown): Added.
3256 * khtml/rendering/render_layer.cpp:
3257 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
3258 (RenderLayer::setHasVerticalScrollbar): Ditto.
3260 2004-11-30 Ken Kocienda <kocienda@apple.com>
3266 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
3268 * khtml/khtml_part.cpp:
3269 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
3270 with no blink if it is.
3272 2004-11-30 Ken Kocienda <kocienda@apple.com>
3278 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
3280 * khtml/khtml_part.cpp:
3281 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
3282 or <input type=image> was checked for focus since these elements are keyboard-focusable,
3283 but not mouse focusable. Also, this function did not work hard enough to set the focused
3284 node, and was content to clear it if the first element checked failed the test, rather
3285 than looking more at parents. This would have the effect of clearing, then resetting the
3286 focus on a DIV containing a button or image with content on either side of it in the
3287 process of arrowing over such content.
3289 2004-11-30 Ken Kocienda <kocienda@apple.com>
3293 * khtml/editing/htmlediting.cpp:
3294 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
3295 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
3296 * khtml/khtml_part.cpp:
3297 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
3298 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
3299 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
3300 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
3301 isCharacterSmartReplaceExempt virtual.
3303 2004-11-30 Ken Kocienda <kocienda@apple.com>
3307 * khtml/editing/htmlediting.cpp:
3308 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
3309 Seemed simple enough to land without review.
3311 2004-11-29 Ken Kocienda <kocienda@apple.com>
3315 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
3316 are handled correctly now, including selections that span multiple blocks, and cases
3317 where content on the pasteboard ends in newlines (or what appear to be newlines to a
3318 user, really block ends or BRs). I also made one small, but important change in the
3319 copy code to annotate the markup written to the pasteboard to support these selections
3322 New header that defines a couple of constants used in copying and pasting.
3324 * ForwardingHeaders/editing/html_interchange.h: Added.
3325 * khtml/editing/html_interchange.h: Added.