1 2005-01-17 David Harrison <harrison@apple.com>
3 Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
5 <rdar://problem/3945880> line-ending space seems not to be present
7 * khtml/editing/selection.cpp:
8 (khtml::Selection::validate):
9 Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
10 * khtml/rendering/bidi.cpp:
11 (khtml::RenderBlock::findNextLineBreak):
12 Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).
14 2005-01-17 Darin Adler <darin@apple.com>
16 Reviewed by John Louch.
18 - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate
20 * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
21 of using mapToGlobal and screen in a complicated way.
22 * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
23 * kwq/KWQWindowWidget.h: Ditto.
24 * kwq/KWQWindowWidget.mm: Ditto.
26 2005-01-17 David Hyatt <hyatt@apple.com>
28 Fix a screwup in rightmost/lowets position computation. 3955207. Make sure floats with layers are still checked.
32 * khtml/rendering/render_block.cpp
34 2005-01-17 Ken Kocienda <kocienda@apple.com>
38 <rdar://problem/3953366> Problems with typing attributes in HTML compose
40 * khtml/editing/htmlediting.cpp:
41 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
42 that tried to sense when typing style could be cleared without actually doing a style diff between
43 before-delete and after-delete positions. Removing this extra check and running the
44 general-purpose code fixes the bug.
46 2005-01-17 Richard Williamson <rjw@apple.com>
48 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
50 Keep track of originating execution context and target execution
51 context for native JS object wrappers, and perform appropriate
54 Reviewed by David Harrison.
56 * khtml/ecma/kjs_binding.cpp:
57 (ScriptInterpreter::isGlobalObject):
58 (ScriptInterpreter::isSafeScript):
59 (ScriptInterpreter::interpreterForGlobalObject):
60 * khtml/ecma/kjs_binding.h:
61 * khtml/ecma/kjs_window.cpp:
62 (Window::interpreter):
63 (Window::isSafeScript):
64 * khtml/ecma/kjs_window.h:
66 (-[WebScriptObject _initializeScriptDOMNodeImp]):
67 * kwq/KWQKHTMLPart.mm:
68 (KWQKHTMLPart::windowScriptObject):
69 (KWQKHTMLPart::windowScriptNPObject):
70 * kwq/WebCoreBridge.mm:
72 (-[WebCoreBridge init]):
74 2005-01-17 Ken Kocienda <kocienda@apple.com>
80 <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with
81 "size up" and "size down" NSFontManager changes
83 * khtml/css/cssparser.cpp:
84 (CSSParser::parseValue): Add support for parsing new font size delta property.
85 * khtml/css/cssproperties.c: Generated file.
86 * khtml/css/cssproperties.h: Ditto.
87 * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
88 * khtml/editing/htmlediting.cpp:
89 (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
90 (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
91 and running command to do the removal.
92 (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
93 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle
94 relative font size changes.
95 (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
96 before or equal to the end. Swap them if not true. I ran into this problem in some similar code in
97 applyRelativeFontStyleChange(). Moving that goodness here too.
98 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
99 Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
100 I use the bool return value now (I obviously did not need it before).
101 (khtml::ApplyStyleCommand::computedFontSize): New helper function.
102 (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
103 (khtml::createStyleSpanElement): Ditto.
104 * khtml/editing/htmlediting.h: Update header accordingly.
105 * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
107 (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
108 (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
109 * kwq/DOMPrivate.h: Declare new conveniences.
110 * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
111 * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
112 * layout-tests/editing/style/relative-font-size-change-001.html: Added.
113 * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
114 * layout-tests/editing/style/relative-font-size-change-002.html: Added.
115 * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
116 * layout-tests/editing/style/relative-font-size-change-003.html: Added.
117 * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
118 * layout-tests/editing/style/relative-font-size-change-004.html: Added.
120 2005-01-14 Darin Adler <darin@apple.com>
122 * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
123 * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
124 * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
125 * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.
127 2005-01-14 Chris Blumenberg <cblu@apple.com>
129 Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page
133 (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
134 (KWQKHTMLPart::mousePressNode): new
135 * kwq/KWQPageState.h:
136 * kwq/KWQPageState.mm:
137 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
138 (-[KWQPageState clear]): clear the mousePressNode
139 (-[KWQPageState dealloc]): deref the mousePressNode
140 (-[KWQPageState mousePressNode]): new
144 2005-01-13 Vicki Murley <vicki@apple.com>
148 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
150 * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"
152 2005-01-13 David Harrison <harrison@apple.com>
154 Reviewed by Ken Kocienda.
156 Better fix for 3905066.
158 * khtml/editing/htmlediting.cpp:
159 (khtml::InsertParagraphSeparatorCommand::doApply):
161 2005-01-10 Maciej Stachowiak <mjs@apple.com>
165 <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
167 * khtml/rendering/render_text.cpp:
168 (InlineTextBox::paint): Support painting custom underline markers for
169 marked text in place of generic yellow.
170 (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
171 * khtml/rendering/render_text.h:
172 * kwq/KWQKHTMLPart.h: Declare new methods and structs.
173 * kwq/KWQKHTMLPart.mm:
174 (KWQKHTMLPart::clear): Clear marked test underlines.
175 (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
176 (convertAttributesToUnderlines): Converts NSAttributedString attributes
177 to simplified and C++-friendly form.
178 (KWQKHTMLPart::markedTextUsesUnderlines): New method.
179 (KWQKHTMLPart::markedTextUnderlines): New method.
181 (QPainter::drawLineForText): Handle pen width.
182 * kwq/WebCoreBridge.h:
183 * kwq/WebCoreBridge.mm:
184 (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
186 * kwq/WebCoreTextRenderer.h:
188 2005-01-12 David Harrison <harrison@apple.com>
190 Reviewed by Dave Hyatt.
192 <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
194 * kwq/KWQAccObject.mm:
195 (-[KWQAccObject addChildrenToArray:]):
196 Use the widget's outer view.
198 2005-01-12 David Harrison <harrison@apple.com>
200 Reviewed by Darin Adler.
202 <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
204 * khtml/xml/dom_nodeimpl.cpp:
205 (NodeImpl::displayNode):
206 Add quotes around text node content.
207 (NodeBaseImpl::childNode):
208 Add nil check to return nil rather than crash when child node not found.
209 * kwq/KWQAccObject.mm:
210 (-[KWQAccObject doAXStringForTextMarkerRange:]):
211 Pass range compliant positions to TextIterator.
213 2005-01-12 David Hyatt <hyatt@apple.com>
215 Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
216 line layout is smarter about including the overflow for both old states and new states.
220 * khtml/rendering/bidi.cpp:
221 (khtml::RenderBlock::layoutInlineChildren):
223 2005-01-12 David Hyatt <hyatt@apple.com>
225 Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move
226 tables/overflows that dont fit within a block only in strict mode.
228 Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific
229 case in editing is hit.
231 Reviewed by darin (first one), kocienda (second one)
233 * khtml/rendering/render_block.cpp:
234 (khtml::RenderBlock::getClearDelta):
235 * khtml/rendering/render_flow.cpp:
236 (RenderFlow::dirtyLinesFromChangedChild):
237 * khtml/rendering/render_line.cpp:
238 (khtml::InlineFlowBox::verticallyAlignBoxes):
240 2005-01-12 Ken Kocienda <kocienda@apple.com>
246 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
248 * khtml/editing/htmlediting.cpp:
249 (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
250 merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
251 added to visible_position files.
252 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
253 tests to determine when to stop moving nodes more complete and correct. Also improved comments.
254 * khtml/editing/visible_position.cpp:
255 (khtml::isFirstVisiblePositionInParagraph): New function.
256 (khtml::isLastVisiblePositionInParagraph): New function.
257 * khtml/editing/visible_position.h: Update header accordingly.
258 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
259 results but still correct.
260 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
261 * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
262 * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
263 * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
264 * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
265 * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
266 * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
267 * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
268 * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
269 * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
271 2005-01-11 Richard Williamson <rjw@apple.com>
273 Fixed 3922875. Fall back to DOM object is EMBED element
274 has no associated runtime object.
278 * khtml/ecma/kjs_dom.cpp:
279 (KJS::getRuntimeObject):
280 * khtml/ecma/kjs_html.cpp:
281 (KJS::HTMLDocument::tryGet):
282 (KJS::HTMLElement::tryGet):
283 (KJS::HTMLCollection::tryGet):
284 (KJS::HTMLCollection::getNamedItems):
286 2005-01-11 David Hyatt <hyatt@apple.com>
288 Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match
293 * khtml/html/htmltokenizer.cpp:
294 (khtml::HTMLTokenizer::parseTag):
296 2005-01-11 Chris Blumenberg <cblu@apple.com>
298 Fixed: <rdar://problem/3930733> Mail prints second page of email blank
302 * khtml/rendering/render_canvas.cpp:
303 (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
304 * khtml/rendering/render_flow.cpp:
305 (RenderFlow::paintLines): removed null check since the print rect should never be null
306 * khtml/rendering/render_list.cpp:
307 (RenderListMarker::paint): ditto
308 * kwq/KWQKHTMLPart.mm:
309 (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
311 2005-01-10 Ken Kocienda <kocienda@apple.com>
317 <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
319 * khtml/editing/htmlediting.cpp:
320 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a
321 simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the
322 result calculated in that deeper scope was not available when tested.
324 2005-01-10 Ken Kocienda <kocienda@apple.com>
330 <rdar://problem/3946852> Option-e goes to next line
332 * khtml/editing/htmlediting.cpp:
333 (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
334 into the start line is done. We plan to change pretty substantially soon to better handle
335 the problem described in <rdar://problem/3937352> Quote level not maintained when copied
336 and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
338 2005-01-10 Ken Kocienda <kocienda@apple.com>
344 <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
346 * khtml/editing/htmlediting.cpp:
347 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
348 to their own blocks if needed so that a block style can be applied.
349 (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
350 (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
351 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
352 This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
354 (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
355 Should remove attributue instead.
356 * khtml/editing/htmlediting.h: Touch function declarations accordingly.
357 * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
358 * layout-tests/editing/style/create-block-for-style-001.html: Added.
359 * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
360 * layout-tests/editing/style/create-block-for-style-002.html: Added.
361 * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
362 * layout-tests/editing/style/create-block-for-style-003.html: Added.
363 * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
364 * layout-tests/editing/style/create-block-for-style-004.html: Added.
365 * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
366 * layout-tests/editing/style/create-block-for-style-005.html: Added.
367 * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
368 * layout-tests/editing/style/create-block-for-style-006.html: Added.
369 * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
370 * layout-tests/editing/style/create-block-for-style-007.html: Added.
371 * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
372 * layout-tests/editing/style/create-block-for-style-008.html: Added.
373 * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
374 * layout-tests/editing/style/create-block-for-style-009.html: Added.
375 * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
376 * layout-tests/editing/style/create-block-for-style-010.html: Added.
377 * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
378 * layout-tests/editing/style/create-block-for-style-011.html: Added.
379 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
380 * layout-tests/editing/style/create-block-for-style-012.html: Added.
381 * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
382 * layout-tests/editing/style/create-block-for-style-013.html: Added.
384 Unrelated updates to these expected results.
385 * layout-tests/editing/inserting/insert-div-007-expected.txt
386 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
388 2005-01-10 Chris Blumenberg <cblu@apple.com>
390 Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
394 * khtml/rendering/render_flow.cpp:
395 (RenderFlow::paintLines): don't do pagination work if printRect is not set
396 * khtml/rendering/render_list.cpp:
397 (RenderListMarker::paint): ditto
399 2005-01-10 David Harrison <harrison@apple.com>
403 * kwq/KWQTextUtilities.mm:
404 (currentTextBreakLocaleID):
405 Return empty string (AKA root locale) if locale pref can not be canonicalized.
407 2005-01-10 John Sullivan <sullivan@apple.com>
409 Fixed broken Panther build.
411 * kwq/KWQTextUtilities.mm:
412 (currentTextBreakLocaleID):
413 This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
414 That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
415 To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
416 function. However, the Tiger-only code was wrong; the string generated using
417 CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
420 2005-01-09 David Harrison <harrison@apple.com>
422 Reviewed by Ken Kocienda.
424 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
426 * khtml/editing/htmlediting.cpp:
427 (khtml::ReplaceSelectionCommand::doApply):
428 Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
430 2005-01-09 Darin Adler <darin@apple.com>
432 Reviewed by Harrison.
434 - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
436 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
437 to a switch statement. Added SEARCH to the set of types that treat the renderer as a
440 2005-01-09 David Harrison <harrison@apple.com>
442 Reviewed by Ken Kocienda.
444 <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
446 Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
447 whitespace to a single non-breaking space when splitting a text node.
449 * khtml/editing/htmlediting.cpp:
450 (khtml::InsertParagraphSeparatorCommand::doApply):
452 2005-01-08 Kevin Decker <kdecker@apple.com>
456 Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
458 * khtml/html/html_elementimpl.cpp:
459 (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
461 2005-01-07 Maciej Stachowiak <mjs@apple.com>
465 <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
467 * Khtml/khtml_part.cpp:
468 (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
469 not started loading yet so it could not possibly be finishing here...
470 (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
471 no document, in this case we must have hit an error or been loading a non-HTML
473 * khtml/khtml_part.h:
475 2005-01-08 David Harrison <harrison@apple.com>
479 <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
481 * khtml/editing/selection.cpp:
482 (khtml::Selection::validate):
483 Tune word selections left/right choice to use right if on empty last line.
485 2005-01-07 David Harrison <harrison@apple.com>
489 <rdar://problem/3942619> AX: Support sentence ax attributes
491 Needed to use the unicode utilities properly. Twas lame before.
493 * khtml/editing/visible_units.cpp:
494 (khtml::previousBoundary):
495 (khtml::nextBoundary):
496 (khtml::startOfWord):
498 (khtml::previousWordPosition):
499 (khtml::nextWordPosition):
500 (khtml::startOfSentence):
501 (khtml::endOfSentence):
502 (khtml::previousSentencePosition):
503 (khtml::nextSentencePosition):
504 * kwq/KWQAccObject.mm:
505 (-[KWQAccObject accessibilityAttributeNames]):
506 (-[KWQAccObject accessibilityAttributeValue:]):
507 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
508 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
509 * kwq/KWQTextUtilities.mm:
510 (currentTextBreakLocaleID):
511 (KWQFindSentenceBoundary):
512 (KWQFindNextSentenceFromIndex):
514 2005-01-07 Ken Kocienda <kocienda@apple.com>
520 <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
521 <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
523 * khtml/editing/htmlediting.cpp:
524 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
525 Merge the typing style with the computed style for the current position. Fixes both bugs.
526 * khtml/editing/htmlediting.h:
527 * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
528 * layout-tests/editing/inserting/insert-div-023.html: Added.
529 * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
530 * layout-tests/editing/inserting/insert-div-024.html: Added.
532 2005-01-07 David Hyatt <hyatt@apple.com>
534 Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling
535 behavior on worldofwarcraft.com.
539 * khtml/rendering/render_table.cpp:
540 (RenderTable::layout):
542 2005-01-06 David Hyatt <hyatt@apple.com>
544 Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to
545 ignore inline flows in this case.
549 * khtml/rendering/render_block.cpp:
550 (khtml::RenderBlock::nodeAtPoint):
552 2005-01-07 Ken Kocienda <kocienda@apple.com>
558 <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
560 * kwq/KWQKHTMLPart.mm:
561 (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
562 in the document, or if it is not a descendent of the document element. In the case of the bug,
563 since the selection has not yet been set up, the focus node passed here is the HTML element, and
564 that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
566 2005-01-06 Kevin Decker <kdecker@apple.com>
570 Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
572 * khtml/khtml_part.cpp:
573 (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.
577 2005-01-06 David Harrison <harrison@apple.com>
581 (addendum to previous checkin for this bug)
582 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
584 Fix line navigation. Add AXUIElementForTextMarker.
586 * kwq/KWQAccObject.mm:
587 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
588 (-[KWQAccObject doAXUIElementForTextMarker:]):
589 (-[KWQAccObject doAXLineForTextMarker:]):
590 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
591 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
592 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
593 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
594 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
596 2005-01-06 Darin Adler <darin@apple.com>
600 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
602 (turns out the PLT regression was a false alarm)
604 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
605 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
607 * khtml/html/htmlparser.cpp:
608 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
609 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
610 to eliminate code that used ID_CLOSE_TAG for an array size.
611 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
612 that manages isindex to use deref instead of delete.
613 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
614 mistake of using ID_CLOSE_TAG for the array size too.
615 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
616 there and it would prevent custom tags from working. Added range check before using the forbidden
617 tag array with the token ID since custom tags will use index values past the end of the array.
618 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
619 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
620 createElement call is still here. Last time I left out a few form element types from this switch;
622 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
623 document if getTagID fails; this creates a unique per-document ID.
625 * khtml/misc/htmltags.c: Regenerated.
626 * khtml/misc/htmltags.h: Regenerated.
628 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
629 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
630 Also rewrote getTagName to work with the new scheme.
632 2005-01-06 David Harrison <harrison@apple.com>
634 Fixed Panther build. Also, do not advertize sentence support since it is incomplete.
636 * kwq/KWQAccObject.mm:
637 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
638 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
639 (-[KWQAccObject accessibilityIsAttributeSettable:]):
641 2005-01-06 David Harrison <harrison@apple.com>
643 Reviewed by Dave Hyatt.
645 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
646 <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
648 Many more AX attributes supported. Numerous fixes to previous AX work.
650 * khtml/editing/visible_units.cpp:
651 (khtml::startSentenceBoundary):
652 (khtml::startOfSentence):
653 (khtml::endSentenceBoundary):
654 (khtml::endOfSentence):
655 (khtml::previousSentencePositionBoundary):
656 (khtml::previousSentencePosition):
657 (khtml::nextSentencePositionBoundary):
658 (khtml::nextSentencePosition):
659 * khtml/editing/visible_units.h:
660 * khtml/khtmlview.cpp:
662 * khtml/misc/helper.cpp:
663 (khtml::findSentenceBoundary):
664 (khtml::nextSentenceFromIndex):
665 * khtml/misc/helper.h:
666 * khtml/misc/htmltags.c:
669 * khtml/rendering/render_container.cpp:
670 (RenderContainer::removeChildNode):
671 (RenderContainer::appendChildNode):
672 (RenderContainer::insertChildNode):
673 * khtml/rendering/render_object.cpp:
674 (RenderObject::remove):
675 * khtml/xml/dom_docimpl.cpp:
676 (DocumentImpl::getAccObjectCache):
677 (DocumentImpl::updateSelection):
678 (DocumentImpl::close):
679 (DocumentImpl::setFocusNode):
680 (DocumentImpl::parentDocument):
681 (DocumentImpl::topDocument):
682 * khtml/xml/dom_docimpl.h:
683 * kwq/KWQAccObject.mm:
684 (-[KWQAccObject accessibilityShouldUseUniqueId]):
685 (-[KWQAccObject detach]):
686 (-[KWQAccObject anchorElement]):
687 (-[KWQAccObject firstChild]):
688 (-[KWQAccObject lastChild]):
689 (-[KWQAccObject previousSibling]):
690 (-[KWQAccObject nextSibling]):
691 (-[KWQAccObject parentObject]):
692 (-[KWQAccObject value]):
693 (-[KWQAccObject accessibilityAttributeNames]):
694 (-[KWQAccObject accessibilityPerformAction:]):
695 (-[KWQAccObject textMarkerForVisiblePosition:]):
696 (-[KWQAccObject visiblePositionForTextMarker:]):
697 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
698 (-[KWQAccObject topDocument]):
699 (-[KWQAccObject topRenderer]):
700 (-[KWQAccObject topView]):
701 (-[KWQAccObject accessibilityAttributeValue:]):
702 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
703 (-[KWQAccObject doAXLineForTextMarker:]):
704 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
705 (-[KWQAccObject doAXStringForTextMarkerRange:]):
706 (-[KWQAccObject doAXTextMarkerForPosition:]):
707 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
708 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
709 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
710 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
711 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
712 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
713 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
714 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
715 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
716 (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
717 (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
718 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
719 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
720 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
721 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
722 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
723 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
724 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
725 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
726 (-[KWQAccObject doAXLengthForTextMarkerRange:]):
727 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
728 (-[KWQAccObject accessibilityHitTest:]):
729 (-[KWQAccObject accessibilityFocusedUIElement]):
730 (-[KWQAccObject accessibilityIsAttributeSettable:]):
731 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
732 (-[KWQAccObject setAccObjectID:]):
733 (-[KWQAccObject removeAccObjectID]):
734 * kwq/KWQAccObjectCache.h:
735 * kwq/KWQAccObjectCache.mm:
736 (KWQAccObjectCache::setAccObject):
737 (KWQAccObjectCache::removeAccObject):
738 (KWQAccObjectCache::visiblePositionForTextMarker):
739 (KWQAccObjectCache::postNotificationToTopWebArea):
740 (KWQAccObjectCache::postNotification):
741 (KWQAccObjectCache::handleFocusedUIElementChanged):
742 * kwq/KWQKHTMLPart.mm:
743 (KWQKHTMLPart::respondToChangedContents):
744 * kwq/KWQTextUtilities.h:
745 * kwq/KWQTextUtilities.mm:
746 (KWQFindNextWordFromIndex):
747 (KWQFindSentenceBoundary):
748 (KWQFindNextSentenceFromIndex):
749 * kwq/WebCoreBridge.mm:
750 (-[WebCoreBridge accessibilityTree]):
752 2005-01-05 Darin Adler <darin@apple.com>
756 - re-landing a subset of my custom tag change that does not fix the bug, but also does
757 not introduce a performance regression
759 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
760 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
762 * khtml/editing/htmlediting.cpp:
763 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
764 per-document tags and is just better all around for things like the document.
765 (khtml::debugNode): Ditto.
766 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
767 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
768 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
769 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
771 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
772 non-HTML elements to be nested as desired.
774 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
775 * khtml/misc/htmlhashes.cpp:
776 (khtml::getTagID): Changed return type to unsigned short.
777 (khtml::getAttrID): Ditto.
779 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
780 * khtml/xml/dom_docimpl.cpp:
781 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
782 Also updated for a few tags that the parser handled but this did not.
784 * kwq/KWQRenderTreeDebug.cpp:
785 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
786 the tag ID directly, which only works for standard nodes.
787 (operator<<): Update to call getTagName.
788 (nodePositionRelativeToRoot): Ditto.
789 (writeSelection): Ditto.
791 2005-01-05 Ken Kocienda <kocienda@apple.com>
797 <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
799 * khtml/editing/htmlediting.cpp:
800 (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
801 this operation work correctly, particularly in the logic to figure out whether to merge content, and
802 also performing merges.
803 * khtml/editing/visible_position.cpp:
804 (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
805 * khtml/editing/visible_units.cpp:
806 (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
807 (khtml::isEndOfParagraph): Ditto.
808 * khtml/editing/visible_units.h: Declare new functions.
810 2005-01-04 Ken Kocienda <kocienda@apple.com>
816 <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
818 * khtml/editing/htmlediting.cpp:
819 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
820 for the block we are adding was being done at the wrong time, which led to the placeholder remaining
821 in the document when it was not needed. This resulted in the extra space reported in the bug.
823 2005-01-04 Kevin Decker <kdecker@apple.com>
827 Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
829 * khtml/rendering/render_block.cpp:
830 (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.
832 2005-01-04 David Hyatt <hyatt@apple.com>
834 Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
838 * khtml/rendering/render_layer.cpp:
839 (RenderLayer::updateScrollInfoAfterLayout):
841 2005-01-04 Ken Kocienda <kocienda@apple.com>
845 Fix for these two bugs:
847 <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
848 <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
850 * khtml/editing/htmlediting.cpp:
851 (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
852 neither start nor end. For 3939148, improve the code which adjusts the insertion point during
853 the process of pasting. It formerly handled only one of the possible cases.
854 * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
855 * layout-tests/editing/pasteboard/paste-text-015.html: Added.
857 2005-01-04 David Hyatt <hyatt@apple.com>
859 Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
863 * khtml/rendering/render_form.cpp:
864 (RenderLineEdit::updateFromElement):
865 * kwq/KWQLineEdit.mm:
866 (QLineEdit::setPlaceholderString):
868 2005-01-04 David Hyatt <hyatt@apple.com>
870 Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when
871 returning pseudo-styles.
875 * khtml/css/cssstyleselector.cpp:
876 (khtml::CSSStyleSelector::matchRulesForList):
877 (khtml::CSSStyleSelector::pseudoStyleForElement):
878 * khtml/rendering/render_style.cpp:
879 (RenderStyle::addPseudoStyle):
881 2005-01-04 Darin Adler <darin@apple.com>
883 - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
885 * khtml/css/cssstyleselector.cpp:
886 * khtml/editing/htmlediting.cpp:
887 * khtml/editing/selection.cpp:
888 * khtml/editing/visible_position.cpp:
889 * khtml/html/dtd.cpp:
890 * khtml/html/htmlparser.cpp:
891 * khtml/html/htmlparser.h:
892 * khtml/html/htmltokenizer.cpp:
893 * khtml/misc/htmlhashes.cpp:
894 * khtml/misc/htmlhashes.h:
895 * khtml/misc/htmltags.c:
896 * khtml/misc/htmltags.h:
897 * khtml/misc/maketags:
898 * khtml/xml/dom_docimpl.cpp:
899 * khtml/xml/dom_docimpl.h:
900 * khtml/xml/dom_nodeimpl.cpp:
901 * khtml/xml/dom_position.cpp:
902 * kwq/KWQRenderTreeDebug.cpp:
904 2005-01-04 Ken Kocienda <kocienda@apple.com>
910 <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
912 * khtml/editing/htmlediting.cpp:
913 (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
914 a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
915 to be applied. Now the code will detect when at the end of a style run and will not move and apply
916 that ending style to the new paragraph, though it will place that style into the typing style. This
917 seems to match NSText behavior.
918 * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed
919 here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
920 not have any visible effect on the document.
921 * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
922 * layout-tests/editing/inserting/insert-div-022.html: Added.
924 2005-01-04 David Hyatt <hyatt@apple.com>
926 Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
931 * khtml/rendering/render_flow.cpp:
932 (RenderFlow::paintLines):
934 2005-01-03 David Hyatt <hyatt@apple.com>
936 Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more
937 robust and make it work regardless of which objects get a layout or not.
941 * khtml/rendering/render_block.cpp:
942 (khtml::RenderBlock::insertFloatingObject):
943 (khtml::RenderBlock::addOverhangingFloats):
944 (khtml::RenderBlock::addIntrudingFloats):
945 * khtml/rendering/render_block.h:
946 (khtml::RenderBlock::FloatingObject::FloatingObject):
948 2005-01-03 Maciej Stachowiak <mjs@apple.com>
952 <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
954 * khtml/html/html_miscimpl.cpp:
955 (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
956 it should not ever be (now).
957 (HTMLCollectionImpl::item): When traversing items stop when we hit
958 nil, meaning the end to avoid triggering above assert (formerly crash).
960 2005-01-03 Maciej Stachowiak <mjs@apple.com>
962 Reviewed by John and Kevin.
964 <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
966 * khtml/ecma/kjs_window.cpp:
967 (Window::get): Look up frame names before buitin window properties
968 to match other browsers. This regressed because we added a builtin
969 "toolbar" property but this site had a frame with that name.
971 2004-12-21 Maciej Stachowiak <mjs@apple.com>
975 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
977 Added opener bridge method to help WebKit implement security check
978 for named frame visibility.
980 * khtml/khtml_part.h:
981 * kwq/WebCoreBridge.h:
982 * kwq/WebCoreBridge.mm:
983 (-[WebCoreBridge opener]):
985 2005-01-03 Ken Kocienda <kocienda@apple.com>
991 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
993 * kwq/WebCoreBridge.mm:
994 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
996 2005-01-03 David Hyatt <hyatt@apple.com>
998 Fix for 3936881, make sure positioned objects prooperly update y-position.
1002 * khtml/rendering/render_block.cpp:
1003 (khtml::RenderBlock::layoutPositionedObjects):
1005 2005-01-03 Ken Kocienda <kocienda@apple.com>
1007 Reviewed by Harrison
1011 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
1013 * khtml/editing/htmlediting.cpp:
1014 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
1015 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
1016 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
1017 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
1018 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
1019 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
1020 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
1021 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
1022 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
1023 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
1024 * khtml/editing/htmlediting.h: Declare new functions.
1026 2004-12-25 Kevin Decker <kdecker@apple.com>
1030 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
1032 * 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.
1034 2004-12-23 Darin Adler <darin@apple.com>
1038 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
1040 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
1041 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
1043 * khtml/editing/htmlediting.cpp:
1044 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
1045 per-document tags and is just better all around for things like the document.
1046 (khtml::debugNode): Ditto.
1047 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
1048 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
1049 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
1050 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
1052 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
1053 non-HTML elements to be nested as desired.
1055 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
1056 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
1058 * khtml/html/htmlparser.cpp:
1059 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
1060 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
1061 to eliminate code that used ID_CLOSE_TAG for an array size.
1062 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
1063 that manages isindex to use deref instead of delete.
1064 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
1065 mistake of using ID_CLOSE_TAG for the array size too.
1066 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
1067 there and it would prevent custom tags from working. Added range check before using the forbidden
1068 tag array with the token ID since custom tags will use index values past the end of the array.
1069 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
1070 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
1071 createElement call is still here. Last time I left out a few form element types from this switch;
1073 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
1074 document if getTagID fails; this creates a unique per-document ID.
1076 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
1077 * khtml/misc/htmlhashes.cpp:
1078 (khtml::getTagID): Changed return type to unsigned short.
1079 (khtml::getAttrID): Ditto.
1081 * khtml/misc/htmltags.c: Regenerated.
1082 * khtml/misc/htmltags.h: Regenerated.
1084 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
1085 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
1086 Also rewrote getTagName to work with the new scheme.
1088 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
1089 * khtml/xml/dom_docimpl.cpp:
1090 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
1091 Also updated for a few tags that the parser handled but this did not.
1093 * kwq/KWQRenderTreeDebug.cpp:
1094 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
1095 the tag ID directly, which only works for standard nodes.
1096 (operator<<): Update to call getTagName.
1097 (nodePositionRelativeToRoot): Ditto.
1098 (writeSelection): Ditto.
1102 2004-12-22 Darin Adler <darin@apple.com>
1104 - rolled out my custom tag name change -- it broke amazon.com
1106 * khtml/css/cssstyleselector.cpp:
1107 * khtml/editing/htmlediting.cpp:
1108 * khtml/editing/selection.cpp:
1109 * khtml/editing/visible_position.cpp:
1110 * khtml/html/dtd.cpp:
1111 * khtml/html/htmlparser.cpp:
1112 * khtml/html/htmlparser.h:
1113 * khtml/html/htmltokenizer.cpp:
1114 * khtml/misc/htmlhashes.cpp:
1115 * khtml/misc/htmlhashes.h:
1116 * khtml/misc/htmltags.c:
1117 * khtml/misc/htmltags.h:
1118 * khtml/misc/maketags:
1119 * khtml/xml/dom_docimpl.cpp:
1120 * khtml/xml/dom_docimpl.h:
1121 * khtml/xml/dom_nodeimpl.cpp:
1122 * khtml/xml/dom_position.cpp:
1123 * kwq/KWQRenderTreeDebug.cpp:
1125 2004-12-22 David Harrison <harrison@apple.com>
1127 Reviewed by Darin Adler.
1129 * khtml/editing/selection.cpp:
1130 (khtml::Selection::validate):
1131 The selecting/deselecting bad behavior is because the Selection code that expands by words
1132 had an inaccurate test for being at the end of the document (where double-clicking needs
1133 to select the last word). Fixed that check.
1135 2004-12-22 Adele Amchan <adele@apple.com>
1139 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
1141 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
1142 so that we match Firefox and WinIE behavior.
1144 2004-12-22 Darin Adler <darin@apple.com>
1148 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
1150 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
1151 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
1153 * khtml/editing/htmlediting.cpp:
1154 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
1155 per-document tags and is just better all around for things like the document.
1156 (khtml::debugNode): Ditto.
1157 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
1158 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
1159 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
1160 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
1162 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
1163 non-HTML elements to be nested as desired.
1165 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
1166 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
1168 * khtml/html/htmlparser.cpp:
1169 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
1170 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
1171 to eliminate code that used ID_CLOSE_TAG for an array size.
1172 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
1173 that manages isindex to use deref instead of delete.
1174 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
1175 mistake of using ID_CLOSE_TAG for the array size too.
1176 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
1177 there and it would prevent custom tags from working. Added range check before using the forbidden
1178 tag array with the token ID since custom tags will use index values past the end of the array.
1179 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
1180 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
1181 createElement call is still here.
1182 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
1183 document if getTagID fails; this creates a unique per-document ID.
1185 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
1186 * khtml/misc/htmlhashes.cpp:
1187 (khtml::getTagID): Changed return type to unsigned short.
1188 (khtml::getAttrID): Ditto.
1190 * khtml/misc/htmltags.c: Regenerated.
1191 * khtml/misc/htmltags.h: Regenerated.
1193 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
1194 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
1195 Also rewrote getTagName to work with the new scheme.
1197 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
1198 * khtml/xml/dom_docimpl.cpp:
1199 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
1200 Also updated for a few tags that the parser handled but this did not.
1202 * kwq/KWQRenderTreeDebug.cpp:
1203 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
1204 the tag ID directly, which only works for standard nodes.
1205 (operator<<): Update to call getTagName.
1206 (nodePositionRelativeToRoot): Ditto.
1207 (writeSelection): Ditto.
1209 2004-12-21 David Harrison <harrison@apple.com>
1211 Reviewed by Ken Kocienda.
1213 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
1215 Problem was the TextIterator was not handling exitNode() from a P block properly.
1217 * khtml/editing/visible_text.cpp:
1218 (khtml::TextIterator::TextIterator):
1219 Add new param that specifies whether the iterator is for content or for searching.
1220 Search iterators do not prevent newlines at the beginning.
1221 (khtml::TextIterator::advance):
1222 Added some comments.
1223 (khtml::TextIterator::handleTextNode):
1224 Added some comments.
1225 (khtml::TextIterator::exitNode):
1226 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
1227 (khtml::TextIterator::emitCharacter):
1228 Added some comments.
1229 (khtml::TextIterator::range):
1230 Added some comments.
1231 (khtml::CharacterIterator::CharacterIterator):
1232 Specify search type TextIterator.
1233 (khtml::CharacterIterator::advance):
1234 * khtml/editing/visible_text.h:
1236 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
1237 * khtml/editing/visible_units.cpp:
1238 (khtml::nextWordBoundary):
1239 Specify search type TextIterator.
1241 2004-12-21 David Harrison <harrison@apple.com>
1243 Reviewed by Ken Kocienda.
1245 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
1247 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
1248 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
1250 * khtml/rendering/render_text.cpp:
1251 (RenderText::setSelectionState)
1253 2004-12-21 Maciej Stachowiak <mjs@apple.com>
1257 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
1259 * khtml/ecma/kjs_window.cpp:
1260 (Window::get): Change most window functions to be restricted by
1263 2004-12-21 Ken Kocienda <kocienda@apple.com>
1269 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
1271 * khtml/editing/htmlediting.cpp:
1272 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
1273 formerly undetected and unhandled. This is the crux of the bug fix.
1274 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
1275 execution of command.
1276 * khtml/editing/htmlediting.h: Declare new function.
1277 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
1278 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
1280 2004-12-21 Ken Kocienda <kocienda@apple.com>
1284 * khtml/editing/htmlediting.cpp:
1285 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
1286 checking in (aka must return false from function returning bool).
1288 2004-12-21 Ken Kocienda <kocienda@apple.com>
1294 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
1296 * khtml/editing/htmlediting.cpp:
1297 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
1298 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
1300 2004-12-21 Ken Kocienda <kocienda@apple.com>
1304 * khtml/editing/htmlediting.cpp:
1305 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
1306 further experiements.
1307 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
1308 be done if the insertion point is in an empty block.
1309 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
1310 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
1311 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
1312 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
1313 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
1314 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
1316 2004-12-21 Darin Adler <darin@apple.com>
1320 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
1322 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
1323 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
1324 * khtml/editing/visible_text.cpp:
1325 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
1326 using the node's index. We only compute the node index if actually asked for the range.
1327 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
1329 (khtml::TextIterator::handleTextBox): Ditto.
1330 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
1332 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
1333 (khtml::TextIterator::exitNode): More of the same.
1334 (khtml::TextIterator::emitCharacter): Ditto.
1335 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
1336 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
1340 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
1344 2004-12-20 Ken Kocienda <kocienda@apple.com>
1348 * khtml/editing/htmlediting.cpp:
1349 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
1350 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1351 Rolling out until I can develop a real fix.
1353 2004-12-20 David Harrison <harrison@apple.com>
1355 Reviewed by Dave Hyatt.
1357 Initial checkin of AXTextMarkerRef support.
1359 * khtml/xml/dom_docimpl.cpp:
1360 (DocumentImpl::updateSelection):
1361 (DocumentImpl::setFocusNode):
1362 * kwq/KWQAccObject.h:
1363 * kwq/KWQAccObject.mm:
1364 (-[KWQAccObject detach]):
1365 (-[KWQAccObject anchorElement]):
1366 (-[KWQAccObject addChildrenToArray:]):
1367 (-[KWQAccObject accessibilityAttributeNames]):
1368 (-[KWQAccObject accessibilityActionDescription:]):
1369 (-[KWQAccObject accessibilityPerformAction:]):
1370 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
1371 (-[KWQAccObject textMarkerForVisiblePosition:]):
1372 (-[KWQAccObject visiblePositionForTextMarker:]):
1373 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
1374 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
1375 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1376 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1377 (-[KWQAccObject accessibilityAttributeValue:]):
1378 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1379 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
1380 (-[KWQAccObject getSelectedTextMarkerRange]):
1381 (-[KWQAccObject doAXLineForTextMarker:]):
1382 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1383 (-[KWQAccObject doAXStringForTextMarkerRange:]):
1384 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
1385 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
1386 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
1387 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
1388 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1389 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1390 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1391 (-[KWQAccObject accessibilityFocusedUIElement]):
1392 (-[KWQAccObject clearChildren]):
1393 (-[KWQAccObject accObjectID]):
1394 (-[KWQAccObject setAccObjectID:]):
1395 (-[KWQAccObject removeAccObjectID]):
1396 * kwq/KWQAccObjectCache.h:
1397 * kwq/KWQAccObjectCache.mm:
1398 (KWQAccObjectCache::KWQAccObjectCache):
1399 (KWQAccObjectCache::~KWQAccObjectCache):
1400 (KWQAccObjectCache::getAccObjectID):
1401 (KWQAccObjectCache::removeAccObjectID):
1402 (KWQAccObjectCache::textMarkerForVisiblePosition):
1403 (KWQAccObjectCache::visiblePositionForTextMarker):
1405 2004-12-19 Darin Adler <darin@apple.com>
1407 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
1409 2004-12-19 Darin Adler <darin@apple.com>
1413 - a garbage collection fix
1415 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
1416 #ifndef to use #if (in practice, either is OK).
1417 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
1419 2004-12-17 David Hyatt <hyatt@apple.com>
1421 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
1423 Reviewed by kocienda
1425 * khtml/rendering/render_box.cpp:
1426 (RenderBox::calcPercentageHeight):
1427 * khtml/rendering/render_table.cpp:
1428 (RenderTableSection::layoutRows):
1430 2004-12-17 David Harrison <harrison@apple.com>
1432 Reviewed by Ken Kocienda.
1434 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
1436 * khtml/editing/visible_units.cpp:
1437 (khtml::endOfParagraph):
1438 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
1440 2004-12-17 Ken Kocienda <kocienda@apple.com>
1444 * khtml/editing/htmlediting.cpp:
1445 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
1446 codes when I added the createBreakElement() function.
1448 2004-12-17 Richard Williamson <rjw@apple.com>
1450 Set the floor of max cacheable object size to 40K. This restores
1451 the long standing floor. Lower floor deleteriously impacts the PLT.
1454 * khtml/khtml_part.cpp:
1455 (KHTMLPart::checkCompleted):
1456 * khtml/misc/loader.cpp:
1459 2004-12-17 Ken Kocienda <kocienda@apple.com>
1465 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1467 * khtml/editing/htmlediting.cpp:
1468 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
1469 Formerly checked only for block boundary.
1471 2004-12-17 David Harrison <harrison@apple.com>
1475 Add KWQCFAutorelease for autoreleasing CF objects.
1476 * kwq/KWQFoundationExtras.h:
1480 2004-12-17 David Harrison <harrison@apple.com>
1484 Fix GC compatibility in getNSString.
1487 (QString::getNSString):
1488 Use NSString allocator instead of CFString, so that autorelease works under GC.
1490 2004-12-17 Ken Kocienda <kocienda@apple.com>
1496 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
1498 * khtml/editing/htmlediting.cpp:
1499 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
1500 move it after the <body> element.
1502 2004-12-17 Ken Kocienda <kocienda@apple.com>
1506 Added new layout tests covering cases from recent bug fixes.
1508 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
1509 * layout-tests/editing/inserting/insert-div-018.html: Added.
1510 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
1511 * layout-tests/editing/inserting/insert-div-019.html: Added.
1512 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
1513 * layout-tests/editing/inserting/insert-div-020.html: Added.
1514 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
1515 * layout-tests/editing/inserting/insert-div-021.html: Added.
1517 2004-12-17 Ken Kocienda <kocienda@apple.com>
1521 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
1523 * layout-tests/editing/inserting/insert-div-013-expected.txt
1524 * layout-tests/editing/inserting/insert-div-014-expected.txt
1526 2004-12-17 Ken Kocienda <kocienda@apple.com>
1532 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
1534 * khtml/editing/htmlediting.cpp:
1535 (khtml::InsertParagraphSeparatorCommand::doApply):
1536 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
1537 block as the reference node for the insertion of the new block.
1538 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
1539 I worked this all out on the whiteboard this time. This should be the last tweak.
1541 2004-12-17 Kevin Decker <kdecker@apple.com>
1545 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
1547 * khtml/xml/xml_tokenizer.cpp:
1548 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
1550 2004-12-16 Ken Kocienda <kocienda@apple.com>
1556 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
1558 * khtml/editing/htmlediting.cpp:
1559 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
1560 it checks the downstream node for the starting position.
1562 2004-12-16 Ken Kocienda <kocienda@apple.com>
1566 Added new createBreakElement() function that makes creating a <br> element a one-liner.
1567 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
1568 over to this new helper.
1570 * khtml/editing/htmlediting.cpp:
1571 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
1572 (khtml::InsertLineBreakCommand::doApply): Ditto.
1573 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1574 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1575 (khtml::ReplaceSelectionCommand::doApply): Ditto.
1576 (khtml::createBreakElement): New helper.
1577 * khtml/editing/htmlediting.h: Ditto.
1579 2004-12-16 David Hyatt <hyatt@apple.com>
1581 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
1582 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
1584 Reviewed by kocienda
1586 * khtml/rendering/render_object.cpp:
1587 (RenderObject::getVerticalPosition):
1589 2004-12-16 Ken Kocienda <kocienda@apple.com>
1595 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
1596 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
1598 * khtml/editing/htmlediting.cpp:
1599 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
1600 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
1601 a check which may move the node used as the reference node for the insertion. Also change this code to
1602 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
1603 to want to shift into the new <p>.
1605 2004-12-16 Darin Adler <darin@apple.com>
1609 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
1610 after talking this over with Dave and Ken
1612 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
1613 * khtml/editing/htmlediting.cpp:
1614 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
1615 helper so this can share code with the plain-text conversion code.
1616 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
1617 helper so this can share code with the plain-text conversion code.
1618 (khtml::createDefaultParagraphElement): Added.
1619 (khtml::createBlockPlaceholderElement): Added.
1621 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
1622 <br> elements for pasting plain text.
1624 - regenerated these files with the newer gperf
1626 * khtml/css/cssproperties.c: Regenerated.
1627 * khtml/css/cssvalues.c: Regenerated.
1628 * khtml/misc/htmlattrs.c: Regenerated.
1629 * khtml/misc/htmltags.c: Regenerated.
1631 2004-12-16 Ken Kocienda <kocienda@apple.com>
1637 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
1639 * khtml/xml/dom_nodeimpl.cpp:
1640 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
1641 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
1642 it stops looking in this situation. This problem eventually caused the delete code to try to
1643 merge a node under a descendent.
1645 2004-12-16 Adele Amchan <adele@apple.com>
1647 Change by Richard, reviewed by me.
1649 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
1651 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
1653 2004-12-16 Adele Amchan <adele@apple.com>
1657 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
1659 Added a call to ObjectImp::get before Window::get just returns Undefined.
1660 This was preventing us from getting the toString function from a Window object.
1662 * khtml/ecma/kjs_window.cpp: (Window::get):
1664 2004-12-16 Ken Kocienda <kocienda@apple.com>
1670 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
1672 * khtml/editing/htmlediting.cpp:
1673 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
1674 to do a better job than it was doing before. Added several test cases to prove I am on a
1676 * khtml/editing/visible_position.cpp:
1677 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
1678 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
1679 This function was returning true for the first position in "bar". Wrong. Also tightened up other
1680 rule: Should not report true when relationship between blocks cannot be determined.
1681 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
1682 when relationship between blocks cannot be determined.
1683 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
1684 * layout-tests/editing/inserting/insert-div-010.html: Added.
1685 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
1686 * layout-tests/editing/inserting/insert-div-011.html: Added.
1687 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
1688 * layout-tests/editing/inserting/insert-div-012.html: Added.
1689 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
1690 * layout-tests/editing/inserting/insert-div-013.html: Added.
1691 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
1692 * layout-tests/editing/inserting/insert-div-014.html: Added.
1693 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
1694 * layout-tests/editing/inserting/insert-div-015.html: Added.
1695 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
1696 * layout-tests/editing/inserting/insert-div-016.html: Added.
1697 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
1698 * layout-tests/editing/inserting/insert-div-017.html: Added.
1700 2004-12-16 Ken Kocienda <kocienda@apple.com>
1704 Added a layout test based on my last checkin.
1706 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
1707 * layout-tests/editing/selection/move-by-word-001.html: Added.
1709 2004-12-16 Ken Kocienda <kocienda@apple.com>
1715 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
1717 * khtml/editing/visible_text.cpp:
1718 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
1719 backwards into a different block that is an descendent of the block containing the text node (as in leaving
1720 the "bar" node in this example: <p>foo</p>bar).
1721 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
1722 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
1723 it is called from there, and now also from advance().
1725 2004-12-15 Darin Adler <darin@apple.com>
1729 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
1731 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
1732 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
1733 type altogether and use the render tree instead.
1735 2004-12-14 John Sullivan <sullivan@apple.com>
1739 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
1740 in the menu, no specific action names
1742 * khtml/editing/edit_actions.h: new header, contains EditAction enum
1743 (renamed from HTMLEditAction, formerly in htmlediting.h)
1745 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
1747 * khtml/editing/htmlediting.h:
1748 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
1749 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
1751 * khtml/editing/htmlediting.cpp:
1752 (khtml::EditCommandPtr::editingAction):
1753 update for enum name change
1754 (khtml::EditCommand::editingAction):
1756 (khtml::ApplyStyleCommand::ApplyStyleCommand):
1757 added editingAction parameter to this constructor
1758 (khtml::ApplyStyleCommand::editingAction):
1760 (khtml::DeleteSelectionCommand::editingAction):
1761 update for enum name change
1762 (khtml::MoveSelectionCommand::editingAction):
1764 (khtml::TypingCommand::editingAction):
1766 (khtml::ReplaceSelectionCommand::editingAction):
1769 * khtml/khtml_part.h:
1770 added EditAction parameter to applyStyle and computeAndSetTypingStyle
1771 * khtml/khtml_part.cpp:
1772 (KHTMLPart::computeAndSetTypingStyle):
1773 added EditAction parameter
1774 (KHTMLPart::applyStyle):
1777 * kwq/KWQKHTMLPart.mm:
1778 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1779 do the cast from EditAction to WebUndoAction a different way to match other code
1781 * kwq/WebCoreBridge.h:
1782 * kwq/WebCoreBridge.mm:
1783 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
1784 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
1785 (-[WebCoreBridge applyStyle:withUndoAction:]):
1788 * WebCore.pbproj/project.pbxproj:
1789 updated for new files
1791 2004-12-14 David Hyatt <hyatt@apple.com>
1793 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
1794 the ridiculous 1024 limit on the span values.
1796 * khtml/html/html_tableimpl.cpp:
1797 (HTMLTableCellElementImpl::parseHTMLAttribute):
1798 * khtml/rendering/render_table.cpp:
1799 (RenderTableCell::collapsedBottomBorder):
1800 * khtml/rendering/render_table.h:
1801 (khtml::RenderTableCell::colSpan):
1802 (khtml::RenderTableCell::setColSpan):
1803 (khtml::RenderTableCell::rowSpan):
1804 (khtml::RenderTableCell::setRowSpan):
1805 (khtml::RenderTableCol::span):
1806 (khtml::RenderTableCol::setSpan):
1808 2004-12-14 David Hyatt <hyatt@apple.com>
1810 Make sure <col> and <colgroup> can have spans updated dynamically as well.
1814 * khtml/html/html_tableimpl.cpp:
1815 (HTMLTableColElementImpl::parseHTMLAttribute):
1816 * khtml/rendering/render_table.cpp:
1817 (RenderTableCell::updateFromElement):
1818 (RenderTableCol::updateFromElement):
1820 2004-12-14 David Hyatt <hyatt@apple.com>
1822 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
1826 * khtml/html/html_tableimpl.cpp:
1827 (HTMLTableCellElementImpl::parseHTMLAttribute):
1828 * khtml/rendering/render_table.cpp:
1829 (RenderTableCell::RenderTableCell):
1830 (RenderTableCell::updateFromElement):
1832 2004-12-14 Chris Blumenberg <cblu@apple.com>
1834 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1838 * khtml/editing/markup.cpp:
1839 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
1841 2004-12-14 David Hyatt <hyatt@apple.com>
1843 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
1844 This is actually a regression from my positioned object DHTML optimization.
1846 Reviewed by kocienda
1848 * khtml/rendering/render_object.cpp:
1849 (RenderObject::setStyle):
1851 2004-12-14 David Hyatt <hyatt@apple.com>
1853 Make sure the class attribute works when newlines are present in the attribute.
1855 Reviewed by kocienda
1857 * khtml/html/html_elementimpl.cpp:
1858 (HTMLNamedAttrMapImpl::parseClassAttribute):
1860 2004-12-14 David Hyatt <hyatt@apple.com>
1862 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
1863 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
1864 read by splitting it into two separate functions.
1866 Reviewed by kocienda
1868 * khtml/rendering/render_block.cpp:
1869 (khtml::RenderBlock::layoutBlockChildren):
1870 (khtml::RenderBlock::clearFloats):
1871 (khtml::RenderBlock::addOverhangingFloats):
1872 (khtml::RenderBlock::addIntrudingFloats):
1873 * khtml/rendering/render_block.h:
1875 2004-12-14 John Sullivan <sullivan@apple.com>
1879 - added Undo action names for Cut, Paste, and Drag
1881 * khtml/editing/htmlediting.h:
1882 * khtml/editing/htmlediting.cpp:
1883 (khtml::DeleteSelectionCommand::editingAction):
1884 overridden to return HTMLEditActionCut
1885 (khtml::MoveSelectionCommand::editingAction):
1886 overridden to return HTMLEditActionDrag
1887 (khtml::ReplaceSelectionCommand::editingAction):
1888 overridden to return HTMLEditActionPaste
1890 2004-12-14 John Sullivan <sullivan@apple.com>
1894 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
1895 no specific action names
1897 The remaining step is to make each EditCommand subclass override editingAction() to return an
1898 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
1899 is not completely straightforward, so this next step isn't trivial.)
1901 * khtml/editing/htmlediting.h:
1902 new enum for HTMLEditAction
1904 * khtml/editing/htmlediting.cpp:
1905 (khtml::EditCommandPtr::editingAction):
1906 new method, calls through to EditCommand
1907 (khtml::EditCommand::editingAction):
1908 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
1909 (khtml::TypingCommand::editingAction):
1910 proof of concept override, returns HTMLEditActionTyping
1912 * kwq/KWQKHTMLPart.h:
1913 declare new private bottleneck method registerCommandForUndoOrRedo
1914 * kwq/KWQKHTMLPart.mm:
1915 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1916 new bottleneck method to reduce code duplication; now calls over the bridge
1917 to get the localized string to use for the Undo action name
1918 (KWQKHTMLPart::registerCommandForUndo):
1919 now calls new bottleneck method
1920 (KWQKHTMLPart::registerCommandForRedo):
1921 now calls new bottleneck method
1923 * kwq/WebCoreBridge.h:
1924 new enum for WebUndoAction, maps directly to HTMLEditAction.
1925 Declaration of nameForUndoAction:
1927 2004-12-14 Darin Adler <darin@apple.com>
1931 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
1933 * khtml/rendering/render_frames.cpp:
1934 (RenderPart::~RenderPart): Check widget for nil.
1935 (RenderPart::setWidget): Ditto.
1936 (RenderFrame::slotViewCleared): Ditto.
1937 (RenderPartObject::slotViewCleared): Ditto.
1939 2004-12-13 Darin Adler <darin@apple.com>
1943 - moved markup-related functions into new sources files in the editing directory
1944 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
1946 * ForwardingHeaders/editing/markup.h: Added.
1947 * khtml/editing/markup.h: Added.
1948 * khtml/editing/markup.cpp: Added.
1950 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
1952 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
1953 * khtml/html/html_elementimpl.cpp:
1954 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
1955 (HTMLElementImpl::outerHTML): Ditto.
1957 * khtml/ecma/kjs_window.cpp:
1958 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
1959 (Window::retrieveActive): Ditto.
1961 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
1962 * khtml/xml/dom_docimpl.h: Ditto.
1964 * khtml/khtml_part.cpp:
1965 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
1966 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
1968 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
1969 still works even with the additional replace overloads added to QString.
1970 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
1972 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
1973 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
1974 * khtml/rendering/render_object.cpp: Ditto.
1975 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
1977 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
1978 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
1979 the support code into markup.cpp.
1981 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
1982 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1984 * khtml/xml/dom_position.cpp:
1985 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
1986 so these return null positions rather than raising exceptions.
1987 (DOM::endPosition): Ditto.
1989 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
1990 * kwq/KWQFrame.h: Ditto.
1991 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
1992 * kwq/KWQKPartsPart.h: Ditto.
1993 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
1994 * kwq/KWQScrollView.h: Ditto.
1995 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
1996 * kwq/KWQKHTMLPart.h: Ditto.
1997 * kwq/KWQKHTMLPart.mm:
1998 (KHTMLView::isKHTMLView): Ditto.
1999 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
2000 replace overloads added to QString.
2001 (KWQKHTMLPart::setStatusBarText): Ditto.
2002 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
2003 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
2004 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
2005 (KWQKHTMLPart::attributedString): Ditto.
2006 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
2007 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
2009 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
2011 (QObject::inherits): Changed to not use dynamic cast.
2012 (QObject::isKHTMLPart): Added. Returns false.
2013 (QObject::isKHTMLView): Ditto.
2014 (QObject::isKPartsReadOnlyPart): Ditto.
2015 (QObject::isQFrame): Ditto.
2016 (QObject::isQScrollView): Ditto.
2018 * kwq/KWQRenderTreeDebug.cpp:
2019 (write): Changed to use inherits rather than dynamic_cast.
2020 (writeSelection): Ditto.
2022 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
2023 than going straight on to the "no parameters at all" version.
2026 * kwq/KWQString.mm: (QString::replace): Added overloads.
2027 * kwq/WebCoreBridge.mm:
2028 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
2029 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
2030 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
2031 the additional replace overloads added to QString.
2032 (-[WebCoreBridge stringForRange:]): Ditto.
2033 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
2034 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
2035 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
2036 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
2038 2004-12-13 Ken Kocienda <kocienda@apple.com>
2044 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
2046 * khtml/editing/htmlediting.cpp:
2047 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
2048 leading and trailing whitespace positions was reversed! I must have introduced this error recently
2049 when changing around this code.
2051 2004-12-13 David Hyatt <hyatt@apple.com>
2053 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
2054 and painting was using the wrong rect when setting up the x/y of the rect.
2058 * khtml/rendering/render_block.cpp:
2059 (khtml::RenderBlock::paint):
2060 (khtml::RenderBlock::nodeAtPoint):
2061 * khtml/rendering/render_object.h:
2062 (khtml::RenderObject::floatRect):
2064 2004-12-13 Ken Kocienda <kocienda@apple.com>
2070 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
2072 Code to figuire out the end node to merge was missing the font tag in the second paragraph
2073 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
2075 * khtml/editing/htmlediting.cpp:
2076 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
2077 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
2078 insufficiently powerful.
2079 (khtml::ReplacementFragment::enclosingBlock): New helper function.
2080 * khtml/editing/htmlediting.h: Add declaration for new helper function.
2081 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
2082 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
2084 2004-12-13 Ken Kocienda <kocienda@apple.com>
2088 WebCore side of fix for this bug:
2090 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
2092 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
2093 bug. This change involves our half of the needed changes.
2095 Note that a lot of this change has to do with changing code to use a <br> element instead of
2096 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
2097 other places, code to handle comments in markup can be removed since we do not use comments for
2098 such annotations after this change.
2100 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
2101 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
2102 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
2103 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
2104 convertedSpaceSpanClassString to match other uses of the idiom used here.
2105 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
2106 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
2107 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
2108 * khtml/html/html_elementimpl.cpp:
2109 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
2110 annotate fragments with comments any longer.
2111 * khtml/html/html_elementimpl.h: Ditto.
2112 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
2113 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
2114 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
2115 spurious semi-colon.
2116 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
2117 * kwq/WebCoreBridge.mm:
2118 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
2119 in DOM when calling createContextualFragment().
2121 2004-12-10 John Sullivan <sullivan@apple.com>
2123 fixed deployment build bustage that John Louch ran into
2125 * kwq/KWQTextEdit.mm:
2126 (QTextEdit::setScrollBarModes):
2127 move bool declaration inside exception-handling block to avoid obscure
2130 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2132 Reviewed by Richard.
2134 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
2137 (QWidget::setFocus): Handle the case where setting focus removed
2138 us from the superview - this can happen due to style changes on
2141 2004-12-10 Ken Kocienda <kocienda@apple.com>
2147 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
2149 There are a number of interesting things we could do to fix this bug, including SPI and involving
2150 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
2151 will fix the bug in the general case until such time as we can come up with more specific
2154 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
2157 * khtml/editing/htmlediting.cpp:
2158 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
2159 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
2160 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
2161 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
2163 2004-12-10 Darin Adler <darin@apple.com>
2167 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
2169 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
2170 * khtml/rendering/render_form.cpp:
2171 (RenderSubmitButton::rawText): Convert to QChar explicitly.
2172 (RenderLineEdit::updateFromElement): Ditto.
2173 (RenderLineEdit::slotTextChanged): Ditto.
2174 (RenderSelect::updateFromElement): Ditto.
2175 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
2176 that requires a derived class. Now we don't use this class at all for WebCore, but they still
2178 (TextAreaWidget::event): Moved out the ifdefs.
2179 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
2180 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
2181 now done in setStyle.
2182 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
2183 that's needed and WebCore no longer has TextAreaWidget.
2184 (RenderTextArea::calcMinMaxWidth): Ditto.
2185 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
2187 (RenderTextArea::updateFromElement): Use type QTextEdit.
2188 (RenderTextArea::text): Ditto.
2189 (RenderTextArea::select): Ditto.
2191 * kwq/KWQTextArea.mm:
2192 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
2193 since it's now handled by QTextEdit.
2194 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
2196 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
2197 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
2198 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
2200 2004-12-10 Ken Kocienda <kocienda@apple.com>
2206 <rdar://problem/3915047> HItting return in empty document inserts <p> but
2207 insertion point does not move
2209 * khtml/editing/htmlediting.cpp:
2210 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
2211 code to insert the <p> element for the return is not detecting the fact
2212 that the document is empty. Inserting a <p> into an empty body will not
2213 "add a new line" as the user expects. With this change, we'll add a second
2214 <p> when the root editable element has no rendered kids.
2216 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2220 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
2222 * khtml/html/html_miscimpl.cpp:
2223 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
2224 the initial one step, otherwise we might inadvertantly step
2225 outside the collection base, thereby causing assertion failures or
2226 other badness later.
2228 2004-12-10 Ken Kocienda <kocienda@apple.com>
2232 * khtml/editing/htmlediting.cpp:
2233 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
2234 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
2235 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
2236 should do nothing if the starting point for the selection is itself the starting block.
2237 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
2238 function, though the names and concepts are slightly different.
2240 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2244 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
2246 * khtml/dom/html_document.cpp:
2247 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
2248 * khtml/dom/html_document.h:
2249 * khtml/ecma/kjs_html.cpp:
2250 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
2251 * khtml/html/html_miscimpl.cpp:
2252 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
2253 the items that can be accessed directly as a document propery, in particular forms, images,
2254 objects, applets and embeds.
2255 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
2256 (HTMLFormCollectionImpl::updateNameCache): Ditto.
2257 * khtml/html/html_miscimpl.h:
2258 (DOM::HTMLCollectionImpl::): Added new type.
2260 2004-12-10 Ken Kocienda <kocienda@apple.com>
2266 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
2268 * khtml/rendering/render_text.cpp:
2269 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
2271 2004-12-10 Ken Kocienda <kocienda@apple.com>
2277 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
2279 * khtml/editing/htmlediting.cpp:
2280 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
2281 that was removed from the document when pasting. This caused the disappearance. Now this
2282 is detected, and the selection is shifted to a node that is in the document.
2284 2004-12-09 Richard Williamson <rjw@apple.com>
2286 Check to disable threaded decoding during
2287 layout tests wasn't invoking function, just checking address of
2288 function, which would always return true.
2290 * kwq/WebCoreImageRendererFactory.m:
2291 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2293 2004-12-09 David Hyatt <hyatt@apple.com>
2295 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
2298 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
2299 all inlines when repainting.
2303 * khtml/rendering/render_block.cpp:
2304 (khtml::RenderBlock::layoutBlockChildren):
2305 * khtml/rendering/render_flow.cpp:
2306 (RenderFlow::getAbsoluteRepaintRect):
2308 2004-12-09 David Hyatt <hyatt@apple.com>
2310 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
2311 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
2312 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
2313 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
2317 * khtml/rendering/render_block.cpp:
2318 (khtml::RenderBlock::getClearDelta):
2319 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
2320 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
2321 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
2322 * layout-tests/fast/block/margin-collapse/102-expected.txt:
2323 * layout-tests/fast/block/margin-collapse/102.html:
2325 2004-12-09 Richard Williamson <rjw@apple.com>
2327 Fixed <rdar://problem/3914078> worldclock crashing gc related
2329 Use ProtectedValue for Context2D instance members.
2333 * khtml/ecma/kjs_html.h:
2335 2004-12-09 John Sullivan <sullivan@apple.com>
2339 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
2341 * kwq/KWQAccObject.mm:
2342 (-[KWQAccObject title]): moved image alt tag code out of here
2343 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
2344 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
2345 that ordinary elements return; this means that ordinary elements that aren't images will return
2346 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
2348 (-[KWQAccObject accessibilityAttributeValue:]):
2349 call accessibilityDescription when asked for AXDescription
2351 2004-12-09 Ken Kocienda <kocienda@apple.com>
2353 Reviewed by Harrison
2357 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
2359 * khtml/editing/htmlediting.cpp:
2360 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
2361 been deleted. If this is the case, set the destination to the node the delete command provides in
2362 its ending selection.
2366 2004-12-09 Ken Kocienda <kocienda@apple.com>
2372 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
2374 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
2375 callback may not be delivered before the program asks for the dimensions of an image in order to
2376 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
2377 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
2379 * kwq/KWQRenderTreeDebug.cpp:
2380 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
2381 (externalRepresentation): Sets debuggingRenderTree flag to true;
2382 * kwq/KWQRenderTreeDebug.h:
2383 * kwq/WebCoreImageRendererFactory.m:
2384 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
2385 do threaded decoding in any case if the flag is set.
2387 2004-12-09 Chris Blumenberg <cblu@apple.com>
2389 Fix for busting XMLHTTPRequest.
2391 Reviewed by kocienda.
2393 * khtml/misc/loader.cpp:
2394 (Loader::servePendingRequests): pass true for deliverAllData
2396 (KIO::get): take deliverAllData param
2397 (KIO::http_post): ditto
2398 * kwq/KWQKJobClasses.h:
2399 * kwq/KWQKJobClasses.mm:
2400 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
2401 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
2403 2004-12-09 Ken Kocienda <kocienda@apple.com>
2407 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
2409 * khtml/xml/dom_nodeimpl.cpp:
2410 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
2412 2004-12-07 Richard Williamson <rjw@apple.com>
2414 Support threaded image decoding on machines w/ > 2 CPUs.
2416 Reviewed by Maciej and Chris.
2418 * khtml/misc/loader.cpp:
2419 (CachedImageCallback::notifyUpdate):
2420 (CachedImageCallback::notifyFinished):
2421 (CachedImageCallback::notifyDecodingError):
2422 (CachedImageCallback::handleError):
2423 (CachedImageCallback::clear):
2424 (CachedImage::CachedImage):
2425 (CachedImage::clear):
2426 (CachedImage::data):
2427 (CachedImage::checkNotify):
2428 (Loader::servePendingRequests):
2429 (Loader::slotFinished):
2430 (Loader::numRequests):
2431 (Loader::cancelRequests):
2432 (Loader::removeBackgroundDecodingRequest):
2433 * khtml/misc/loader.h:
2434 (khtml::CachedImageCallback::CachedImageCallback):
2435 (khtml::CachedImageCallback::ref):
2436 (khtml::CachedImageCallback::deref):
2437 (khtml::CachedImage::decoderCallback):
2438 * khtml/rendering/render_object.cpp:
2439 (RenderObject::setPixmap):
2442 (-[WebImageCallback initWithCallback:khtml::]):
2443 (-[WebImageCallback _commonTermination]):
2444 (-[WebImageCallback dealloc]):
2445 (-[WebImageCallback finalize]):
2446 (-[WebImageCallback notify]):
2447 (-[WebImageCallback setImageSourceStatus:]):
2448 (-[WebImageCallback status]):
2449 (QPixmap::shouldUseThreadedDecoding):
2450 (QPixmap::receivedData):
2451 * kwq/WebCoreImageRenderer.h:
2452 * kwq/WebCoreImageRendererFactory.h:
2453 * kwq/WebCoreImageRendererFactory.m:
2454 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2455 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
2457 2004-12-07 Ken Kocienda <kocienda@apple.com>
2461 * khtml/editing/htmlediting.cpp:
2462 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
2463 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
2464 after new block has been inserted, otherwise a crash can result. Shuffle down call
2465 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
2468 2004-12-07 Ken Kocienda <kocienda@apple.com>
2474 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
2476 * khtml/editing/htmlediting.cpp:
2477 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
2478 for determining the location for inserting content. Do not allow an insert before or after if the
2479 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
2480 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
2481 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
2483 2004-12-07 Darin Adler <darin@apple.com>
2487 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
2489 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
2491 2004-12-07 Ken Kocienda <kocienda@apple.com>
2495 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
2496 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
2498 * khtml/editing/html_interchange.h: Name change, as described above.
2499 * khtml/editing/htmlediting.cpp:
2500 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
2501 * khtml/xml/dom2_rangeimpl.cpp:
2502 (DOM::RangeImpl::toHTML): Ditto.
2504 2004-12-07 Ken Kocienda <kocienda@apple.com>
2508 Added a couple more layout tests.
2510 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
2511 * layout-tests/editing/deleting/delete-line-013.html: Added.
2512 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
2513 * layout-tests/editing/deleting/delete-line-014.html: Added.
2515 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2519 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
2521 * kwq/KWQListBox.mm:
2522 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
2523 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
2524 (-[KWQListBoxScrollView widget]): See above.
2525 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
2526 afterMouseDown, to avoid triggering an assertion failure.
2528 2004-12-06 David Hyatt <hyatt@apple.com>
2530 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
2531 made by me, kocienda and harrison to just remove it.
2535 * khtml/rendering/bidi.cpp:
2536 (khtml::RenderBlock::layoutInlineChildren):
2537 * khtml/rendering/render_block.cpp:
2538 (khtml:::RenderFlow):
2539 * khtml/rendering/render_block.h:
2540 * khtml/rendering/render_flow.cpp:
2541 (RenderFlow::dirtyLinesFromChangedChild):
2543 2004-12-06 David Hyatt <hyatt@apple.com>
2545 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
2546 not a damage rect that can be changed when intersected with the clip regions of the web page.
2550 * khtml/rendering/render_canvas.h:
2551 (khtml::RenderCanvas::printRect):
2552 (khtml::RenderCanvas::setPrintRect):
2553 * khtml/rendering/render_flow.cpp:
2554 (RenderFlow::paintLines):
2555 * khtml/rendering/render_list.cpp:
2556 (RenderListMarker::paint):
2557 * kwq/KWQKHTMLPart.mm:
2558 (KWQKHTMLPart::adjustPageHeight):
2560 2004-12-06 David Harrison <harrison@apple.com>
2562 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
2564 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
2567 * khtml/rendering/render_flow.cpp:
2568 (RenderFlow::dirtyLinesFromChangedChild):
2569 Dirty the line above because new child can inval the cached line break position of previous line.
2571 2004-12-06 David Hyatt <hyatt@apple.com>
2573 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
2574 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
2575 3126929, handle top/left overflow.
2577 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
2579 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
2580 regions and web pages) has been fixed.
2584 * khtml/rendering/bidi.cpp:
2585 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2586 (khtml::RenderBlock::checkLinesForOverflow):
2587 * khtml/rendering/render_block.cpp:
2588 (khtml:::RenderFlow):
2589 (khtml::RenderBlock::overflowHeight):
2590 (khtml::RenderBlock::overflowWidth):
2591 (khtml::RenderBlock::overflowLeft):
2592 (khtml::RenderBlock::overflowTop):
2593 (khtml::RenderBlock::overflowRect):
2594 (khtml::RenderBlock::layoutBlock):
2595 (khtml::RenderBlock::layoutBlockChildren):
2596 (khtml::RenderBlock::paint):
2597 (khtml::RenderBlock::floatRect):
2598 (khtml::RenderBlock::lowestPosition):
2599 (khtml::RenderBlock::rightmostPosition):
2600 (khtml::RenderBlock::leftmostPosition):
2601 (khtml::RenderBlock::nodeAtPoint):
2602 * khtml/rendering/render_block.h:
2603 * khtml/rendering/render_box.h:
2604 (khtml::RenderBox::borderBox):
2605 (khtml::RenderBox::borderTopExtra):
2606 (khtml::RenderBox::borderBottomExtra):
2607 * khtml/rendering/render_layer.cpp:
2608 (RenderLayer::paintScrollbars):
2609 (mustExamineRenderer):
2610 (RenderLayer::intersectsDamageRect):
2611 (RenderLayer::containsPoint):
2612 * khtml/rendering/render_line.cpp:
2613 (khtml::InlineFlowBox::placeBoxesHorizontally):
2614 (khtml::InlineFlowBox::verticallyAlignBoxes):
2615 * khtml/rendering/render_line.h:
2616 (khtml::InlineBox::leftOverflow):
2617 (khtml::InlineBox::rightOverflow):
2618 (khtml::InlineFlowBox::setVerticalOverflowPositions):
2619 (khtml::RootInlineBox::RootInlineBox):
2620 (khtml::RootInlineBox::leftOverflow):
2621 (khtml::RootInlineBox::rightOverflow):
2622 (khtml::RootInlineBox::setVerticalOverflowPositions):
2623 (khtml::RootInlineBox::setHorizontalOverflowPositions):
2624 * khtml/rendering/render_object.h:
2625 (khtml::RenderObject::borderBox):
2626 (khtml::RenderObject::overflowLeft):
2627 (khtml::RenderObject::overflowTop):
2628 (khtml::RenderObject::overflowRect):
2629 (khtml::RenderObject::floatRect):
2630 * khtml/rendering/render_table.cpp:
2631 (RenderTable::layout):
2632 (RenderTable::paint):
2633 (RenderTable::paintBoxDecorations):
2634 (RenderTable::calcMinMaxWidth):
2635 * khtml/rendering/render_table.h:
2636 (khtml::RenderTableCell::borderTopExtra):
2637 (khtml::RenderTableCell::borderBottomExtra):
2642 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2646 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
2648 I changed all unprotected places that can navigate a different
2649 window or frame from script to check for a javascript: URL, and if
2650 found, to check for safety using cross-site-script rules.
2652 I considered a few other possible exploits and made no change:
2654 - document.location is already protected because the document
2655 object itself is protected
2657 - frame.src, frame.location, iframe.src and targetted links are
2658 all safe because setting the URL of a frame to a javascript: URL
2659 executes the script in the context of the parent
2661 * khtml/ecma/kjs_window.cpp:
2662 (WindowFunc::tryCall):
2664 (LocationFunc::tryCall):
2666 2004-12-06 Ken Kocienda <kocienda@apple.com>
2672 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
2674 * khtml/editing/htmlediting.cpp:
2675 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
2676 check for one of the special cases being checked for in this function. The specific case
2677 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
2678 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
2679 case where a selection ended in a <br> after a block and would not delete any part of the
2680 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
2683 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
2684 new use of the function exposed this bug:
2686 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
2688 * khtml/xml/dom_position.cpp:
2689 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
2690 not have this fatal flaw. It is a much better design as well.
2692 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
2693 have what I consider to be a better result. Going with it.
2695 2004-12-06 Chris Blumenberg <cblu@apple.com>
2697 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
2702 (-[DOMElement _font]): new SPI for AppKit
2705 2004-12-06 Darin Adler <darin@apple.com>
2709 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
2711 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
2712 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
2714 2004-12-06 John Sullivan <sullivan@apple.com>
2716 Darin found what appears to be the real leak that we were falsely blaming
2717 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
2718 sure nothing barfed.
2720 * khtml/css/cssparser.cpp:
2721 (CSSParser::parseValue):
2722 call clearProperties() instead of just setting numParsedProperties to 0
2723 (CSSParser::parseDeclaration):
2725 (CSSParser::createStyleDeclaration):
2728 2004-12-06 Ken Kocienda <kocienda@apple.com>
2734 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
2735 * layout-tests/editing/inserting/insert-div-001.html: Added.
2736 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
2737 * layout-tests/editing/inserting/insert-div-002.html: Added.
2738 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
2739 * layout-tests/editing/inserting/insert-div-003.html: Added.
2740 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
2741 * layout-tests/editing/inserting/insert-div-004.html: Added.
2742 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
2743 * layout-tests/editing/inserting/insert-div-005.html: Added.
2744 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
2745 * layout-tests/editing/inserting/insert-div-006.html: Added.
2746 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
2747 * layout-tests/editing/inserting/insert-div-007.html: Added.
2748 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
2749 * layout-tests/editing/inserting/insert-div-008.html: Added.
2750 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
2751 * layout-tests/editing/inserting/insert-div-009.html: Added.
2753 2004-12-06 Ken Kocienda <kocienda@apple.com>
2755 Reviewed by Harrison
2759 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
2761 * khtml/editing/htmlediting.cpp:
2762 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
2763 being added to this function. This ensures that the added block has a height.
2764 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2766 2004-12-06 Ken Kocienda <kocienda@apple.com>
2770 * khtml/dom/dom_string.cpp:
2771 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
2772 * khtml/dom/dom_string.h: Ditto.
2773 * khtml/editing/htmlediting.cpp:
2774 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
2775 RebalanceWhitespaceCommand instance.
2776 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
2777 (khtml::InsertLineBreakCommand::doApply): Ditto.
2778 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2779 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2780 (khtml::InsertTextCommand::input): Ditto.
2781 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
2782 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
2783 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2784 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
2785 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
2786 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
2787 * khtml/editing/htmlediting.h: Ditto.
2788 (khtml::RebalanceWhitespaceCommand::): Ditto.
2790 2004-12-05 Darin Adler <darin@apple.com>
2792 - fixed small problem in my check-in from yesterday
2795 (positionForEvent): Get location from event without raising exception if it's the wrong type.
2796 (clickCountForEvent): Same, for clickCount.
2797 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
2798 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
2799 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
2801 2004-12-04 Darin Adler <darin@apple.com>
2805 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
2807 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
2808 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
2809 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
2811 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
2813 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
2814 * khtml/rendering/render_form.cpp:
2815 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
2816 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
2817 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
2819 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
2820 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
2821 Added a fixState helper method so the constructors can save code.
2823 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
2824 and added a third constructor that uses the "current event" from AppKit (used above).
2825 (QMouseEvent::fixState): Compute state and click count based on event type.
2827 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
2829 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
2830 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
2831 underlying cause in CSS.
2833 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
2835 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
2836 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
2838 2004-12-03 Chris Blumenberg <cblu@apple.com>
2841 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2842 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2843 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2844 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
2846 Reviewed by darin, rjw, kocienda.
2848 * khtml/misc/loader.cpp:
2849 (CachedObject::~CachedObject):
2850 (CachedCSSStyleSheet::checkNotify):
2851 (Loader::servePendingRequests):
2852 (Loader::slotFinished):
2853 (Loader::slotReceivedResponse):
2854 (Cache::requestImage):
2855 (Cache::requestScript):
2856 * khtml/misc/loader.h:
2857 (khtml::CachedObject::CachedObject):
2858 (khtml::CachedObject::response):
2859 (khtml::CachedObject::allData):
2860 * kwq/KWQKJobClasses.h:
2861 * kwq/KWQKJobClasses.mm:
2862 (KIO::TransferJobPrivate::TransferJobPrivate):
2863 (KIO::TransferJobPrivate::~TransferJobPrivate):
2864 (KIO::TransferJob::TransferJob):
2865 (KIO::TransferJob::assembleResponseHeaders):
2866 (KIO::TransferJob::retrieveCharset):
2867 (KIO::TransferJob::emitResult):
2868 (KIO::TransferJob::emitReceivedResponse):
2871 (KWQHeaderStringFromDictionary):
2872 (KWQCheckCacheObjectStatus):
2873 (KWQIsResponseURLEqualToURL):
2875 (KWQResponseMIMEType):
2876 (KWQCacheObjectExpiresTime):
2877 (khtml::CachedObject::setResponse):
2878 (khtml::CachedObject::setAllData):
2882 * kwq/KWQResourceLoader.mm:
2883 (-[KWQResourceLoader finishJobAndHandle:]):
2884 (-[KWQResourceLoader cancel]):
2885 (-[KWQResourceLoader reportError]):
2886 (-[KWQResourceLoader finishWithData:]):
2894 * kwq/WebCoreBridge.h:
2895 * kwq/WebCoreResourceLoader.h:
2897 2004-12-04 Darin Adler <darin@apple.com>
2901 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
2903 * khtml/rendering/render_form.cpp:
2904 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
2905 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
2906 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
2907 (RenderSlider::slotSliderValueChanged): Ditto.
2909 2004-12-03 John Sullivan <sullivan@apple.com>
2913 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
2914 khtml::BackgroundLayer::cullEmptyLayers
2916 * khtml/rendering/render_style.cpp:
2917 (BackgroundLayer::cullEmptyLayers):
2918 added missing nil check
2922 2004-12-03 Ken Kocienda <kocienda@apple.com>
2926 Roll out some recent changes by Chris that caused a performance regression.
2927 Fix is in hand, but it is a little risky this close to a submission. So,
2928 we have decided to roll back the change with the regression and roll in
2929 the new code after we submit.
2931 * khtml/css/cssproperties.c:
2934 * khtml/css/cssvalues.c:
2937 * khtml/misc/htmlattrs.c:
2940 * khtml/misc/htmltags.c:
2943 * khtml/misc/loader.cpp:
2944 (CachedObject::~CachedObject):
2945 (CachedObject::setResponse):
2946 (CachedCSSStyleSheet::checkNotify):
2947 (Loader::servePendingRequests):
2948 (Loader::slotFinished):
2949 (Loader::slotReceivedResponse):
2950 (Cache::requestImage):
2951 (Cache::requestScript):
2952 * khtml/misc/loader.h:
2953 (khtml::CachedObject::CachedObject):
2954 (khtml::CachedObject::response):
2955 * kwq/KWQKJobClasses.h:
2956 * kwq/KWQKJobClasses.mm:
2957 (KIO::TransferJobPrivate::TransferJobPrivate):
2958 (KIO::TransferJobPrivate::~TransferJobPrivate):
2959 (KIO::TransferJob::TransferJob):
2960 (KIO::TransferJob::assembleResponseHeaders):
2961 (KIO::TransferJob::retrieveCharset):
2962 (KIO::TransferJob::emitResult):
2963 (KIO::TransferJob::emitReceivedResponse):
2966 (KWQHeaderStringFromDictionary):
2967 (KWQCheckCacheObjectStatus):
2968 (KWQRetainResponse):
2969 (KWQReleaseResponse):
2970 (KWQIsResponseURLEqualToURL):
2972 (KWQResponseMIMEType):
2973 (KWQResponseTextEncodingName):
2974 (KWQResponseHeaderString):
2975 (KWQCacheObjectExpiresTime):
2976 (KWQLoader::KWQLoader):
2980 * kwq/KWQResourceLoader.mm:
2981 (-[KWQResourceLoader finishJobAndHandle]):
2982 (-[KWQResourceLoader cancel]):
2983 (-[KWQResourceLoader reportError]):
2984 (-[KWQResourceLoader finish]):
2992 * kwq/WebCoreBridge.h:
2993 * kwq/WebCoreResourceLoader.h:
2995 2004-12-03 John Sullivan <sullivan@apple.com>
2999 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
3001 * kwq/KWQKHTMLPart.mm:
3002 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
3003 when checking whether we moved the focus to another view, make sure we didn't "move" it to
3004 our documentView, because that's no move at all.
3006 2004-12-03 Darin Adler <darin@apple.com>
3010 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
3012 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
3013 Added missing initialization for base class and node pointer.
3015 - fixed a few places that could leave dangling node pointers
3017 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
3018 Clear out the node pointer when the node is destroyed.
3019 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
3021 2004-12-03 Chris Blumenberg <cblu@apple.com>
3023 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.
3024 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
3028 * khtml/misc/loader.cpp:
3029 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
3030 (Loader::slotFinished): take data param
3031 * khtml/misc/loader.h:
3032 * kwq/KWQKJobClasses.h:
3033 * kwq/KWQKJobClasses.mm:
3034 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
3035 (KIO::TransferJob::emitResult): take data param and pass it
3036 * kwq/KWQResourceLoader.mm:
3037 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
3038 (-[KWQResourceLoader cancel]): pass nil for data
3039 (-[KWQResourceLoader reportError]): ditto
3040 (-[KWQResourceLoader finishWithData:]): pass data
3042 (KWQSlot::KWQSlot): pass data param to slotFinished
3043 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
3045 2004-12-03 Ken Kocienda <kocienda@apple.com>
3049 Did some clean up in the Position class as a result of trying to write some new layout
3050 tests and discovering a bug along the way.
3052 I removed these three functions from the Position class:
3054 1. bool isFirstRenderedPositionOnLine() const;
3055 2. bool isLastRenderedPositionOnLine() const;
3056 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
3057 4. bool inFirstEditableInRootEditableElement() const;
3059 The first two have replacements in the VisiblePosition class, and some code has been
3060 moved to use these new variants. The third function was a helper used only by these
3061 first two function, and can be removed as well. The fourth function was not used by anyone.
3063 * khtml/editing/htmlediting.cpp:
3064 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
3065 * khtml/editing/visible_position.cpp:
3066 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
3067 Incorrect results were being returned when asking about positions at the starts of blocks.
3068 * khtml/xml/dom_position.cpp:
3069 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
3070 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
3071 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
3072 * khtml/xml/dom_position.h: Update header for deletions.
3074 2004-12-03 Ken Kocienda <kocienda@apple.com>
3078 Terminology change in execCommand command identifiers. Specifically, the name of
3079 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
3080 terminology used by AppKit. It is also more accurate, since the insertion of a
3081 "br" element is what the command does. The inspiration for this change is so the
3082 -insertNewline AppKit method can be mapped to insert a new "div" element in
3083 a document and avoid ambiguity with what the javascript editing command does.
3085 * khtml/editing/jsediting.cpp
3086 * layout-tests/editing/deleting/delete-tab-004.html
3087 * layout-tests/editing/editing.js
3088 * layout-tests/editing/inserting/insert-3654864-fix.html
3089 * layout-tests/editing/inserting/insert-3659587-fix.html
3090 * layout-tests/editing/inserting/insert-3775316-fix.html
3091 * layout-tests/editing/inserting/insert-3800346-fix.html
3092 * layout-tests/editing/inserting/insert-br-001.html
3093 * layout-tests/editing/inserting/insert-br-002.html
3094 * layout-tests/editing/inserting/insert-br-003.html
3095 * layout-tests/editing/inserting/insert-br-004.html
3096 * layout-tests/editing/inserting/insert-br-005.html
3097 * layout-tests/editing/inserting/insert-br-006.html
3098 * layout-tests/editing/inserting/insert-br-007.html
3099 * layout-tests/editing/inserting/insert-br-008.html
3100 * layout-tests/editing/inserting/insert-tab-004.html
3101 * layout-tests/editing/inserting/insert-text-with-newlines.html
3102 * layout-tests/editing/pasteboard/paste-text-010.html
3104 2004-12-02 Ken Kocienda <kocienda@apple.com>
3110 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
3112 * khtml/editing/htmlediting.cpp:
3113 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
3114 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
3115 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
3116 in a block and the document is in quirks mode, add an additional br to make the one in the
3117 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
3118 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
3119 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
3121 2004-12-02 Richard Williamson <rjw@apple.com>
3123 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
3125 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
3126 the b/f cache won't incorrectly trash the previous state when restoring.
3130 * kwq/WebCoreBridge.h:
3131 * kwq/WebCoreBridge.mm:
3132 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
3133 (-[WebCoreBridge canCachePage]):
3134 (-[WebCoreBridge clear]):
3136 2004-12-02 Ken Kocienda <kocienda@apple.com>
3142 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
3144 * khtml/xml/dom2_rangeimpl.cpp:
3145 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
3146 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
3147 of this bug where there is content after the body tag). Did a little code clean up as well.
3148 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
3150 2004-12-02 Ken Kocienda <kocienda@apple.com>
3156 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
3158 * khtml/khtml_part.cpp:
3159 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
3160 to figure out which end of the selection to extend.
3162 2004-12-02 David Harrison <harrison@apple.com>
3164 Reviewed by Ken Kocienda.
3166 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
3167 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
3169 * khtml/editing/visible_text.cpp:
3170 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3171 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
3172 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
3173 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
3174 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
3175 Distinguish BR from whitespace.
3176 * khtml/editing/visible_text.h:
3177 Distinguish BR from whitespace.
3178 * khtml/editing/visible_units.cpp:
3179 (khtml::previousWordBoundary):
3180 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.
3182 2004-12-02 Ken Kocienda <kocienda@apple.com>
3188 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
3190 * khtml/xml/dom_position.cpp:
3191 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
3192 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
3193 exception trying to use a Position returned from this function to set the boundary point of a Range (which
3194 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
3195 contract to return a range-compliant position, hence the need for this fix.
3197 2004-12-01 Ken Kocienda <kocienda@apple.com>
3203 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
3204 regard to other editing commands. The class had a name change ages ago, and it was never
3206 * khtml/editing/htmlediting.h: Ditto.
3208 2004-12-01 Ken Kocienda <kocienda@apple.com>
3212 Some improvements for paste, including some new code to annotate
3213 whitespace when writing to the pasteboard to ensure that the meaning
3214 of the markup on the pasteboard is unambiguous.
3216 There is also new code for reading this annotated markup from the pasteboard,
3217 removing the nodes that were added only to prevent ambiguity.
3219 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
3220 The header should have been added earlier, but I did not do so.
3221 * khtml/editing/html_interchange.cpp: Added.
3222 (convertHTMLTextToInterchangeFormat):
3223 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
3224 * khtml/editing/htmlediting.cpp:
3225 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
3226 Also fixed a bug in the code that counts blocks in a fragment.
3227 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
3228 (khtml::ReplacementFragment::insertNodeBefore): New helper.
3229 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
3230 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
3231 * khtml/editing/htmlediting.h: Add some new declarations.
3232 * khtml/xml/dom2_rangeimpl.cpp:
3233 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
3234 * khtml/xml/dom_nodeimpl.cpp:
3235 (NodeImpl::stringValueForRange): New helper.
3236 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
3237 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
3238 should be added. Called by the paste code.
3239 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
3241 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
3242 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
3243 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
3245 2004-11-30 Chris Blumenberg <cblu@apple.com>
3247 * ChangeLog: removed conflict marker
3249 2004-11-30 Chris Blumenberg <cblu@apple.com>
3252 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
3253 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
3257 * khtml/misc/loader.cpp:
3258 (CachedObject::~CachedObject): release m_allData
3259 (CachedObject::setAllData): new
3260 (Loader::servePendingRequests): connect slotAllData
3261 (Loader::slotAllData): new
3262 (Cache::requestImage): tweak
3263 * khtml/misc/loader.h:
3264 (khtml::CachedObject::CachedObject): set allData to 0
3265 (khtml::CachedObject::allData): new
3266 * kwq/KWQKJobClasses.h:
3267 * kwq/KWQKJobClasses.mm:
3268 (KIO::TransferJob::TransferJob): set m_allData
3269 (KIO::TransferJob::emitAllData): new
3271 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
3272 * kwq/KWQResourceLoader.mm:
3273 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
3275 (KWQSlot::KWQSlot): support for slotAllData
3277 * kwq/WebCoreBridge.h:
3278 * kwq/WebCoreResourceLoader.h:
3280 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3284 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3288 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
3290 * khtml/khtml_part.cpp:
3291 (KHTMLPart::begin): call setParsing on document here after opening
3292 - from now on we'll only set parsing to true for a document open
3293 caused by page loading, not a programmatic one.
3294 * khtml/xml/dom_docimpl.cpp:
3295 (DocumentImpl::open): don't setParsing to true here any more.
3297 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3301 - fix recent regression from collection perf fixes.
3303 * khtml/html/html_miscimpl.cpp:
3304 (HTMLFormCollectionImpl::updateNameCache): Look up the name
3305 attribute in the name cache, not the id cache (d'oh!)
3307 2004-11-30 Darin Adler <darin@apple.com>
3311 - rolled in a KDE fix for a problem that may underlie a number of crashes
3313 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
3314 the KDE guys to fix a subtle problem. Code said "n = n =".
3316 - rolled in a KDE fix for a containingBlock crash
3318 * khtml/rendering/render_object.cpp: Roll in a change from KDE that adds frameset to the list of
3319 elements that can not be a containingBlock. They said this fixes a crash, although I did not look
3322 - fixed <rdar://problem/3884660> 8A305: Repro crash in QScrollBar::setValue (affects Safari RSS)
3325 (-[KWQButton initWithQButton:]): Set up target and action here instead of in caller.
3326 (-[KWQButton detachQButton]): Added.
3327 (-[KWQButton sendConsumedMouseUpIfNeeded]): Check button for nil instead of checking target.
3328 (-[KWQButton mouseDown:]): Add calls to QWidget::beforeMouseDown/afterMouseDown.
3329 (-[KWQButton widget]): Added.
3330 (-[KWQButton becomeFirstResponder]): Added check to handle when button is 0.
3331 (-[KWQButton resignFirstResponder]): Ditto.
3332 (-[KWQButton canBecomeKeyView]): Ditto.
3333 (QButton::QButton): Remove target and action setup; handled in KWQButton now.
3334 (QButton::~QButton): Call detachQButton instead of setTarget:nil.
3336 * kwq/KWQComboBox.mm:
3337 (QComboBox::~QComboBox): Call detachQComboBox.
3338 (-[KWQPopUpButtonCell detachQComboBox]): Added.
3339 (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Handle case where box is 0.
3340 (-[KWQPopUpButtonCell setHighlighted:]): Ditto.
3341 (-[KWQPopUpButton action:]): Ditto.
3342 (-[KWQPopUpButton widget]): Tweaked.
3343 (-[KWQPopUpButton mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
3344 (-[KWQPopUpButton becomeFirstResponder]): Handle case where widget is 0.
3345 (-[KWQPopUpButton resignFirstResponder]): Ditto.
3346 (-[KWQPopUpButton canBecomeKeyView]): Ditto.
3348 * kwq/KWQLineEdit.mm: (QLineEdit::~QLineEdit): Updated to use new detachQLineEdit name.
3350 * kwq/KWQListBox.mm:
3351 (-[KWQTableView mouseDown:]): Added. Calls QWidget::beforeMouseDown/afterMouseDown.
3353 * kwq/KWQScrollBar.h: Removed m_scroller field.
3354 * kwq/KWQScrollBar.mm:
3355 (-[KWQScrollBar initWithQScrollBar:]): Rearranged a little bit.
3356 (-[KWQScrollBar detachQScrollBar]): Added.
3357 (-[KWQScrollBar widget]): Added.
3358 (-[KWQScrollBar mouseDown:]): Added. Calls QWidget::beforeMouseDown and afterMouseDown.
3359 (QScrollBar::QScrollBar): Changed to no longer set m_scroller.
3360 (QScrollBar::~QScrollBar): Changed to call detachQScrollBar. No longer calls removeFromSuperview.
3361 (QScrollBar::setValue): Chagned to use getView instad of m_scrollBar.
3362 (QScrollBar::setKnobProportion): Ditto.
3363 (QScrollBar::scrollbarHit): Ditto.
3365 * kwq/KWQScrollView.mm:
3366 (QScrollView::addChild): Changed to call QWidget to add to superview to accomodate the
3367 hack where we don't remove right away when doing mouse tracking.
3368 (QScrollView::removeChild): Changed to call QWidget to remove from superview to accomodate
3369 the hack where we don't add right away when doing mouse tracking.
3371 * kwq/KWQSlider.h: Added destructor.
3373 (-[KWQSlider initWithQSlider:]): Tweaked a little.
3374 (-[KWQSlider detachQSlider]): Added.
3375 (-[KWQSlider mouseDown:]): Added call to QWidget::beforeMouseDown/afterMouseDown.
3376 (-[KWQSlider widget]): Added.
3377 (QSlider::~QSlider): Added. Calls detachQSlider.
3379 * kwq/KWQTextArea.h: Added detachQTextEdit method.
3380 * kwq/KWQTextArea.mm:
3381 (-[KWQTextArea detachQTextEdit]): Added.
3382 (-[KWQTextArea textDidChange:]): Added check for widget of 0.
3383 (-[KWQTextArea becomeFirstResponder]): Ditto.
3384 (-[KWQTextArea nextKeyView]): Ditto.
3385 (-[KWQTextArea previousKeyView]): Ditto.
3386 (-[KWQTextArea drawRect:]): Ditto.
3387 (-[KWQTextAreaTextView insertTab:]): Ditto.
3388 (-[KWQTextAreaTextView insertBacktab:]): Ditto.
3389 (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Ditto.
3390 (-[KWQTextAreaTextView selectedTextAttributes]): Ditto.
3391 (-[KWQTextAreaTextView mouseDown:]): Ditto.
3392 (-[KWQTextAreaTextView keyDown:]): Ditto.
3393 (-[KWQTextAreaTextView keyUp:]): Ditto.
3395 * kwq/KWQTextEdit.h: Added ~QTextEdit.
3396 * kwq/KWQTextEdit.mm: (QTextEdit::~QTextEdit): Added. Calls detachQTextEdit.
3398 * kwq/KWQTextField.h: Changed invalidate to detachQLineEdit.
3399 * kwq/KWQTextField.mm: (-[KWQTextFieldController detachQLineEdit]): Changed.
3401 * kwq/KWQWidget.h: Added addToSuperview/removeFromSuperview for use from QScrollView.
3402 Added beforeMouseDown and afterMouseDown for use in widget implementations.
3403 Removed unused hasMouseTracking function.
3405 (QWidget::QWidget): Initialize two new fields.
3406 (QWidget::~QWidget): Added code to remove view when widget is destroyed.
3407 (QWidget::getOuterView): Remove unneeded exception blocking since we're just caling superview.
3408 (QWidget::addToSuperview): Added.
3409 (QWidget::removeFromSuperview): Added.
3410 (QWidget::beforeMouseDown): Added.
3411 (QWidget::afterMouseDown): Added.
3413 * khtml/rendering/render_layer.cpp:
3414 (RenderLayer::setHasHorizontalScrollbar): Remove parent parameter; let addChild call addSubview:.
3415 (RenderLayer::setHasVerticalScrollbar): Ditto.
3417 2004-11-30 Ken Kocienda <kocienda@apple.com>
3423 <rdar://problem/3863031> REGRESSION (Mail): caret continues flashing while mouse is down
3425 * khtml/khtml_part.cpp:
3426 (KHTMLPart::timerEvent): Add a check for whether the mouse is down. Keep the caret drawn
3427 with no blink if it is.
3429 2004-11-30 Ken Kocienda <kocienda@apple.com>
3435 <rdar://problem/3861602> cursor gets lost trying to backspace to delete a form control
3437 * khtml/khtml_part.cpp:
3438 (KHTMLPart::setFocusNodeIfNeeded): This function would clear the selection if a <button>
3439 or <input type=image> was checked for focus since these elements are keyboard-focusable,
3440 but not mouse focusable. Also, this function did not work hard enough to set the focused
3441 node, and was content to clear it if the first element checked failed the test, rather
3442 than looking more at parents. This would have the effect of clearing, then resetting the
3443 focus on a DIV containing a button or image with content on either side of it in the
3444 process of arrowing over such content.
3446 2004-11-30 Ken Kocienda <kocienda@apple.com>
3450 * khtml/editing/htmlediting.cpp:
3451 (khtml::ReplaceSelectionCommand::doApply): Fix smart replace, which I (knowingly) broke with yesterday's checkin.
3452 Also, call updateLayout() in one more place to prevent stale information being returned from caretMaxOffset().
3453 * khtml/khtml_part.cpp:
3454 (KHTMLPart::isCharacterSmartReplaceExempt): Make this virtual and always return true. This gets rid of an
3455 ugly APPLE_CHANGES block and use of KWQ(part) in ReplaceSelectionCommand.
3456 * khtml/khtml_part.h: To help out with the isCharacterSmartReplaceExempt cleanup, add declaration.
3457 * kwq/KWQKHTMLPart.h: To help out with the isCharacterSmartReplaceExempt cleanup, make
3458 isCharacterSmartReplaceExempt virtual.
3460 2004-11-30 Ken Kocienda <kocienda@apple.com>
3464 * khtml/editing/htmlediting.cpp:
3465 (khtml::ReplacementFragment::mergeEndNode): Fixed one-line coding mistake that created an endless loop.
3466 Seemed simple enough to land without review.
3468 2004-11-29 Ken Kocienda <kocienda@apple.com>
3472 Rewrite of paste code (specifically the ReplaceSelectionCommand class). Many more cases
3473 are handled correctly now, including selections that span multiple blocks, and cases
3474 where content on the pasteboard ends in newlines (or what appear to be newlines to a
3475 user, really block ends or BRs). I also made one small, but important change in the
3476 copy code to annotate the markup written to the pasteboard to support these selections
3479 New header that defines a couple of constants used in copying and pasting.
3481 * ForwardingHeaders/editing/html_interchange.h: Added.
3482 * khtml/editing/html_interchange.h: Added.
3484 Rewrite of the ReplaceSelectionCommand. There are several new helper functions, as well
3485 as a new helper class, ReplacementFragment, which encapsulates information and functions
3486 pertaining to a document fragment that is being inserted into a document.
3488 * khtml/editing/htmlediting.cpp:
3489 (khtml::ReplacementFragment::ReplacementFragment):
3490 (khtml::ReplacementFragment::~ReplacementFragment):
3491 (khtml::ReplacementFragment::firstChild): Simple accessor.
3492 (khtml::ReplacementFragment::lastChild): Ditto.
3493 (khtml::ReplacementFragment::mergeStartNode): Looks at the nodes in a fragment and determines
3494 the starting node to use for merging into the block containing the start of the selection.
3495 (khtml::ReplacementFragment::mergeEndNode): Same as above, but for the end of the selection.
3496 (khtml::ReplacementFragment::pruneEmptyNodes): Simple helper.
3497 (khtml::ReplacementFragment::isInterchangeNewlineComment): Determines if a node is the
3498 special annotation comment added in by the copy code.
3499 (khtml::ReplacementFragment::removeNode): Simple helper.
3500 (khtml::isComment): Simple helper.
3501 (khtml::isProbablyBlock): Determines if a node is of a type that is usually rendered as a block.
3502 I would like to do better than this some day, but this check will hold us until I can do better.
3503 (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand):
3504 (khtml::ReplaceSelectionCommand::~ReplaceSelectionCommand):
3505 (khtml::ReplaceSelectionCommand::doApply):
3506 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Figures out the right ending selection.
3507 * khtml/editing/htmlediting.h: Declarations for the new ReplacementFragment class.
3508 (khtml::ReplacementFragment::root):
3509 (khtml::ReplacementFragment::type):
3510 (khtml::ReplacementFragment::isEmpty):
3511 (khtml::ReplacementFragment::isSingleTextNode):
3512 (khtml::ReplacementFragment::isTreeFragment):
3513 (khtml::ReplacementFragment::hasMoreThanOneBlock):
3514 (khtml::ReplacementFragment::hasLogicalNewlineAtEnd):
3516 This smaller set of changes markup generation to add the newline annotation described in the
3517 comment at the start of this entry.
3519 * khtml/xml/dom2_rangeimpl.cpp:
3520 (DOM::RangeImpl::addCommentToHTMLMarkup): Simple helper.
3521 (DOM::RangeImpl::toHTML): Added new EAnnotateForInterchange default argument to control whether
3522 comment annotations are added to the markup generated.
3523 * khtml/xml/dom2_rangeimpl.h: Add some new declarations.
3524 * kwq/WebCoreBridge.mm:
3525 (-[WebCoreBridge markupStringFromRange:nodes:]): Request that markup resulting from call to
3526 DOM::RangeImpl::toHTML uses annotations when generating.
3530 * layout-tests/editing/pasteboard/paste-text-001-expected.txt: Added.
3531 * layout-tests/editing/pasteboard/paste-text-001.html: Added.
3532 * layout-tests/editing/pasteboard/paste-text-002-expected.txt: Added.
3533 * layout-tests/editing/pasteboard/paste-text-002.html: Added.
3534 * layout-tests/editing/pasteboard/paste-text-003-expected.txt: Added.
3535 * layout-tests/editing/pasteboard/paste-text-003.html: Added.
3536 * layout-tests/editing/pasteboard/paste-text-004-expected.txt: Added.
3537 * layout-tests/editing/pasteboard/paste-text-004.html: Added.
3538 * layout-tests/editing/pasteboard/paste-text-005-expected.txt: Added.
3539 * layout-tests/editing/pasteboard/paste-text-005.html: Added.
3540 * layout-tests/editing/pasteboard/paste-text-006-expected.txt: Added.
3541 * layout-tests/editing/pasteboard/paste-text-006.html: Added.
3542 * layout-tests/editing/pasteboard/paste-text-007-expected.txt: Added.
3543 * layout-tests/editing/pasteboard/paste-text-007.html: Added.
3544 * layout-tests/editing/pasteboard/paste-text-008-expected.txt: Added.
3545 * layout-tests/editing/pasteboard/paste-text-008.html: Added.
3546 * layout-tests/editing/pasteboard/paste-text-009-expected.txt: Added.
3547 * layout-tests/editing/pasteboard/paste-text-009.html: Added.
3549 2004-11-29 Ken Kocienda <kocienda@apple.com>
3551 Reviewed by Harrison
3553 Made two small changes that make it possible for comments to have DOM nodes made for them
3554 when pasting. This relies on some earlier work I did some days ago.
3556 * khtml/xml/dom_nodeimpl.cpp:
3557 (NodeImpl::startMarkup): Get the string from the comment.
3558 * kwq/WebCoreBridge.mm:
3559 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
3560 rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
3561 be included in the DOM.
3563 2004-11-29 Ken Kocienda <kocienda@apple.com>
3565 Reviewed by Harrison
3567 Added some new helpers to the VisiblePosition class. I will begin to use these when I check in
3568 my improved paste code.
3570 * khtml/editing/visible_position.cpp:
3571 (khtml::blockRelationship)
3572 (khtml::visiblePositionsInDifferentBlocks)
3573 (khtml::isFirstVisiblePositionInBlock)
3574 (khtml::isFirstVisiblePositionInNode)
3575 (khtml::isLastVisiblePositionInBlock)
3576 * khtml/editing/visible_position.h
3578 2004-11-29 Ken Kocienda <kocienda@apple.com>
3580 Reviewed by Harrison
3582 * khtml/xml/dom_position.cpp:
3583 (DOM::Position::downstream): Fix a bug in downstream that prevented a call with DoNotStayInBlock
3584 specified from obeying that directive. The old code would stop at an outer block boundary in
3585 the case where that block had a block as its first child. The correct behavior is to drill into
3586 that inner block (and continue on drilling down, if possible), to find the correct position.
3588 2004-11-29 Ken Kocienda <kocienda@apple.com>
3590 Reviewed by Harrison
3592 Small improvements to the node-display debugging helpers.
3594 * khtml/xml/dom_nodeimpl.cpp:
3595 (NodeImpl::displayTree): Make the rootNode be this if there is no rootEditableElement.
3596 * khtml/xml/dom_nodeimpl.h: Make displayNode take a default argument of "" for its string.
3598 2004-11-29 Ken Kocienda <kocienda@apple.com>
3600 Reviewed by Harrison
3602 * khtml/editing/htmlediting.cpp:
3603 (khtml::DeleteSelectionCommand::handleGeneralDelete): The downstream position in this function
3604 may need to be adjusted when deleting text off the front part of a text node. This fixes a problem
3605 I discovered while improving the paste command, where the insertion poitn wound up in the wrong
3606 place after the delete.
3608 2004-11-29 Ken Kocienda <kocienda@apple.com>
3610 Reviewed by Harrison
3612 Add a new helper function to insert a paragraph separator. Will be used in my
3613 upcoming paste improvments.
3615 * khtml/editing/htmlediting.cpp: Added function
3616 (khtml::CompositeEditCommand::insertParagraphSeparator)
3617 * khtml/editing/htmlediting.h: Ditto.
3619 2004-11-23 David Harrison <harrison@apple.com>
3621 Added various comments.
3623 * khtml/editing/htmlediting.cpp:
3624 (khtml::StyleChange::init):
3625 (khtml::ApplyStyleCommand::doApply):
3626 (khtml::ApplyStyleCommand::applyBlockStyle):
3627 (khtml::ApplyStyleCommand::applyInlineStyle):
3629 2004-11-23 David Hyatt <hyatt@apple.com>
3631 Hit testing in table cells with top/bottom space from vertical alignment didn't work. I forgot about the
3632 super-secret yPos() lie that table cells do. Use m_y instead of yPos().
3634 * khtml/rendering/render_block.cpp:
3635 (khtml::RenderBlock::nodeAtPoint):
3637 2004-11-22 David Hyatt <hyatt@apple.com>
3639 Make sure you can use document.createElement to make a <canvas> element.
3641 * khtml/xml/dom_docimpl.cpp:
3642 (DocumentImpl::createHTMLElement):
3644 2004-11-22 Maciej Stachowiak <mjs@apple.com>
3648 <rdar://problem/3492044> performing JavaScript operations on form elements is slower than WinIE (HTMLFormCollection)
3649 <rdar://problem/3489679> selecting an item on the Apache bugzilla query page is very slow (HTMLFormCollection)
3650 <rdar://problem/3477810> checking 80 check boxes with JavaScript is 10x slower than in IE (HTMLFormCollection)
3651 <rdar://problem/3760962> JavaScript that toggles checkboxes is slow (HTMLCollection,HTMLFormCollection)
3653 * khtml/ecma/kjs_html.cpp:
3654 (KJS::HTMLDocument::tryGet):
3655 * khtml/html/html_formimpl.cpp:
3656 (DOM::HTMLFormElementImpl::HTMLFormElementImpl):
3657 (DOM::HTMLFormElementImpl::~HTMLFormElementImpl):
3658 * khtml/html/html_formimpl.h:
3659 * khtml/html/html_miscimpl.cpp:
3660 (HTMLCollectionImpl::HTMLCollectionImpl):
3661 (HTMLCollectionImpl::~HTMLCollectionImpl):
3662 (HTMLCollectionImpl::CollectionInfo::CollectionInfo):
3663 (HTMLCollectionImpl::CollectionInfo::reset):
3664 (HTMLCollectionImpl::resetCollectionInfo):
3665 (HTMLCollectionImpl::checkForNameMatch):
3667 (HTMLCollectionImpl::updateNameCache):
3668 (HTMLCollectionImpl::namedItems):
3669 (HTMLFormCollectionImpl::HTMLFormCollectionImpl):
3670 (HTMLFormCollectionImpl::~HTMLFormCollectionImpl):
3671 (HTMLFormCollectionImpl::item):
3672 (HTMLFormCollectionImpl::updateNameCache):
3673 * khtml/html/html_miscimpl.h:
3675 2004-11-22 David Hyatt <hyatt@apple.com>
3677 Improve the WebCore cache so that the maximum cacheable object size is scaled based off the total cache
3682 * khtml/misc/loader.cpp:
3683 (CachedObject::finish):
3686 * khtml/misc/loader.h:
3687 (khtml::Cache::maxCacheableObjectSize):
3689 2004-11-22 David Hyatt <hyatt@apple.com>
3691 Fix for 3673381, huge directory listing so slow it seems like a hang. Rework painting and hit testing so that
3692 it crawls the line box tree instead of the render tree. This allows more precise intersection/containment testing
3693 that lets us short circuit earlier when painting and hit testing.
3697 * khtml/khtml_part.cpp:
3698 (KHTMLPart::isPointInsideSelection):
3699 * khtml/rendering/render_block.cpp:
3700 (khtml::RenderBlock::paint):
3701 (khtml::RenderBlock::paintChildren):
3702 (khtml::RenderBlock::paintObject):
3703 (khtml::RenderBlock::paintFloats):
3704 (khtml::RenderBlock::nodeAtPoint):
3705 * khtml/rendering/render_block.h:
3706 * khtml/rendering/render_box.cpp:
3707 (RenderBox::nodeAtPoint):
3708 * khtml/rendering/render_box.h:
3709 * khtml/rendering/render_br.h:
3710 * khtml/rendering/render_canvas.cpp:
3711 (RenderCanvas::paint):
3712 * khtml/rendering/render_flow.cpp:
3713 (RenderFlow::paintLines):
3714 (RenderFlow::hitTestLines):
3715 (RenderFlow::caretRect):
3716 (RenderFlow::addFocusRingRects):
3717 (RenderFlow::paintFocusRing):
3718 (RenderFlow::paintOutlines):
3719 (RenderFlow::paintOutlineForLine):
3720 * khtml/rendering/render_flow.h:
3721 * khtml/rendering/render_frames.cpp:
3722 (RenderFrameSet::nodeAtPoint):
3723 * khtml/rendering/render_frames.h:
3724 * khtml/rendering/render_image.cpp:
3725 (RenderImage::nodeAtPoint):
3726 * khtml/rendering/render_image.h:
3727 * khtml/rendering/render_inline.cpp:
3728 (RenderInline::paint):
3729 (RenderInline::nodeAtPoint):
3730 * khtml/rendering/render_inline.h:
3731 * khtml/rendering/render_layer.cpp:
3732 (RenderLayer::paintLayer):
3733 (RenderLayer::hitTest):
3734 (RenderLayer::hitTestLayer):
3735 * khtml/rendering/render_layer.h:
3736 * khtml/rendering/render_line.cpp:
3737 (khtml::InlineBox::paint):
3738 (khtml::InlineBox::nodeAtPoint):
3739 (khtml::InlineFlowBox::flowObject):
3740 (khtml::InlineFlowBox::nodeAtPoint):
3741 (khtml::InlineFlowBox::paint):
3742 (khtml::InlineFlowBox::paintBackgrounds):
3743 (khtml::InlineFlowBox::paintBackground):
3744 (khtml::InlineFlowBox::paintBackgroundAndBorder):
3745 (khtml::InlineFlowBox::paintDecorations):
3746 (khtml::EllipsisBox::paint):
3747 (khtml::EllipsisBox::nodeAtPoint):
3748 (khtml::RootInlineBox::paintEllipsisBox):
3749 (khtml::RootInlineBox::paint):
3750 (khtml::RootInlineBox::nodeAtPoint):
3751 * khtml/rendering/render_line.h:
3752 (khtml::InlineRunBox::paintBackgroundAndBorder):
3753 * khtml/rendering/render_object.cpp:
3754 (RenderObject::hitTest):
3755 (RenderObject::setInnerNode):
3756 (RenderObject::nodeAtPoint):
3757 * khtml/rendering/render_object.h:
3758 (khtml::RenderObject::PaintInfo::PaintInfo):
3759 (khtml::RenderObject::PaintInfo::~PaintInfo):
3760 (khtml::RenderObject::paintingRootForChildren):
3761 (khtml::RenderObject::shouldPaintWithinRoot):
3762 * khtml/rendering/render_table.cpp:
3763 (RenderTable::layout):
3764 (RenderTable::paint):
3765 * khtml/rendering/render_text.cpp:
3766 (simpleDifferenceBetweenColors):
3767 (correctedTextColor):
3768 (InlineTextBox::nodeAtPoint):
3769 (InlineTextBox::paint):
3770 (InlineTextBox::selectionStartEnd):
3771 (InlineTextBox::paintSelection):
3772 (InlineTextBox::paintMarkedTextBackground):
3773 (InlineTextBox::paintDecoration):
3774 (RenderText::posOfChar):
3775 * khtml/rendering/render_text.h:
3776 (khtml::RenderText::paint):
3777 (khtml::RenderText::layout):
3778 (khtml::RenderText::nodeAtPoint):
3779 * khtml/xml/dom2_eventsimpl.cpp:
3780 (MouseEventImpl::computeLayerPos):
3781 * khtml/xml/dom_docimpl.cpp:
3782 (DocumentImpl::prepareMouseEvent):
3783 * kwq/KWQAccObject.mm:
3784 (-[KWQAccObject accessibilityHitTest:]):
3785 * kwq/KWQKHTMLPart.mm:
3786 (KWQKHTMLPart::scrollOverflowWithScrollWheelEvent):
3787 (KWQKHTMLPart::eventMayStartDrag):
3788 (KWQKHTMLPart::khtmlMouseMoveEvent):
3789 * kwq/WebCoreBridge.mm:
3790 (-[WebCoreBridge elementAtPoint:]):
3791 (-[WebCoreBridge _positionForPoint:]):
3793 2004-11-22 Maciej Stachowiak <mjs@apple.com>
3797 <rdar://problem/3890961> selecting an item on the Apache bugzilla query page can be sped up 10% (HTMLFormCollection)
3798 <rdar://problem/3890958> JavaScript that toggles checkboxes can be improved 73% (HTMLCollection,HTMLFormCollection)
3800 This avoids the O(N^2) penalty for named item traversal for form collections.
3802 It also combines the item traversal logic for all non-form
3803 collection operations into a single traverseNextItem
3804 function. This avoids having 5 copies of the big switch statement
3807 Also fixed a bug that prevented the last form element from being removed properly.
3809 * khtml/html/html_formimpl.cpp:
3810 (DOM::removeFromVector):
3811 * khtml/dom/html_misc.cpp:
3812 (HTMLCollection::namedItems):
3813 * khtml/dom/html_misc.h:
3814 * khtml/ecma/kjs_html.cpp:
3815 (KJS::HTMLCollection::getNamedItems):
3816 * khtml/html/html_miscimpl.cpp:
3817 (HTMLCollectionImpl::traverseNextItem):
3818 (HTMLCollectionImpl::calcLength):
3819 (HTMLCollectionImpl::length):
3820 (HTMLCollectionImpl::item):
3821 (HTMLCollectionImpl::nextItem):
3822 (HTMLCollectionImpl::checkForNameMatch):
3823 (HTMLCollectionImpl::namedItem):
3824 (HTMLCollectionImpl::namedItems):
3825 (HTMLCollectionImpl::nextNamedItem):
3826 (HTMLFormCollectionImpl::calcLength):
3827 (HTMLFormCollectionImpl::namedItem):
3828 (HTMLFormCollectionImpl::nextNamedItem):
3829 (HTMLFormCollectionImpl::namedItems):
3830 * khtml/html/html_miscimpl.h:
3832 2004-11-22 Ken Kocienda <kocienda@apple.com>
3834 Reviewed by Harrison
3836 Change around the way we block the Javascript "Paste" command identifier from
3837 being available. Formerly, this was done with an ifdef we never compiled in.
3838 Now, this is done with a couple of cheap runtime checks. The advantage is that
3839 we can now compile this command into development builds, and still yet switch
3840 on the command in deployment builds through the use of WebCore SPI so we can
3841 write and run layout tests with all of our builds.
3843 * khtml/editing/jsediting.cpp:
3844 (DOM::JSEditor::queryCommandSupported): Checks state of paste command in case
3845 command being queried is the paste command.
3846 (DOM::JSEditor::setSupportsPasteCommand): New SPI to turn on paste command.
3847 * khtml/editing/jsediting.h: Ditto.
3848 * khtml/khtml_part.cpp:
3849 (KHTMLPart::pasteFromPasteboard): Added.
3850 (KHTMLPart::canPaste): Added.
3851 * kwq/KWQKHTMLPart.mm:
3852 (KHTMLPart::canPaste): Added.
3853 * kwq/KWQRenderTreeDebug.cpp:
3854 (externalRepresentation): Turn on paste command.
3855 * kwq/WebCoreBridge.h: Add canPaste call so WebKit can fill in the answer.
3857 2004-11-21 Maciej Stachowiak <mjs@apple.com>
3859 Reviewed by Richard.
3861 <rdar://problem/3889655> HTMLCollectionImpl should use traverseNextNode to improve speed and save recursion
3863 * khtml/html/html_miscimpl.cpp:
3864 (HTMLCollectionImpl::calcLength):
3865 (HTMLCollectionImpl::getItem):
3866 (HTMLCollectionImpl::item):
3867 (HTMLCollectionImpl::nextItem):
3868 (HTMLCollectionImpl::getNamedItem):
3869 (HTMLCollectionImpl::namedItem):
3870 (HTMLCollectionImpl::nextNamedItemInternal):
3871 (HTMLFormCollectionImpl::nextNamedItemInternal):
3873 2004-11-19 Maciej Stachowiak <mjs@apple.com>