1 2005-01-17 David Harrison <harrison@apple.com>
3 Updated expected test results.
5 <rdar://problem/3945880> line-ending space seems not to be present
7 * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt:
8 * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt:
9 * layout-tests/editing/inserting/insert-div-020-expected.txt:
10 * layout-tests/editing/inserting/insert-div-021-expected.txt:
11 * layout-tests/editing/inserting/insert-div-022-expected.txt:
12 * layout-tests/editing/inserting/insert-div-023-expected.txt:
13 * layout-tests/editing/inserting/insert-div-024-expected.txt:
15 2005-01-17 David Harrison <harrison@apple.com>
17 Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp).
19 <rdar://problem/3945880> line-ending space seems not to be present
21 * khtml/editing/selection.cpp:
22 (khtml::Selection::validate):
23 Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end.
24 * khtml/rendering/bidi.cpp:
25 (khtml::RenderBlock::findNextLineBreak):
26 Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break).
28 2005-01-17 Darin Adler <darin@apple.com>
30 Reviewed by John Louch.
32 - fixed <rdar://problem/3958503> need screenX and screenY to use WebKit windowFrame delegate
34 * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead
35 of using mapToGlobal and screen in a complicated way.
36 * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function.
37 * kwq/KWQWindowWidget.h: Ditto.
38 * kwq/KWQWindowWidget.mm: Ditto.
40 2005-01-17 David Hyatt <hyatt@apple.com>
42 Fix a screwup in rightmost/lowets position computation. 3955207. Make sure floats with layers are still checked.
46 * khtml/rendering/render_block.cpp
48 2005-01-17 Ken Kocienda <kocienda@apple.com>
52 <rdar://problem/3953366> Problems with typing attributes in HTML compose
54 * khtml/editing/htmlediting.cpp:
55 (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization"
56 that tried to sense when typing style could be cleared without actually doing a style diff between
57 before-delete and after-delete positions. Removing this extra check and running the
58 general-purpose code fixes the bug.
60 2005-01-17 Richard Williamson <rjw@apple.com>
62 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
64 Keep track of originating execution context and target execution
65 context for native JS object wrappers, and perform appropriate
68 Reviewed by David Harrison.
70 * khtml/ecma/kjs_binding.cpp:
71 (ScriptInterpreter::isGlobalObject):
72 (ScriptInterpreter::isSafeScript):
73 (ScriptInterpreter::interpreterForGlobalObject):
74 * khtml/ecma/kjs_binding.h:
75 * khtml/ecma/kjs_window.cpp:
76 (Window::interpreter):
77 (Window::isSafeScript):
78 * khtml/ecma/kjs_window.h:
80 (-[WebScriptObject _initializeScriptDOMNodeImp]):
81 * kwq/KWQKHTMLPart.mm:
82 (KWQKHTMLPart::windowScriptObject):
83 (KWQKHTMLPart::windowScriptNPObject):
84 * kwq/WebCoreBridge.mm:
86 (-[WebCoreBridge init]):
88 2005-01-17 Ken Kocienda <kocienda@apple.com>
94 <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with
95 "size up" and "size down" NSFontManager changes
97 * khtml/css/cssparser.cpp:
98 (CSSParser::parseValue): Add support for parsing new font size delta property.
99 * khtml/css/cssproperties.c: Generated file.
100 * khtml/css/cssproperties.h: Ditto.
101 * khtml/css/cssproperties.in: Add support for parsing new font size delta property.
102 * khtml/editing/htmlediting.cpp:
103 (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use.
104 (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating
105 and running command to do the removal.
106 (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work.
107 (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle
108 relative font size changes.
109 (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is
110 before or equal to the end. Swap them if not true. I ran into this problem in some similar code in
111 applyRelativeFontStyleChange(). Moving that goodness here too.
112 (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often.
113 Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded.
114 I use the bool return value now (I obviously did not need it before).
115 (khtml::ApplyStyleCommand::computedFontSize): New helper function.
116 (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto.
117 (khtml::createStyleSpanElement): Ditto.
118 * khtml/editing/htmlediting.h: Update header accordingly.
119 * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes.
121 (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience.
122 (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto.
123 * kwq/DOMPrivate.h: Declare new conveniences.
124 * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting.
125 * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added.
126 * layout-tests/editing/style/relative-font-size-change-001.html: Added.
127 * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added.
128 * layout-tests/editing/style/relative-font-size-change-002.html: Added.
129 * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added.
130 * layout-tests/editing/style/relative-font-size-change-003.html: Added.
131 * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added.
132 * layout-tests/editing/style/relative-font-size-change-004.html: Added.
134 2005-01-14 Darin Adler <darin@apple.com>
136 * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1.
137 * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1.
138 * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1.
139 * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1.
141 2005-01-14 Chris Blumenberg <cblu@apple.com>
143 Fixed: <rdar://problem/3886415> arrow keys don't work when the user hits Back to return to RSS page
147 (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode
148 (KWQKHTMLPart::mousePressNode): new
149 * kwq/KWQPageState.h:
150 * kwq/KWQPageState.mm:
151 (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode
152 (-[KWQPageState clear]): clear the mousePressNode
153 (-[KWQPageState dealloc]): deref the mousePressNode
154 (-[KWQPageState mousePressNode]): new
158 2005-01-13 Vicki Murley <vicki@apple.com>
162 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
164 * WebCore.pbproj/project.pbxproj: bump "2004" to "2005"
166 2005-01-13 David Harrison <harrison@apple.com>
168 Reviewed by Ken Kocienda.
170 Better fix for 3905066.
172 * khtml/editing/htmlediting.cpp:
173 (khtml::InsertParagraphSeparatorCommand::doApply):
175 2005-01-10 Maciej Stachowiak <mjs@apple.com>
179 <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input)
181 * khtml/rendering/render_text.cpp:
182 (InlineTextBox::paint): Support painting custom underline markers for
183 marked text in place of generic yellow.
184 (InlineTextBox::paintMarkedTextUnderline): New method that handles this.
185 * khtml/rendering/render_text.h:
186 * kwq/KWQKHTMLPart.h: Declare new methods and structs.
187 * kwq/KWQKHTMLPart.mm:
188 (KWQKHTMLPart::clear): Clear marked test underlines.
189 (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now.
190 (convertAttributesToUnderlines): Converts NSAttributedString attributes
191 to simplified and C++-friendly form.
192 (KWQKHTMLPart::markedTextUsesUnderlines): New method.
193 (KWQKHTMLPart::markedTextUnderlines): New method.
195 (QPainter::drawLineForText): Handle pen width.
196 * kwq/WebCoreBridge.h:
197 * kwq/WebCoreBridge.mm:
198 (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes
200 * kwq/WebCoreTextRenderer.h:
202 2005-01-12 David Harrison <harrison@apple.com>
204 Reviewed by Dave Hyatt.
206 <rdar://problem/3888973> AX: Parent AXWebArea of nested AXWebAreas is messed up
208 * kwq/KWQAccObject.mm:
209 (-[KWQAccObject addChildrenToArray:]):
210 Use the widget's outer view.
212 2005-01-12 David Harrison <harrison@apple.com>
214 Reviewed by Darin Adler.
216 <rdar://problem/3949908> Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute
218 * khtml/xml/dom_nodeimpl.cpp:
219 (NodeImpl::displayNode):
220 Add quotes around text node content.
221 (NodeBaseImpl::childNode):
222 Add nil check to return nil rather than crash when child node not found.
223 * kwq/KWQAccObject.mm:
224 (-[KWQAccObject doAXStringForTextMarkerRange:]):
225 Pass range compliant positions to TextIterator.
227 2005-01-12 David Hyatt <hyatt@apple.com>
229 Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during
230 line layout is smarter about including the overflow for both old states and new states.
234 * khtml/rendering/bidi.cpp:
235 (khtml::RenderBlock::layoutInlineChildren):
237 2005-01-12 David Hyatt <hyatt@apple.com>
239 Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move
240 tables/overflows that dont fit within a block only in strict mode.
242 Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific
243 case in editing is hit.
245 Reviewed by darin (first one), kocienda (second one)
247 * khtml/rendering/render_block.cpp:
248 (khtml::RenderBlock::getClearDelta):
249 * khtml/rendering/render_flow.cpp:
250 (RenderFlow::dirtyLinesFromChangedChild):
251 * khtml/rendering/render_line.cpp:
252 (khtml::InlineFlowBox::verticallyAlignBoxes):
254 2005-01-12 Ken Kocienda <kocienda@apple.com>
260 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
262 * khtml/editing/htmlediting.cpp:
263 (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block
264 merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions
265 added to visible_position files.
266 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes
267 tests to determine when to stop moving nodes more complete and correct. Also improved comments.
268 * khtml/editing/visible_position.cpp:
269 (khtml::isFirstVisiblePositionInParagraph): New function.
270 (khtml::isLastVisiblePositionInParagraph): New function.
271 * khtml/editing/visible_position.h: Update header accordingly.
272 * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former
273 results but still correct.
274 * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto.
275 * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added.
276 * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added.
277 * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added.
278 * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added.
279 * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added.
280 * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added.
281 * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added.
282 * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added.
283 * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug.
285 2005-01-11 Richard Williamson <rjw@apple.com>
287 Fixed 3922875. Fall back to DOM object is EMBED element
288 has no associated runtime object.
292 * khtml/ecma/kjs_dom.cpp:
293 (KJS::getRuntimeObject):
294 * khtml/ecma/kjs_html.cpp:
295 (KJS::HTMLDocument::tryGet):
296 (KJS::HTMLElement::tryGet):
297 (KJS::HTMLCollection::tryGet):
298 (KJS::HTMLCollection::getNamedItems):
300 2005-01-11 David Hyatt <hyatt@apple.com>
302 Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match
307 * khtml/html/htmltokenizer.cpp:
308 (khtml::HTMLTokenizer::parseTag):
310 2005-01-11 Chris Blumenberg <cblu@apple.com>
312 Fixed: <rdar://problem/3930733> Mail prints second page of email blank
316 * khtml/rendering/render_canvas.cpp:
317 (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing
318 * khtml/rendering/render_flow.cpp:
319 (RenderFlow::paintLines): removed null check since the print rect should never be null
320 * khtml/rendering/render_list.cpp:
321 (RenderListMarker::paint): ditto
322 * kwq/KWQKHTMLPart.mm:
323 (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page
325 2005-01-10 Ken Kocienda <kocienda@apple.com>
331 <rdar://problem/3943648> extra line is inserted after pressing return within quoted text of reply
333 * khtml/editing/htmlediting.cpp:
334 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a
335 simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the
336 result calculated in that deeper scope was not available when tested.
338 2005-01-10 Ken Kocienda <kocienda@apple.com>
344 <rdar://problem/3946852> Option-e goes to next line
346 * khtml/editing/htmlediting.cpp:
347 (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content
348 into the start line is done. We plan to change pretty substantially soon to better handle
349 the problem described in <rdar://problem/3937352> Quote level not maintained when copied
350 and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug.
352 2005-01-10 Ken Kocienda <kocienda@apple.com>
358 <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines
360 * khtml/editing/htmlediting.cpp:
361 (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
362 to their own blocks if needed so that a block style can be applied.
363 (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
364 (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
365 (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
366 This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
368 (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
369 Should remove attributue instead.
370 * khtml/editing/htmlediting.h: Touch function declarations accordingly.
371 * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
372 * layout-tests/editing/style/create-block-for-style-001.html: Added.
373 * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
374 * layout-tests/editing/style/create-block-for-style-002.html: Added.
375 * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
376 * layout-tests/editing/style/create-block-for-style-003.html: Added.
377 * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
378 * layout-tests/editing/style/create-block-for-style-004.html: Added.
379 * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
380 * layout-tests/editing/style/create-block-for-style-005.html: Added.
381 * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
382 * layout-tests/editing/style/create-block-for-style-006.html: Added.
383 * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
384 * layout-tests/editing/style/create-block-for-style-007.html: Added.
385 * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
386 * layout-tests/editing/style/create-block-for-style-008.html: Added.
387 * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
388 * layout-tests/editing/style/create-block-for-style-009.html: Added.
389 * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
390 * layout-tests/editing/style/create-block-for-style-010.html: Added.
391 * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
392 * layout-tests/editing/style/create-block-for-style-011.html: Added.
393 * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
394 * layout-tests/editing/style/create-block-for-style-012.html: Added.
395 * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
396 * layout-tests/editing/style/create-block-for-style-013.html: Added.
398 Unrelated updates to these expected results.
399 * layout-tests/editing/inserting/insert-div-007-expected.txt
400 * layout-tests/editing/pasteboard/paste-text-013-expected.txt
402 2005-01-10 Chris Blumenberg <cblu@apple.com>
404 Fixed: <rdar://problem/3936844> Mail: Messages with rich text do not print
408 * khtml/rendering/render_flow.cpp:
409 (RenderFlow::paintLines): don't do pagination work if printRect is not set
410 * khtml/rendering/render_list.cpp:
411 (RenderListMarker::paint): ditto
413 2005-01-10 David Harrison <harrison@apple.com>
417 * kwq/KWQTextUtilities.mm:
418 (currentTextBreakLocaleID):
419 Return empty string (AKA root locale) if locale pref can not be canonicalized.
421 2005-01-10 John Sullivan <sullivan@apple.com>
423 Fixed broken Panther build.
425 * kwq/KWQTextUtilities.mm:
426 (currentTextBreakLocaleID):
427 This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities.
428 That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString.
429 To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger
430 function. However, the Tiger-only code was wrong; the string generated using
431 CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that
434 2005-01-09 David Harrison <harrison@apple.com>
436 Reviewed by Ken Kocienda.
438 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
440 * khtml/editing/htmlediting.cpp:
441 (khtml::ReplaceSelectionCommand::doApply):
442 Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
444 2005-01-09 Darin Adler <darin@apple.com>
446 Reviewed by Harrison.
448 - fixed <rdar://problem/3939176> select() method does not work on <input type=search>
450 * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement
451 to a switch statement. Added SEARCH to the set of types that treat the renderer as a
454 2005-01-09 David Harrison <harrison@apple.com>
456 Reviewed by Ken Kocienda.
458 <rdar://problem/3905066> REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes)
460 Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing
461 whitespace to a single non-breaking space when splitting a text node.
463 * khtml/editing/htmlediting.cpp:
464 (khtml::InsertParagraphSeparatorCommand::doApply):
466 2005-01-08 Kevin Decker <kdecker@apple.com>
470 Fixed: <rdar://problem/3924219> Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program
472 * khtml/html/html_elementimpl.cpp:
473 (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents.
475 2005-01-07 Maciej Stachowiak <mjs@apple.com>
479 <rdar://problem/3807144> REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com)
481 * Khtml/khtml_part.cpp:
482 (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has
483 not started loading yet so it could not possibly be finishing here...
484 (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still
485 no document, in this case we must have hit an error or been loading a non-HTML
487 * khtml/khtml_part.h:
489 2005-01-08 David Harrison <harrison@apple.com>
493 <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
495 * khtml/editing/selection.cpp:
496 (khtml::Selection::validate):
497 Tune word selections left/right choice to use right if on empty last line.
499 2005-01-07 David Harrison <harrison@apple.com>
503 <rdar://problem/3942619> AX: Support sentence ax attributes
505 Needed to use the unicode utilities properly. Twas lame before.
507 * khtml/editing/visible_units.cpp:
508 (khtml::previousBoundary):
509 (khtml::nextBoundary):
510 (khtml::startOfWord):
512 (khtml::previousWordPosition):
513 (khtml::nextWordPosition):
514 (khtml::startOfSentence):
515 (khtml::endOfSentence):
516 (khtml::previousSentencePosition):
517 (khtml::nextSentencePosition):
518 * kwq/KWQAccObject.mm:
519 (-[KWQAccObject accessibilityAttributeNames]):
520 (-[KWQAccObject accessibilityAttributeValue:]):
521 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
522 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
523 * kwq/KWQTextUtilities.mm:
524 (currentTextBreakLocaleID):
525 (KWQFindSentenceBoundary):
526 (KWQFindNextSentenceFromIndex):
528 2005-01-07 Ken Kocienda <kocienda@apple.com>
534 <rdar://problem/3939523> in some cases, text does not retain style info after pressing return twice
535 <rdar://problem/3944492> after pressing return twice, text is bold when it shouldn't be
537 * khtml/editing/htmlediting.cpp:
538 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion):
539 Merge the typing style with the computed style for the current position. Fixes both bugs.
540 * khtml/editing/htmlediting.h:
541 * layout-tests/editing/inserting/insert-div-023-expected.txt: Added.
542 * layout-tests/editing/inserting/insert-div-023.html: Added.
543 * layout-tests/editing/inserting/insert-div-024-expected.txt: Added.
544 * layout-tests/editing/inserting/insert-div-024.html: Added.
546 2005-01-07 David Hyatt <hyatt@apple.com>
548 Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling
549 behavior on worldofwarcraft.com.
553 * khtml/rendering/render_table.cpp:
554 (RenderTable::layout):
556 2005-01-06 David Hyatt <hyatt@apple.com>
558 Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to
559 ignore inline flows in this case.
563 * khtml/rendering/render_block.cpp:
564 (khtml::RenderBlock::nodeAtPoint):
566 2005-01-07 Ken Kocienda <kocienda@apple.com>
572 <rdar://problem/3848412> for forwarded message, tabbing to message view scrolls to bottom of view
574 * kwq/KWQKHTMLPart.mm:
575 (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not
576 in the document, or if it is not a descendent of the document element. In the case of the bug,
577 since the selection has not yet been set up, the focus node passed here is the HTML element, and
578 that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing.
580 2005-01-06 Kevin Decker <kdecker@apple.com>
584 Fixed: <rdar://problem/3932215> REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari
586 * khtml/khtml_part.cpp:
587 (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.
591 2005-01-06 David Harrison <harrison@apple.com>
595 (addendum to previous checkin for this bug)
596 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
598 Fix line navigation. Add AXUIElementForTextMarker.
600 * kwq/KWQAccObject.mm:
601 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
602 (-[KWQAccObject doAXUIElementForTextMarker:]):
603 (-[KWQAccObject doAXLineForTextMarker:]):
604 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
605 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
606 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
607 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
608 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
610 2005-01-06 Darin Adler <darin@apple.com>
614 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
616 (turns out the PLT regression was a false alarm)
618 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
619 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
621 * khtml/html/htmlparser.cpp:
622 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
623 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
624 to eliminate code that used ID_CLOSE_TAG for an array size.
625 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
626 that manages isindex to use deref instead of delete.
627 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
628 mistake of using ID_CLOSE_TAG for the array size too.
629 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
630 there and it would prevent custom tags from working. Added range check before using the forbidden
631 tag array with the token ID since custom tags will use index values past the end of the array.
632 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
633 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
634 createElement call is still here. Last time I left out a few form element types from this switch;
636 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
637 document if getTagID fails; this creates a unique per-document ID.
639 * khtml/misc/htmltags.c: Regenerated.
640 * khtml/misc/htmltags.h: Regenerated.
642 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
643 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
644 Also rewrote getTagName to work with the new scheme.
646 2005-01-06 David Harrison <harrison@apple.com>
648 Fixed Panther build. Also, do not advertize sentence support since it is incomplete.
650 * kwq/KWQAccObject.mm:
651 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
652 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
653 (-[KWQAccObject accessibilityIsAttributeSettable:]):
655 2005-01-06 David Harrison <harrison@apple.com>
657 Reviewed by Dave Hyatt.
659 <rdar://problem/3776056> AX: Editable HTML should not be viewed as AXStaticText
660 <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work
662 Many more AX attributes supported. Numerous fixes to previous AX work.
664 * khtml/editing/visible_units.cpp:
665 (khtml::startSentenceBoundary):
666 (khtml::startOfSentence):
667 (khtml::endSentenceBoundary):
668 (khtml::endOfSentence):
669 (khtml::previousSentencePositionBoundary):
670 (khtml::previousSentencePosition):
671 (khtml::nextSentencePositionBoundary):
672 (khtml::nextSentencePosition):
673 * khtml/editing/visible_units.h:
674 * khtml/khtmlview.cpp:
676 * khtml/misc/helper.cpp:
677 (khtml::findSentenceBoundary):
678 (khtml::nextSentenceFromIndex):
679 * khtml/misc/helper.h:
680 * khtml/misc/htmltags.c:
683 * khtml/rendering/render_container.cpp:
684 (RenderContainer::removeChildNode):
685 (RenderContainer::appendChildNode):
686 (RenderContainer::insertChildNode):
687 * khtml/rendering/render_object.cpp:
688 (RenderObject::remove):
689 * khtml/xml/dom_docimpl.cpp:
690 (DocumentImpl::getAccObjectCache):
691 (DocumentImpl::updateSelection):
692 (DocumentImpl::close):
693 (DocumentImpl::setFocusNode):
694 (DocumentImpl::parentDocument):
695 (DocumentImpl::topDocument):
696 * khtml/xml/dom_docimpl.h:
697 * kwq/KWQAccObject.mm:
698 (-[KWQAccObject accessibilityShouldUseUniqueId]):
699 (-[KWQAccObject detach]):
700 (-[KWQAccObject anchorElement]):
701 (-[KWQAccObject firstChild]):
702 (-[KWQAccObject lastChild]):
703 (-[KWQAccObject previousSibling]):
704 (-[KWQAccObject nextSibling]):
705 (-[KWQAccObject parentObject]):
706 (-[KWQAccObject value]):
707 (-[KWQAccObject accessibilityAttributeNames]):
708 (-[KWQAccObject accessibilityPerformAction:]):
709 (-[KWQAccObject textMarkerForVisiblePosition:]):
710 (-[KWQAccObject visiblePositionForTextMarker:]):
711 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
712 (-[KWQAccObject topDocument]):
713 (-[KWQAccObject topRenderer]):
714 (-[KWQAccObject topView]):
715 (-[KWQAccObject accessibilityAttributeValue:]):
716 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
717 (-[KWQAccObject doAXLineForTextMarker:]):
718 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
719 (-[KWQAccObject doAXStringForTextMarkerRange:]):
720 (-[KWQAccObject doAXTextMarkerForPosition:]):
721 (-[KWQAccObject doAXBoundsForTextMarkerRange:]):
722 (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
723 (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
724 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
725 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
726 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
727 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
728 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
729 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
730 (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]):
731 (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]):
732 (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]):
733 (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]):
734 (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
735 (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
736 (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]):
737 (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
738 (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]):
739 (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]):
740 (-[KWQAccObject doAXLengthForTextMarkerRange:]):
741 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
742 (-[KWQAccObject accessibilityHitTest:]):
743 (-[KWQAccObject accessibilityFocusedUIElement]):
744 (-[KWQAccObject accessibilityIsAttributeSettable:]):
745 (-[KWQAccObject doSetAXSelectedTextMarkerRange:]):
746 (-[KWQAccObject setAccObjectID:]):
747 (-[KWQAccObject removeAccObjectID]):
748 * kwq/KWQAccObjectCache.h:
749 * kwq/KWQAccObjectCache.mm:
750 (KWQAccObjectCache::setAccObject):
751 (KWQAccObjectCache::removeAccObject):
752 (KWQAccObjectCache::visiblePositionForTextMarker):
753 (KWQAccObjectCache::postNotificationToTopWebArea):
754 (KWQAccObjectCache::postNotification):
755 (KWQAccObjectCache::handleFocusedUIElementChanged):
756 * kwq/KWQKHTMLPart.mm:
757 (KWQKHTMLPart::respondToChangedContents):
758 * kwq/KWQTextUtilities.h:
759 * kwq/KWQTextUtilities.mm:
760 (KWQFindNextWordFromIndex):
761 (KWQFindSentenceBoundary):
762 (KWQFindNextSentenceFromIndex):
763 * kwq/WebCoreBridge.mm:
764 (-[WebCoreBridge accessibilityTree]):
766 2005-01-05 Darin Adler <darin@apple.com>
770 - re-landing a subset of my custom tag change that does not fix the bug, but also does
771 not introduce a performance regression
773 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
774 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
776 * khtml/editing/htmlediting.cpp:
777 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
778 per-document tags and is just better all around for things like the document.
779 (khtml::debugNode): Ditto.
780 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
781 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
782 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
783 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
785 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
786 non-HTML elements to be nested as desired.
788 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
789 * khtml/misc/htmlhashes.cpp:
790 (khtml::getTagID): Changed return type to unsigned short.
791 (khtml::getAttrID): Ditto.
793 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
794 * khtml/xml/dom_docimpl.cpp:
795 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
796 Also updated for a few tags that the parser handled but this did not.
798 * kwq/KWQRenderTreeDebug.cpp:
799 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
800 the tag ID directly, which only works for standard nodes.
801 (operator<<): Update to call getTagName.
802 (nodePositionRelativeToRoot): Ditto.
803 (writeSelection): Ditto.
805 2005-01-05 Ken Kocienda <kocienda@apple.com>
811 <rdar://problem/3941203> REGRESSION (Mail): Paste inserts content in wrong place
813 * khtml/editing/htmlediting.cpp:
814 (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make
815 this operation work correctly, particularly in the logic to figure out whether to merge content, and
816 also performing merges.
817 * khtml/editing/visible_position.cpp:
818 (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination.
819 * khtml/editing/visible_units.cpp:
820 (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply().
821 (khtml::isEndOfParagraph): Ditto.
822 * khtml/editing/visible_units.h: Declare new functions.
824 2005-01-04 Ken Kocienda <kocienda@apple.com>
830 <rdar://problem/3926522> Pressing return in a quoted block inserts too many newlines
832 * khtml/editing/htmlediting.cpp:
833 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded()
834 for the block we are adding was being done at the wrong time, which led to the placeholder remaining
835 in the document when it was not needed. This resulted in the extra space reported in the bug.
837 2005-01-04 Kevin Decker <kdecker@apple.com>
841 Fixed: <rdar://problem/3936879> nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com
843 * khtml/rendering/render_block.cpp:
844 (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.
846 2005-01-04 David Hyatt <hyatt@apple.com>
848 Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed.
852 * khtml/rendering/render_layer.cpp:
853 (RenderLayer::updateScrollInfoAfterLayout):
855 2005-01-04 Ken Kocienda <kocienda@apple.com>
859 Fix for these two bugs:
861 <rdar://problem/3938935> REGRESSION (Mail): Pasting into an empty document mangles content
862 <rdar://problem/3939148> REGRESSION (Mail): Pasting mistakenly reverses lines
864 * khtml/editing/htmlediting.cpp:
865 (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge
866 neither start nor end. For 3939148, improve the code which adjusts the insertion point during
867 the process of pasting. It formerly handled only one of the possible cases.
868 * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added.
869 * layout-tests/editing/pasteboard/paste-text-015.html: Added.
871 2005-01-04 David Hyatt <hyatt@apple.com>
873 Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard.
877 * khtml/rendering/render_form.cpp:
878 (RenderLineEdit::updateFromElement):
879 * kwq/KWQLineEdit.mm:
880 (QLineEdit::setPlaceholderString):
882 2005-01-04 David Hyatt <hyatt@apple.com>
884 Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when
885 returning pseudo-styles.
889 * khtml/css/cssstyleselector.cpp:
890 (khtml::CSSStyleSelector::matchRulesForList):
891 (khtml::CSSStyleSelector::pseudoStyleForElement):
892 * khtml/rendering/render_style.cpp:
893 (RenderStyle::addPseudoStyle):
895 2005-01-04 Darin Adler <darin@apple.com>
897 - rolled out my custom tag name change again -- it caused a 1 ms PLT regression
899 * khtml/css/cssstyleselector.cpp:
900 * khtml/editing/htmlediting.cpp:
901 * khtml/editing/selection.cpp:
902 * khtml/editing/visible_position.cpp:
903 * khtml/html/dtd.cpp:
904 * khtml/html/htmlparser.cpp:
905 * khtml/html/htmlparser.h:
906 * khtml/html/htmltokenizer.cpp:
907 * khtml/misc/htmlhashes.cpp:
908 * khtml/misc/htmlhashes.h:
909 * khtml/misc/htmltags.c:
910 * khtml/misc/htmltags.h:
911 * khtml/misc/maketags:
912 * khtml/xml/dom_docimpl.cpp:
913 * khtml/xml/dom_docimpl.h:
914 * khtml/xml/dom_nodeimpl.cpp:
915 * khtml/xml/dom_position.cpp:
916 * kwq/KWQRenderTreeDebug.cpp:
918 2005-01-04 Ken Kocienda <kocienda@apple.com>
924 <rdar://problem/3927554> Style info applied to remainder of document after a newline is entered
926 * khtml/editing/htmlediting.cpp:
927 (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts
928 a paragraph separator. The bug was all about applying styles to the new paragraph that did not need
929 to be applied. Now the code will detect when at the end of a style run and will not move and apply
930 that ending style to the new paragraph, though it will place that style into the typing style. This
931 seems to match NSText behavior.
932 * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed
933 here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did
934 not have any visible effect on the document.
935 * layout-tests/editing/inserting/insert-div-022-expected.txt: Added.
936 * layout-tests/editing/inserting/insert-div-022.html: Added.
938 2005-01-04 David Hyatt <hyatt@apple.com>
940 Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn
945 * khtml/rendering/render_flow.cpp:
946 (RenderFlow::paintLines):
948 2005-01-03 David Hyatt <hyatt@apple.com>
950 Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more
951 robust and make it work regardless of which objects get a layout or not.
955 * khtml/rendering/render_block.cpp:
956 (khtml::RenderBlock::insertFloatingObject):
957 (khtml::RenderBlock::addOverhangingFloats):
958 (khtml::RenderBlock::addIntrudingFloats):
959 * khtml/rendering/render_block.h:
960 (khtml::RenderBlock::FloatingObject::FloatingObject):
962 2005-01-03 Maciej Stachowiak <mjs@apple.com>
966 <rdar://problem/3935390> Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode
968 * khtml/html/html_miscimpl.cpp:
969 (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil,
970 it should not ever be (now).
971 (HTMLCollectionImpl::item): When traversing items stop when we hit
972 nil, meaning the end to avoid triggering above assert (formerly crash).
974 2005-01-03 Maciej Stachowiak <mjs@apple.com>
976 Reviewed by John and Kevin.
978 <rdar://problem/3870317> REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to
980 * khtml/ecma/kjs_window.cpp:
981 (Window::get): Look up frame names before buitin window properties
982 to match other browsers. This regressed because we added a builtin
983 "toolbar" property but this site had a frame with that name.
985 2004-12-21 Maciej Stachowiak <mjs@apple.com>
989 <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another
991 Added opener bridge method to help WebKit implement security check
992 for named frame visibility.
994 * khtml/khtml_part.h:
995 * kwq/WebCoreBridge.h:
996 * kwq/WebCoreBridge.mm:
997 (-[WebCoreBridge opener]):
999 2005-01-03 Ken Kocienda <kocienda@apple.com>
1005 <rdar://problem/3933926> Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible]
1007 * kwq/WebCoreBridge.mm:
1008 (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug.
1010 2005-01-03 David Hyatt <hyatt@apple.com>
1012 Fix for 3936881, make sure positioned objects prooperly update y-position.
1016 * khtml/rendering/render_block.cpp:
1017 (khtml::RenderBlock::layoutPositionedObjects):
1019 2005-01-03 Ken Kocienda <kocienda@apple.com>
1021 Reviewed by Harrison
1025 <rdar://problem/3928250> REGRESSION (Mail): Typing style lost after hitting return key
1027 * khtml/editing/htmlediting.cpp:
1028 (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command.
1029 (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable.
1030 (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable.
1031 (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command.
1032 (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style
1033 (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the <p>
1034 insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style
1035 of the new <p> and only sets those styles needed to preserve the style in effect before the insertion.
1036 (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions.
1037 (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs.
1038 * khtml/editing/htmlediting.h: Declare new functions.
1040 2004-12-25 Kevin Decker <kdecker@apple.com>
1044 Fixed: <rdar://problem/3505072> hang in KHTMLParser::parseToken (consulting.soroos.net)
1046 * 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.
1048 2004-12-23 Darin Adler <darin@apple.com>
1052 - re-fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
1054 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
1055 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
1057 * khtml/editing/htmlediting.cpp:
1058 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
1059 per-document tags and is just better all around for things like the document.
1060 (khtml::debugNode): Ditto.
1061 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
1062 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
1063 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
1064 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
1066 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
1067 non-HTML elements to be nested as desired.
1069 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
1070 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
1072 * khtml/html/htmlparser.cpp:
1073 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
1074 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
1075 to eliminate code that used ID_CLOSE_TAG for an array size.
1076 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
1077 that manages isindex to use deref instead of delete.
1078 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
1079 mistake of using ID_CLOSE_TAG for the array size too.
1080 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
1081 there and it would prevent custom tags from working. Added range check before using the forbidden
1082 tag array with the token ID since custom tags will use index values past the end of the array.
1083 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
1084 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
1085 createElement call is still here. Last time I left out a few form element types from this switch;
1087 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
1088 document if getTagID fails; this creates a unique per-document ID.
1090 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
1091 * khtml/misc/htmlhashes.cpp:
1092 (khtml::getTagID): Changed return type to unsigned short.
1093 (khtml::getAttrID): Ditto.
1095 * khtml/misc/htmltags.c: Regenerated.
1096 * khtml/misc/htmltags.h: Regenerated.
1098 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
1099 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
1100 Also rewrote getTagName to work with the new scheme.
1102 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
1103 * khtml/xml/dom_docimpl.cpp:
1104 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
1105 Also updated for a few tags that the parser handled but this did not.
1107 * kwq/KWQRenderTreeDebug.cpp:
1108 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
1109 the tag ID directly, which only works for standard nodes.
1110 (operator<<): Update to call getTagName.
1111 (nodePositionRelativeToRoot): Ditto.
1112 (writeSelection): Ditto.
1116 2004-12-22 Darin Adler <darin@apple.com>
1118 - rolled out my custom tag name change -- it broke amazon.com
1120 * khtml/css/cssstyleselector.cpp:
1121 * khtml/editing/htmlediting.cpp:
1122 * khtml/editing/selection.cpp:
1123 * khtml/editing/visible_position.cpp:
1124 * khtml/html/dtd.cpp:
1125 * khtml/html/htmlparser.cpp:
1126 * khtml/html/htmlparser.h:
1127 * khtml/html/htmltokenizer.cpp:
1128 * khtml/misc/htmlhashes.cpp:
1129 * khtml/misc/htmlhashes.h:
1130 * khtml/misc/htmltags.c:
1131 * khtml/misc/htmltags.h:
1132 * khtml/misc/maketags:
1133 * khtml/xml/dom_docimpl.cpp:
1134 * khtml/xml/dom_docimpl.h:
1135 * khtml/xml/dom_nodeimpl.cpp:
1136 * khtml/xml/dom_position.cpp:
1137 * kwq/KWQRenderTreeDebug.cpp:
1139 2004-12-22 David Harrison <harrison@apple.com>
1141 Reviewed by Darin Adler.
1143 * khtml/editing/selection.cpp:
1144 (khtml::Selection::validate):
1145 The selecting/deselecting bad behavior is because the Selection code that expands by words
1146 had an inaccurate test for being at the end of the document (where double-clicking needs
1147 to select the last word). Fixed that check.
1149 2004-12-22 Adele Amchan <adele@apple.com>
1153 Fix for <rdar://problem/3911650> tabs at safeway.com stop working after a while
1155 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): removed call to cancelRedirection
1156 so that we match Firefox and WinIE behavior.
1158 2004-12-22 Darin Adler <darin@apple.com>
1162 - fixed <rdar://problem/3760910> Request to include support for custom tag names in HTML (they already work in XML)
1164 * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed
1165 some code that used ID_LAST_TAG in a slightly wrong, but harmless, way.
1167 * khtml/editing/htmlediting.cpp:
1168 (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for
1169 per-document tags and is just better all around for things like the document.
1170 (khtml::debugNode): Ditto.
1171 * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto.
1172 * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto.
1173 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto.
1174 * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto.
1176 * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows
1177 non-HTML elements to be nested as desired.
1179 * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on
1180 the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a
1182 * khtml/html/htmlparser.cpp:
1183 (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more
1184 sense to just have the array be a member so we don't have to use new and delete on it. Also needed
1185 to eliminate code that used ID_CLOSE_TAG for an array size.
1186 (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code
1187 that manages isindex to use deref instead of delete.
1188 (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the
1189 mistake of using ID_CLOSE_TAG for the array size too.
1190 (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever
1191 there and it would prevent custom tags from working. Added range check before using the forbidden
1192 tag array with the token ID since custom tags will use index values past the end of the array.
1193 (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done
1194 inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic
1195 createElement call is still here.
1196 * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the
1197 document if getTagID fails; this creates a unique per-document ID.
1199 * khtml/misc/htmlhashes.h: Changed return types to unsigned short.
1200 * khtml/misc/htmlhashes.cpp:
1201 (khtml::getTagID): Changed return type to unsigned short.
1202 (khtml::getAttrID): Ditto.
1204 * khtml/misc/htmltags.c: Regenerated.
1205 * khtml/misc/htmltags.h: Regenerated.
1207 * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define".
1208 Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags.
1209 Also rewrote getTagName to work with the new scheme.
1211 * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden.
1212 * khtml/xml/dom_docimpl.cpp:
1213 (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID.
1214 Also updated for a few tags that the parser handled but this did not.
1216 * kwq/KWQRenderTreeDebug.cpp:
1217 (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on
1218 the tag ID directly, which only works for standard nodes.
1219 (operator<<): Update to call getTagName.
1220 (nodePositionRelativeToRoot): Ditto.
1221 (writeSelection): Ditto.
1223 2004-12-21 David Harrison <harrison@apple.com>
1225 Reviewed by Ken Kocienda.
1227 <rdar://problem/3924934> REGRESSION: double click at end of line selects start of next line
1229 Problem was the TextIterator was not handling exitNode() from a P block properly.
1231 * khtml/editing/visible_text.cpp:
1232 (khtml::TextIterator::TextIterator):
1233 Add new param that specifies whether the iterator is for content or for searching.
1234 Search iterators do not prevent newlines at the beginning.
1235 (khtml::TextIterator::advance):
1236 Added some comments.
1237 (khtml::TextIterator::handleTextNode):
1238 Added some comments.
1239 (khtml::TextIterator::exitNode):
1240 Emit newline for P (and other) blocks with position following the block, instead of the m_lastTextNode.
1241 (khtml::TextIterator::emitCharacter):
1242 Added some comments.
1243 (khtml::TextIterator::range):
1244 Added some comments.
1245 (khtml::CharacterIterator::CharacterIterator):
1246 Specify search type TextIterator.
1247 (khtml::CharacterIterator::advance):
1248 * khtml/editing/visible_text.h:
1250 Add new TextIterator::TextIterator param that specifies whether the iterator is for content or for searching.
1251 * khtml/editing/visible_units.cpp:
1252 (khtml::nextWordBoundary):
1253 Specify search type TextIterator.
1255 2004-12-21 David Harrison <harrison@apple.com>
1257 Reviewed by Ken Kocienda.
1259 <rdar://problem/3924695> REGRESSION (Mail): double-clicking past end of line shows no selection, should select to EOL
1261 Problem was that RenderText::setSelectionState did not handle the SelectionStart case where start and end are the end of the line.
1262 Fixed by pretending the start == end-1 in that situation, as long as end > 0.
1264 * khtml/rendering/render_text.cpp:
1265 (RenderText::setSelectionState)
1267 2004-12-21 Maciej Stachowiak <mjs@apple.com>
1271 <rdar://problem/3929187> WebKit needs to restrict access to certain window operations by domain
1273 * khtml/ecma/kjs_window.cpp:
1274 (Window::get): Change most window functions to be restricted by
1277 2004-12-21 Ken Kocienda <kocienda@apple.com>
1283 <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
1285 * khtml/editing/htmlediting.cpp:
1286 (khtml::DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent): New function to detect case
1287 formerly undetected and unhandled. This is the crux of the bug fix.
1288 (khtml::DeleteSelectionCommand::doApply): Call insertPlaceholderForAncestorBlockContent() during
1289 execution of command.
1290 * khtml/editing/htmlediting.h: Declare new function.
1291 * layout-tests/editing/deleting/delete-3928305-fix-expected.txt: Added.
1292 * layout-tests/editing/deleting/delete-3928305-fix.html: Added.
1294 2004-12-21 Ken Kocienda <kocienda@apple.com>
1298 * khtml/editing/htmlediting.cpp:
1299 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Note to self: Must compile code before
1300 checking in (aka must return false from function returning bool).
1302 2004-12-21 Ken Kocienda <kocienda@apple.com>
1308 <rdar://problem/3927752> Crash in khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded(DOM::NodeImpl*)
1310 * khtml/editing/htmlediting.cpp:
1311 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Added some null checks.
1312 (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Ditto.
1314 2004-12-21 Ken Kocienda <kocienda@apple.com>
1318 * khtml/editing/htmlediting.cpp:
1319 (khtml::ReplacementFragment::mergeStartNode): Refine concept of how this node is found based on
1320 further experiements.
1321 (khtml::ReplaceSelectionCommand::doApply): Add a special case for determining merges that need to
1322 be done if the insertion point is in an empty block.
1323 * layout-tests/editing/pasteboard/paste-text-012-expected.txt: Added.
1324 * layout-tests/editing/pasteboard/paste-text-012.html: Added.
1325 * layout-tests/editing/pasteboard/paste-text-013-expected.txt: Added.
1326 * layout-tests/editing/pasteboard/paste-text-013.html: Added.
1327 * layout-tests/editing/pasteboard/paste-text-014-expected.txt: Added.
1328 * layout-tests/editing/pasteboard/paste-text-014.html: Added.
1330 2004-12-21 Darin Adler <darin@apple.com>
1334 - fixed <rdar://problem/3899133> text search in a Safari window takes a very long time on Tiger updates page (and some other pages)
1336 * khtml/editing/visible_text.h: Add an "offset base node" parameter to emitCharacter, and also
1337 add a field to track it. Must make a few things mutable so we can update them in the range accessor.
1338 * khtml/editing/visible_text.cpp:
1339 (khtml::TextIterator::advance): Pass in base node and offsets rather than computing actual offsets
1340 using the node's index. We only compute the node index if actually asked for the range.
1341 (khtml::TextIterator::handleTextNode): Pass 0 for base node and set base node to 0 when setting
1343 (khtml::TextIterator::handleTextBox): Ditto.
1344 (khtml::TextIterator::handleReplacedElement): Pass base node and set base node instead of calling
1346 (khtml::TextIterator::handleNonTextNode): Pass 0 for offset.
1347 (khtml::TextIterator::exitNode): More of the same.
1348 (khtml::TextIterator::emitCharacter): Ditto.
1349 (khtml::TextIterator::range): If an offset base node is stored, then get its node index, and then
1350 add that in to the offsets. Doing the work here guarantees it's done only once when doing a text search.
1354 * khtml/khtml_part.cpp: Removed SPEED_DEBUG define. Not sure why it was on.
1358 2004-12-20 Ken Kocienda <kocienda@apple.com>
1362 * khtml/editing/htmlediting.cpp:
1363 (khtml::DeleteSelectionCommand::moveNodesAfterNode): My one-liner for this bug introduced layout test
1364 regressions: <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1365 Rolling out until I can develop a real fix.
1367 2004-12-20 David Harrison <harrison@apple.com>
1369 Reviewed by Dave Hyatt.
1371 Initial checkin of AXTextMarkerRef support.
1373 * khtml/xml/dom_docimpl.cpp:
1374 (DocumentImpl::updateSelection):
1375 (DocumentImpl::setFocusNode):
1376 * kwq/KWQAccObject.h:
1377 * kwq/KWQAccObject.mm:
1378 (-[KWQAccObject detach]):
1379 (-[KWQAccObject anchorElement]):
1380 (-[KWQAccObject addChildrenToArray:]):
1381 (-[KWQAccObject accessibilityAttributeNames]):
1382 (-[KWQAccObject accessibilityActionDescription:]):
1383 (-[KWQAccObject accessibilityPerformAction:]):
1384 (-[KWQAccObject textMarkerRangeFromMarkers:andEndMarker:]):
1385 (-[KWQAccObject textMarkerForVisiblePosition:]):
1386 (-[KWQAccObject visiblePositionForTextMarker:]):
1387 (-[KWQAccObject AXTextMarkerRangeCopyStartMarkerWrapper:]):
1388 (-[KWQAccObject AXTextMarkerRangeCopyEndMarkerWrapper:]):
1389 (-[KWQAccObject visiblePositionForStartOfTextMarkerRange:]):
1390 (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]):
1391 (-[KWQAccObject accessibilityAttributeValue:]):
1392 (-[KWQAccObject accessibilityParameterizedAttributeNames]):
1393 (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]):
1394 (-[KWQAccObject getSelectedTextMarkerRange]):
1395 (-[KWQAccObject doAXLineForTextMarker:]):
1396 (-[KWQAccObject doAXTextMarkerRangeForLine:]):
1397 (-[KWQAccObject doAXStringForTextMarkerRange:]):
1398 (-[KWQAccObject doAXNextTextMarkerForTextMarker:]):
1399 (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]):
1400 (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]):
1401 (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]):
1402 (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
1403 (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
1404 (-[KWQAccObject accessibilityAttributeValue:forParameter:]):
1405 (-[KWQAccObject accessibilityFocusedUIElement]):
1406 (-[KWQAccObject clearChildren]):
1407 (-[KWQAccObject accObjectID]):
1408 (-[KWQAccObject setAccObjectID:]):
1409 (-[KWQAccObject removeAccObjectID]):
1410 * kwq/KWQAccObjectCache.h:
1411 * kwq/KWQAccObjectCache.mm:
1412 (KWQAccObjectCache::KWQAccObjectCache):
1413 (KWQAccObjectCache::~KWQAccObjectCache):
1414 (KWQAccObjectCache::getAccObjectID):
1415 (KWQAccObjectCache::removeAccObjectID):
1416 (KWQAccObjectCache::textMarkerForVisiblePosition):
1417 (KWQAccObjectCache::visiblePositionForTextMarker):
1419 2004-12-19 Darin Adler <darin@apple.com>
1421 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added nil check.
1423 2004-12-19 Darin Adler <darin@apple.com>
1427 - a garbage collection fix
1429 * kwq/KWQFoundationExtras.h: (KWQCFAutorelease): Added a more-extensive comment and fixed the BUILDING_ON_PANTHER
1430 #ifndef to use #if (in practice, either is OK).
1431 * kwq/KWQKURL.mm: (KURL::getNSURL): Use KWQCFAutorelease instead of autorelease.
1433 2004-12-17 David Hyatt <hyatt@apple.com>
1435 Fix for 3923255, specified percentage heights of divs with overflow auto inside tables not honored.
1437 Reviewed by kocienda
1439 * khtml/rendering/render_box.cpp:
1440 (RenderBox::calcPercentageHeight):
1441 * khtml/rendering/render_table.cpp:
1442 (RenderTableSection::layoutRows):
1444 2004-12-17 David Harrison <harrison@apple.com>
1446 Reviewed by Ken Kocienda.
1448 <rdar://problem/3924930> REGRESSION: triple click does not select to end of line
1450 * khtml/editing/visible_units.cpp:
1451 (khtml::endOfParagraph):
1452 When includeLineBreak is true, allow traversal to next node after enclosingBlockFlowElement.
1454 2004-12-17 Ken Kocienda <kocienda@apple.com>
1458 * khtml/editing/htmlediting.cpp:
1459 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Missed deleting some now-obsolete expcetion
1460 codes when I added the createBreakElement() function.
1462 2004-12-17 Richard Williamson <rjw@apple.com>
1464 Set the floor of max cacheable object size to 40K. This restores
1465 the long standing floor. Lower floor deleteriously impacts the PLT.
1468 * khtml/khtml_part.cpp:
1469 (KHTMLPart::checkCompleted):
1470 * khtml/misc/loader.cpp:
1473 2004-12-17 Ken Kocienda <kocienda@apple.com>
1479 <rdar://problem/3926142> REGRESSION (Mail): Deleting text decreases quote level
1481 * khtml/editing/htmlediting.cpp:
1482 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Stop merging nodes when a <br> is hit.
1483 Formerly checked only for block boundary.
1485 2004-12-17 David Harrison <harrison@apple.com>
1489 Add KWQCFAutorelease for autoreleasing CF objects.
1490 * kwq/KWQFoundationExtras.h:
1494 2004-12-17 David Harrison <harrison@apple.com>
1498 Fix GC compatibility in getNSString.
1501 (QString::getNSString):
1502 Use NSString allocator instead of CFString, so that autorelease works under GC.
1504 2004-12-17 Ken Kocienda <kocienda@apple.com>
1510 <rdar://problem/3890973> REGRESSION (Mail): Deleting reorders remaining text
1512 * khtml/editing/htmlediting.cpp:
1513 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Added check to ensure that moving content will not
1514 move it after the <body> element.
1516 2004-12-17 Ken Kocienda <kocienda@apple.com>
1520 Added new layout tests covering cases from recent bug fixes.
1522 * layout-tests/editing/inserting/insert-div-018-expected.txt: Added.
1523 * layout-tests/editing/inserting/insert-div-018.html: Added.
1524 * layout-tests/editing/inserting/insert-div-019-expected.txt: Added.
1525 * layout-tests/editing/inserting/insert-div-019.html: Added.
1526 * layout-tests/editing/inserting/insert-div-020-expected.txt: Added.
1527 * layout-tests/editing/inserting/insert-div-020.html: Added.
1528 * layout-tests/editing/inserting/insert-div-021-expected.txt: Added.
1529 * layout-tests/editing/inserting/insert-div-021.html: Added.
1531 2004-12-17 Ken Kocienda <kocienda@apple.com>
1535 Changes in layout resulting from giving <p> elements no margin rather than 0.1em margin.
1537 * layout-tests/editing/inserting/insert-div-013-expected.txt
1538 * layout-tests/editing/inserting/insert-div-014-expected.txt
1540 2004-12-17 Ken Kocienda <kocienda@apple.com>
1546 <rdar://problem/3925317> Increase quote in email and with cursor below the quote the new line appears above the quote
1548 * khtml/editing/htmlediting.cpp:
1549 (khtml::InsertParagraphSeparatorCommand::doApply):
1550 * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting
1551 block as the reference node for the insertion of the new block.
1552 (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true.
1553 I worked this all out on the whiteboard this time. This should be the last tweak.
1555 2004-12-17 Kevin Decker <kdecker@apple.com>
1559 Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
1561 * khtml/xml/xml_tokenizer.cpp:
1562 (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
1564 2004-12-16 Ken Kocienda <kocienda@apple.com>
1570 <rdar://problem/3924888> REGRESSION (Mail): Hitting return key at end of line does not insert visible newline
1572 * khtml/editing/htmlediting.cpp:
1573 (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that
1574 it checks the downstream node for the starting position.
1576 2004-12-16 Ken Kocienda <kocienda@apple.com>
1580 Added new createBreakElement() function that makes creating a <br> element a one-liner.
1581 Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode,
1582 over to this new helper.
1584 * khtml/editing/htmlediting.cpp:
1585 (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function.
1586 (khtml::InsertLineBreakCommand::doApply): Ditto.
1587 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
1588 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
1589 (khtml::ReplaceSelectionCommand::doApply): Ditto.
1590 (khtml::createBreakElement): New helper.
1591 * khtml/editing/htmlediting.h: Ditto.
1593 2004-12-16 David Hyatt <hyatt@apple.com>
1595 Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was
1596 vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page.
1598 Reviewed by kocienda
1600 * khtml/rendering/render_object.cpp:
1601 (RenderObject::getVerticalPosition):
1603 2004-12-16 Ken Kocienda <kocienda@apple.com>
1609 <rdar://problem/3924486> REGRESSION (Mail): Hitting return key does not insert visible newline
1610 <rdar://problem/3924579> REGRESSION (Mail): After deleting, hitting return key does not insert visible newline
1612 * khtml/editing/htmlediting.cpp:
1613 (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a <p> will
1614 make a visible <br> collapse. For the second bug, move the code that inserts the new <p> after
1615 a check which may move the node used as the reference node for the insertion. Also change this code to
1616 insert the <p> after the last sibling of the starting position, to move it past the nodes we're going
1617 to want to shift into the new <p>.
1619 2004-12-16 Darin Adler <darin@apple.com>
1623 - use <p> elements rather than <br> when pasting plain text; also use margin of 0 rather than 0.1 em
1624 after talking this over with Dave and Ken
1626 * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement.
1627 * khtml/editing/htmlediting.cpp:
1628 (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement
1629 helper so this can share code with the plain-text conversion code.
1630 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement
1631 helper so this can share code with the plain-text conversion code.
1632 (khtml::createDefaultParagraphElement): Added.
1633 (khtml::createBlockPlaceholderElement): Added.
1635 * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
1636 <br> elements for pasting plain text.
1638 - regenerated these files with the newer gperf
1640 * khtml/css/cssproperties.c: Regenerated.
1641 * khtml/css/cssvalues.c: Regenerated.
1642 * khtml/misc/htmlattrs.c: Regenerated.
1643 * khtml/misc/htmltags.c: Regenerated.
1645 2004-12-16 Ken Kocienda <kocienda@apple.com>
1651 <rdar://problem/3924291> REGRESSION (Mail): Crash deleting content following a <p> element
1653 * khtml/xml/dom_nodeimpl.cpp:
1654 (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for
1655 parent that is not an inline would skip past previous siblings of nodes which were blocks. Now
1656 it stops looking in this situation. This problem eventually caused the delete code to try to
1657 merge a node under a descendent.
1659 2004-12-16 Adele Amchan <adele@apple.com>
1661 Change by Richard, reviewed by me.
1663 Fix for: <rdar://problem/3923983> background image decoding prevents page with 0Kb image from finishing to load
1665 * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading.
1667 2004-12-16 Adele Amchan <adele@apple.com>
1671 Fix for: <rdar://problem/3534824> VIP: some navigation links on safeway.com don't work due to a JavaScript quirk
1673 Added a call to ObjectImp::get before Window::get just returns Undefined.
1674 This was preventing us from getting the toString function from a Window object.
1676 * khtml/ecma/kjs_window.cpp: (Window::get):
1678 2004-12-16 Ken Kocienda <kocienda@apple.com>
1684 <rdar://problem/3918351> REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place
1686 * khtml/editing/htmlediting.cpp:
1687 (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function
1688 to do a better job than it was doing before. Added several test cases to prove I am on a
1690 * khtml/editing/visible_position.cpp:
1691 (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the
1692 leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup: <p>foo</p>bar).
1693 This function was returning true for the first position in "bar". Wrong. Also tightened up other
1694 rule: Should not report true when relationship between blocks cannot be determined.
1695 (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true
1696 when relationship between blocks cannot be determined.
1697 * layout-tests/editing/inserting/insert-div-010-expected.txt: Added.
1698 * layout-tests/editing/inserting/insert-div-010.html: Added.
1699 * layout-tests/editing/inserting/insert-div-011-expected.txt: Added.
1700 * layout-tests/editing/inserting/insert-div-011.html: Added.
1701 * layout-tests/editing/inserting/insert-div-012-expected.txt: Added.
1702 * layout-tests/editing/inserting/insert-div-012.html: Added.
1703 * layout-tests/editing/inserting/insert-div-013-expected.txt: Added.
1704 * layout-tests/editing/inserting/insert-div-013.html: Added.
1705 * layout-tests/editing/inserting/insert-div-014-expected.txt: Added.
1706 * layout-tests/editing/inserting/insert-div-014.html: Added.
1707 * layout-tests/editing/inserting/insert-div-015-expected.txt: Added.
1708 * layout-tests/editing/inserting/insert-div-015.html: Added.
1709 * layout-tests/editing/inserting/insert-div-016-expected.txt: Added.
1710 * layout-tests/editing/inserting/insert-div-016.html: Added.
1711 * layout-tests/editing/inserting/insert-div-017-expected.txt: Added.
1712 * layout-tests/editing/inserting/insert-div-017.html: Added.
1714 2004-12-16 Ken Kocienda <kocienda@apple.com>
1718 Added a layout test based on my last checkin.
1720 * layout-tests/editing/selection/move-by-word-001-expected.txt: Added.
1721 * layout-tests/editing/selection/move-by-word-001.html: Added.
1723 2004-12-16 Ken Kocienda <kocienda@apple.com>
1729 <rdar://problem/3917929> REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps
1731 * khtml/editing/visible_text.cpp:
1732 (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating
1733 backwards into a different block that is an descendent of the block containing the text node (as in leaving
1734 the "bar" node in this example: <p>foo</p>bar).
1735 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper.
1736 (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since
1737 it is called from there, and now also from advance().
1739 2004-12-15 Darin Adler <darin@apple.com>
1743 - fixed problem where plain-text would put a blank line between each <p> even when they have no margins
1745 * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the
1746 "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node
1747 type altogether and use the render tree instead.
1749 2004-12-14 John Sullivan <sullivan@apple.com>
1753 - rest of WebCore fix for <rdar://problem/3790011> undoable operations all say "Undo"
1754 in the menu, no specific action names
1756 * khtml/editing/edit_actions.h: new header, contains EditAction enum
1757 (renamed from HTMLEditAction, formerly in htmlediting.h)
1759 * ForwardingHeaders/editing/edit_actions.h: new forwarding header
1761 * khtml/editing/htmlediting.h:
1762 removed HTMLEditAction enum in favor of including edit_actions.h; added khtml::
1763 namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand
1765 * khtml/editing/htmlediting.cpp:
1766 (khtml::EditCommandPtr::editingAction):
1767 update for enum name change
1768 (khtml::EditCommand::editingAction):
1770 (khtml::ApplyStyleCommand::ApplyStyleCommand):
1771 added editingAction parameter to this constructor
1772 (khtml::ApplyStyleCommand::editingAction):
1774 (khtml::DeleteSelectionCommand::editingAction):
1775 update for enum name change
1776 (khtml::MoveSelectionCommand::editingAction):
1778 (khtml::TypingCommand::editingAction):
1780 (khtml::ReplaceSelectionCommand::editingAction):
1783 * khtml/khtml_part.h:
1784 added EditAction parameter to applyStyle and computeAndSetTypingStyle
1785 * khtml/khtml_part.cpp:
1786 (KHTMLPart::computeAndSetTypingStyle):
1787 added EditAction parameter
1788 (KHTMLPart::applyStyle):
1791 * kwq/KWQKHTMLPart.mm:
1792 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1793 do the cast from EditAction to WebUndoAction a different way to match other code
1795 * kwq/WebCoreBridge.h:
1796 * kwq/WebCoreBridge.mm:
1797 (-[WebCoreBridge setTypingStyle:withUndoAction:]):
1798 added WebUndoAction parameter, passed into ApplyStyleCommand constructor
1799 (-[WebCoreBridge applyStyle:withUndoAction:]):
1802 * WebCore.pbproj/project.pbxproj:
1803 updated for new files
1805 2004-12-14 David Hyatt <hyatt@apple.com>
1807 Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove
1808 the ridiculous 1024 limit on the span values.
1810 * khtml/html/html_tableimpl.cpp:
1811 (HTMLTableCellElementImpl::parseHTMLAttribute):
1812 * khtml/rendering/render_table.cpp:
1813 (RenderTableCell::collapsedBottomBorder):
1814 * khtml/rendering/render_table.h:
1815 (khtml::RenderTableCell::colSpan):
1816 (khtml::RenderTableCell::setColSpan):
1817 (khtml::RenderTableCell::rowSpan):
1818 (khtml::RenderTableCell::setRowSpan):
1819 (khtml::RenderTableCol::span):
1820 (khtml::RenderTableCol::setSpan):
1822 2004-12-14 David Hyatt <hyatt@apple.com>
1824 Make sure <col> and <colgroup> can have spans updated dynamically as well.
1828 * khtml/html/html_tableimpl.cpp:
1829 (HTMLTableColElementImpl::parseHTMLAttribute):
1830 * khtml/rendering/render_table.cpp:
1831 (RenderTableCell::updateFromElement):
1832 (RenderTableCol::updateFromElement):
1834 2004-12-14 David Hyatt <hyatt@apple.com>
1836 Fix for 3833123, setting a cell's colspan does not update rendering like it should.
1840 * khtml/html/html_tableimpl.cpp:
1841 (HTMLTableCellElementImpl::parseHTMLAttribute):
1842 * khtml/rendering/render_table.cpp:
1843 (RenderTableCell::RenderTableCell):
1844 (RenderTableCell::updateFromElement):
1846 2004-12-14 Chris Blumenberg <cblu@apple.com>
1848 Fixed: <rdar://problem/3864536> crash copying text from other apps and pasting in a sticky in dashboard
1852 * khtml/editing/markup.cpp:
1853 (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it
1855 2004-12-14 David Hyatt <hyatt@apple.com>
1857 Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position.
1858 This is actually a regression from my positioned object DHTML optimization.
1860 Reviewed by kocienda
1862 * khtml/rendering/render_object.cpp:
1863 (RenderObject::setStyle):
1865 2004-12-14 David Hyatt <hyatt@apple.com>
1867 Make sure the class attribute works when newlines are present in the attribute.
1869 Reviewed by kocienda
1871 * khtml/html/html_elementimpl.cpp:
1872 (HTMLNamedAttrMapImpl::parseClassAttribute):
1874 2004-12-14 David Hyatt <hyatt@apple.com>
1876 Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was
1877 actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to
1878 read by splitting it into two separate functions.
1880 Reviewed by kocienda
1882 * khtml/rendering/render_block.cpp:
1883 (khtml::RenderBlock::layoutBlockChildren):
1884 (khtml::RenderBlock::clearFloats):
1885 (khtml::RenderBlock::addOverhangingFloats):
1886 (khtml::RenderBlock::addIntrudingFloats):
1887 * khtml/rendering/render_block.h:
1889 2004-12-14 John Sullivan <sullivan@apple.com>
1893 - added Undo action names for Cut, Paste, and Drag
1895 * khtml/editing/htmlediting.h:
1896 * khtml/editing/htmlediting.cpp:
1897 (khtml::DeleteSelectionCommand::editingAction):
1898 overridden to return HTMLEditActionCut
1899 (khtml::MoveSelectionCommand::editingAction):
1900 overridden to return HTMLEditActionDrag
1901 (khtml::ReplaceSelectionCommand::editingAction):
1902 overridden to return HTMLEditActionPaste
1904 2004-12-14 John Sullivan <sullivan@apple.com>
1908 - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu,
1909 no specific action names
1911 The remaining step is to make each EditCommand subclass override editingAction() to return an
1912 appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action
1913 is not completely straightforward, so this next step isn't trivial.)
1915 * khtml/editing/htmlediting.h:
1916 new enum for HTMLEditAction
1918 * khtml/editing/htmlediting.cpp:
1919 (khtml::EditCommandPtr::editingAction):
1920 new method, calls through to EditCommand
1921 (khtml::EditCommand::editingAction):
1922 new method for subclasses to override, returns HTMLEditActionUnspecified at this level
1923 (khtml::TypingCommand::editingAction):
1924 proof of concept override, returns HTMLEditActionTyping
1926 * kwq/KWQKHTMLPart.h:
1927 declare new private bottleneck method registerCommandForUndoOrRedo
1928 * kwq/KWQKHTMLPart.mm:
1929 (KWQKHTMLPart::registerCommandForUndoOrRedo):
1930 new bottleneck method to reduce code duplication; now calls over the bridge
1931 to get the localized string to use for the Undo action name
1932 (KWQKHTMLPart::registerCommandForUndo):
1933 now calls new bottleneck method
1934 (KWQKHTMLPart::registerCommandForRedo):
1935 now calls new bottleneck method
1937 * kwq/WebCoreBridge.h:
1938 new enum for WebUndoAction, maps directly to HTMLEditAction.
1939 Declaration of nameForUndoAction:
1941 2004-12-14 Darin Adler <darin@apple.com>
1945 - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident)
1947 * khtml/rendering/render_frames.cpp:
1948 (RenderPart::~RenderPart): Check widget for nil.
1949 (RenderPart::setWidget): Ditto.
1950 (RenderFrame::slotViewCleared): Ditto.
1951 (RenderPartObject::slotViewCleared): Ditto.
1953 2004-12-13 Darin Adler <darin@apple.com>
1957 - moved markup-related functions into new sources files in the editing directory
1958 - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster
1960 * ForwardingHeaders/editing/markup.h: Added.
1961 * khtml/editing/markup.h: Added.
1962 * khtml/editing/markup.cpp: Added.
1964 * WebCore.pbproj/project.pbxproj: Added markup.h/cpp.
1966 * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more.
1967 * khtml/html/html_elementimpl.cpp:
1968 (HTMLElementImpl::innerHTML): Changed to call createMarkup.
1969 (HTMLElementImpl::outerHTML): Ditto.
1971 * khtml/ecma/kjs_window.cpp:
1972 (Window::retrieveWindow): Comment out assert that uses dynamic_cast.
1973 (Window::retrieveActive): Ditto.
1975 * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere.
1976 * khtml/xml/dom_docimpl.h: Ditto.
1978 * khtml/khtml_part.cpp:
1979 (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML.
1980 (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast.
1982 * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code
1983 still works even with the additional replace overloads added to QString.
1984 * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto.
1986 * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object
1987 base pointer, because it used dynamic_cast in its implementation. Made the other version public.
1988 * khtml/rendering/render_object.cpp: Ditto.
1989 * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete.
1991 * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations.
1992 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all
1993 the support code into markup.cpp.
1995 * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp.
1996 * khtml/xml/dom_nodeimpl.cpp: Ditto.
1998 * khtml/xml/dom_position.cpp:
1999 (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks
2000 so these return null positions rather than raising exceptions.
2001 (DOM::endPosition): Ditto.
2003 * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast.
2004 * kwq/KWQFrame.h: Ditto.
2005 * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto.
2006 * kwq/KWQKPartsPart.h: Ditto.
2007 * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto.
2008 * kwq/KWQScrollView.h: Ditto.
2009 * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto.
2010 * kwq/KWQKHTMLPart.h: Ditto.
2011 * kwq/KWQKHTMLPart.mm:
2012 (KHTMLView::isKHTMLView): Ditto.
2013 (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional
2014 replace overloads added to QString.
2015 (KWQKHTMLPart::setStatusBarText): Ditto.
2016 (KWQKHTMLPart::runJavaScriptAlert): Ditto.
2017 (KWQKHTMLPart::runJavaScriptConfirm): Ditto.
2018 (KWQKHTMLPart::runJavaScriptPrompt): Ditto.
2019 (KWQKHTMLPart::attributedString): Ditto.
2020 (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto.
2021 (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above).
2023 * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior.
2025 (QObject::inherits): Changed to not use dynamic cast.
2026 (QObject::isKHTMLPart): Added. Returns false.
2027 (QObject::isKHTMLView): Ditto.
2028 (QObject::isKPartsReadOnlyPart): Ditto.
2029 (QObject::isQFrame): Ditto.
2030 (QObject::isQScrollView): Ditto.
2032 * kwq/KWQRenderTreeDebug.cpp:
2033 (write): Changed to use inherits rather than dynamic_cast.
2034 (writeSelection): Ditto.
2036 * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather
2037 than going straight on to the "no parameters at all" version.
2040 * kwq/KWQString.mm: (QString::replace): Added overloads.
2041 * kwq/WebCoreBridge.mm:
2042 (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h.
2043 (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto.
2044 (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with
2045 the additional replace overloads added to QString.
2046 (-[WebCoreBridge stringForRange:]): Ditto.
2047 (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h.
2048 (-[WebCoreBridge elementAtPoint:]): QChar conversion.
2049 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h.
2050 (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h.
2052 2004-12-13 Ken Kocienda <kocienda@apple.com>
2058 <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
2060 * khtml/editing/htmlediting.cpp:
2061 (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
2062 leading and trailing whitespace positions was reversed! I must have introduced this error recently
2063 when changing around this code.
2065 2004-12-13 David Hyatt <hyatt@apple.com>
2067 Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing
2068 and painting was using the wrong rect when setting up the x/y of the rect.
2072 * khtml/rendering/render_block.cpp:
2073 (khtml::RenderBlock::paint):
2074 (khtml::RenderBlock::nodeAtPoint):
2075 * khtml/rendering/render_object.h:
2076 (khtml::RenderObject::floatRect):
2078 2004-12-13 Ken Kocienda <kocienda@apple.com>
2084 <rdar://problem/3917863> REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles
2086 Code to figuire out the end node to merge was missing the font tag in the second paragraph
2087 written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter.
2089 * khtml/editing/htmlediting.cpp:
2090 (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted
2091 looking for the node that is the last inline in the last block of the fragment. The old algorithm was
2092 insufficiently powerful.
2093 (khtml::ReplacementFragment::enclosingBlock): New helper function.
2094 * khtml/editing/htmlediting.h: Add declaration for new helper function.
2095 * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added.
2096 * layout-tests/editing/pasteboard/paste-text-011.html: Added.
2098 2004-12-13 Ken Kocienda <kocienda@apple.com>
2102 WebCore side of fix for this bug:
2104 <rdar://problem/3768372> REGRESSION (Mail): paste of text ending in whitespace loses whitespace
2106 Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this
2107 bug. This change involves our half of the needed changes.
2109 Note that a lot of this change has to do with changing code to use a <br> element instead of
2110 a comment node as the mechanism to annotate HTML with information used to fix the bug. In some
2111 other places, code to handle comments in markup can be removed since we do not use comments for
2112 such annotations after this change.
2114 * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed.
2115 (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline.
2116 (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment.
2117 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to
2118 convertedSpaceSpanClassString to match other uses of the idiom used here.
2119 (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
2120 * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed.
2121 (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline().
2122 * khtml/html/html_elementimpl.cpp:
2123 (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not
2124 annotate fragments with comments any longer.
2125 * khtml/html/html_elementimpl.h: Ditto.
2126 * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed.
2127 (DOM::interchangeNewlineMarkupString): New helper to return <br> element markup we use to annotate content for interchange.
2128 (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove
2129 spurious semi-colon.
2130 * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum.
2131 * kwq/WebCoreBridge.mm:
2132 (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments
2133 in DOM when calling createContextualFragment().
2135 2004-12-10 John Sullivan <sullivan@apple.com>
2137 fixed deployment build bustage that John Louch ran into
2139 * kwq/KWQTextEdit.mm:
2140 (QTextEdit::setScrollBarModes):
2141 move bool declaration inside exception-handling block to avoid obscure
2144 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2146 Reviewed by Richard.
2148 <rdar://problem/3907484> REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com)
2151 (QWidget::setFocus): Handle the case where setting focus removed
2152 us from the superview - this can happen due to style changes on
2155 2004-12-10 Ken Kocienda <kocienda@apple.com>
2161 <rdar://problem/3915008> REGRESSION (Mail): Too much white space between lines separated by carriage returns
2163 There are a number of interesting things we could do to fix this bug, including SPI and involving
2164 the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that
2165 will fix the bug in the general case until such time as we can come up with more specific
2168 So, I added a helper method to create <p> elements with an inline style that sets top and bottom margins
2171 * khtml/editing/htmlediting.cpp:
2172 (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create
2173 paragraph elements to insert. Also adds style information to keep the <p> from having "too-big" margins.
2174 (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method.
2175 * khtml/editing/htmlediting.h: Add createParagraphElement() declaration.
2177 2004-12-10 Darin Adler <darin@apple.com>
2181 - fixed <rdar://problem/3910419> setting style={overflow:hidden} for <textarea> does not prevent appearance of scrollbars
2183 * khtml/rendering/render_form.h: Remove now-unneeded wrap parameter.
2184 * khtml/rendering/render_form.cpp:
2185 (RenderSubmitButton::rawText): Convert to QChar explicitly.
2186 (RenderLineEdit::updateFromElement): Ditto.
2187 (RenderLineEdit::slotTextChanged): Ditto.
2188 (RenderSelect::updateFromElement): Ditto.
2189 (TextAreaWidget::TextAreaWidget): Moved out most of the initialization since it's not something
2190 that requires a derived class. Now we don't use this class at all for WebCore, but they still
2192 (TextAreaWidget::event): Moved out the ifdefs.
2193 (RenderTextArea::RenderTextArea): Moved setting code from TextAreaWidget here. Put a bunch that
2194 we don't need at all inside !APPLE_CHANGES, and removed the setting for scroll bars, since that's
2195 now done in setStyle.
2196 (RenderTextArea::handleFocusOut): Use type QTextEdit instead of TextAreaWidget since that's all
2197 that's needed and WebCore no longer has TextAreaWidget.
2198 (RenderTextArea::calcMinMaxWidth): Ditto.
2199 (RenderTextArea::setStyle): Add code to set scroll bar modes based on wrap setting combined with
2201 (RenderTextArea::updateFromElement): Use type QTextEdit.
2202 (RenderTextArea::text): Ditto.
2203 (RenderTextArea::select): Ditto.
2205 * kwq/KWQTextArea.mm:
2206 (-[KWQTextArea _configureTextViewForWordWrapMode]): Don't set horizontal scroller visibility here,
2207 since it's now handled by QTextEdit.
2208 (-[KWQTextArea initWithFrame:]): Don't set vertical scroller visibility or scroller auto-hiding.
2210 * kwq/KWQTextEdit.h: Add setScrollBarModes function to be used instead of separate setter for
2211 the horizontal and vertical mode; needed because AppKit switches "autohide" for both at once.
2212 * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Added.
2214 2004-12-10 Ken Kocienda <kocienda@apple.com>
2220 <rdar://problem/3915047> HItting return in empty document inserts <p> but
2221 insertion point does not move
2223 * khtml/editing/htmlediting.cpp:
2224 (khtml::InsertParagraphSeparatorCommand::doApply): The issue is that the
2225 code to insert the <p> element for the return is not detecting the fact
2226 that the document is empty. Inserting a <p> into an empty body will not
2227 "add a new line" as the user expects. With this change, we'll add a second
2228 <p> when the root editable element has no rendered kids.
2230 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2234 <rdar://problem/3912979> REGRESSION (125-173): repro crash in HTMLCollectionImpl code (www.clubtravel.ie)
2236 * khtml/html/html_miscimpl.cpp:
2237 (HTMLCollectionImpl::traverseNextItem): Pass base when traversing
2238 the initial one step, otherwise we might inadvertantly step
2239 outside the collection base, thereby causing assertion failures or
2240 other badness later.
2242 2004-12-10 Ken Kocienda <kocienda@apple.com>
2246 * khtml/editing/htmlediting.cpp:
2247 (khtml::InsertParagraphSeparatorCommand::doApply): There is a starting block which is supposed to
2248 act as the root node for this operation. However, a loop was incorrectly coded, and a parent node
2249 search could escape this node. Also, one other piece to code to move nodes to the new <p> element
2250 should do nothing if the starting point for the selection is itself the starting block.
2251 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Similar changes, in spirit, to the above
2252 function, though the names and concepts are slightly different.
2254 2004-12-10 Maciej Stachowiak <mjs@apple.com>
2258 <rdar://problem/3907705> REGRESSION (172-173): DHTML menus are broken at hrweb.apple.com
2260 * khtml/dom/html_document.cpp:
2261 (HTMLDocument::nameableItems): New method, wrapper for HTMLCollection creation.
2262 * khtml/dom/html_document.h:
2263 * khtml/ecma/kjs_html.cpp:
2264 (KJS::HTMLDocument::tryGet): use doc.nameableItems(), not doc.all()!
2265 * khtml/html/html_miscimpl.cpp:
2266 (HTMLCollectionImpl::traverseNextItem): Added new DOC_NAMEABLE_ITEMS type, this represents
2267 the items that can be accessed directly as a document propery, in particular forms, images,
2268 objects, applets and embeds.
2269 (HTMLCollectionImpl::updateNameCache): Fix some nameCache/idCache confusion.
2270 (HTMLFormCollectionImpl::updateNameCache): Ditto.
2271 * khtml/html/html_miscimpl.h:
2272 (DOM::HTMLCollectionImpl::): Added new type.
2274 2004-12-10 Ken Kocienda <kocienda@apple.com>
2280 <rdar://problem/3914779> REGRESSION (Mail): Cannot arrow navigate to position before last character on text-wrapped line
2282 * khtml/rendering/render_text.cpp:
2283 (RenderText::caretRect): Code was not detecting space at the end of a line correctly. Now it does.
2285 2004-12-10 Ken Kocienda <kocienda@apple.com>
2291 <rdar://problem/3914755> REGRESSION (Mail): Insertion point disappears after pasting paragraph
2293 * khtml/editing/htmlediting.cpp:
2294 (khtml::ReplaceSelectionCommand::doApply): Selection could end up in a "placeholder" node
2295 that was removed from the document when pasting. This caused the disappearance. Now this
2296 is detected, and the selection is shifted to a node that is in the document.
2298 2004-12-09 Richard Williamson <rjw@apple.com>
2300 Check to disable threaded decoding during
2301 layout tests wasn't invoking function, just checking address of
2302 function, which would always return true.
2304 * kwq/WebCoreImageRendererFactory.m:
2305 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2307 2004-12-09 David Hyatt <hyatt@apple.com>
2309 Fix for 3892686, left/top overflow was not being propagated properly up to containing blocks because of a math
2312 Also fix a bug I noticed on the same page where relative position offsets were not being added in properly for
2313 all inlines when repainting.
2317 * khtml/rendering/render_block.cpp:
2318 (khtml::RenderBlock::layoutBlockChildren):
2319 * khtml/rendering/render_flow.cpp:
2320 (RenderFlow::getAbsoluteRepaintRect):
2322 2004-12-09 David Hyatt <hyatt@apple.com>
2324 Fix for 3867545, finance.yahoo.com lays out incorrectly. Add a quirk that will prevent tables from moving
2325 down below floats when there is insufficient space. Instead we will match Gecko and just spill out of the
2326 containing block to the right. This appears to be the more common desired behavior, despite being wrong.
2327 WinIE sometimes wraps and sometimes doesn't, but it's really hard for us to match its inconsistency.
2331 * khtml/rendering/render_block.cpp:
2332 (khtml::RenderBlock::getClearDelta):
2333 * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
2334 * layout-tests/apple-only/base/www.ebay.com/index-expected.txt:
2335 * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
2336 * layout-tests/fast/block/margin-collapse/102-expected.txt:
2337 * layout-tests/fast/block/margin-collapse/102.html:
2339 2004-12-09 Richard Williamson <rjw@apple.com>
2341 Fixed <rdar://problem/3914078> worldclock crashing gc related
2343 Use ProtectedValue for Context2D instance members.
2347 * khtml/ecma/kjs_html.h:
2349 2004-12-09 John Sullivan <sullivan@apple.com>
2353 - fixed <rdar://problem/3731099> Move AXTitle string for image elements to AXDescription
2355 * kwq/KWQAccObject.mm:
2356 (-[KWQAccObject title]): moved image alt tag code out of here
2357 (-[KWQAccObject accessibilityDescription]): moved image alt tag code into this new method
2358 (-[KWQAccObject accessibilityAttributeNames]): include AXDescription in the set of attributes
2359 that ordinary elements return; this means that ordinary elements that aren't images will return
2360 a nil description, which isn't ideal, but is in keeping with the way the rest of these attributes
2362 (-[KWQAccObject accessibilityAttributeValue:]):
2363 call accessibilityDescription when asked for AXDescription
2365 2004-12-09 Ken Kocienda <kocienda@apple.com>
2367 Reviewed by Harrison
2371 <rdar://problem/3910425> REGRESSION (Mail): Crash in ReplaceSelectionCommand; selection is empty, leading to null deref
2373 * khtml/editing/htmlediting.cpp:
2374 (khtml::MoveSelectionCommand::doApply): The node representing the destination for the move may have
2375 been deleted. If this is the case, set the destination to the node the delete command provides in
2376 its ending selection.
2380 2004-12-09 Ken Kocienda <kocienda@apple.com>
2386 <rdar://problem/3912841> REGRESSION (173-TOT): Some images report 0x0 dimensions on layout tests, causes spurious test failures
2388 The new threaded image decoding capability can throw off layout tests. The issue is that the decoding
2389 callback may not be delivered before the program asks for the dimensions of an image in order to
2390 wrote the layout dimensions. More generally, I think we need to ensure that there are no races in
2391 layout tests, so I have added a flag to the render tree debug code that we can set when debugging.
2393 * kwq/KWQRenderTreeDebug.cpp:
2394 (debuggingRenderTree): New function. Returns flag which tells whether the program is debugging the render tree.
2395 (externalRepresentation): Sets debuggingRenderTree flag to true;
2396 * kwq/KWQRenderTreeDebug.h:
2397 * kwq/WebCoreImageRendererFactory.m:
2398 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]): Checks debuggingRenderTree flag and will not
2399 do threaded decoding in any case if the flag is set.
2401 2004-12-09 Chris Blumenberg <cblu@apple.com>
2403 Fix for busting XMLHTTPRequest.
2405 Reviewed by kocienda.
2407 * khtml/misc/loader.cpp:
2408 (Loader::servePendingRequests): pass true for deliverAllData
2410 (KIO::get): take deliverAllData param
2411 (KIO::http_post): ditto
2412 * kwq/KWQKJobClasses.h:
2413 * kwq/KWQKJobClasses.mm:
2414 (KIO::TransferJob::TransferJob): if deliverAllData, create signal with data param
2415 (KIO::TransferJob::emitResult): if deliverAllData, call signal with data param
2417 2004-12-09 Ken Kocienda <kocienda@apple.com>
2421 <rdar://problem/3911011> REGRESSION (Mail): Spaces at end of line causing word wrap lost when copied/pasted
2423 * khtml/xml/dom_nodeimpl.cpp:
2424 (NodeImpl::renderedText): Fixed the code so that spaces at the end of lines are not skipped.
2426 2004-12-07 Richard Williamson <rjw@apple.com>
2428 Support threaded image decoding on machines w/ > 2 CPUs.
2430 Reviewed by Maciej and Chris.
2432 * khtml/misc/loader.cpp:
2433 (CachedImageCallback::notifyUpdate):
2434 (CachedImageCallback::notifyFinished):
2435 (CachedImageCallback::notifyDecodingError):
2436 (CachedImageCallback::handleError):
2437 (CachedImageCallback::clear):
2438 (CachedImage::CachedImage):
2439 (CachedImage::clear):
2440 (CachedImage::data):
2441 (CachedImage::checkNotify):
2442 (Loader::servePendingRequests):
2443 (Loader::slotFinished):
2444 (Loader::numRequests):
2445 (Loader::cancelRequests):
2446 (Loader::removeBackgroundDecodingRequest):
2447 * khtml/misc/loader.h:
2448 (khtml::CachedImageCallback::CachedImageCallback):
2449 (khtml::CachedImageCallback::ref):
2450 (khtml::CachedImageCallback::deref):
2451 (khtml::CachedImage::decoderCallback):
2452 * khtml/rendering/render_object.cpp:
2453 (RenderObject::setPixmap):
2456 (-[WebImageCallback initWithCallback:khtml::]):
2457 (-[WebImageCallback _commonTermination]):
2458 (-[WebImageCallback dealloc]):
2459 (-[WebImageCallback finalize]):
2460 (-[WebImageCallback notify]):
2461 (-[WebImageCallback setImageSourceStatus:]):
2462 (-[WebImageCallback status]):
2463 (QPixmap::shouldUseThreadedDecoding):
2464 (QPixmap::receivedData):
2465 * kwq/WebCoreImageRenderer.h:
2466 * kwq/WebCoreImageRendererFactory.h:
2467 * kwq/WebCoreImageRendererFactory.m:
2468 (+[WebCoreImageRendererFactory shouldUseThreadedDecoding]):
2469 (+[WebCoreImageRendererFactory setShouldUseThreadedDecoding:]):
2471 2004-12-07 Ken Kocienda <kocienda@apple.com>
2475 * khtml/editing/htmlediting.cpp:
2476 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Fix a problem with my
2477 change in thei code yesterday. Call to insertBlockPlaceholderIfNeeded() must be done
2478 after new block has been inserted, otherwise a crash can result. Shuffle down call
2479 to insertBlockPlaceholderIfNeeded() a couple of lines (where the node is inserted),
2482 2004-12-07 Ken Kocienda <kocienda@apple.com>
2488 <rdar://problem/3907422> REGRESSION (Mail): Pasting quoted content can place content after body element
2490 * khtml/editing/htmlediting.cpp:
2491 (khtml::ReplaceSelectionCommand::doApply): Detect when the body element is the "reference block" used
2492 for determining the location for inserting content. Do not allow an insert before or after if the
2493 reference block is the body. Perform insertNodeAt(0) and appendNode, respectively, in the block-is-body case.
2494 * layout-tests/editing/inserting/insert-3907422-fix-expected.txt: Added.
2495 * layout-tests/editing/inserting/insert-3907422-fix.html: Added.
2497 2004-12-07 Darin Adler <darin@apple.com>
2501 - fixed <rdar://problem/3908701> REGRESSION: Cursor does not change to "hand" over active links
2503 * kwq/KWQEvent.mm: (positionForEvent): Add NSMouseMoved to list of events that have mouse location.
2505 2004-12-07 Ken Kocienda <kocienda@apple.com>
2509 Changed name of constant from KHTMLInterchangeNewline to AppleInterchangeNewline.
2510 I discussed this with Hyatt and he agreed that going with "Apple" names was OK.
2512 * khtml/editing/html_interchange.h: Name change, as described above.
2513 * khtml/editing/htmlediting.cpp:
2514 (khtml::ReplacementFragment::isInterchangeNewlineComment): Ditto.
2515 * khtml/xml/dom2_rangeimpl.cpp:
2516 (DOM::RangeImpl::toHTML): Ditto.
2518 2004-12-07 Ken Kocienda <kocienda@apple.com>
2522 Added a couple more layout tests.
2524 * layout-tests/editing/deleting/delete-line-013-expected.txt: Added.
2525 * layout-tests/editing/deleting/delete-line-013.html: Added.
2526 * layout-tests/editing/deleting/delete-line-014-expected.txt: Added.
2527 * layout-tests/editing/deleting/delete-line-014.html: Added.
2529 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2533 - fixed <rdar://problem/3906974> assertion failure in QWidget::beforeMouseDown clicking on <select multiple>
2535 * kwq/KWQListBox.mm:
2536 (QListBox::QListBox): Initialize KWQListBoxScrollView with this.
2537 (-[KWQListBoxScrollView initWithListBox:]): Make this class a KWQWidgetHolder.
2538 (-[KWQListBoxScrollView widget]): See above.
2539 (-[KWQTableView mouseDown:]): Pass outerView rather than self to beforeMouseDown and
2540 afterMouseDown, to avoid triggering an assertion failure.
2542 2004-12-06 David Hyatt <hyatt@apple.com>
2544 Fix for 3615411, the linesAppended optimization was old and broken, and it's easier with the new code fixes
2545 made by me, kocienda and harrison to just remove it.
2549 * khtml/rendering/bidi.cpp:
2550 (khtml::RenderBlock::layoutInlineChildren):
2551 * khtml/rendering/render_block.cpp:
2552 (khtml:::RenderFlow):
2553 * khtml/rendering/render_block.h:
2554 * khtml/rendering/render_flow.cpp:
2555 (RenderFlow::dirtyLinesFromChangedChild):
2557 2004-12-06 David Hyatt <hyatt@apple.com>
2559 Fix for 3787133, some web pages print with many blank pages. Make sure to use the real page print rect and
2560 not a damage rect that can be changed when intersected with the clip regions of the web page.
2564 * khtml/rendering/render_canvas.h:
2565 (khtml::RenderCanvas::printRect):
2566 (khtml::RenderCanvas::setPrintRect):
2567 * khtml/rendering/render_flow.cpp:
2568 (RenderFlow::paintLines):
2569 * khtml/rendering/render_list.cpp:
2570 (RenderListMarker::paint):
2571 * kwq/KWQKHTMLPart.mm:
2572 (KWQKHTMLPart::adjustPageHeight):
2574 2004-12-06 David Harrison <harrison@apple.com>
2576 Reviewed by Ken Kocienda and Dave Hyatt (OOPS!).
2578 <rdar://problem/3849947> Typing after pasting line does not appear until after window resize.
2581 * khtml/rendering/render_flow.cpp:
2582 (RenderFlow::dirtyLinesFromChangedChild):
2583 Dirty the line above because new child can inval the cached line break position of previous line.
2585 2004-12-06 David Hyatt <hyatt@apple.com>
2587 Fix for 3254464, radio buttons do not work for quiz on netscape.com. Left/top overflow needed to be implemented.
2588 This also fixes 3106907, link hover color only partially set on rollover and the more general architecture bug
2589 3126929, handle top/left overflow.
2591 This patch also fixes 3902891, scroll bar of position:fixed content moves when a page is scrolled.
2593 Finally, the Emerson regression 3869718 (error involving computing the rightmost/lowest position of overflow:auto
2594 regions and web pages) has been fixed.
2598 * khtml/rendering/bidi.cpp:
2599 (khtml::RenderBlock::computeHorizontalPositionsForLine):
2600 (khtml::RenderBlock::checkLinesForOverflow):
2601 * khtml/rendering/render_block.cpp:
2602 (khtml:::RenderFlow):
2603 (khtml::RenderBlock::overflowHeight):
2604 (khtml::RenderBlock::overflowWidth):
2605 (khtml::RenderBlock::overflowLeft):
2606 (khtml::RenderBlock::overflowTop):
2607 (khtml::RenderBlock::overflowRect):
2608 (khtml::RenderBlock::layoutBlock):
2609 (khtml::RenderBlock::layoutBlockChildren):
2610 (khtml::RenderBlock::paint):
2611 (khtml::RenderBlock::floatRect):
2612 (khtml::RenderBlock::lowestPosition):
2613 (khtml::RenderBlock::rightmostPosition):
2614 (khtml::RenderBlock::leftmostPosition):
2615 (khtml::RenderBlock::nodeAtPoint):
2616 * khtml/rendering/render_block.h:
2617 * khtml/rendering/render_box.h:
2618 (khtml::RenderBox::borderBox):
2619 (khtml::RenderBox::borderTopExtra):
2620 (khtml::RenderBox::borderBottomExtra):
2621 * khtml/rendering/render_layer.cpp:
2622 (RenderLayer::paintScrollbars):
2623 (mustExamineRenderer):
2624 (RenderLayer::intersectsDamageRect):
2625 (RenderLayer::containsPoint):
2626 * khtml/rendering/render_line.cpp:
2627 (khtml::InlineFlowBox::placeBoxesHorizontally):
2628 (khtml::InlineFlowBox::verticallyAlignBoxes):
2629 * khtml/rendering/render_line.h:
2630 (khtml::InlineBox::leftOverflow):
2631 (khtml::InlineBox::rightOverflow):
2632 (khtml::InlineFlowBox::setVerticalOverflowPositions):
2633 (khtml::RootInlineBox::RootInlineBox):
2634 (khtml::RootInlineBox::leftOverflow):
2635 (khtml::RootInlineBox::rightOverflow):
2636 (khtml::RootInlineBox::setVerticalOverflowPositions):
2637 (khtml::RootInlineBox::setHorizontalOverflowPositions):
2638 * khtml/rendering/render_object.h:
2639 (khtml::RenderObject::borderBox):
2640 (khtml::RenderObject::overflowLeft):
2641 (khtml::RenderObject::overflowTop):
2642 (khtml::RenderObject::overflowRect):
2643 (khtml::RenderObject::floatRect):
2644 * khtml/rendering/render_table.cpp:
2645 (RenderTable::layout):
2646 (RenderTable::paint):
2647 (RenderTable::paintBoxDecorations):
2648 (RenderTable::calcMinMaxWidth):
2649 * khtml/rendering/render_table.h:
2650 (khtml::RenderTableCell::borderTopExtra):
2651 (khtml::RenderTableCell::borderBottomExtra):
2656 2004-12-06 Maciej Stachowiak <mjs@apple.com>
2660 - fixed <rdar://problem/3903797> scripts can cause other frames/windows to execute arbitrary script using javascript: URLs
2662 I changed all unprotected places that can navigate a different
2663 window or frame from script to check for a javascript: URL, and if
2664 found, to check for safety using cross-site-script rules.
2666 I considered a few other possible exploits and made no change:
2668 - document.location is already protected because the document
2669 object itself is protected
2671 - frame.src, frame.location, iframe.src and targetted links are
2672 all safe because setting the URL of a frame to a javascript: URL
2673 executes the script in the context of the parent
2675 * khtml/ecma/kjs_window.cpp:
2676 (WindowFunc::tryCall):
2678 (LocationFunc::tryCall):
2680 2004-12-06 Ken Kocienda <kocienda@apple.com>
2686 <rdar://problem/3890955> 8A314: Forward delete sometimes fails to delete the selected quoted text
2688 * khtml/editing/htmlediting.cpp:
2689 (khtml::DeleteSelectionCommand::handleSpecialCaseBRDelete): Fixed bonehead coding mistake in the
2690 check for one of the special cases being checked for in this function. The specific case
2691 intends to check for a selection that is only a <br> after a block ends (as in </div><br>). If it
2692 sees such markup, it deletes only the <br> and bails. However, this code would run in *any*
2693 case where a selection ended in a <br> after a block and would not delete any part of the
2694 selection preceding the <br>. Bad. I have tightened the check to see that only a <br> is
2697 Fixing the bug above was accomplished with an additional call to DOM::Position::downstream. This
2698 new use of the function exposed this bug:
2700 <rdar://problem/3907666> Incorrectly coded loop in Position::downstream can lead to infinite loop
2702 * khtml/xml/dom_position.cpp:
2703 (DOM::Position::downstream): I am ashamed of my first cut at this. Rewrote the loop so it does
2704 not have this fatal flaw. It is a much better design as well.
2706 * layout-tests/editing/deleting/delete-3800834-fix-expected.txt: Changes made this test
2707 have what I consider to be a better result. Going with it.
2709 2004-12-06 Chris Blumenberg <cblu@apple.com>
2711 Fixed: <rdar://problem/3871718> REGRESSION (125-168): text marked bold with font that does not have bold variant copies as non-bold
2716 (-[DOMElement _font]): new SPI for AppKit
2719 2004-12-06 Darin Adler <darin@apple.com>
2723 - fixed <rdar://problem/3906327> Select All of a large document is slow (>15 secs on my machine for attached specimen)
2725 * kwq/KWQScrollView.mm: (QScrollView::updateContents): Intersect with visibleRect before calling through
2726 to NSView to dirty; NSView could also be more efficient in this case (I filed 3906343).
2728 2004-12-06 John Sullivan <sullivan@apple.com>
2730 Darin found what appears to be the real leak that we were falsely blaming
2731 on the 'leaks' tool (3880245). I made the change, and ran layout tests and PLT to make
2732 sure nothing barfed.
2734 * khtml/css/cssparser.cpp:
2735 (CSSParser::parseValue):
2736 call clearProperties() instead of just setting numParsedProperties to 0
2737 (CSSParser::parseDeclaration):
2739 (CSSParser::createStyleDeclaration):
2742 2004-12-06 Ken Kocienda <kocienda@apple.com>
2748 * layout-tests/editing/inserting/insert-div-001-expected.txt: Added.
2749 * layout-tests/editing/inserting/insert-div-001.html: Added.
2750 * layout-tests/editing/inserting/insert-div-002-expected.txt: Added.
2751 * layout-tests/editing/inserting/insert-div-002.html: Added.
2752 * layout-tests/editing/inserting/insert-div-003-expected.txt: Added.
2753 * layout-tests/editing/inserting/insert-div-003.html: Added.
2754 * layout-tests/editing/inserting/insert-div-004-expected.txt: Added.
2755 * layout-tests/editing/inserting/insert-div-004.html: Added.
2756 * layout-tests/editing/inserting/insert-div-005-expected.txt: Added.
2757 * layout-tests/editing/inserting/insert-div-005.html: Added.
2758 * layout-tests/editing/inserting/insert-div-006-expected.txt: Added.
2759 * layout-tests/editing/inserting/insert-div-006.html: Added.
2760 * layout-tests/editing/inserting/insert-div-007-expected.txt: Added.
2761 * layout-tests/editing/inserting/insert-div-007.html: Added.
2762 * layout-tests/editing/inserting/insert-div-008-expected.txt: Added.
2763 * layout-tests/editing/inserting/insert-div-008.html: Added.
2764 * layout-tests/editing/inserting/insert-div-009-expected.txt: Added.
2765 * layout-tests/editing/inserting/insert-div-009.html: Added.
2767 2004-12-06 Ken Kocienda <kocienda@apple.com>
2769 Reviewed by Harrison
2773 <rdar://problem/3906948> REGRESSION (Mail): Insert paragraph code can make the insertion point "stick" in place.
2775 * khtml/editing/htmlediting.cpp:
2776 (khtml::InsertParagraphSeparatorCommand::doApply): Call insertBlockPlaceholderIfNeeded(), passing block
2777 being added to this function. This ensures that the added block has a height.
2778 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2780 2004-12-06 Ken Kocienda <kocienda@apple.com>
2784 * khtml/dom/dom_string.cpp:
2785 (DOM::DOMString::substring): Expose method already on DOMStrimgImpl.
2786 * khtml/dom/dom_string.h: Ditto.
2787 * khtml/editing/htmlediting.cpp:
2788 (khtml::CompositeEditCommand::rebalanceWhitespace): New helper to create and execute a
2789 RebalanceWhitespaceCommand instance.
2790 (khtml::DeleteSelectionCommand::doApply): Call rebalanceWhitespace() after running command.
2791 (khtml::InsertLineBreakCommand::doApply): Ditto.
2792 (khtml::InsertParagraphSeparatorCommand::doApply): Ditto.
2793 (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto.
2794 (khtml::InsertTextCommand::input): Ditto.
2795 (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand): New command.
2796 (khtml::RebalanceWhitespaceCommand::~RebalanceWhitespaceCommand): Ditto.
2797 (khtml::RebalanceWhitespaceCommand::doApply): Ditto.
2798 (khtml::RebalanceWhitespaceCommand::doUnapply): Ditto.
2799 (khtml::RebalanceWhitespaceCommand::preservesTypingStyle): Ditto.
2800 (khtml::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
2801 * khtml/editing/htmlediting.h: Ditto.
2802 (khtml::RebalanceWhitespaceCommand::): Ditto.
2804 2004-12-05 Darin Adler <darin@apple.com>
2806 - fixed small problem in my check-in from yesterday
2809 (positionForEvent): Get location from event without raising exception if it's the wrong type.
2810 (clickCountForEvent): Same, for clickCount.
2811 (QMouseEvent::QMouseEvent): Use the new helper functions so this can be constructed even with
2812 the wrong type of NSEvent. Required for cases where a keyboard event causes a "click" and we need
2813 to synthesize a QMouseEvent for KHTML internal use, using the key down NSEvent.
2815 2004-12-04 Darin Adler <darin@apple.com>
2819 - fixed <rdar://problem/3878329> REGRESSION (169-170): colors are wrong for my.yahoo.com due to CSS background parsing changes
2821 * khtml/css/cssparser.cpp: (CSSParser::parseBackgroundShorthand): Changed function so it doesn't rely on the position
2822 attribute being at the end of the array and then moved position attribute before color attribute so it takes precedence.
2823 Since "0" can be both the X coordinate of a position and a legal color (meaning black), we need to do position first.
2825 - fixed <rdar://problem/3760869> click events for input type=button or type=checkbox don't have flags like shiftKey set
2827 * khtml/rendering/render_form.h: Remove unused RenderFormElement fields.
2828 * khtml/rendering/render_form.cpp:
2829 (RenderFormElement::RenderFormElement): Take out code to set a bunch of unused fields.
2830 (RenderFormElement::slotClicked): Change to create the QMouseEvent from the actual mouse event rather than
2831 creating it with all the flags set to 0, using the new QMouseEvent constructor that does so.
2833 * kwq/KWQEvent.h: Added constructor that takes no parameters which uses the current event from AppKit.
2834 Made the click count getter const and added an isDoubleClick that matches the logic used elsewhere.
2835 Added a fixState helper method so the constructors can save code.
2837 (QMouseEvent::QMouseEvent): Factored out the state-fixing code that was in the two existing constructors
2838 and added a third constructor that uses the "current event" from AppKit (used above).
2839 (QMouseEvent::fixState): Compute state and click count based on event type.
2841 - fixed first symptom of <rdar://problem/3830936> REGRESSION (125-165): crash due to null font family, hang at changeforamerica.com
2843 * kwq/KWQFontFamily.mm: (KWQFontFamily::getNSFamily): Handle empty strings specially so we don't run into trouble when
2844 the family name is a null string. This prevents the crash, but there are still other problems that may have the same
2845 underlying cause in CSS.
2847 - fixed <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result
2849 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::insertedIntoDocument):
2850 Added nil check before calling scheduleRelayout. This is new code so the nil-dereference is a recent regression.
2852 2004-12-03 Chris Blumenberg <cblu@apple.com>
2855 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
2856 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
2857 <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
2858 <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear
2860 Reviewed by darin, rjw, kocienda.
2862 * khtml/misc/loader.cpp:
2863 (CachedObject::~CachedObject):
2864 (CachedCSSStyleSheet::checkNotify):
2865 (Loader::servePendingRequests):
2866 (Loader::slotFinished):
2867 (Loader::slotReceivedResponse):
2868 (Cache::requestImage):
2869 (Cache::requestScript):
2870 * khtml/misc/loader.h:
2871 (khtml::CachedObject::CachedObject):
2872 (khtml::CachedObject::response):
2873 (khtml::CachedObject::allData):
2874 * kwq/KWQKJobClasses.h:
2875 * kwq/KWQKJobClasses.mm:
2876 (KIO::TransferJobPrivate::TransferJobPrivate):
2877 (KIO::TransferJobPrivate::~TransferJobPrivate):
2878 (KIO::TransferJob::TransferJob):
2879 (KIO::TransferJob::assembleResponseHeaders):
2880 (KIO::TransferJob::retrieveCharset):
2881 (KIO::TransferJob::emitResult):
2882 (KIO::TransferJob::emitReceivedResponse):
2885 (KWQHeaderStringFromDictionary):
2886 (KWQCheckCacheObjectStatus):
2887 (KWQIsResponseURLEqualToURL):
2889 (KWQResponseMIMEType):
2890 (KWQCacheObjectExpiresTime):
2891 (khtml::CachedObject::setResponse):
2892 (khtml::CachedObject::setAllData):
2896 * kwq/KWQResourceLoader.mm:
2897 (-[KWQResourceLoader finishJobAndHandle:]):
2898 (-[KWQResourceLoader cancel]):
2899 (-[KWQResourceLoader reportError]):
2900 (-[KWQResourceLoader finishWithData:]):
2908 * kwq/WebCoreBridge.h:
2909 * kwq/WebCoreResourceLoader.h:
2911 2004-12-04 Darin Adler <darin@apple.com>
2915 - fixed <rdar://problem/3876093> REGRESSION (166-167): Setting slider control's value from JavaScript has no effect (breaks RSS)
2917 * khtml/rendering/render_form.cpp:
2918 (RenderSlider::updateFromElement): Call setValue to update the value of the DOM element rather than
2919 modifying the m_value data member directly. We don't use m_value at all for sliders now, and in fact
2920 the code relies on the fact that m_value is null. Setting m_value to a non-null value was causing the bug.
2921 (RenderSlider::slotSliderValueChanged): Ditto.
2923 2004-12-03 John Sullivan <sullivan@apple.com>
2927 - fixed <rdar://problem/3889411> REGRESSION (125-172): repro crash in
2928 khtml::BackgroundLayer::cullEmptyLayers
2930 * khtml/rendering/render_style.cpp:
2931 (BackgroundLayer::cullEmptyLayers):
2932 added missing nil check
2936 2004-12-03 Ken Kocienda <kocienda@apple.com>
2940 Roll out some recent changes by Chris that caused a performance regression.
2941 Fix is in hand, but it is a little risky this close to a submission. So,
2942 we have decided to roll back the change with the regression and roll in
2943 the new code after we submit.
2945 * khtml/css/cssproperties.c:
2948 * khtml/css/cssvalues.c:
2951 * khtml/misc/htmlattrs.c:
2954 * khtml/misc/htmltags.c:
2957 * khtml/misc/loader.cpp:
2958 (CachedObject::~CachedObject):
2959 (CachedObject::setResponse):
2960 (CachedCSSStyleSheet::checkNotify):
2961 (Loader::servePendingRequests):
2962 (Loader::slotFinished):
2963 (Loader::slotReceivedResponse):
2964 (Cache::requestImage):
2965 (Cache::requestScript):
2966 * khtml/misc/loader.h:
2967 (khtml::CachedObject::CachedObject):
2968 (khtml::CachedObject::response):
2969 * kwq/KWQKJobClasses.h:
2970 * kwq/KWQKJobClasses.mm:
2971 (KIO::TransferJobPrivate::TransferJobPrivate):
2972 (KIO::TransferJobPrivate::~TransferJobPrivate):
2973 (KIO::TransferJob::TransferJob):
2974 (KIO::TransferJob::assembleResponseHeaders):
2975 (KIO::TransferJob::retrieveCharset):
2976 (KIO::TransferJob::emitResult):
2977 (KIO::TransferJob::emitReceivedResponse):
2980 (KWQHeaderStringFromDictionary):
2981 (KWQCheckCacheObjectStatus):
2982 (KWQRetainResponse):
2983 (KWQReleaseResponse):
2984 (KWQIsResponseURLEqualToURL):
2986 (KWQResponseMIMEType):
2987 (KWQResponseTextEncodingName):
2988 (KWQResponseHeaderString):
2989 (KWQCacheObjectExpiresTime):
2990 (KWQLoader::KWQLoader):
2994 * kwq/KWQResourceLoader.mm:
2995 (-[KWQResourceLoader finishJobAndHandle]):
2996 (-[KWQResourceLoader cancel]):
2997 (-[KWQResourceLoader reportError]):
2998 (-[KWQResourceLoader finish]):
3006 * kwq/WebCoreBridge.h:
3007 * kwq/WebCoreResourceLoader.h:
3009 2004-12-03 John Sullivan <sullivan@apple.com>
3013 - fixed <rdar://problem/3903990> can't tab to all items on www.google.com any more (other pages too?)
3015 * kwq/KWQKHTMLPart.mm:
3016 (KWQKHTMLPart::nextKeyViewInFrameHierarchy):
3017 when checking whether we moved the focus to another view, make sure we didn't "move" it to
3018 our documentView, because that's no move at all.
3020 2004-12-03 Darin Adler <darin@apple.com>
3024 - fixed <rdar://problem/3901109> REGRESSION (171-172): repro crash in DOM::NodeImpl::setChanged at chick-fil-a.com
3026 * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::CSSMutableStyleDeclarationImpl):
3027 Added missing initialization for base class and node pointer.
3029 - fixed a few places that could leave dangling node pointers
3031 * khtml/html/html_baseimpl.cpp: (HTMLBodyElementImpl::~HTMLBodyElementImpl):
3032 Clear out the node pointer when the node is destroyed.
3033 * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::~HTMLElementImpl): Ditto.
3035 2004-12-03 Chris Blumenberg <cblu@apple.com>
3037 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.
3038 Fixed: <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account
3042 * khtml/misc/loader.cpp:
3043 (Loader::servePendingRequests): pass data param to slotFinished, removed allData signal
3044 (Loader::slotFinished): take data param
3045 * khtml/misc/loader.h:
3046 * kwq/KWQKJobClasses.h:
3047 * kwq/KWQKJobClasses.mm:
3048 (KIO::TransferJob::TransferJob): have m_result take a data param, removed m_allData
3049 (KIO::TransferJob::emitResult): take data param and pass it
3050 * kwq/KWQResourceLoader.mm:
3051 (-[KWQResourceLoader finishJobAndHandle:]): take data param and pass it
3052 (-[KWQResourceLoader cancel]): pass nil for data
3053 (-[KWQResourceLoader reportError]): ditto
3054 (-[KWQResourceLoader finishWithData:]): pass data
3056 (KWQSlot::KWQSlot): pass data param to slotFinished
3057 (KWQSlot::call): added support for slotFinished_Loader, removed slotAllData
3059 2004-12-03 Ken Kocienda <kocienda@apple.com>
3063 Did some clean up in the Position class as a result of trying to write some new layout
3064 tests and discovering a bug along the way.
3066 I removed these three functions from the Position class:
3068 1. bool isFirstRenderedPositionOnLine() const;
3069 2. bool isLastRenderedPositionOnLine() const;
3070 3. static bool renderersOnDifferentLine(RenderObject *r1, long o1, RenderObject *r2, long o2);
3071 4. bool inFirstEditableInRootEditableElement() const;
3073 The first two have replacements in the VisiblePosition class, and some code has been
3074 moved to use these new variants. The third function was a helper used only by these
3075 first two function, and can be removed as well. The fourth function was not used by anyone.
3077 * khtml/editing/htmlediting.cpp:
3078 (khtml::InsertTextCommand::input): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
3079 * khtml/editing/visible_position.cpp:
3080 (khtml::visiblePositionsOnDifferentLines): Added an additional check for blocks to this function.
3081 Incorrect results were being returned when asking about positions at the starts of blocks.
3082 * khtml/xml/dom_position.cpp:
3083 (DOM::Position::previousCharacterPosition): Change over to use VisiblePosition isFirstVisiblePositionOnLine().
3084 (DOM::Position::nextCharacterPosition): Change over to use VisiblePosition isLastVisiblePositionOnLine().
3085 (DOM::Position::rendersInDifferentPosition): Removed use of #3 helper in a log message. We can live without it.
3086 * khtml/xml/dom_position.h: Update header for deletions.
3088 2004-12-03 Ken Kocienda <kocienda@apple.com>
3092 Terminology change in execCommand command identifiers. Specifically, the name of
3093 "InsertNewline" command has been changed to "InsertLineBreak". This matches the
3094 terminology used by AppKit. It is also more accurate, since the insertion of a
3095 "br" element is what the command does. The inspiration for this change is so the
3096 -insertNewline AppKit method can be mapped to insert a new "div" element in
3097 a document and avoid ambiguity with what the javascript editing command does.
3099 * khtml/editing/jsediting.cpp
3100 * layout-tests/editing/deleting/delete-tab-004.html
3101 * layout-tests/editing/editing.js
3102 * layout-tests/editing/inserting/insert-3654864-fix.html
3103 * layout-tests/editing/inserting/insert-3659587-fix.html
3104 * layout-tests/editing/inserting/insert-3775316-fix.html
3105 * layout-tests/editing/inserting/insert-3800346-fix.html
3106 * layout-tests/editing/inserting/insert-br-001.html
3107 * layout-tests/editing/inserting/insert-br-002.html
3108 * layout-tests/editing/inserting/insert-br-003.html
3109 * layout-tests/editing/inserting/insert-br-004.html
3110 * layout-tests/editing/inserting/insert-br-005.html
3111 * layout-tests/editing/inserting/insert-br-006.html
3112 * layout-tests/editing/inserting/insert-br-007.html
3113 * layout-tests/editing/inserting/insert-br-008.html
3114 * layout-tests/editing/inserting/insert-tab-004.html
3115 * layout-tests/editing/inserting/insert-text-with-newlines.html
3116 * layout-tests/editing/pasteboard/paste-text-010.html
3118 2004-12-02 Ken Kocienda <kocienda@apple.com>
3124 <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
3126 * khtml/editing/htmlediting.cpp:
3127 (khtml::InsertLineBreakCommand::doApply): Added check for strict mode before adding an extra br element
3128 at the end of a block. This is only necessary in quirks mode. Also, lower-case "br" used to make element.
3129 (khtml::ReplaceSelectionCommand::doApply): If the replacement adds a br element as the last element
3130 in a block and the document is in quirks mode, add an additional br to make the one in the
3131 replacement content show up. This turns out to be much the same logic as is done in InsertLineBreakCommand.
3132 * layout-tests/editing/inserting/insert-3786362-fix-expected.txt: Added.
3133 * layout-tests/editing/inserting/insert-3786362-fix.html: Added.
3135 2004-12-02 Richard Williamson <rjw@apple.com>
3137 Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images
3139 Ensure that the document is cleared when leaving a non-HTML page. This ensures that
3140 the b/f cache won't incorrectly trash the previous state when restoring.
3144 * kwq/WebCoreBridge.h:
3145 * kwq/WebCoreBridge.mm:
3146 (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
3147 (-[WebCoreBridge canCachePage]):
3148 (-[WebCoreBridge clear]):
3150 2004-12-02 Ken Kocienda <kocienda@apple.com>
3156 <rdar://problem/3857775> 8A293: Mail.app crashes converting copy-pasted text into plain text
3158 * khtml/xml/dom2_rangeimpl.cpp:
3159 (DOM::RangeImpl::commonAncestorContainer): Return the document element if no common ancestor container
3160 was found. This can happen in cases where the DOM was built from malformed markup (as in the case
3161 of this bug where there is content after the body tag). Did a little code clean up as well.
3162 (DOM::RangeImpl::compareBoundaryPoints): Made code more robust by adding some null checks.
3164 2004-12-02 Ken Kocienda <kocienda@apple.com>
3170 <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection was created right-to-left
3172 * khtml/khtml_part.cpp:
3173 (KHTMLPart::handleMousePressEventSingleClick): Use RangeImpl::compareBoundaryPoints
3174 to figure out which end of the selection to extend.
3176 2004-12-02 David Harrison <harrison@apple.com>
3178 Reviewed by Ken Kocienda.
3180 <rdar://problem/3834917> REGRESSION (Mail): double-clicking blank line selects end of previous line
3181 Fixed originally reported bug plus the case of double-clicking whitespace at the beginning of a line, which has a similar result.
3183 * khtml/editing/visible_text.cpp:
3184 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3185 (khtml::SimplifiedBackwardsTextIterator::handleTextNode):
3186 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement):
3187 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode):
3188 (khtml::SimplifiedBackwardsTextIterator::emitCharacter):
3189 Distinguish BR from whitespace.
3190 * khtml/editing/visible_text.h:
3191 Distinguish BR from whitespace.
3192 * khtml/editing/visible_units.cpp:
3193 (khtml::previousWordBoundary):
3194 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.
3196 2004-12-02 Ken Kocienda <kocienda@apple.com>
3202 <rdar://problem/3900996> Crash dragging past end of contentEditable DIV, at DOM::RangeImpl::pastEndNode() const + 24
3204 * khtml/xml/dom_position.cpp:
3205 (DOM::Position::equivalentRangeCompliantPosition): Fixed this function so that it constrains the offset
3206 of the position to be >= 0 and <= number of kids of its node. Not doing this constraining led to a DOM
3207 exception trying to use a Position returned from this function to set the boundary point of a Range (which
3208 eventually led to the crash). Since this crash happened, it seems like this function was failing in its
3209 contract to return a range-compliant position, hence the need for this fix.
3211 2004-12-01 Ken Kocienda <kocienda@apple.com>
3217 * khtml/editing/htmlediting.cpp: Move ReplaceSelectionCommand into alphabetical order with
3218 regard to other editing commands. The class had a name change ages ago, and it was never
3220 * khtml/editing/htmlediting.h: Ditto.
3222 2004-12-01 Ken Kocienda <kocienda@apple.com>
3226 Some improvements for paste, including some new code to annotate
3227 whitespace when writing to the pasteboard to ensure that the meaning
3228 of the markup on the pasteboard is unambiguous.
3230 There is also new code for reading this annotated markup from the pasteboard,
3231 removing the nodes that were added only to prevent ambiguity.
3233 * WebCore.pbproj/project.pbxproj: Added html_interchange.h and html_interchange.cpp files.
3234 The header should have been added earlier, but I did not do so.
3235 * khtml/editing/html_interchange.cpp: Added.
3236 (convertHTMLTextToInterchangeFormat):
3237 * khtml/editing/html_interchange.h: Added some new constants for use with whitespace annotations.
3238 * khtml/editing/htmlediting.cpp:
3239 (khtml::ReplacementFragment::ReplacementFragment): Now looks for and removes annotations added for whitespace.
3240 Also fixed a bug in the code that counts blocks in a fragment.
3241 (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): New helper. Recognizes annotation spans.
3242 (khtml::ReplacementFragment::insertNodeBefore): New helper.
3243 (khtml::ReplaceSelectionCommand::doApply): Fixed a bug in the code that sets the start position
3244 for the replacement after deleting. This was causing a bug when pasting at the end of a block.
3245 * khtml/editing/htmlediting.h: Add some new declarations.
3246 * khtml/xml/dom2_rangeimpl.cpp:
3247 (DOM::RangeImpl::toHTML): Calls to startMarkup now pass true for the new annotate flag.
3248 * khtml/xml/dom_nodeimpl.cpp:
3249 (NodeImpl::stringValueForRange): New helper.
3250 (NodeImpl::renderedText): New helper to return only the rendered text in a node.
3251 (NodeImpl::startMarkup): Now takes an additional flag to control whether interchange annotations
3252 should be added. Called by the paste code.
3253 * khtml/xml/dom_nodeimpl.h: Added and modified function declarations.
3255 New test to check the khtml::ReplaceSelectionCommand::doApply fix.
3256 * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Added.
3257 * layout-tests/editing/pasteboard/paste-text-010.html: Added.
3259 2004-11-30 Chris Blumenberg <cblu@apple.com>
3261 * ChangeLog: removed conflict marker
3263 2004-11-30 Chris Blumenberg <cblu@apple.com>
3266 <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data
3267 <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br)
3271 * khtml/misc/loader.cpp:
3272 (CachedObject::~CachedObject): release m_allData
3273 (CachedObject::setAllData): new
3274 (Loader::servePendingRequests): connect slotAllData
3275 (Loader::slotAllData): new
3276 (Cache::requestImage): tweak
3277 * khtml/misc/loader.h:
3278 (khtml::CachedObject::CachedObject): set allData to 0
3279 (khtml::CachedObject::allData): new
3280 * kwq/KWQKJobClasses.h:
3281 * kwq/KWQKJobClasses.mm:
3282 (KIO::TransferJob::TransferJob): set m_allData
3283 (KIO::TransferJob::emitAllData): new
3285 (KWQCheckCacheObjectStatus): pass WebKit the data instead of the length of the resource
3286 * kwq/KWQResourceLoader.mm:
3287 (-[KWQResourceLoader finishWithData:]): renamed to pass all data for the resource
3289 (KWQSlot::KWQSlot): support for slotAllData
3291 * kwq/WebCoreBridge.h:
3292 * kwq/WebCoreResourceLoader.h:
3294 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3298 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3302 <rdar://problem/3805311> REGRESSION (159-163): onload in dynamically written document not called (causes blank search page at Japanese EPP site, many others)
3304 * khtml/khtml_part.cpp:
3305 (KHTMLPart::begin): call setParsing on document here after opening
3306 - from now on we'll only set parsing to true for a document open
3307 caused by page loading, not a programmatic one.
3308 * khtml/xml/dom_docimpl.cpp:
3309 (DocumentImpl::open): don't setParsing to true here any more.
3311 2004-11-30 Maciej Stachowiak <mjs@apple.com>
3315 - fix recent regression from collection perf fixes.
3317 * khtml/html/html_miscimpl.cpp:
3318 (HTMLFormCollectionImpl::updateNameCache): Look up the name
3319 attribute in the name cache, not the id cache (d'oh!)
3321 2004-11-30 Darin Adler <darin@apple.com>
3325 - rolled in a KDE fix for a problem that may underlie a number of crashes
3327 * khtml/xml/dom2_rangeimpl.cpp: (RangeImpl::compareBoundaryPoints): Rolled in a change from
3328 the KDE guys to fix a subtle problem. Code said "n = n =".
3330 - rolled in a KDE fix for a containingBlock crash