1 2005-01-13 David Harrison <harrison@apple.com>
3 Reviewed by Ken Kocienda.
5 Better fix for 3905066.
7 * khtml/editing/htmlediting.cpp:
8 (khtml::InsertParagraphSeparatorCommand::doApply):
10 2005-01-10 Maciej Stachowiak <mjs@apple.com>
14 <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
16 * khtml/rendering/render_text.cpp:
17 (InlineTextBox::paint): Support painting custom underline markers for
18 marked text in place of generic yellow.
19 (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
20 * khtml/rendering/render_text.h:
21 * kwq/KWQKHTMLPart.h: Declare new methods and structs.
22 * kwq/KWQKHTMLPart.mm:
23 (KWQKHTMLPart::clear): Clear marked test underlines.
24 (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
25 (convertAttributesToUnderlines): Converts NSAttributedString attributes
26 to simplified and C++-friendly form.
27 (KWQKHTMLPart::markedTextUsesUnderlines): New method.
28 (KWQKHTMLPart::markedTextUnderlines): New method.
30 (QPainter::drawLineForText): Handle pen width.
31 * kwq/WebCoreBridge.h:
32 * kwq/WebCoreBridge.mm:
33 (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
35 * kwq/WebCoreTextRenderer.h:
37 2005-01-12 David Harrison <harrison@apple.com>
39 Reviewed by Dave Hyatt.
41 <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
43 * kwq/KWQAccObject.mm:
44 (-[KWQAccObject addChildrenToArray:]):
45 Use the widget's outer view.
47 2005-01-12 David Harrison <harrison@apple.com>
49 Reviewed by Darin Adler.
51 <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
53 * khtml/xml/dom_nodeimpl.cpp:
54 (NodeImpl::displayNode):
55 Add quotes around text node content.
56 (NodeBaseImpl::childNode):
57 Add nil check to return nil rather than crash when child node not found.
58 * kwq/KWQAccObject.mm:
59 (-[KWQAccObject doAXStringForTextMarkerRange:]):
60 Pass range compliant positions to TextIterator.
62 2005-01-12 David Hyatt <hyatt@apple.com>
64 Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
65 line layout is smarter about including the overflow for both old states and new states.
69 * khtml/rendering/bidi.cpp:
70 (khtml::RenderBlock::layoutInlineChildren):
72 2005-01-12 David Hyatt <hyatt@apple.com>
74 Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move
75 tables/overflows that dont fit within a block only in strict mode.
77 Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific
78 case in editing is hit.
80 Reviewed by darin (first one), kocienda (second one)
82 * khtml/rendering/render_block.cpp:
83 (khtml::RenderBlock::getClearDelta):
84 * khtml/rendering/render_flow.cpp:
85 (RenderFlow::dirtyLinesFromChangedChild):
86 * khtml/rendering/render_line.cpp:
87 (khtml::InlineFlowBox::verticallyAlignBoxes):
89 2005-01-12 Ken Kocienda <kocienda@apple.com>
95 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
97 * khtml/editing/htmlediting.cpp:
98 (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
99 merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
100 added to visible_position files.
101 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
102 tests to determine when to stop moving nodes more complete and correct. Also improved comments.
103 * khtml/editing/visible_position.cpp:
104 (khtml::isFirstVisiblePositionInParagraph): New function.
105 (khtml::isLastVisiblePositionInParagraph): New function.
106 * khtml/editing/visible_position.h: Update header accordingly.
107 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
108 results but still correct.
109 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
110 * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
111 * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
112 * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
113 * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
114 * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
115 * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
116 * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
117 * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
118 * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
120 2005-01-11 Richard Williamson <rjw@apple.com>
122 Fixed 3922875. Fall back to DOM object is EMBED element
123 has no associated runtime object.
127 * khtml/ecma/kjs_dom.cpp:
128 (KJS::getRuntimeObject):
129 * khtml/ecma/kjs_html.cpp:
130 (KJS::HTMLDocument::tryGet):
131 (KJS::HTMLElement::tryGet):
132 (KJS::HTMLCollection::tryGet):
133 (KJS::HTMLCollection::getNamedItems):
135 2005-01-11 David Hyatt <hyatt@apple.com>
137 Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match
142 * khtml/html/htmltokenizer.cpp:
143 (khtml::HTMLTokenizer::parseTag):
145 2005-01-11 Chris Blumenberg <cblu@apple.com>
147 Fixed: <rdar://problem/3930733> Mail prints second page of email blank
151 * khtml/rendering/render_canvas.cpp:
152 (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
153 * khtml/rendering/render_flow.cpp:
154 (RenderFlow::paintLines): removed null check since the print rect should never be null
155 * khtml/rendering/render_list.cpp:
156 (RenderListMarker::paint): ditto
157 * kwq/KWQKHTMLPart.mm:
158 (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
160 2005-01-10 Ken Kocienda <kocienda@apple.com>
166 <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
168 * khtml/editing/htmlediting.cpp:
169 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a
170 simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the
171 result calculated in that deeper scope was not available when tested.
173 2005-01-10 Ken Kocienda <kocienda@apple.com>
179 <rdar://problem/3946852> Option-e goes to next line
181 * khtml/editing/htmlediting.cpp:
182 (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
183 into the start line is done. We plan to change pretty substantially soon to better handle
184 the problem described in <rdar://problem/3937352> Quote level not maintained when copied
185 and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
187 2005-01-10 Ken Kocienda <kocienda@apple.com>
193 <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
195 * khtml/editing/htmlediting.cpp:
196 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
197 to their own blocks if needed so that a block style can be applied.
198 (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
199 (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
200 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
201 This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
203 (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
204 Should remove attributue instead.
205 * khtml/editing/htmlediting.h: Touch function declarations accordingly.
206 * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
207 * layout-tests/editing/style/create-block-for-style-001.html: Added.
208 * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
209 * layout-tests/editing/style/create-block-for-style-002.html: Added.
210 * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
211 * layout-tests/editing/style/create-block-for-style-003.html: Added.
212 * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
213 * layout-tests/editing/style/create-block-for-style-004.html: Added.
214 * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
215 * layout-tests/editing/style/create-block-for-style-005.html: Added.
216 * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
217 * layout-tests/editing/style/create-block-for-style-006.html: Added.
218 * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
219 * layout-tests/editing/style/create-block-for-style-007.html: Added.
220 * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
221 * layout-tests/editing/style/create-block-for-style-008.html: Added.
222 * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
223 * layout-tests/editing/style/create-block-for-style-009.html: Added.
224 * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
225 * layout-tests/editing/style/create-block-for-style-010.html: Added.
226 * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
227 * layout-tests/editing/style/create-block-for-style-011.html: Added.
228 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
229 * layout-tests/editing/style/create-block-for-style-012.html: Added.
230 * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
231 * layout-tests/editing/style/create-block-for-style-013.html: Added.
233 Unrelated updates to these expected results.
234 * layout-tests/editing/inserting/insert-div-007-expected.txt
235 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
237 2005-01-10 Chris Blumenberg <cblu@apple.com>
239 Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
243 * khtml/rendering/render_flow.cpp:
244 (RenderFlow::paintLines): don't do pagination work if printRect is not set
245 * khtml/rendering/render_list.cpp:
246 (RenderListMarker::paint): ditto
248 2005-01-10 David Harrison <harrison@apple.com>
252 * kwq/KWQTextUtilities.mm:
253 (currentTextBreakLocaleID):
254 Return empty string (AKA root locale) if locale pref can not be canonicalized.
256 2005-01-10 John Sullivan <sullivan@apple.com>
258 Fixed broken Panther build.
260 * kwq/KWQTextUtilities.mm:
261 (currentTextBreakLocaleID):
262 This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
263 That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
264 To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
265 function. However, the Tiger-only code was wrong; the string generated using
266 CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
269 2005-01-09 David Harrison <harrison@apple.com>
271 Reviewed by Ken Kocienda.
273 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
275 * khtml/editing/htmlediting.cpp:
276 (khtml::ReplaceSelectionCommand::doApply):
277 Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
279 2005-01-09 Darin Adler <darin@apple.com>
281 Reviewed by Harrison.
283 - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
285 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
286 to a switch statement. Added SEARCH to the set of types that treat the renderer as a
289 2005-01-09 David Harrison <harrison@apple.com>
291 Reviewed by Ken Kocienda.
293 <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
295 Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
296 whitespace to a single non-breaking space when splitting a text node.
298 * khtml/editing/htmlediting.cpp:
299 (khtml::InsertParagraphSeparatorCommand::doApply):
301 2005-01-08 Kevin Decker <kdecker@apple.com>
305 Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
307 * khtml/html/html_elementimpl.cpp:
308 (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
310 2005-01-07 Maciej Stachowiak <mjs@apple.com>
314 <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
316 * Khtml/khtml_part.cpp:
317 (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
318 not started loading yet so it could not possibly be finishing here...
319 (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
320 no document, in this case we must have hit an error or been loading a non-HTML
322 * khtml/khtml_part.h:
324 2005-01-08 David Harrison <harrison@apple.com>
328 <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
330 * khtml/editing/selection.cpp:
331 (khtml::Selection::validate):
332 Tune word selections left/right choice to use right if on empty last line.
334 2005-01-07 David Harrison <harrison@apple.com>
338 <rdar://problem/3942619> AX: Support sentence ax attributes
340 Needed to use the unicode utilities properly. Twas lame before.
342 * khtml/editing/visible_units.cpp:
343 (khtml::previousBoundary):
344 (khtml::nextBoundary):
345 (khtml::startOfWord):
347 (khtml::previousWordPosition):
348 (khtml::nextWordPosition):
349 (khtml::startOfSentence):
350 (khtml::endOfSentence):
351 (khtml::previousSentencePosition):
352 (khtml::nextSentencePosition):
353 * kwq/KWQAccObject.mm:
354 (-[KWQAccObject accessibilityAttributeNames]):
355 (-[KWQAccObject accessibilityAttributeValue:]):
356 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
357 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
358 * kwq/KWQTextUtilities.mm:
359 (currentTextBreakLocaleID):
360 (KWQFindSentenceBoundary):
361 (KWQFindNextSentenceFromIndex):
363 2005-01-07 Ken Kocienda <kocienda@apple.com>
369 <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
370 <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
372 * khtml/editing/htmlediting.cpp:
373 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
374 Merge the typing style with the computed style for the current position. Fixes both bugs.
375 * khtml/editing/htmlediting.h:
376 * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
377 * layout-tests/editing/inserting/insert-div-023.html: Added.
378 * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
379 * layout-tests/editing/inserting/insert-div-024.html: Added.
381 2005-01-07 David Hyatt <hyatt@apple.com>
383 Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling
384 behavior on worldofwarcraft.com.
388 * khtml/rendering/render_table.cpp:
389 (RenderTable::layout):
391 2005-01-06 David Hyatt <hyatt@apple.com>
393 Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to
394 ignore inline flows in this case.
398 * khtml/rendering/render_block.cpp:
399 (khtml::RenderBlock::nodeAtPoint):
401 2005-01-07 Ken Kocienda <kocienda@apple.com>
407 <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
409 * kwq/KWQKHTMLPart.mm:
410 (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
411 in the document, or if it is not a descendent of the document element. In the case of the bug,
412 since the selection has not yet been set up, the focus node passed here is the HTML element, and
413 that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
415 2005-01-06 Kevin Decker <kdecker@apple.com>
419 Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
421 * khtml/khtml_part.cpp:
422 (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.
426 2005-01-06 David Harrison <harrison@apple.com>
430 (addendum to previous checkin for this bug)
431 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
433 Fix line navigation. Add AXUIElementForTextMarker.
435 * kwq/KWQAccObject.mm:
436 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
437 (-[KWQAccObject doAXUIElementForTextMarker:]):
438 (-[KWQAccObject doAXLineForTextMarker:]):
439 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
440 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
441 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
442 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
443 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
445 2005-01-06 Darin Adler <darin@apple.com>
449 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
451 (turns out the PLT regression was a false alarm)
453 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
454 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
456 * khtml/html/htmlparser.cpp:
457 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
458 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
459 to eliminate code that used ID_CLOSE_TAG for an array size.
460 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
461 that manages isindex to use deref instead of delete.
462 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
463 mistake of using ID_CLOSE_TAG for the array size too.
464 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
465 there and it would prevent custom tags from working. Added range check before using the forbidden
466 tag array with the token ID since custom tags will use index values past the end of the array.
467 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
468 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
469 createElement call is still here. Last time I left out a few form element types from this switch;
471 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
472 document if getTagID fails; this creates a unique per-document ID.
474 * khtml/misc/htmltags.c: Regenerated.
475 * khtml/misc/htmltags.h: Regenerated.
477 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
478 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
479 Also rewrote getTagName to work with the new scheme.
481 2005-01-06 David Harrison <harrison@apple.com>
483 Fixed Panther build. Also, do not advertize sentence support since it is incomplete.
485 * kwq/KWQAccObject.mm:
486 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
487 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
488 (-[KWQAccObject accessibilityIsAttributeSettable:]):
490 2005-01-06 David Harrison <harrison@apple.com>
492 Reviewed by Dave Hyatt.
494 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
495 <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
497 Many more AX attributes supported. Numerous fixes to previous AX work.
499 * khtml/editing/visible_units.cpp:
500 (khtml::startSentenceBoundary):
501 (khtml::startOfSentence):
502 (khtml::endSentenceBoundary):
503 (khtml::endOfSentence):
504 (khtml::previousSentencePositionBoundary):
505 (khtml::previousSentencePosition):
506 (khtml::nextSentencePositionBoundary):
507 (khtml::nextSentencePosition):
508 * khtml/editing/visible_units.h:
509 * khtml/khtmlview.cpp:
511 * khtml/misc/helper.cpp:
512 (khtml::findSentenceBoundary):
513 (khtml::nextSentenceFromIndex):
514 * khtml/misc/helper.h:
515 * khtml/misc/htmltags.c:
518 * khtml/rendering/render_container.cpp:
519 (RenderContainer::removeChildNode):
520 (RenderContainer::appendChildNode):
521 (RenderContainer::insertChildNode):
522 * khtml/rendering/render_object.cpp:
523 (RenderObject::remove):
524 * khtml/xml/dom_docimpl.cpp:
525 (DocumentImpl::getAccObjectCache):
526 (DocumentImpl::updateSelection):
527 (DocumentImpl::close):
528 (DocumentImpl::setFocusNode):
529 (DocumentImpl::parentDocument):
530 (DocumentImpl::topDocument):
531 * khtml/xml/dom_docimpl.h:
532 * kwq/KWQAccObject.mm:
533 (-[KWQAccObject accessibilityShouldUseUniqueId]):
534 (-[KWQAccObject detach]):
535 (-[KWQAccObject anchorElement]):
536 (-[KWQAccObject firstChild]):
537 (-[KWQAccObject lastChild]):
538 (-[KWQAccObject previousSibling]):
539 (-[KWQAccObject nextSibling]):
540 (-[KWQAccObject parentObject]):
541 (-[KWQAccObject value]):
542 (-[KWQAccObject accessibilityAttributeNames]):
543 (-[KWQAccObject accessibilityPerformAction:]):
544 (-[KWQAccObject textMarkerForVisiblePosition:]):
545 (-[KWQAccObject visiblePositionForTextMarker:]):
546 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
547 (-[KWQAccObject topDocument]):
548 (-[KWQAccObject topRenderer]):
549 (-[KWQAccObject topView]):
550 (-[KWQAccObject accessibilityAttributeValue:]):
551 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
552 (-[KWQAccObject doAXLineForTextMarker:]):
553 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
554 (-[KWQAccObject doAXStringForTextMarkerRange:]):
555 (-[KWQAccObject doAXTextMarkerForPosition:]):
556 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
557 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
558 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
559 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
560 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
561 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
562 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
563 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
564 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
565 (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
566 (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
567 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
568 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
569 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
570 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
571 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
572 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
573 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
574 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
575 (-[KWQAccObject doAXLengthForTextMarkerRange:]):
576 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
577 (-[KWQAccObject accessibilityHitTest:]):
578 (-[KWQAccObject accessibilityFocusedUIElement]):
579 (-[KWQAccObject accessibilityIsAttributeSettable:]):
580 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
581 (-[KWQAccObject setAccObjectID:]):
582 (-[KWQAccObject removeAccObjectID]):
583 * kwq/KWQAccObjectCache.h:
584 * kwq/KWQAccObjectCache.mm:
585 (KWQAccObjectCache::setAccObject):
586 (KWQAccObjectCache::removeAccObject):
587 (KWQAccObjectCache::visiblePositionForTextMarker):
588 (KWQAccObjectCache::postNotificationToTopWebArea):
589 (KWQAccObjectCache::postNotification):
590 (KWQAccObjectCache::handleFocusedUIElementChanged):
591 * kwq/KWQKHTMLPart.mm:
592 (KWQKHTMLPart::respondToChangedContents):
593 * kwq/KWQTextUtilities.h:
594 * kwq/KWQTextUtilities.mm:
595 (KWQFindNextWordFromIndex):
596 (KWQFindSentenceBoundary):
597 (KWQFindNextSentenceFromIndex):
598 * kwq/WebCoreBridge.mm:
599 (-[WebCoreBridge accessibilityTree]):
601 2005-01-05 Darin Adler <darin@apple.com>
605 - re-landing a subset of my custom tag change that does not fix the bug, but also does
606 not introduce a performance regression
608 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
609 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
611 * khtml/editing/htmlediting.cpp:
612 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
613 per-document tags and is just better all around for things like the document.
614 (khtml::debugNode): Ditto.
615 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
616 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
617 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
618 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
620 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
621 non-HTML elements to be nested as desired.
623 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
624 * khtml/misc/htmlhashes.cpp:
625 (khtml::getTagID): Changed return type to unsigned short.
626 (khtml::getAttrID): Ditto.
628 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
629 * khtml/xml/dom_docimpl.cpp:
630 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
631 Also updated for a few tags that the parser handled but this did not.
633 * kwq/KWQRenderTreeDebug.cpp:
634 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
635 the tag ID directly, which only works for standard nodes.
636 (operator<<): Update to call getTagName.
637 (nodePositionRelativeToRoot): Ditto.
638 (writeSelection): Ditto.
640 2005-01-05 Ken Kocienda <kocienda@apple.com>
646 <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
648 * khtml/editing/htmlediting.cpp:
649 (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
650 this operation work correctly, particularly in the logic to figure out whether to merge content, and
651 also performing merges.
652 * khtml/editing/visible_position.cpp:
653 (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
654 * khtml/editing/visible_units.cpp:
655 (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
656 (khtml::isEndOfParagraph): Ditto.
657 * khtml/editing/visible_units.h: Declare new functions.
659 2005-01-04 Ken Kocienda <kocienda@apple.com>
665 <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
667 * khtml/editing/htmlediting.cpp:
668 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
669 for the block we are adding was being done at the wrong time, which led to the placeholder remaining
670 in the document when it was not needed. This resulted in the extra space reported in the bug.
672 2005-01-04 Kevin Decker <kdecker@apple.com>
676 Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
678 * khtml/rendering/render_block.cpp:
679 (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.
681 2005-01-04 David Hyatt <hyatt@apple.com>
683 Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
687 * khtml/rendering/render_layer.cpp:
688 (RenderLayer::updateScrollInfoAfterLayout):
690 2005-01-04 Ken Kocienda <kocienda@apple.com>
694 Fix for these two bugs:
696 <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
697 <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
699 * khtml/editing/htmlediting.cpp:
700 (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
701 neither start nor end. For 3939148, improve the code which adjusts the insertion point during
702 the process of pasting. It formerly handled only one of the possible cases.
703 * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
704 * layout-tests/editing/pasteboard/paste-text-015.html: Added.
706 2005-01-04 David Hyatt <hyatt@apple.com>
708 Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
712 * khtml/rendering/render_form.cpp:
713 (RenderLineEdit::updateFromElement):
714 * kwq/KWQLineEdit.mm:
715 (QLineEdit::setPlaceholderString):
717 2005-01-04 David Hyatt <hyatt@apple.com>
719 Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when
720 returning pseudo-styles.
724 * khtml/css/cssstyleselector.cpp:
725 (khtml::CSSStyleSelector::matchRulesForList):
726 (khtml::CSSStyleSelector::pseudoStyleForElement):
727 * khtml/rendering/render_style.cpp:
728 (RenderStyle::addPseudoStyle):
730 2005-01-04 Darin Adler <darin@apple.com>
732 - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
734 * khtml/css/cssstyleselector.cpp:
735 * khtml/editing/htmlediting.cpp:
736 * khtml/editing/selection.cpp:
737 * khtml/editing/visible_position.cpp:
738 * khtml/html/dtd.cpp:
739 * khtml/html/htmlparser.cpp:
740 * khtml/html/htmlparser.h:
741 * khtml/html/htmltokenizer.cpp:
742 * khtml/misc/htmlhashes.cpp:
743 * khtml/misc/htmlhashes.h:
744 * khtml/misc/htmltags.c:
745 * khtml/misc/htmltags.h:
746 * khtml/misc/maketags:
747 * khtml/xml/dom_docimpl.cpp:
748 * khtml/xml/dom_docimpl.h:
749 * khtml/xml/dom_nodeimpl.cpp:
750 * khtml/xml/dom_position.cpp:
751 * kwq/KWQRenderTreeDebug.cpp:
753 2005-01-04 Ken Kocienda <kocienda@apple.com>
759 <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
761 * khtml/editing/htmlediting.cpp:
762 (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
763 a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
764 to be applied. Now the code will detect when at the end of a style run and will not move and apply
765 that ending style to the new paragraph, though it will place that style into the typing style. This
766 seems to match NSText behavior.
767 * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed
768 here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
769 not have any visible effect on the document.
770 * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
771 * layout-tests/editing/inserting/insert-div-022.html: Added.
773 2005-01-04 David Hyatt <hyatt@apple.com>
775 Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
780 * khtml/rendering/render_flow.cpp:
781 (RenderFlow::paintLines):
783 2005-01-03 David Hyatt <hyatt@apple.com>
785 Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more
786 robust and make it work regardless of which objects get a layout or not.
790 * khtml/rendering/render_block.cpp:
791 (khtml::RenderBlock::insertFloatingObject):
792 (khtml::RenderBlock::addOverhangingFloats):
793 (khtml::RenderBlock::addIntrudingFloats):
794 * khtml/rendering/render_block.h:
795 (khtml::RenderBlock::FloatingObject::FloatingObject):
797 2005-01-03 Maciej Stachowiak <mjs@apple.com>
801 <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
803 * khtml/html/html_miscimpl.cpp:
804 (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
805 it should not ever be (now).
806 (HTMLCollectionImpl::item): When traversing items stop when we hit
807 nil, meaning the end to avoid triggering above assert (formerly crash).
809 2005-01-03 Maciej Stachowiak <mjs@apple.com>
811 Reviewed by John and Kevin.
813 <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
815 * khtml/ecma/kjs_window.cpp:
816 (Window::get): Look up frame names before buitin window properties
817 to match other browsers. This regressed because we added a builtin
818 "toolbar" property but this site had a frame with that name.
820 2004-12-21 Maciej Stachowiak <mjs@apple.com>
824 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
826 Added opener bridge method to help WebKit implement security check
827 for named frame visibility.
829 * khtml/khtml_part.h:
830 * kwq/WebCoreBridge.h:
831 * kwq/WebCoreBridge.mm:
832 (-[WebCoreBridge opener]):
834 2005-01-03 Ken Kocienda <kocienda@apple.com>
840 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
842 * kwq/WebCoreBridge.mm:
843 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
845 2005-01-03 David Hyatt <hyatt@apple.com>
847 Fix for 3936881, make sure positioned objects prooperly update y-position.
851 * khtml/rendering/render_block.cpp:
852 (khtml::RenderBlock::layoutPositionedObjects):
854 2005-01-03 Ken Kocienda <kocienda@apple.com>
860 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
862 * khtml/editing/htmlediting.cpp:
863 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
864 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
865 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
866 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
867 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
868 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
869 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
870 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
871 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
872 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
873 * khtml/editing/htmlediting.h: Declare new functions.
875 2004-12-25 Kevin Decker <kdecker@apple.com>
879 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
881 * 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.
883 2004-12-23 Darin Adler <darin@apple.com>
887 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
889 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
890 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
892 * khtml/editing/htmlediting.cpp:
893 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
894 per-document tags and is just better all around for things like the document.
895 (khtml::debugNode): Ditto.
896 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
897 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
898 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
899 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
901 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
902 non-HTML elements to be nested as desired.
904 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
905 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
907 * khtml/html/htmlparser.cpp:
908 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
909 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
910 to eliminate code that used ID_CLOSE_TAG for an array size.
911 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
912 that manages isindex to use deref instead of delete.
913 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
914 mistake of using ID_CLOSE_TAG for the array size too.
915 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
916 there and it would prevent custom tags from working. Added range check before using the forbidden
917 tag array with the token ID since custom tags will use index values past the end of the array.
918 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
919 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
920 createElement call is still here. Last time I left out a few form element types from this switch;
922 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
923 document if getTagID fails; this creates a unique per-document ID.
925 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
926 * khtml/misc/htmlhashes.cpp:
927 (khtml::getTagID): Changed return type to unsigned short.
928 (khtml::getAttrID): Ditto.
930 * khtml/misc/htmltags.c: Regenerated.
931 * khtml/misc/htmltags.h: Regenerated.
933 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
934 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
935 Also rewrote getTagName to work with the new scheme.
937 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
938 * khtml/xml/dom_docimpl.cpp:
939 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
940 Also updated for a few tags that the parser handled but this did not.
942 * kwq/KWQRenderTreeDebug.cpp:
943 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
944 the tag ID directly, which only works for standard nodes.
945 (operator<<): Update to call getTagName.
946 (nodePositionRelativeToRoot): Ditto.
947 (writeSelection): Ditto.
951 2004-12-22 Darin Adler <darin@apple.com>
953 - rolled out my custom tag name change -- it broke amazon.com
955 * khtml/css/cssstyleselector.cpp:
956 * khtml/editing/htmlediting.cpp:
957 * khtml/editing/selection.cpp:
958 * khtml/editing/visible_position.cpp:
959 * khtml/html/dtd.cpp:
960 * khtml/html/htmlparser.cpp:
961 * khtml/html/htmlparser.h:
962 * khtml/html/htmltokenizer.cpp:
963 * khtml/misc/htmlhashes.cpp:
964 * khtml/misc/htmlhashes.h:
965 * khtml/misc/htmltags.c:
966 * khtml/misc/htmltags.h:
967 * khtml/misc/maketags:
968 * khtml/xml/dom_docimpl.cpp:
969 * khtml/xml/dom_docimpl.h:
970 * khtml/xml/dom_nodeimpl.cpp:
971 * khtml/xml/dom_position.cpp:
972 * kwq/KWQRenderTreeDebug.cpp:
974 2004-12-22 David Harrison <harrison@apple.com>
976 Reviewed by Darin Adler.
978 * khtml/editing/selection.cpp:
979 (khtml::Selection::validate):
980 The selecting/deselecting bad behavior is because the Selection code that expands by words
981 had an inaccurate test for being at the end of the document (where double-clicking needs
982 to select the last word). Fixed that check.
984 2004-12-22 Adele Amchan <adele@apple.com>
988 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
990 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
991 so that we match Firefox and WinIE behavior.
993 2004-12-22 Darin Adler <darin@apple.com>
997 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
999 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
1000 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
1002 * khtml/editing/htmlediting.cpp:
1003 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
1004 per-document tags and is just better all around for things like the document.
1005 (khtml::debugNode): Ditto.
1006 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
1007 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
1008 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
1009 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
1011 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
1012 non-HTML elements to be nested as desired.
1014 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
1015 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
1017 * khtml/html/htmlparser.cpp:
1018 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
1019 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
1020 to eliminate code that used ID_CLOSE_TAG for an array size.
1021 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
1022 that manages isindex to use deref instead of delete.
1023 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
1024 mistake of using ID_CLOSE_TAG for the array size too.
1025 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
1026 there and it would prevent custom tags from working. Added range check before using the forbidden
1027 tag array with the token ID since custom tags will use index values past the end of the array.
1028 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
1029 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
1030 createElement call is still here.
1031 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
1032 document if getTagID fails; this creates a unique per-document ID.
1034 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
1035 * khtml/misc/htmlhashes.cpp:
1036 (khtml::getTagID): Changed return type to unsigned short.
1037 (khtml::getAttrID): Ditto.
1039 * khtml/misc/htmltags.c: Regenerated.
1040 * khtml/misc/htmltags.h: Regenerated.
1042 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
1043 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
1044 Also rewrote getTagName to work with the new scheme.
1046 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
1047 * khtml/xml/dom_docimpl.cpp:
1048 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
1049 Also updated for a few tags that the parser handled but this did not.
1051 * kwq/KWQRenderTreeDebug.cpp:
1052 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
1053 the tag ID directly, which only works for standard nodes.
1054 (operator<<): Update to call getTagName.
1055 (nodePositionRelativeToRoot): Ditto.
1056 (writeSelection): Ditto.
1058 2004-12-21 David Harrison <harrison@apple.com>
1060 Reviewed by Ken Kocienda.
1062 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
1064 Problem was the TextIterator was not handling exitNode() from a P block properly.
1066 * khtml/editing/visible_text.cpp:
1067 (khtml::TextIterator::TextIterator):
1068 Add new param that specifies whether the iterator is for content or for searching.
1069 Search iterators do not prevent newlines at the beginning.
1070 (khtml::TextIterator::advance):
1071 Added some comments.
1072 (khtml::TextIterator::handleTextNode):
1073 Added some comments.
1074 (khtml::TextIterator::exitNode):
1075 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
1076 (khtml::TextIterator::emitCharacter):
1077 Added some comments.
1078 (khtml::TextIterator::range):
1079 Added some comments.
1080 (khtml::CharacterIterator::CharacterIterator):
1081 Specify search type TextIterator.
1082 (khtml::CharacterIterator::advance):
1083 * khtml/editing/visible_text.h:
1085 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
1086 * khtml/editing/visible_units.cpp:
1087 (khtml::nextWordBoundary):
1088 Specify search type TextIterator.
1090 2004-12-21 David Harrison <harrison@apple.com>
1092 Reviewed by Ken Kocienda.
1094 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
1096 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
1097 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
1099 * khtml/rendering/render_text.cpp:
1100 (RenderText::setSelectionState)
1102 2004-12-21 Maciej Stachowiak <mjs@apple.com>
1106 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
1108 * khtml/ecma/kjs_window.cpp:
1109 (Window::get): Change most window functions to be restricted by
1112 2004-12-21 Ken Kocienda <kocienda@apple.com>
1118 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
1120 * khtml/editing/htmlediting.cpp:
1121 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
1122 formerly undetected and unhandled. This is the crux of the bug fix.
1123 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
1124 execution of command.
1125 * khtml/editing/htmlediting.h: Declare new function.
1126 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
1127 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
1129 2004-12-21 Ken Kocienda <kocienda@apple.com>
1133 * khtml/editing/htmlediting.cpp:
1134 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
1135 checking in (aka must return false from function returning bool).
1137 2004-12-21 Ken Kocienda <kocienda@apple.com>
1143 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
1145 * khtml/editing/htmlediting.cpp:
1146 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
1147 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
1149 2004-12-21 Ken Kocienda <kocienda@apple.com>
1153 * khtml/editing/htmlediting.cpp:
1154 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
1155 further experiements.
1156 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
1157 be done if the insertion point is in an empty block.
1158 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
1159 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
1160 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
1161 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
1162 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
1163 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
1165 2004-12-21 Darin Adler <darin@apple.com>
1169 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
1171 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
1172 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
1173 * khtml/editing/visible_text.cpp:
1174 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
1175 using the node's index. We only compute the node index if actually asked for the range.
1176 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
1178 (khtml::TextIterator::handleTextBox): Ditto.
1179 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
1181 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
1182 (khtml::TextIterator::exitNode): More of the same.
1183 (khtml::TextIterator::emitCharacter): Ditto.
1184 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
1185 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
1189 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
1193 2004-12-20 Ken Kocienda <kocienda@apple.com>
1197 * khtml/editing/htmlediting.cpp:
1198 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
1199 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1200 Rolling out until I can develop a real fix.
1202 2004-12-20 David Harrison <harrison@apple.com>
1204 Reviewed by Dave Hyatt.
1206 Initial checkin of AXTextMarkerRef support.
1208 * khtml/xml/dom_docimpl.cpp:
1209 (DocumentImpl::updateSelection):
1210 (DocumentImpl::setFocusNode):
1211 * kwq/KWQAccObject.h:
1212 * kwq/KWQAccObject.mm:
1213 (-[KWQAccObject detach]):
1214 (-[KWQAccObject anchorElement]):
1215 (-[KWQAccObject addChildrenToArray:]):
1216 (-[KWQAccObject accessibilityAttributeNames]):
1217 (-[KWQAccObject accessibilityActionDescription:]):
1218 (-[KWQAccObject accessibilityPerformAction:]):
1219 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
1220 (-[KWQAccObject textMarkerForVisiblePosition:]):
1221 (-[KWQAccObject visiblePositionForTextMarker:]):
1222 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
1223 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
1224 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1225 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1226 (-[KWQAccObject accessibilityAttributeValue:]):
1227 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1228 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
1229 (-[KWQAccObject getSelectedTextMarkerRange]):
1230 (-[KWQAccObject doAXLineForTextMarker:]):
1231 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1232 (-[KWQAccObject doAXStringForTextMarkerRange:]):
1233 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
1234 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
1235 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
1236 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
1237 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1238 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1239 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1240 (-[KWQAccObject accessibilityFocusedUIElement]):
1241 (-[KWQAccObject clearChildren]):
1242 (-[KWQAccObject accObjectID]):
1243 (-[KWQAccObject setAccObjectID:]):
1244 (-[KWQAccObject removeAccObjectID]):
1245 * kwq/KWQAccObjectCache.h:
1246 * kwq/KWQAccObjectCache.mm:
1247 (KWQAccObjectCache::KWQAccObjectCache):
1248 (KWQAccObjectCache::~KWQAccObjectCache):
1249 (KWQAccObjectCache::getAccObjectID):
1250 (KWQAccObjectCache::removeAccObjectID):
1251 (KWQAccObjectCache::textMarkerForVisiblePosition):
1252 (KWQAccObjectCache::visiblePositionForTextMarker):
1254 2004-12-19 Darin Adler <darin@apple.com>
1256 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
1258 2004-12-19 Darin Adler <darin@apple.com>
1262 - a garbage collection fix
1264 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
1265 #ifndef to use #if (in practice, either is OK).
1266 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
1268 2004-12-17 David Hyatt <hyatt@apple.com>
1270 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
1272 Reviewed by kocienda
1274 * khtml/rendering/render_box.cpp:
1275 (RenderBox::calcPercentageHeight):
1276 * khtml/rendering/render_table.cpp:
1277 (RenderTableSection::layoutRows):
1279 2004-12-17 David Harrison <harrison@apple.com>
1281 Reviewed by Ken Kocienda.
1283 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
1285 * khtml/editing/visible_units.cpp:
1286 (khtml::endOfParagraph):
1287 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
1289 2004-12-17 Ken Kocienda <kocienda@apple.com>
1293 * khtml/editing/htmlediting.cpp:
1294 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
1295 codes when I added the createBreakElement() function.
1297 2004-12-17 Richard Williamson <rjw@apple.com>
1299 Set the floor of max cacheable object size to 40K. This restores
1300 the long standing floor. Lower floor deleteriously impacts the PLT.
1303 * khtml/khtml_part.cpp:
1304 (KHTMLPart::checkCompleted):
1305 * khtml/misc/loader.cpp:
1308 2004-12-17 Ken Kocienda <kocienda@apple.com>
1314 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1316 * khtml/editing/htmlediting.cpp:
1317 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
1318 Formerly checked only for block boundary.
1320 2004-12-17 David Harrison <harrison@apple.com>
1324 Add KWQCFAutorelease for autoreleasing CF objects.
1325 * kwq/KWQFoundationExtras.h:
1329 2004-12-17 David Harrison <harrison@apple.com>
1333 Fix GC compatibility in getNSString.
1336 (QString::getNSString):
1337 Use NSString allocator instead of CFString, so that autorelease works under GC.
1339 2004-12-17 Ken Kocienda <kocienda@apple.com>
1345 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
1347 * khtml/editing/htmlediting.cpp:
1348 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
1349 move it after the <body> element.
1351 2004-12-17 Ken Kocienda <kocienda@apple.com>
1355 Added new layout tests covering cases from recent bug fixes.
1357 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
1358 * layout-tests/editing/inserting/insert-div-018.html: Added.
1359 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
1360 * layout-tests/editing/inserting/insert-div-019.html: Added.
1361 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
1362 * layout-tests/editing/inserting/insert-div-020.html: Added.
1363 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
1364 * layout-tests/editing/inserting/insert-div-021.html: Added.
1366 2004-12-17 Ken Kocienda <kocienda@apple.com>
1370 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
1372 * layout-tests/editing/inserting/insert-div-013-expected.txt
1373 * layout-tests/editing/inserting/insert-div-014-expected.txt
1375 2004-12-17 Ken Kocienda <kocienda@apple.com>
1381 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
1383 * khtml/editing/htmlediting.cpp:
1384 (khtml::InsertParagraphSeparatorCommand::doApply):
1385 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
1386 block as the reference node for the insertion of the new block.
1387 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
1388 I worked this all out on the whiteboard this time. This should be the last tweak.
1390 2004-12-17 Kevin Decker <kdecker@apple.com>
1394 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
1396 * khtml/xml/xml_tokenizer.cpp:
1397 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
1399 2004-12-16 Ken Kocienda <kocienda@apple.com>
1405 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
1407 * khtml/editing/htmlediting.cpp:
1408 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
1409 it checks the downstream node for the starting position.
1411 2004-12-16 Ken Kocienda <kocienda@apple.com>
1415 Added new createBreakElement() function that makes creating a <br> element a one-liner.
1416 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
1417 over to this new helper.
1419 * khtml/editing/htmlediting.cpp:
1420 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
1421 (khtml::InsertLineBreakCommand::doApply): Ditto.
1422 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1423 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1424 (khtml::ReplaceSelectionCommand::doApply): Ditto.
1425 (khtml::createBreakElement): New helper.
1426 * khtml/editing/htmlediting.h: Ditto.
1428 2004-12-16 David Hyatt <hyatt@apple.com>
1430 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
1431 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
1433 Reviewed by kocienda
1435 * khtml/rendering/render_object.cpp:
1436 (RenderObject::getVerticalPosition):
1438 2004-12-16 Ken Kocienda <kocienda@apple.com>
1444 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
1445 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
1447 * khtml/editing/htmlediting.cpp:
1448 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
1449 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
1450 a check which may move the node used as the reference node for the insertion. Also change this code to
1451 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
1452 to want to shift into the new <p>.
1454 2004-12-16 Darin Adler <darin@apple.com>
1458 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
1459 after talking this over with Dave and Ken
1461 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
1462 * khtml/editing/htmlediting.cpp:
1463 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
1464 helper so this can share code with the plain-text conversion code.
1465 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
1466 helper so this can share code with the plain-text conversion code.
1467 (khtml::createDefaultParagraphElement): Added.
1468 (khtml::createBlockPlaceholderElement): Added.
1470 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
1471 <br> elements for pasting plain text.
1473 - regenerated these files with the newer gperf
1475 * khtml/css/cssproperties.c: Regenerated.
1476 * khtml/css/cssvalues.c: Regenerated.
1477 * khtml/misc/htmlattrs.c: Regenerated.
1478 * khtml/misc/htmltags.c: Regenerated.
1480 2004-12-16 Ken Kocienda <kocienda@apple.com>
1486 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
1488 * khtml/xml/dom_nodeimpl.cpp:
1489 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
1490 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
1491 it stops looking in this situation. This problem eventually caused the delete code to try to
1492 merge a node under a descendent.
1494 2004-12-16 Adele Amchan <adele@apple.com>
1496 Change by Richard, reviewed by me.
1498 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
1500 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
1502 2004-12-16 Adele Amchan <adele@apple.com>
1506 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
1508 Added a call to ObjectImp::get before Window::get just returns Undefined.
1509 This was preventing us from getting the toString function from a Window object.
1511 * khtml/ecma/kjs_window.cpp: (Window::get):
1513 2004-12-16 Ken Kocienda <kocienda@apple.com>
1519 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
1521 * khtml/editing/htmlediting.cpp:
1522 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
1523 to do a better job than it was doing before. Added several test cases to prove I am on a
1525 * khtml/editing/visible_position.cpp:
1526 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
1527 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
1528 This function was returning true for the first position in "bar". Wrong. Also tightened up other
1529 rule: Should not report true when relationship between blocks cannot be determined.
1530 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
1531 when relationship between blocks cannot be determined.
1532 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
1533 * layout-tests/editing/inserting/insert-div-010.html: Added.
1534 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
1535 * layout-tests/editing/inserting/insert-div-011.html: Added.
1536 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
1537 * layout-tests/editing/inserting/insert-div-012.html: Added.
1538 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
1539 * layout-tests/editing/inserting/insert-div-013.html: Added.
1540 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
1541 * layout-tests/editing/inserting/insert-div-014.html: Added.
1542 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
1543 * layout-tests/editing/inserting/insert-div-015.html: Added.
1544 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
1545 * layout-tests/editing/inserting/insert-div-016.html: Added.
1546 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
1547 * layout-tests/editing/inserting/insert-div-017.html: Added.
1549 2004-12-16 Ken Kocienda <kocienda@apple.com>
1553 Added a layout test based on my last checkin.
1555 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
1556 * layout-tests/editing/selection/move-by-word-001.html: Added.
1558 2004-12-16 Ken Kocienda <kocienda@apple.com>
1564 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
1566 * khtml/editing/visible_text.cpp:
1567 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
1568 backwards into a different block that is an descendent of the block containing the text node (as in leaving
1569 the "bar" node in this example: <p>foo</p>bar).
1570 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
1571 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
1572 it is called from there, and now also from advance().
1574 2004-12-15 Darin Adler <darin@apple.com>
1578 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
1580 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
1581 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
1582 type altogether and use the render tree instead.
1584 2004-12-14 John Sullivan <sullivan@apple.com>
1588 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
1589 in the menu, no specific action names
1591 * khtml/editing/edit_actions.h: new header, contains EditAction enum
1592 (renamed from HTMLEditAction, formerly in htmlediting.h)
1594 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
1596 * khtml/editing/htmlediting.h:
1597 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
1598 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
1600 * khtml/editing/htmlediting.cpp:
1601 (khtml::EditCommandPtr::editingAction):
1602 update for enum name change
1603 (khtml::EditCommand::editingAction):
1605 (khtml::ApplyStyleCommand::ApplyStyleCommand):
1606 added editingAction parameter to this constructor
1607 (khtml::ApplyStyleCommand::editingAction):
1609 (khtml::DeleteSelectionCommand::editingAction):
1610 update for enum name change
1611 (khtml::MoveSelectionCommand::editingAction):
1613 (khtml::TypingCommand::editingAction):
1615 (khtml::ReplaceSelectionCommand::editingAction):
1618 * khtml/khtml_part.h:
1619 added EditAction parameter to applyStyle and computeAndSetTypingStyle
1620 * khtml/khtml_part.cpp:
1621 (KHTMLPart::computeAndSetTypingStyle):
1622 added EditAction parameter
1623 (KHTMLPart::applyStyle):
1626 * kwq/KWQKHTMLPart.mm:
1627 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1628 do the cast from EditAction to WebUndoAction a different way to match other code
1630 * kwq/WebCoreBridge.h:
1631 * kwq/WebCoreBridge.mm:
1632 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
1633 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
1634 (-[WebCoreBridge applyStyle:withUndoAction:]):
1637 * WebCore.pbproj/project.pbxproj:
1638 updated for new files
1640 2004-12-14 David Hyatt <hyatt@apple.com>
1642 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
1643 the ridiculous 1024 limit on the span values.
1645 * khtml/html/html_tableimpl.cpp:
1646 (HTMLTableCellElementImpl::parseHTMLAttribute):
1647 * khtml/rendering/render_table.cpp:
1648 (RenderTableCell::collapsedBottomBorder):
1649 * khtml/rendering/render_table.h:
1650 (khtml::RenderTableCell::colSpan):
1651 (khtml::RenderTableCell::setColSpan):
1652 (khtml::RenderTableCell::rowSpan):
1653 (khtml::RenderTableCell::setRowSpan):
1654 (khtml::RenderTableCol::span):
1655 (khtml::RenderTableCol::setSpan):
1657 2004-12-14 David Hyatt <hyatt@apple.com>
1659 Make sure <col> and <colgroup> can have spans updated dynamically as well.
1663 * khtml/html/html_tableimpl.cpp:
1664 (HTMLTableColElementImpl::parseHTMLAttribute):
1665 * khtml/rendering/render_table.cpp:
1666 (RenderTableCell::updateFromElement):
1667 (RenderTableCol::updateFromElement):
1669 2004-12-14 David Hyatt <hyatt@apple.com>
1671 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
1675 * khtml/html/html_tableimpl.cpp:
1676 (HTMLTableCellElementImpl::parseHTMLAttribute):
1677 * khtml/rendering/render_table.cpp:
1678 (RenderTableCell::RenderTableCell):
1679 (RenderTableCell::updateFromElement):
1681 2004-12-14 Chris Blumenberg <cblu@apple.com>
1683 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1687 * khtml/editing/markup.cpp:
1688 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
1690 2004-12-14 David Hyatt <hyatt@apple.com>
1692 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
1693 This is actually a regression from my positioned object DHTML optimization.
1695 Reviewed by kocienda
1697 * khtml/rendering/render_object.cpp:
1698 (RenderObject::setStyle):
1700 2004-12-14 David Hyatt <hyatt@apple.com>
1702 Make sure the class attribute works when newlines are present in the attribute.
1704 Reviewed by kocienda
1706 * khtml/html/html_elementimpl.cpp:
1707 (HTMLNamedAttrMapImpl::parseClassAttribute):
1709 2004-12-14 David Hyatt <hyatt@apple.com>
1711 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
1712 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
1713 read by splitting it into two separate functions.
1715 Reviewed by kocienda
1717 * khtml/rendering/render_block.cpp:
1718 (khtml::RenderBlock::layoutBlockChildren):
1719 (khtml::RenderBlock::clearFloats):
1720 (khtml::RenderBlock::addOverhangingFloats):
1721 (khtml::RenderBlock::addIntrudingFloats):
1722 * khtml/rendering/render_block.h:
1724 2004-12-14 John Sullivan <sullivan@apple.com>
1728 - added Undo action names for Cut, Paste, and Drag
1730 * khtml/editing/htmlediting.h:
1731 * khtml/editing/htmlediting.cpp:
1732 (khtml::DeleteSelectionCommand::editingAction):
1733 overridden to return HTMLEditActionCut
1734 (khtml::MoveSelectionCommand::editingAction):
1735 overridden to return HTMLEditActionDrag
1736 (khtml::ReplaceSelectionCommand::editingAction):
1737 overridden to return HTMLEditActionPaste
1739 2004-12-14 John Sullivan <sullivan@apple.com>
1743 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
1744 no specific action names
1746 The remaining step is to make each EditCommand subclass override editingAction() to return an
1747 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
1748 is not completely straightforward, so this next step isn't trivial.)
1750 * khtml/editing/htmlediting.h:
1751 new enum for HTMLEditAction
1753 * khtml/editing/htmlediting.cpp:
1754 (khtml::EditCommandPtr::editingAction):
1755 new method, calls through to EditCommand
1756 (khtml::EditCommand::editingAction):
1757 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
1758 (khtml::TypingCommand::editingAction):
1759 proof of concept override, returns HTMLEditActionTyping
1761 * kwq/KWQKHTMLPart.h:
1762 declare new private bottleneck method registerCommandForUndoOrRedo
1763 * kwq/KWQKHTMLPart.mm:
1764 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1765 new bottleneck method to reduce code duplication; now calls over the bridge
1766 to get the localized string to use for the Undo action name
1767 (KWQKHTMLPart::registerCommandForUndo):
1768 now calls new bottleneck method
1769 (KWQKHTMLPart::registerCommandForRedo):
1770 now calls new bottleneck method
1772 * kwq/WebCoreBridge.h:
1773 new enum for WebUndoAction, maps directly to HTMLEditAction.
1774 Declaration of nameForUndoAction:
1776 2004-12-14 Darin Adler <darin@apple.com>
1780 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
1782 * khtml/rendering/render_frames.cpp:
1783 (RenderPart::~RenderPart): Check widget for nil.
1784 (RenderPart::setWidget): Ditto.
1785 (RenderFrame::slotViewCleared): Ditto.
1786 (RenderPartObject::slotViewCleared): Ditto.
1788 2004-12-13 Darin Adler <darin@apple.com>
1792 - moved markup-related functions into new sources files in the editing directory
1793 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
1795 * ForwardingHeaders/editing/markup.h: Added.
1796 * khtml/editing/markup.h: Added.
1797 * khtml/editing/markup.cpp: Added.
1799 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
1801 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
1802 * khtml/html/html_elementimpl.cpp:
1803 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
1804 (HTMLElementImpl::outerHTML): Ditto.
1806 * khtml/ecma/kjs_window.cpp:
1807 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
1808 (Window::retrieveActive): Ditto.
1810 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
1811 * khtml/xml/dom_docimpl.h: Ditto.
1813 * khtml/khtml_part.cpp:
1814 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
1815 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
1817 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
1818 still works even with the additional replace overloads added to QString.
1819 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
1821 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
1822 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
1823 * khtml/rendering/render_object.cpp: Ditto.
1824 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
1826 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
1827 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
1828 the support code into markup.cpp.
1830 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
1831 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1833 * khtml/xml/dom_position.cpp:
1834 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
1835 so these return null positions rather than raising exceptions.
1836 (DOM::endPosition): Ditto.
1838 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
1839 * kwq/KWQFrame.h: Ditto.
1840 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
1841 * kwq/KWQKPartsPart.h: Ditto.
1842 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
1843 * kwq/KWQScrollView.h: Ditto.
1844 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
1845 * kwq/KWQKHTMLPart.h: Ditto.
1846 * kwq/KWQKHTMLPart.mm:
1847 (KHTMLView::isKHTMLView): Ditto.
1848 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
1849 replace overloads added to QString.
1850 (KWQKHTMLPart::setStatusBarText): Ditto.
1851 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
1852 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
1853 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
1854 (KWQKHTMLPart::attributedString): Ditto.
1855 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
1856 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
1858 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
1860 (QObject::inherits): Changed to not use dynamic cast.
1861 (QObject::isKHTMLPart): Added. Returns false.
1862 (QObject::isKHTMLView): Ditto.
1863 (QObject::isKPartsReadOnlyPart): Ditto.
1864 (QObject::isQFrame): Ditto.
1865 (QObject::isQScrollView): Ditto.
1867 * kwq/KWQRenderTreeDebug.cpp:
1868 (write): Changed to use inherits rather than dynamic_cast.
1869 (writeSelection): Ditto.
1871 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
1872 than going straight on to the "no parameters at all" version.
1875 * kwq/KWQString.mm: (QString::replace): Added overloads.
1876 * kwq/WebCoreBridge.mm:
1877 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
1878 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
1879 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
1880 the additional replace overloads added to QString.
1881 (-[WebCoreBridge stringForRange:]): Ditto.
1882 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
1883 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
1884 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
1885 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
1887 2004-12-13 Ken Kocienda <kocienda@apple.com>
1893 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
1895 * khtml/editing/htmlediting.cpp:
1896 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
1897 leading and trailing whitespace positions was reversed! I must have introduced this error recently
1898 when changing around this code.
1900 2004-12-13 David Hyatt <hyatt@apple.com>
1902 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
1903 and painting was using the wrong rect when setting up the x/y of the rect.
1907 * khtml/rendering/render_block.cpp:
1908 (khtml::RenderBlock::paint):
1909 (khtml::RenderBlock::nodeAtPoint):
1910 * khtml/rendering/render_object.h:
1911 (khtml::RenderObject::floatRect):
1913 2004-12-13 Ken Kocienda <kocienda@apple.com>
1919 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
1921 Code to figuire out the end node to merge was missing the font tag in the second paragraph
1922 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
1924 * khtml/editing/htmlediting.cpp:
1925 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
1926 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
1927 insufficiently powerful.
1928 (khtml::ReplacementFragment::enclosingBlock): New helper function.
1929 * khtml/editing/htmlediting.h: Add declaration for new helper function.
1930 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
1931 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
1933 2004-12-13 Ken Kocienda <kocienda@apple.com>
1937 WebCore side of fix for this bug:
1939 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
1941 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
1942 bug. This change involves our half of the needed changes.
1944 Note that a lot of this change has to do with changing code to use a <br> element instead of
1945 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
1946 other places, code to handle comments in markup can be removed since we do not use comments for
1947 such annotations after this change.
1949 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
1950 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
1951 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
1952 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
1953 convertedSpaceSpanClassString to match other uses of the idiom used here.
1954 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1955 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
1956 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
1957 * khtml/html/html_elementimpl.cpp:
1958 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
1959 annotate fragments with comments any longer.
1960 * khtml/html/html_elementimpl.h: Ditto.
1961 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
1962 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
1963 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
1964 spurious semi-colon.
1965 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
1966 * kwq/WebCoreBridge.mm:
1967 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
1968 in DOM when calling createContextualFragment().
1970 2004-12-10 John Sullivan <sullivan@apple.com>
1972 fixed deployment build bustage that John Louch ran into
1974 * kwq/KWQTextEdit.mm:
1975 (QTextEdit::setScrollBarModes):
1976 move bool declaration inside exception-handling block to avoid obscure
1979 2004-12-10 Maciej Stachowiak <mjs@apple.com>
1981 Reviewed by Richard.
1983 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
1986 (QWidget::setFocus): Handle the case where setting focus removed
1987 us from the superview - this can happen due to style changes on
1990 2004-12-10 Ken Kocienda <kocienda@apple.com>
1996 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
1998 There are a number of interesting things we could do to fix this bug, including SPI and involving
1999 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
2000 will fix the bug in the general case until such time as we can come up with more specific
2003 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
2006 * khtml/editing/htmlediting.cpp:
2007 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
2008 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
2009 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
2010 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
2012 2004-12-10 Darin Adler <darin@apple.com>
2016 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
2018 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
2019 * khtml/rendering/render_form.cpp:
2020 (RenderSubmitButton::rawText): Convert to QChar explicitly.
2021 (RenderLineEdit::updateFromElement): Ditto.
2022 (RenderLineEdit::slotTextChanged): Ditto.
2023 (RenderSelect::updateFromElement): Ditto.
2024 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
2025 that requires a derived class. Now we don't use this class at all for WebCore, but they still
2027 (TextAreaWidget::event): Moved out the ifdefs.
2028 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
2029 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
2030 now done in setStyle.
2031 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
2032 that's needed and WebCore no longer has TextAreaWidget.
2033 (RenderTextArea::calcMinMaxWidth): Ditto.
2034 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
2036 (RenderTextArea::updateFromElement): Use type QTextEdit.
2037 (RenderTextArea::text): Ditto.
2038 (RenderTextArea::select): Ditto.
2040 * kwq/KWQTextArea.mm:
2041 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
2042 since it's now handled by QTextEdit.
2043 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
2045 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
2046 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
2047 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
2049 2004-12-10 Ken Kocienda <kocienda@apple.com>
2055 <rdar://problem/3915047> HItting return in empty document inserts <p> but
2056 insertion point does not move
2058 * khtml/editing/htmlediting.cpp:
2059 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
2060 code to insert the <p> element for the return is not detecting the fact
2061 that the document is empty. Inserting a <p> into an empty body will not
2062 "add a new line" as the user expects. With this change, we'll add a second
2063 <p> when the root editable element has no rendered kids.
2065 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2069 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
2071 * khtml/html/html_miscimpl.cpp:
2072 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
2073 the initial one step, otherwise we might inadvertantly step
2074 outside the collection base, thereby causing assertion failures or
2075 other badness later.
2077 2004-12-10 Ken Kocienda <kocienda@apple.com>
2081 * khtml/editing/htmlediting.cpp:
2082 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
2083 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
2084 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
2085 should do nothing if the starting point for the selection is itself the starting block.
2086 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
2087 function, though the names and concepts are slightly different.
2089 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2093 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
2095 * khtml/dom/html_document.cpp:
2096 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
2097 * khtml/dom/html_document.h:
2098 * khtml/ecma/kjs_html.cpp:
2099 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
2100 * khtml/html/html_miscimpl.cpp:
2101 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
2102 the items that can be accessed directly as a document propery, in particular forms, images,
2103 objects, applets and embeds.
2104 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
2105 (HTMLFormCollectionImpl::updateNameCache): Ditto.
2106 * khtml/html/html_miscimpl.h:
2107 (DOM::HTMLCollectionImpl::): Added new type.
2109 2004-12-10 Ken Kocienda <kocienda@apple.com>
2115 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
2117 * khtml/rendering/render_text.cpp:
2118 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
2120 2004-12-10 Ken Kocienda <kocienda@apple.com>
2126 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
2128 * khtml/editing/htmlediting.cpp:
2129 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
2130 that was removed from the document when pasting. This caused the disappearance. Now this
2131 is detected, and the selection is shifted to a node that is in the document.
2133 2004-12-09 Richard Williamson <rjw@apple.com>
2135 Check to disable threaded decoding during
2136 layout tests wasn't invoking function, just checking address of
2137 function, which would always return true.
2139 * kwq/WebCoreImageRendererFactory.m:
2140 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2142 2004-12-09 David Hyatt <hyatt@apple.com>
2144 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
2147 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
2148 all inlines when repainting.
2152 * khtml/rendering/render_block.cpp:
2153 (khtml::RenderBlock::layoutBlockChildren):
2154 * khtml/rendering/render_flow.cpp:
2155 (RenderFlow::getAbsoluteRepaintRect):
2157 2004-12-09 David Hyatt <hyatt@apple.com>
2159 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
2160 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
2161 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
2162 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
2166 * khtml/rendering/render_block.cpp:
2167 (khtml::RenderBlock::getClearDelta):
2168 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
2169 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
2170 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
2171 * layout-tests/fast/block/margin-collapse/102-expected.txt:
2172 * layout-tests/fast/block/margin-collapse/102.html:
2174 2004-12-09 Richard Williamson <rjw@apple.com>
2176 Fixed <rdar://problem/3914078> worldclock crashing gc related
2178 Use ProtectedValue for Context2D instance members.
2182 * khtml/ecma/kjs_html.h:
2184 2004-12-09 John Sullivan <sullivan@apple.com>
2188 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
2190 * kwq/KWQAccObject.mm:
2191 (-[KWQAccObject title]): moved image alt tag code out of here
2192 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
2193 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
2194 that ordinary elements return; this means that ordinary elements that aren't images will return
2195 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
2197 (-[KWQAccObject accessibilityAttributeValue:]):
2198 call accessibilityDescription when asked for AXDescription
2200 2004-12-09 Ken Kocienda <kocienda@apple.com>
2202 Reviewed by Harrison
2206 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
2208 * khtml/editing/htmlediting.cpp:
2209 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
2210 been deleted. If this is the case, set the destination to the node the delete command provides in
2211 its ending selection.
2215 2004-12-09 Ken Kocienda <kocienda@apple.com>
2221 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
2223 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
2224 callback may not be delivered before the program asks for the dimensions of an image in order to
2225 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
2226 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
2228 * kwq/KWQRenderTreeDebug.cpp:
2229 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
2230 (externalRepresentation): Sets debuggingRenderTree flag to true;
2231 * kwq/KWQRenderTreeDebug.h:
2232 * kwq/WebCoreImageRendererFactory.m:
2233 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
2234 do threaded decoding in any case if the flag is set.
2236 2004-12-09 Chris Blumenberg <cblu@apple.com>
2238 Fix for busting XMLHTTPRequest.
2240 Reviewed by kocienda.
2242 * khtml/misc/loader.cpp:
2243 (Loader::servePendingRequests): pass true for deliverAllData
2245 (KIO::get): take deliverAllData param
2246 (KIO::http_post): ditto
2247 * kwq/KWQKJobClasses.h:
2248 * kwq/KWQKJobClasses.mm:
2249 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
2250 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
2252 2004-12-09 Ken Kocienda <kocienda@apple.com>
2256 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
2258 * khtml/xml/dom_nodeimpl.cpp:
2259 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
2261 2004-12-07 Richard Williamson <rjw@apple.com>
2263 Support threaded image decoding on machines w/ > 2 CPUs.
2265 Reviewed by Maciej and Chris.
2267 * khtml/misc/loader.cpp:
2268 (CachedImageCallback::notifyUpdate):
2269 (CachedImageCallback::notifyFinished):
2270 (CachedImageCallback::notifyDecodingError):
2271 (CachedImageCallback::handleError):
2272 (CachedImageCallback::clear):
2273 (CachedImage::CachedImage):
2274 (CachedImage::clear):
2275 (CachedImage::data):
2276 (CachedImage::checkNotify):
2277 (Loader::servePendingRequests):
2278 (Loader::slotFinished):
2279 (Loader::numRequests):
2280 (Loader::cancelRequests):
2281 (Loader::removeBackgroundDecodingRequest):
2282 * khtml/misc/loader.h:
2283 (khtml::CachedImageCallback::CachedImageCallback):
2284 (khtml::CachedImageCallback::ref):
2285 (khtml::CachedImageCallback::deref):
2286 (khtml::CachedImage::decoderCallback):
2287 * khtml/rendering/render_object.cpp:
2288 (RenderObject::setPixmap):
2291 (-[WebImageCallback initWithCallback:khtml::]):
2292 (-[WebImageCallback _commonTermination]):
2293 (-[WebImageCallback dealloc]):
2294 (-[WebImageCallback finalize]):
2295 (-[WebImageCallback notify]):
2296 (-[WebImageCallback setImageSourceStatus:]):
2297 (-[WebImageCallback status]):
2298 (QPixmap::shouldUseThreadedDecoding):
2299 (QPixmap::receivedData):
2300 * kwq/WebCoreImageRenderer.h:
2301 * kwq/WebCoreImageRendererFactory.h:
2302 * kwq/WebCoreImageRendererFactory.m:
2303 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2304 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
2306 2004-12-07 Ken Kocienda <kocienda@apple.com>
2310 * khtml/editing/htmlediting.cpp:
2311 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
2312 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
2313 after new block has been inserted, otherwise a crash can result. Shuffle down call
2314 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
2317 2004-12-07 Ken Kocienda <kocienda@apple.com>
2323 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
2325 * khtml/editing/htmlediting.cpp:
2326 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
2327 for determining the location for inserting content. Do not allow an insert before or after if the
2328 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
2329 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
2330 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
2332 2004-12-07 Darin Adler <darin@apple.com>
2336 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
2338 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
2340 2004-12-07 Ken Kocienda <kocienda@apple.com>
2344 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
2345 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
2347 * khtml/editing/html_interchange.h: Name change, as described above.
2348 * khtml/editing/htmlediting.cpp:
2349 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
2350 * khtml/xml/dom2_rangeimpl.cpp:
2351 (DOM::RangeImpl::toHTML): Ditto.
2353 2004-12-07 Ken Kocienda <kocienda@apple.com>
2357 Added a couple more layout tests.
2359 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
2360 * layout-tests/editing/deleting/delete-line-013.html: Added.
2361 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
2362 * layout-tests/editing/deleting/delete-line-014.html: Added.
2364 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2368 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
2370 * kwq/KWQListBox.mm:
2371 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
2372 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
2373 (-[KWQListBoxScrollView widget]): See above.
2374 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
2375 afterMouseDown, to avoid triggering an assertion failure.
2377 2004-12-06 David Hyatt <hyatt@apple.com>
2379 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
2380 made by me, kocienda and harrison to just remove it.
2384 * khtml/rendering/bidi.cpp:
2385 (khtml::RenderBlock::layoutInlineChildren):
2386 * khtml/rendering/render_block.cpp:
2387 (khtml:::RenderFlow):
2388 * khtml/rendering/render_block.h:
2389 * khtml/rendering/render_flow.cpp:
2390 (RenderFlow::dirtyLinesFromChangedChild):
2392 2004-12-06 David Hyatt <hyatt@apple.com>
2394 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
2395 not a damage rect that can be changed when intersected with the clip regions of the web page.
2399 * khtml/rendering/render_canvas.h:
2400 (khtml::RenderCanvas::printRect):
2401 (khtml::RenderCanvas::setPrintRect):
2402 * khtml/rendering/render_flow.cpp:
2403 (RenderFlow::paintLines):
2404 * khtml/rendering/render_list.cpp:
2405 (RenderListMarker::paint):
2406 * kwq/KWQKHTMLPart.mm:
2407 (KWQKHTMLPart::adjustPageHeight):
2409 2004-12-06 David Harrison <harrison@apple.com>
2411 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
2413 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
2416 * khtml/rendering/render_flow.cpp:
2417 (RenderFlow::dirtyLinesFromChangedChild):
2418 Dirty the line above because new child can inval the cached line break position of previous line.
2420 2004-12-06 David Hyatt <hyatt@apple.com>
2422 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
2423 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
2424 3126929, handle top/left overflow.
2426 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
2428 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
2429 regions and web pages) has been fixed.
2433 * khtml/rendering/bidi.cpp:
2434 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2435 (khtml::RenderBlock::checkLinesForOverflow):
2436 * khtml/rendering/render_block.cpp:
2437 (khtml:::RenderFlow):
2438 (khtml::RenderBlock::overflowHeight):
2439 (khtml::RenderBlock::overflowWidth):
2440 (khtml::RenderBlock::overflowLeft):
2441 (khtml::RenderBlock::overflowTop):
2442 (khtml::RenderBlock::overflowRect):
2443 (khtml::RenderBlock::layoutBlock):
2444 (khtml::RenderBlock::layoutBlockChildren):
2445 (khtml::RenderBlock::paint):
2446 (khtml::RenderBlock::floatRect):
2447 (khtml::RenderBlock::lowestPosition):
2448 (khtml::RenderBlock::rightmostPosition):
2449 (khtml::RenderBlock::leftmostPosition):
2450 (khtml::RenderBlock::nodeAtPoint):
2451 * khtml/rendering/render_block.h:
2452 * khtml/rendering/render_box.h:
2453 (khtml::RenderBox::borderBox):
2454 (khtml::RenderBox::borderTopExtra):
2455 (khtml::RenderBox::borderBottomExtra):
2456 * khtml/rendering/render_layer.cpp:
2457 (RenderLayer::paintScrollbars):
2458 (mustExamineRenderer):
2459 (RenderLayer::intersectsDamageRect):
2460 (RenderLayer::containsPoint):
2461 * khtml/rendering/render_line.cpp:
2462 (khtml::InlineFlowBox::placeBoxesHorizontally):
2463 (khtml::InlineFlowBox::verticallyAlignBoxes):
2464 * khtml/rendering/render_line.h:
2465 (khtml::InlineBox::leftOverflow):
2466 (khtml::InlineBox::rightOverflow):
2467 (khtml::InlineFlowBox::setVerticalOverflowPositions):
2468 (khtml::RootInlineBox::RootInlineBox):
2469 (khtml::RootInlineBox::leftOverflow):
2470 (khtml::RootInlineBox::rightOverflow):
2471 (khtml::RootInlineBox::setVerticalOverflowPositions):
2472 (khtml::RootInlineBox::setHorizontalOverflowPositions):
2473 * khtml/rendering/render_object.h:
2474 (khtml::RenderObject::borderBox):
2475 (khtml::RenderObject::overflowLeft):
2476 (khtml::RenderObject::overflowTop):
2477 (khtml::RenderObject::overflowRect):
2478 (khtml::RenderObject::floatRect):
2479 * khtml/rendering/render_table.cpp:
2480 (RenderTable::layout):
2481 (RenderTable::paint):
2482 (RenderTable::paintBoxDecorations):
2483 (RenderTable::calcMinMaxWidth):
2484 * khtml/rendering/render_table.h:
2485 (khtml::RenderTableCell::borderTopExtra):
2486 (khtml::RenderTableCell::borderBottomExtra):
2491 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2495 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
2497 I changed all unprotected places that can navigate a different
2498 window or frame from script to check for a javascript: URL, and if
2499 found, to check for safety using cross-site-script rules.
2501 I considered a few other possible exploits and made no change:
2503 - document.location is already protected because the document
2504 object itself is protected
2506 - frame.src, frame.location, iframe.src and targetted links are
2507 all safe because setting the URL of a frame to a javascript: URL
2508 executes the script in the context of the parent
2510 * khtml/ecma/kjs_window.cpp:
2511 (WindowFunc::tryCall):
2513 (LocationFunc::tryCall):
2515 2004-12-06 Ken Kocienda <kocienda@apple.com>
2521 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
2523 * khtml/editing/htmlediting.cpp:
2524 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
2525 check for one of the special cases being checked for in this function. The specific case
2526 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
2527 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
2528 case where a selection ended in a <br> after a block and would not delete any part of the
2529 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
2532 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
2533 new use of the function exposed this bug:
2535 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
2537 * khtml/xml/dom_position.cpp:
2538 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
2539 not have this fatal flaw. It is a much better design as well.
2541 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
2542 have what I consider to be a better result. Going with it.
2544 2004-12-06 Chris Blumenberg <cblu@apple.com>
2546 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
2551 (-[DOMElement _font]): new SPI for AppKit
2554 2004-12-06 Darin Adler <darin@apple.com>
2558 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
2560 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
2561 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
2563 2004-12-06 John Sullivan <sullivan@apple.com>
2565 Darin found what appears to be the real leak that we were falsely blaming
2566 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
2567 sure nothing barfed.
2569 * khtml/css/cssparser.cpp:
2570 (CSSParser::parseValue):
2571 call clearProperties() instead of just setting numParsedProperties to 0
2572 (CSSParser::parseDeclaration):
2574 (CSSParser::createStyleDeclaration):
2577 2004-12-06 Ken Kocienda <kocienda@apple.com>
2583 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
2584 * layout-tests/editing/inserting/insert-div-001.html: Added.
2585 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
2586 * layout-tests/editing/inserting/insert-div-002.html: Added.
2587 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
2588 * layout-tests/editing/inserting/insert-div-003.html: Added.
2589 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
2590 * layout-tests/editing/inserting/insert-div-004.html: Added.
2591 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
2592 * layout-tests/editing/inserting/insert-div-005.html: Added.
2593 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
2594 * layout-tests/editing/inserting/insert-div-006.html: Added.
2595 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
2596 * layout-tests/editing/inserting/insert-div-007.html: Added.
2597 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
2598 * layout-tests/editing/inserting/insert-div-008.html: Added.
2599 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
2600 * layout-tests/editing/inserting/insert-div-009.html: Added.
2602 2004-12-06 Ken Kocienda <kocienda@apple.com>
2604 Reviewed by Harrison
2608 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
2610 * khtml/editing/htmlediting.cpp:
2611 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
2612 being added to this function. This ensures that the added block has a height.
2613 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2615 2004-12-06 Ken Kocienda <kocienda@apple.com>
2619 * khtml/dom/dom_string.cpp:
2620 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
2621 * khtml/dom/dom_string.h: Ditto.
2622 * khtml/editing/htmlediting.cpp:
2623 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
2624 RebalanceWhitespaceCommand instance.
2625 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
2626 (khtml::InsertLineBreakCommand::doApply): Ditto.
2627 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2628 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2629 (khtml::InsertTextCommand::input): Ditto.
2630 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
2631 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
2632 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2633 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
2634 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
2635 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
2636 * khtml/editing/htmlediting.h: Ditto.
2637 (khtml::RebalanceWhitespaceCommand::): Ditto.
2639 2004-12-05 Darin Adler <darin@apple.com>
2641 - fixed small problem in my check-in from yesterday
2644 (positionForEvent): Get location from event without raising exception if it's the wrong type.
2645 (clickCountForEvent): Same, for clickCount.
2646 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
2647 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
2648 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
2650 2004-12-04 Darin Adler <darin@apple.com>
2654 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
2656 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
2657 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
2658 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
2660 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
2662 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
2663 * khtml/rendering/render_form.cpp:
2664 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
2665 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
2666 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
2668 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
2669 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
2670 Added a fixState helper method so the constructors can save code.
2672 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
2673 and added a third constructor that uses the "current event" from AppKit (used above).
2674 (QMouseEvent::fixState): Compute state and click count based on event type.
2676 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
2678 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
2679 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
2680 underlying cause in CSS.
2682 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
2684 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
2685 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
2687 2004-12-03 Chris Blumenberg <cblu@apple.com>
2690 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2691 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2692 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2693 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
2695 Reviewed by darin, rjw, kocienda.
2697 * khtml/misc/loader.cpp:
2698 (CachedObject::~CachedObject):
2699 (CachedCSSStyleSheet::checkNotify):
2700 (Loader::servePendingRequests):
2701 (Loader::slotFinished):
2702 (Loader::slotReceivedResponse):
2703 (Cache::requestImage):
2704 (Cache::requestScript):
2705 * khtml/misc/loader.h:
2706 (khtml::CachedObject::CachedObject):
2707 (khtml::CachedObject::response):
2708 (khtml::CachedObject::allData):
2709 * kwq/KWQKJobClasses.h:
2710 * kwq/KWQKJobClasses.mm:
2711 (KIO::TransferJobPrivate::TransferJobPrivate):
2712 (KIO::TransferJobPrivate::~TransferJobPrivate):
2713 (KIO::TransferJob::TransferJob):
2714 (KIO::TransferJob::assembleResponseHeaders):
2715 (KIO::TransferJob::retrieveCharset):
2716 (KIO::TransferJob::emitResult):
2717 (KIO::TransferJob::emitReceivedResponse):
2720 (KWQHeaderStringFromDictionary):
2721 (KWQCheckCacheObjectStatus):
2722 (KWQIsResponseURLEqualToURL):
2724 (KWQResponseMIMEType):
2725 (KWQCacheObjectExpiresTime):
2726 (khtml::CachedObject::setResponse):
2727 (khtml::CachedObject::setAllData):
2731 * kwq/KWQResourceLoader.mm:
2732 (-[KWQResourceLoader finishJobAndHandle:]):
2733 (-[KWQResourceLoader cancel]):
2734 (-[KWQResourceLoader reportError]):
2735 (-[KWQResourceLoader finishWithData:]):
2743 * kwq/WebCoreBridge.h:
2744 * kwq/WebCoreResourceLoader.h:
2746 2004-12-04 Darin Adler <darin@apple.com>
2750 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
2752 * khtml/rendering/render_form.cpp:
2753 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
2754 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
2755 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
2756 (RenderSlider::slotSliderValueChanged): Ditto.
2758 2004-12-03 John Sullivan <sullivan@apple.com>
2762 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
2763 khtml::BackgroundLayer::cullEmptyLayers
2765 * khtml/rendering/render_style.cpp:
2766 (BackgroundLayer::cullEmptyLayers):
2767 added missing nil check
2771 2004-12-03 Ken Kocienda <kocienda@apple.com>
2775 Roll out some recent changes by Chris that caused a performance regression.
2776 Fix is in hand, but it is a little risky this close to a submission. So,
2777 we have decided to roll back the change with the regression and roll in
2778 the new code after we submit.
2780 * khtml/css/cssproperties.c:
2783 * khtml/css/cssvalues.c:
2786 * khtml/misc/htmlattrs.c:
2789 * khtml/misc/htmltags.c:
2792 * khtml/misc/loader.cpp:
2793 (CachedObject::~CachedObject):
2794 (CachedObject::setResponse):
2795 (CachedCSSStyleSheet::checkNotify):
2796 (Loader::servePendingRequests):
2797 (Loader::slotFinished):
2798 (Loader::slotReceivedResponse):
2799 (Cache::requestImage):
2800 (Cache::requestScript):
2801 * khtml/misc/loader.h:
2802 (khtml::CachedObject::CachedObject):
2803 (khtml::CachedObject::response):
2804 * kwq/KWQKJobClasses.h:
2805 * kwq/KWQKJobClasses.mm:
2806 (KIO::TransferJobPrivate::TransferJobPrivate):
2807 (KIO::TransferJobPrivate::~TransferJobPrivate):
2808 (KIO::TransferJob::TransferJob):
2809 (KIO::TransferJob::assembleResponseHeaders):
2810 (KIO::TransferJob::retrieveCharset):
2811 (KIO::TransferJob::emitResult):
2812 (KIO::TransferJob::emitReceivedResponse):
2815 (KWQHeaderStringFromDictionary):
2816 (KWQCheckCacheObjectStatus):
2817 (KWQRetainResponse):
2818 (KWQReleaseResponse):
2819 (KWQIsResponseURLEqualToURL):
2821 (KWQResponseMIMEType):
2822 (KWQResponseTextEncodingName):
2823 (KWQResponseHeaderString):
2824 (KWQCacheObjectExpiresTime):
2825 (KWQLoader::KWQLoader):
2829 * kwq/KWQResourceLoader.mm:
2830 (-[KWQResourceLoader finishJobAndHandle]):
2831 (-[KWQResourceLoader cancel]):
2832 (-[KWQResourceLoader reportError]):
2833 (-[KWQResourceLoader finish]):
2841 * kwq/WebCoreBridge.h:
2842 * kwq/WebCoreResourceLoader.h:
2844 2004-12-03 John Sullivan <sullivan@apple.com>
2848 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
2850 * kwq/KWQKHTMLPart.mm:
2851 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
2852 when checking whether we moved the focus to another view, make sure we didn't "move" it to
2853 our documentView, because that's no move at all.
2855 2004-12-03 Darin Adler <darin@apple.com>
2859 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
2861 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
2862 Added missing initialization for base class and node pointer.
2864 - fixed a few places that could leave dangling node pointers
2866 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
2867 Clear out the node pointer when the node is destroyed.
2868 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
2870 2004-12-03 Chris Blumenberg <cblu@apple.com>
2872 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.
2873 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2877 * khtml/misc/loader.cpp:
2878 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
2879 (Loader::slotFinished): take data param
2880 * khtml/misc/loader.h:
2881 * kwq/KWQKJobClasses.h:
2882 * kwq/KWQKJobClasses.mm:
2883 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
2884 (KIO::TransferJob::emitResult): take data param and pass it
2885 * kwq/KWQResourceLoader.mm:
2886 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
2887 (-[KWQResourceLoader cancel]): pass nil for data
2888 (-[KWQResourceLoader reportError]): ditto
2889 (-[KWQResourceLoader finishWithData:]): pass data
2891 (KWQSlot::KWQSlot): pass data param to slotFinished
2892 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
2894 2004-12-03 Ken Kocienda <kocienda@apple.com>
2898 Did some clean up in the Position class as a result of trying to write some new layout
2899 tests and discovering a bug along the way.
2901 I removed these three functions from the Position class:
2903 1. bool isFirstRenderedPositionOnLine() const;
2904 2. bool isLastRenderedPositionOnLine() const;
2905 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
2906 4. bool inFirstEditableInRootEditableElement() const;
2908 The first two have replacements in the VisiblePosition class, and some code has been
2909 moved to use these new variants. The third function was a helper used only by these
2910 first two function, and can be removed as well. The fourth function was not used by anyone.
2912 * khtml/editing/htmlediting.cpp:
2913 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2914 * khtml/editing/visible_position.cpp:
2915 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
2916 Incorrect results were being returned when asking about positions at the starts of blocks.
2917 * khtml/xml/dom_position.cpp:
2918 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
2919 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
2920 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
2921 * khtml/xml/dom_position.h: Update header for deletions.
2923 2004-12-03 Ken Kocienda <kocienda@apple.com>
2927 Terminology change in execCommand command identifiers. Specifically, the name of
2928 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
2929 terminology used by AppKit. It is also more accurate, since the insertion of a
2930 "br" element is what the command does. The inspiration for this change is so the
2931 -insertNewline AppKit method can be mapped to insert a new "div" element in
2932 a document and avoid ambiguity with what the javascript editing command does.
2934 * khtml/editing/jsediting.cpp
2935 * layout-tests/editing/deleting/delete-tab-004.html
2936 * layout-tests/editing/editing.js
2937 * layout-tests/editing/inserting/insert-3654864-fix.html
2938 * layout-tests/editing/inserting/insert-3659587-fix.html
2939 * layout-tests/editing/inserting/insert-3775316-fix.html
2940 * layout-tests/editing/inserting/insert-3800346-fix.html
2941 * layout-tests/editing/inserting/insert-br-001.html
2942 * layout-tests/editing/inserting/insert-br-002.html
2943 * layout-tests/editing/inserting/insert-br-003.html
2944 * layout-tests/editing/inserting/insert-br-004.html
2945 * layout-tests/editing/inserting/insert-br-005.html
2946 * layout-tests/editing/inserting/insert-br-006.html
2947 * layout-tests/editing/inserting/insert-br-007.html
2948 * layout-tests/editing/inserting/insert-br-008.html
2949 * layout-tests/editing/inserting/insert-tab-004.html
2950 * layout-tests/editing/inserting/insert-text-with-newlines.html
2951 * layout-tests/editing/pasteboard/paste-text-010.html
2953 2004-12-02 Ken Kocienda <kocienda@apple.com>
2959 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
2961 * khtml/editing/htmlediting.cpp:
2962 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
2963 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
2964 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
2965 in a block and the document is in quirks mode, add an additional br to make the one in the
2966 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
2967 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
2968 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
2970 2004-12-02 Richard Williamson <rjw@apple.com>
2972 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
2974 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
2975 the b/f cache won't incorrectly trash the previous state when restoring.
2979 * kwq/WebCoreBridge.h:
2980 * kwq/WebCoreBridge.mm:
2981 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
2982 (-[WebCoreBridge canCachePage]):
2983 (-[WebCoreBridge clear]):
2985 2004-12-02 Ken Kocienda <kocienda@apple.com>
2991 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
2993 * khtml/xml/dom2_rangeimpl.cpp:
2994 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
2995 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
2996 of this bug where there is content after the body tag). Did a little code clean up as well.
2997 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
2999 2004-12-02 Ken Kocienda <kocienda@apple.com>
3005 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
3007 * khtml/khtml_part.cpp:
3008 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
3009 to figure out which end of the selection to extend.
3011 2004-12-02 David Harrison <harrison@apple.com>
3013 Reviewed by Ken Kocienda.
3015 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
3016 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
3018 * khtml/editing/visible_text.cpp:
3019 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3020 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
3021 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
3022 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
3023 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
3024 Distinguish BR from whitespace.
3025 * khtml/editing/visible_text.h:
3026 Distinguish BR from whitespace.
3027 * khtml/editing/visible_units.cpp:
3028 (khtml::previousWordBoundary):
3029 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.
3031 2004-12-02 Ken Kocienda <kocienda@apple.com>
3037 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
3039 * khtml/xml/dom_position.cpp:
3040 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
3041 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
3042 exception trying to use a Position returned from this function to set the boundary point of a Range (which
3043 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
3044 contract to return a range-compliant position, hence the need for this fix.
3046 2004-12-01 Ken Kocienda <kocienda@apple.com>
3052 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
3053 regard to other editing commands. The class had a name change ages ago, and it was never
3055 * khtml/editing/htmlediting.h: Ditto.
3057 2004-12-01 Ken Kocienda <kocienda@apple.com>
3061 Some improvements for paste, including some new code to annotate
3062 whitespace when writing to the pasteboard to ensure that the meaning
3063 of the markup on the pasteboard is unambiguous.
3065 There is also new code for reading this annotated markup from the pasteboard,
3066 removing the nodes that were added only to prevent ambiguity.
3068 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
3069 The header should have been added earlier, but I did not do so.
3070 * khtml/editing/html_interchange.cpp: Added.
3071 (convertHTMLTextToInterchangeFormat):
3072 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
3073 * khtml/editing/htmlediting.cpp:
3074 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
3075 Also fixed a bug in the code that counts blocks in a fragment.
3076 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
3077 (khtml::ReplacementFragment::insertNodeBefore): New helper.
3078 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
3079 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
3080 * khtml/editing/htmlediting.h: Add some new declarations.
3081 * khtml/xml/dom2_rangeimpl.cpp:
3082 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
3083 * khtml/xml/dom_nodeimpl.cpp:
3084 (NodeImpl::stringValueForRange): New helper.
3085 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
3086 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
3087 should be added. Called by the paste code.
3088 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
3090 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
3091 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
3092 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
3094 2004-11-30 Chris Blumenberg <cblu@apple.com>
3096 * ChangeLog: removed conflict marker
3098 2004-11-30 Chris Blumenberg <cblu@apple.com>
3101 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
3102 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
3106 * khtml/misc/loader.cpp:
3107 (CachedObject::~CachedObject): release m_allData
3108 (CachedObject::setAllData): new
3109 (Loader::servePendingRequests): connect slotAllData
3110 (Loader::slotAllData): new
3111 (Cache::requestImage): tweak
3112 * khtml/misc/loader.h:
3113 (khtml::CachedObject::CachedObject): set allData to 0
3114 (khtml::CachedObject::allData): new
3115 * kwq/KWQKJobClasses.h:
3116 * kwq/KWQKJobClasses.mm:
3117 (KIO::TransferJob::TransferJob): set m_allData
3118 (KIO::TransferJob::emitAllData): new
3120 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
3121 * kwq/KWQResourceLoader.mm:
3122 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
3124 (KWQSlot::KWQSlot): support for slotAllData
3126 * kwq/WebCoreBridge.h:
3127 * kwq/WebCoreResourceLoader.h:
3129 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3133 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3137 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
3139 * khtml/khtml_part.cpp:
3140 (KHTMLPart::begin): call setParsing on document here after opening
3141 - from now on we'll only set parsing to true for a document open
3142 caused by page loading, not a programmatic one.
3143 * khtml/xml/dom_docimpl.cpp:
3144 (DocumentImpl::open): don't setParsing to true here any more.
3146 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3150 - fix recent regression from collection perf fixes.
3152 * khtml/html/html_miscimpl.cpp:
3153 (HTMLFormCollectionImpl::updateNameCache): Look up the name
3154 attribute in the name cache, not the id cache (d'oh!)
3156 2004-11-30 Darin Adler <darin@apple.com>
3160 - rolled in a KDE fix for a problem that may underlie a number of crashes
3162 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
3163 the KDE guys to fix a subtle problem. Code said "n = n =".
3165 - rolled in a KDE fix for a containingBlock crash
3167 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
3168 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
3171 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
3174 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
3175 (-[KWQButton detachQButton]): Added.
3176 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
3177 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
3178 (-[KWQButton widget]): Added.
3179 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
3180 (-[KWQButton resignFirstResponder]): Ditto.
3181 (-[KWQButton canBecomeKeyView]): Ditto.
3182 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
3183 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
3185 * kwq/KWQComboBox.mm:
3186 (QComboBox::~QComboBox): Call detachQComboBox.
3187 (-[KWQPopUpButtonCell detachQComboBox]): Added.
3188 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
3189 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
3190 (-[KWQPopUpButton action:]): Ditto.
3191 (-[KWQPopUpButton widget]): Tweaked.
3192 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
3193 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
3194 (-[KWQPopUpButton resignFirstResponder]): Ditto.
3195 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
3197 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
3199 * kwq/KWQListBox.mm:
3200 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
3202 * kwq/KWQScrollBar.h: Removed m_scroller field.
3203 * kwq/KWQScrollBar.mm:
3204 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
3205 (-[KWQScrollBar detachQScrollBar]): Added.
3206 (-[KWQScrollBar widget]): Added.
3207 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
3208 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
3209 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
3210 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
3211 (QScrollBar::setKnobProportion): Ditto.
3212 (QScrollBar::scrollbarHit): Ditto.
3214 * kwq/KWQScrollView.mm:
3215 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
3216 hack where we don't remove right away when doing mouse tracking.
3217 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
3218 the hack where we don't add right away when doing mouse tracking.
3220 * kwq/KWQSlider.h: Added destructor.
3222 (-[KWQSlider initWithQSlider:]): Tweaked a little.
3223 (-[KWQSlider detachQSlider]): Added.
3224 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
3225 (-[KWQSlider widget]): Added.
3226 (QSlider::~QSlider): Added. Calls detachQSlider.
3228 * kwq/KWQTextArea.h: Added detachQTextEdit method.
3229 * kwq/KWQTextArea.mm:
3230 (-[KWQTextArea detachQTextEdit]): Added.
3231 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
3232 (-[KWQTextArea becomeFirstResponder]): Ditto.
3233 (-[KWQTextArea nextKeyView]): Ditto.
3234 (-[KWQTextArea previousKeyView]): Ditto.
3235 (-[KWQTextArea drawRect:]): Ditto.
3236 (-[KWQTextAreaTextView insertTab:]): Ditto.
3237 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
3238 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
3239 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
3240 (-[KWQTextAreaTextView mouseDown:]): Ditto.
3241 (-[KWQTextAreaTextView keyDown:]): Ditto.
3242 (-[KWQTextAreaTextView keyUp:]): Ditto.
3244 * kwq/KWQTextEdit.h: Added ~QTextEdit.
3245 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
3247 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
3248 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
3250 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
3251 Added beforeMouseDown and afterMouseDown for use in widget implementations.
3252 Removed unused hasMouseTracking function.
3254 (QWidget::QWidget): Initialize two new fields.
3255 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
3256 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
3257 (QWidget::addToSuperview): Added.
3258 (QWidget::removeFromSuperview): Added.
3259 (QWidget::beforeMouseDown): Added.
3260 (QWidget::afterMouseDown): Added.
3262 * khtml/rendering/render_layer.cpp:
3263 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
3264 (RenderLayer::setHasVerticalScrollbar): Ditto.
3266 2004-11-30 Ken Kocienda <kocienda@apple.com>
3272 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
3274 * khtml/khtml_part.cpp:
3275 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
3276 with no blink if it is.
3278 2004-11-30 Ken Kocienda <kocienda@apple.com>
3284 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
3286 * khtml/khtml_part.cpp:
3287 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
3288 or <input type=image> was checked for focus since these elements are keyboard-focusable,
3289 but not mouse focusable. Also, this function did not work hard enough to set the focused
3290 node, and was content to clear it if the first element checked failed the test, rather
3291 than looking more at parents. This would have the effect of clearing, then resetting the
3292 focus on a DIV containing a button or image with content on either side of it in the
3293 process of arrowing over such content.
3295 2004-11-30 Ken Kocienda <kocienda@apple.com>
3299 * khtml/editing/htmlediting.cpp:
3300 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
3301 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
3302 * khtml/khtml_part.cpp:
3303 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
3304 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
3305 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
3306 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
3307 isCharacterSmartReplaceExempt virtual.
3309 2004-11-30 Ken Kocienda <kocienda@apple.com>
3313 * khtml/editing/htmlediting.cpp:
3314 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
3315 Seemed simple enough to land without review.
3317 2004-11-29 Ken Kocienda <kocienda@apple.com>
3321 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
3322 are handled correctly now, including selections that span multiple blocks, and cases
3323 where content on the pasteboard ends in newlines (or what appear to be newlines to a
3324 user, really block ends or BRs). I also made one small, but important change in the
3325 copy code to annotate the markup written to the pasteboard to support these selections
3328 New header that defines a couple of constants used in copying and pasting.
3330 * ForwardingHeaders/editing/html_interchange.h: Added.
3331 * khtml/editing/html_interchange.h: Added.
3333 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
3334 as a new helper class, ReplacementFragment, which encapsulates information and functions
3335 pertaining to a document fragment that is being inserted into a document.
3337 * khtml/editing/htmlediting.cpp:
3338 (khtml::ReplacementFragment::ReplacementFragment):
3339 (khtml::ReplacementFragment::~ReplacementFragment):
3340 (khtml::ReplacementFragment::firstChild): Simple accessor.
3341 (khtml::ReplacementFragment::lastChild): Ditto.
3342 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
3343 the starting node to use for merging into the block containing the start of the selection.
3344 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
3345 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
3346 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
3347 special annotation comment added in by the copy code.
3348 (khtml::ReplacementFragment::removeNode): Simple helper.
3349 (khtml::isComment): Simple helper.
3350 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
3351 I would like to do better than this some day, but this check will hold us until I can do better.
3352 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
3353 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
3354 (khtml::ReplaceSelectionCommand::doApply):
3355 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
3356 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
3357 (khtml::ReplacementFragment::root):
3358 (khtml::ReplacementFragment::type):
3359 (khtml::ReplacementFragment::isEmpty):
3360 (khtml::ReplacementFragment::isSingleTextNode):
3361 (khtml::ReplacementFragment::isTreeFragment):
3362 (khtml::ReplacementFragment::hasMoreThanOneBlock):
3363 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
3365 This smaller set of changes markup generation to add the newline annotation described in the
3366 comment at the start of this entry.
3368 * khtml/xml/dom2_rangeimpl.cpp:
3369 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
3370 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
3371 comment annotations are added to the markup generated.
3372 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
3373 * kwq/WebCoreBridge.mm:
3374 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
3375 DOM::RangeImpl::toHTML uses annotations when generating.
3379 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
3380 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
3381 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
3382 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
3383 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
3384 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
3385 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
3386 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
3387 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
3388 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
3389 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
3390 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
3391 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
3392 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
3393 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
3394 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
3395 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
3396 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
3398 2004-11-29 Ken Kocienda <kocienda@apple.com>
3400 Reviewed by Harrison
3402 Made two small changes that make it possible for comments to have DOM nodes made for them
3403 when pasting. This relies on some earlier work I did some days ago.
3405 * khtml/xml/dom_nodeimpl.cpp:
3406 (NodeImpl::startMarkup): Get the string from the comment.
3407 * kwq/WebCoreBridge.mm:
3408 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
3409 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
3410 be included in the DOM.
3412 2004-11-29 Ken Kocienda <kocienda@apple.com>
3414 Reviewed by Harrison
3416 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
3417 my improved paste code.
3419 * khtml/editing/visible_position.cpp:
3420 (khtml::blockRelationship)
3421 (khtml::visiblePositionsInDifferentBlocks)
3422 (khtml::isFirstVisiblePositionInBlock)
3423 (khtml::isFirstVisiblePositionInNode)
3424 (khtml::isLastVisiblePositionInBlock)
3425 * khtml/editing/visible_position.h
3427 2004-11-29 Ken Kocienda <kocienda@apple.com>
3429 Reviewed by Harrison
3431 * khtml/xml/dom_position.cpp:
3432 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
3433 specified from obeying that directive. The old code would stop at an outer block boundary in
3434 the case where that block had a block as its first child. The correct behavior is to drill into
3435 that inner block (and continue on drilling down, if possible), to find the correct position.
3437 2004-11-29 Ken Kocienda <kocienda@apple.com>
3439 Reviewed by Harrison
3441 Small improvements to the node-display debugging helpers.
3443 * khtml/xml/dom_nodeimpl.cpp:
3444 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
3445 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
3447 2004-11-29 Ken Kocienda <kocienda@apple.com>
3449 Reviewed by Harrison
3451 * khtml/editing/htmlediting.cpp:
3452 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
3453 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
3454 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
3455 place after the delete.
3457 2004-11-29 Ken Kocienda <kocienda@apple.com>
3459 Reviewed by Harrison
3461 Add a new helper function to insert a paragraph separator. Will be used in my
3462 upcoming paste improvments.
3464 * khtml/editing/htmlediting.cpp: Added function
3465 (khtml::CompositeEditCommand::insertParagraphSeparator)
3466 * khtml/editing/htmlediting.h: Ditto.
3468 2004-11-23 David Harrison <harrison@apple.com>
3470 Added various comments.
3472 * khtml/editing/htmlediting.cpp:
3473 (khtml::StyleChange::init):
3474 (khtml::ApplyStyleCommand::doApply):
3475 (khtml::ApplyStyleCommand::applyBlockStyle):
3476 (khtml::ApplyStyleCommand::applyInlineStyle):
3478 2004-11-23 David Hyatt <hyatt@apple.com>
3480 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
3481 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
3483 * khtml/rendering/render_block.cpp:
3484 (khtml::RenderBlock::nodeAtPoint):
3486 2004-11-22 David Hyatt <hyatt@apple.com>
3488 Make sure you can use document.createElement to make a <canvas> element.
3490 * khtml/xml/dom_docimpl.cpp:
3491 (DocumentImpl::createHTMLElement):
3493 2004-11-22 Maciej Stachowiak <mjs@apple.com>
3497 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
3498 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
3499 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
3500 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
3502 * khtml/ecma/kjs_html.cpp:
3503 (KJS::HTMLDocument::tryGet):
3504 * khtml/html/html_formimpl.cpp:
3505 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
3506 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3507 * khtml/html/html_formimpl.h:
3508 * khtml/html/html_miscimpl.cpp:
3509 (HTMLCollectionImpl::HTMLCollectionImpl):
3510 (HTMLCollectionImpl::~HTMLCollectionImpl):
3511 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
3512 (HTMLCollectionImpl::CollectionInfo::reset):
3513 (HTMLCollectionImpl::resetCollectionInfo):
3514 (HTMLCollectionImpl::checkForNameMatch):
3516 (HTMLCollectionImpl::updateNameCache):
3517 (HTMLCollectionImpl::namedItems):
3518 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
3519 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
3520 (HTMLFormCollectionImpl::item):
3521 (HTMLFormCollectionImpl::updateNameCache):
3522 * khtml/html/html_miscimpl.h:
3524 2004-11-22 David Hyatt <hyatt@apple.com>
3526 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
3531 * khtml/misc/loader.cpp:
3532 (CachedObject::finish):
3535 * khtml/misc/loader.h:
3536 (khtml::Cache::maxCacheableObjectSize):
3538 2004-11-22 David Hyatt <hyatt@apple.com>
3540 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
3541 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
3542 that lets us short circuit earlier when painting and hit testing.
3546 * khtml/khtml_part.cpp:
3547 (KHTMLPart::isPointInsideSelection):
3548 * khtml/rendering/render_block.cpp:
3549 (khtml::RenderBlock::paint):
3550 (khtml::RenderBlock::paintChildren):
3551 (khtml::RenderBlock::paintObject):
3552 (khtml::RenderBlock::paintFloats):
3553 (khtml::RenderBlock::nodeAtPoint):
3554 * khtml/rendering/render_block.h:
3555 * khtml/rendering/render_box.cpp:
3556 (RenderBox::nodeAtPoint):
3557 * khtml/rendering/render_box.h:
3558 * khtml/rendering/render_br.h:
3559 * khtml/rendering/render_canvas.cpp:
3560 (RenderCanvas::paint):
3561 * khtml/rendering/render_flow.cpp:
3562 (RenderFlow::paintLines):
3563 (RenderFlow::hitTestLines):
3564 (RenderFlow::caretRect):
3565 (RenderFlow::addFocusRingRects):
3566 (RenderFlow::paintFocusRing):
3567 (RenderFlow::paintOutlines):
3568 (RenderFlow::paintOutlineForLine):
3569 * khtml/rendering/render_flow.h:
3570 * khtml/rendering/render_frames.cpp:
3571 (RenderFrameSet::nodeAtPoint):
3572 * khtml/rendering/render_frames.h:
3573 * khtml/rendering/render_image.cpp:
3574 (RenderImage::nodeAtPoint):
3575 * khtml/rendering/render_image.h:
3576 * khtml/rendering/render_inline.cpp:
3577 (RenderInline::paint):
3578 (RenderInline::nodeAtPoint):
3579 * khtml/rendering/render_inline.h:
3580 * khtml/rendering/render_layer.cpp:
3581 (RenderLayer::paintLayer):
3582 (RenderLayer::hitTest):
3583 (RenderLayer::hitTestLayer):
3584 * khtml/rendering/render_layer.h:
3585 * khtml/rendering/render_line.cpp:
3586 (khtml::InlineBox::paint):
3587 (khtml::InlineBox::nodeAtPoint):
3588 (khtml::InlineFlowBox::flowObject):
3589 (khtml::InlineFlowBox::nodeAtPoint):
3590 (khtml::InlineFlowBox::paint):
3591 (khtml::InlineFlowBox::paintBackgrounds):
3592 (khtml::InlineFlowBox::paintBackground):
3593 (khtml::InlineFlowBox::paintBackgroundAndBorder):
3594 (khtml::InlineFlowBox::paintDecorations):
3595 (khtml::EllipsisBox::paint):
3596 (khtml::EllipsisBox::nodeAtPoint):
3597 (khtml::RootInlineBox::paintEllipsisBox):
3598 (khtml::RootInlineBox::paint):
3599 (khtml::RootInlineBox::nodeAtPoint):
3600 * khtml/rendering/render_line.h:
3601 (khtml::InlineRunBox::paintBackgroundAndBorder):
3602 * khtml/rendering/render_object.cpp:
3603 (RenderObject::hitTest):
3604 (RenderObject::setInnerNode):
3605 (RenderObject::nodeAtPoint):
3606 * khtml/rendering/render_object.h:
3607 (khtml::RenderObject::PaintInfo::PaintInfo):
3608 (khtml::RenderObject::PaintInfo::~PaintInfo):
3609 (khtml::RenderObject::paintingRootForChildren):
3610 (khtml::RenderObject::shouldPaintWithinRoot):
3611 * khtml/rendering/render_table.cpp:
3612 (RenderTable::layout):
3613 (RenderTable::paint):
3614 * khtml/rendering/render_text.cpp:
3615 (simpleDifferenceBetweenColors):
3616 (correctedTextColor):
3617 (InlineTextBox::nodeAtPoint):
3618 (InlineTextBox::paint):
3619 (InlineTextBox::selectionStartEnd):
3620 (InlineTextBox::paintSelection):
3621 (InlineTextBox::paintMarkedTextBackground):
3622 (InlineTextBox::paintDecoration):
3623 (RenderText::posOfChar):
3624 * khtml/rendering/render_text.h:
3625 (khtml::RenderText::paint):
3626 (khtml::RenderText::layout):
3627 (khtml::RenderText::nodeAtPoint):
3628 * khtml/xml/dom2_eventsimpl.cpp:
3629 (MouseEventImpl::computeLayerPos):
3630 * khtml/xml/dom_docimpl.cpp:
3631 (DocumentImpl::prepareMouseEvent):
3632 * kwq/KWQAccObject.mm:
3633 (-[KWQAccObject accessibilityHitTest:]):
3634 * kwq/KWQKHTMLPart.mm:
3635 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
3636 (KWQKHTMLPart::eventMayStartDrag):
3637 (KWQKHTMLPart::khtmlMouseMoveEvent):
3638 * kwq/WebCoreBridge.mm:
3639 (-[WebCoreBridge elementAtPoint:]):
3640 (-[WebCoreBridge _positionForPoint:]):
3642 2004-11-22 Maciej Stachowiak <mjs@apple.com>
3646 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
3647 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
3649 This avoids the O(N^2) penalty for named item traversal for form collections.
3651 It also combines the item traversal logic for all non-form
3652 collection operations into a single traverseNextItem
3653 function. This avoids having 5 copies of the big switch statement
3656 Also fixed a bug that prevented the last form element from being removed properly.
3658 * khtml/html/html_formimpl.cpp:
3659 (DOM::removeFromVector):
3660 * khtml/dom/html_misc.cpp:
3661 (HTMLCollection::namedItems):
3662 * khtml/dom/html_misc.h:
3663 * khtml/ecma/kjs_html.cpp:
3664 (KJS::HTMLCollection::getNamedItems):
3665 * khtml/html/html_miscimpl.cpp:
3666 (HTMLCollectionImpl::traverseNextItem):
3667 (HTMLCollectionImpl::calcLength):
3668 (HTMLCollectionImpl::length):
3669 (HTMLCollectionImpl::item):
3670 (HTMLCollectionImpl::nextItem):
3671 (HTMLCollectionImpl::checkForNameMatch):
3672 (HTMLCollectionImpl::namedItem):
3673 (HTMLCollectionImpl::namedItems):
3674 (HTMLCollectionImpl::nextNamedItem):
3675 (HTMLFormCollectionImpl::calcLength):
3676 (HTMLFormCollectionImpl::namedItem):
3677 (HTMLFormCollectionImpl::nextNamedItem):
3678 (HTMLFormCollectionImpl::namedItems):
3679 * khtml/html/html_miscimpl.h:
3681 2004-11-22 Ken Kocienda <kocienda@apple.com>
3683 Reviewed by Harrison
3685 Change around the way we block the Javascript "Paste" command identifier from
3686 being available. Formerly, this was done with an ifdef we never compiled in.
3687 Now, this is done with a couple of cheap runtime checks. The advantage is that
3688 we can now compile this command into development builds, and still yet switch
3689 on the command in deployment builds through the use of WebCore SPI so we can
3690 write and run layout tests with all of our builds.
3692 * khtml/editing/jsediting.cpp:
3693 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
3694 command being queried is the paste command.
3695 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
3696 * khtml/editing/jsediting.h: Ditto.
3697 * khtml/khtml_part.cpp:
3698 (KHTMLPart::pasteFromPasteboard): Added.
3699 (KHTMLPart::canPaste): Added.
3700 * kwq/KWQKHTMLPart.mm:
3701 (KHTMLPart::canPaste): Added.
3702 * kwq/KWQRenderTreeDebug.cpp:
3703 (externalRepresentation): Turn on paste command.
3704 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
3706 2004-11-21 Maciej Stachowiak <mjs@apple.com>
3708 Reviewed by Richard.
3710 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
3712 * khtml/html/html_miscimpl.cpp:
3713 (HTMLCollectionImpl::calcLength):
3714 (HTMLCollectionImpl::getItem):
3715 (HTMLCollectionImpl::item):
3716 (HTMLCollectionImpl::nextItem):
3717 (HTMLCollectionImpl::getNamedItem):
3718 (HTMLCollectionImpl::namedItem):
3719 (HTMLCollectionImpl::nextNamedItemInternal):
3720 (HTMLFormCollectionImpl::nextNamedItemInternal):
3722 2004-11-19 Maciej Stachowiak <mjs@apple.com>
3726 <rdar://problem/3482935> JavaScript so slow it seems like a hang (hrweb.apple.com) (HTMLCollection?)
3727 <rdar://problem/3759149> PeopleSoft page in Safari twice as slow as Mozilla engine (HTMLFormCollection)
3728 <rdar://problem/3888368> selecting an item on the Apache bugzilla query page can be improved 95% (HTMLFormCollection)
3730 Many optimizations to HTMLFormCollection. Iterating it should not
3731 be N^2 any more, though finding items by name could still be.
3733 * khtml/html/html_formimpl.cpp:
3734 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3735 (DOM::HTMLFormElementImpl::length):
3736 (DOM::HTMLFormElementImpl::submitClick):
3737 (DOM::HTMLFormElementImpl::formData):
3738 (DOM::HTMLFormElementImpl::submit):
3739 (DOM::HTMLFormElementImpl::reset):
3740 (DOM::HTMLFormElementImpl::radioClicked):
3741 (DOM::appendToVector):
3742 (DOM::removeFromVector):
3743 (DOM::HTMLFormElementImpl::registerFormElement):
3744 (DOM::HTMLFormElementImpl::removeFormElement):
3745 (DOM::HTMLFormElementImpl::makeFormElementDormant):
3746 (DOM::HTMLFormElementImpl::registerImgElement):
3747 (DOM::HTMLFormElementImpl::removeImgElement):
3748 * khtml/html/html_formimpl.h:
3749 * khtml/html/html_miscimpl.cpp:
3750 (HTMLFormCollectionImpl::FormCollectionInfo::FormCollectionInfo):
3751 (void::HTMLFormCollectionImpl::FormCollectionInfo::reset):
3752 (HTMLFormCollectionImpl::resetCollectionInfo):
3753 (HTMLFormCollectionImpl::calcLength):
3754 (HTMLFormCollectionImpl::item):
3755 (HTMLFormCollectionImpl::getNamedItem):
3756 (HTMLFormCollectionImpl::getNamedFormItem):
3757 (HTMLFormCollectionImpl::firstItem):
3758 (HTMLFormCollectionImpl::nextItem):
3759 * khtml/html/html_miscimpl.h:
3760 (DOM::HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
3761 * khtml/xml/dom_elementimpl.cpp:
3762 (ElementImpl::setAttribute):
3763 (ElementImpl::setAttributeMap):
3764 * kwq/KWQPtrVector.h:
3765 (QPtrVector::findRef):
3766 * kwq/KWQVectorImpl.h:
3767 * kwq/KWQVectorImpl.mm:
3768 (KWQVectorImpl::findRef):
3769 * kwq/WebCoreBridge.mm:
3770 (-[WebCoreBridge elementWithName:inForm:]):
3771 (-[WebCoreBridge controlsInForm:]):
3773 2004-11-19 David Harrison <harrison@apple.com>
3775 Reviewed by Ken and Darin.
3777 <rdar://problem/3856215> Cannot remove bold from the beginning of a message
3779 Problem is that KHTMLPart::computeAndSetTypingStyle always looked upstream
3780 for the existing style, but in this case (hitting cmd-B with caret at top of
3781 file) there is nothing upstream. Changed this to use the VisiblePosition
3782 deepEquivalent instead.
3784 * khtml/khtml_part.cpp:
3785 (KHTMLPart::computeAndSetTypingStyle):
3789 2004-11-19 Maciej Stachowiak <mjs@apple.com>
3793 <rdar://problem/3864151> REGRESSION (125-167): Chrysler.com never stops loading
3795 * khtml/xml/dom_docimpl.cpp:
3796 (DocumentImpl::close): Don't fire the onload handler if there is a
3797 redirect pending. This is a very long-standing bug that was masked
3798 by our previously incorrect redirect logic. It used to be that an
3799 older redirect would always win. Recently we changed things so
3800 that a newer redirect would win, but a script that causes a
3801 redirect would stop parsing once complete (so if there are two
3802 redirects in the same script, the latter wins). However, we should
3803 have also prevented onload in this case. Testing with other
3804 browsers shows that onload handlers do not run at all when there
3805 is a pending redirect.
3807 2004-11-19 Ken Kocienda <kocienda@apple.com>
3809 Reviewed by Harrison
3811 Fix some object lifetime issues in these two commands. This fixes some crashes
3812 I am seeing in some new code I am working on, but have not yet reproduced otherwise.
3814 * khtml/editing/htmlediting.cpp:
3815 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): No longer deref nodes
3816 in the ancestor list. They are not ref'ed when put on list. D'uh.
3817 (khtml::InsertParagraphSeparatorCommand::doApply): Ref all cloned nodes that are created by the command
3818 before putting them on the cloned nodes list. This are still deref'ed in the destructor.
3819 (khtml::InsertParagraphSeparatorInQuotedContentCommand::~InsertParagraphSeparatorInQuotedContentCommand): Ditto
3821 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto doApply comment.
3823 2004-11-19 Ken Kocienda <kocienda@apple.com>
3825 Reviewed by Harrison
3829 <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it
3831 * khtml/khtml_part.cpp:
3832 (KHTMLPart::computeAndSetTypingStyle): New helper that does the work of reducing a passed-in style
3833 declaration given the current selection, and then sets the minimum necessary style as the typing
3835 (KHTMLPart::applyStyle): Call new computeAndSetTypingStyle. The guts of computeAndSetTypingStyle used
3836 to be here in the selection-as-caret case. But now [WebCoreBridge setTypingStyle:] needs this code
3838 * khtml/khtml_part.h: Declare new computeAndSetTypingStyle() function.
3839 * kwq/WebCoreBridge.h: Declare new typingStyle and setTypingStyle: methods.
3840 * kwq/WebCoreBridge.mm:
3841 (-[WebCoreBridge typingStyle]): Calls through to the part to retrieve the typing style.
3842 (-[WebCoreBridge setTypingStyle:]): Calls through to the part to set the typing style.
3844 2004-11-18 David Harrison <harrison@apple.com>
3848 Back out part of Darin's fix for <rdar://problem/3885729>, because the new exception gets triggered
3849 by Mail.app. Filed <rdar://problem/3886832> against Mail.app.
3852 (-[DOMCSSStyleDeclaration setProperty:::]):
3854 2004-11-18 Chris Blumenberg <cblu@apple.com>
3856 Fixed: <rdar://problem/3587481> Bug Reporter Login Page: Password AutoFill does not work reliably
3860 * kwq/KWQKHTMLPart.mm:
3861 (KWQKHTMLPart::currentForm): just return the current form, don't scan the entire document looking for a form if there is no current form
3863 2004-11-18 Maciej Stachowiak <mjs@apple.com>
3867 - fix recursive item traversal, use traverseNextNode() instead of
3868 the buggy hand-rolled traversal.
3870 * khtml/xml/dom_nodeimpl.cpp:
3871 (NodeListImpl::recursiveItem):
3873 2004-11-17 Darin Adler <darin@apple.com>
3877 - fixed <rdar://problem/3885744> crash with XMLHttpRequest test page (reported by KDE folks)