3 2004-08-27 Ken Kocienda <kocienda@apple.com>
9 <rdar://problem/3778059> Odd behaviour when editing between blockquote elements
11 * khtml/editing/htmlediting_impl.cpp:
12 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): This function should not move
13 the selection out of the current block, ever. This is exactly what the bug reported.
14 What was I thinking? Now, the code looks at the passed-in position and then the equivalent
15 upstream and downstream positions to see if the selection can be placed there after the
16 delete, and settles on the block containing the passed-in position as a fallback.
17 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
18 * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
20 2004-08-26 Richard Williamson <rjw@apple.com>
22 Boiler plate for canvas gradients and patterns.
26 * khtml/ecma/kjs_html.cpp:
27 (KJS::Context2DFunction::tryCall):
29 (Context2D::~Context2D):
30 (KJS::GradientFunction::tryCall):
33 (Gradient::getValueProperty):
36 (Gradient::~Gradient):
37 (ImagePattern::ImagePattern):
38 (ImagePattern::tryGet):
39 (ImagePattern::getValueProperty):
40 (ImagePattern::tryPut):
41 (ImagePattern::putValue):
42 (ImagePattern::~ImagePattern):
43 * khtml/ecma/kjs_html.h:
44 (KJS::Gradient::toBoolean):
45 (KJS::Gradient::classInfo):
47 (KJS::ImagePattern::toBoolean):
48 (KJS::ImagePattern::classInfo):
49 (KJS::ImagePattern::):
50 * khtml/ecma/kjs_html.lut.h:
53 2004-08-26 Ken Kocienda <kocienda@apple.com>
59 <rdar://problem/3777899> REGRESSION (Mail): only first of several misspelled words separated by
60 carriage returns is marked
62 * khtml/editing/htmlediting_impl.cpp:
63 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Give the spellchecker a slightly larger
64 selection to work with while typing. This should preclude bugs of this type.
66 2004-08-26 Ken Kocienda <kocienda@apple.com>
72 <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
74 * khtml/rendering/render_box.cpp:
75 (RenderBox::caretPos): Always use the font height for calculating the caret height in
76 non-replaced elements (like blocks), rather than the height of the box.
78 2004-08-26 Ken Kocienda <kocienda@apple.com>
82 Silly me. Forgot to add this file before.
84 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: Added.
86 2004-08-26 David Hyatt <hyatt@apple.com>
88 Fix for 3777172, crash from nested colgroup. Don't allow nested table sections or col groups.
92 * khtml/html/htmlparser.cpp:
93 (KHTMLParser::insertNode):
95 2004-08-26 Ken Kocienda <kocienda@apple.com>
101 <rdar://problem/3775316> document sprouts an extra newline character at the end
103 * khtml/editing/htmlediting_impl.cpp:
104 (khtml::InputNewlineCommandImpl::doApply): There was in insufficient check
105 in the code which adds extra BR elements at the ends of blocks, which we do
106 to work around the fact that BR elements, when they are the last element in a
107 block, do not render. Now the code sees whether there already is one of these
108 extra BR's in the document and won't add and "extra" extra.
109 * layout-tests/editing/inserting/insert-3775316-fix.html: Added.
111 2004-08-26 David Hyatt <hyatt@apple.com>
113 Fix for 3710721 and 3504114, crashes because of bad ownership model for list markers.
117 * khtml/rendering/render_container.cpp:
118 (RenderContainer::detach):
119 * khtml/rendering/render_list.cpp:
120 (RenderListItem::setStyle):
121 (RenderListItem::detach):
122 (RenderListItem::updateMarkerLocation):
123 * khtml/rendering/render_list.h:
125 2004-08-26 Ken Kocienda <kocienda@apple.com>
129 * khtml/editing/htmlediting_impl.cpp:
130 (khtml::ApplyStyleCommandImpl::doApply): Remove the StayInBlock modifier from the
131 call to upstream when passing the start position to removeStyle(). This makes the
132 start position sufficiently upstream so that all relevant style tags are removed.
133 (khtml::ApplyStyleCommandImpl::removeStyle): Pass the start position to nodeFullySelected.
134 (khtml::ApplyStyleCommandImpl::nodeFullySelected): Change interface so start position
135 for calculation is passed in, rather than recalculating it every time.
136 * khtml/editing/htmlediting_impl.h: nodeFullySelected interface change.
137 * khtml/xml/dom_position.h: Add a comment about the working of upstream() and
140 2004-08-26 Ken Kocienda <kocienda@apple.com>
144 Fix garbled contenteditable attribute. I must have checked
147 * layout-tests/editing/deleting/delete-3775172-fix.html
149 2004-08-25 Kevin Decker <kdecker@apple.com>
151 Reviewed by John and Maciej.
153 - Fixes SAP bug <rdar://problem/3751295> Personalize link at the
154 top gives an error in the pop-up window.
156 * khtml/ecma/kjs_window.cpp:
157 (WindowFunc::tryCall): Passes a referrer to KHTMLPart::begin()
159 2004-08-25 Richard Williamson <rjw@apple.com>
161 Updated to <canvas> API to match the spec. (Still need
162 to implement gradients and patterns.)
166 * khtml/ecma/kjs_html.cpp:
167 (KJS::Context2DFunction::tryCall):
168 (Context2D::getValueProperty):
169 (Context2D::drawingContext):
170 (Context2D::colorRefFromValue):
171 (Context2D::colorFromValue):
172 (Context2D::setShadow):
173 (Context2D::putValue):
175 (Context2D::restore):
176 (Context2D::Context2D):
177 * khtml/ecma/kjs_html.h:
179 * khtml/ecma/kjs_html.lut.h:
182 2004-08-25 Ken Kocienda <kocienda@apple.com>
186 * layout-tests/editing/deleting/delete-3775172-fix.html: Wrong version of test checked in
189 2004-08-25 Ken Kocienda <kocienda@apple.com>
193 Added test case for <rdar://problem/3775172> Blot crashes after typing one character then deleting it
195 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Added.
196 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
198 2004-08-25 Ken Kocienda <kocienda@apple.com>
202 * layout-tests/editing/style/style-3690704-fix-expected.txt: Fewer styling spans added
203 on this test as a result of the previously-checked-in fix.
205 2004-08-25 Ken Kocienda <kocienda@apple.com>
211 <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style
213 * khtml/editing/htmlediting_impl.cpp:
214 (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
215 now in the iteration when attempting to find nodes that can be styled together with one span.
216 * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
219 2004-08-25 Ken Kocienda <kocienda@apple.com>
225 <rdar://problem/3775172> Blot crashes after typing one character then deleting it
227 * khtml/css/css_computedstyle.cpp:
228 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Bail early if the element
229 being queried does not have a renderer or that renderer does not have a style. Prevents
230 a crash in the cases that it does not.
231 * khtml/editing/htmlediting_impl.cpp:
232 (khtml::DeleteSelectionCommandImpl::doApply): Add one more case to deleting when the
233 start and end nodes are different. If the downstream end node is the last node in the
234 block, then it may need to be deleted completely. Before this patch, the code
235 erroneously assumed that any deletion in this node had to be trimming of a text node.
236 This was asserted, and the description in 3775172 shows a simple case where this assertion
237 does not hold. The additional case and associated checks now make it all better.
238 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
240 2004-08-25 David Hyatt <hyatt@apple.com>
242 Fix for 3365086, large tables crash Safari. Make sure to use ints rather than shorts for row and column
243 counts. Also fix a pathological array resize scenario for tables as rows are added.
247 * khtml/rendering/render_table.cpp:
248 (RenderTable::splitColumn):
249 (RenderTable::appendColumn):
250 (RenderTableSection::RenderTableSection):
251 (RenderTableSection::ensureRows):
252 (RenderTableSection::setCellWidths):
253 (RenderTableSection::calcRowHeight):
254 (RenderTableSection::layoutRows):
255 (RenderTableSection::paint):
256 (RenderTableSection::recalcCells):
257 (RenderTableSection::clearGrid):
258 * khtml/rendering/render_table.h:
259 (khtml::RenderTableSection::numRows):
261 2004-08-25 David Hyatt <hyatt@apple.com>
263 To save memory in the common case, move the margin***Collapse variables into the CSS3 struct instead of
264 bloating the surround struct.
266 * khtml/rendering/render_style.cpp:
267 (StyleSurroundData::StyleSurroundData):
268 (StyleSurroundData::operator==):
269 (marginBottomCollapse):
270 (StyleCSS3NonInheritedData::operator==):
272 * khtml/rendering/render_style.h:
273 (khtml::RenderStyle::marginTopCollapse):
274 (khtml::RenderStyle::marginBottomCollapse):
275 (khtml::RenderStyle::setMarginTopCollapse):
276 (khtml::RenderStyle::setMarginBottomCollapse):
278 2004-08-25 David Hyatt <hyatt@apple.com>
280 Fix the "extra space in TypePad blogs" Emerson problem by adding the ability to collapse away margins.
281 Also added support for explicitly preventing margin collapsing.
285 * khtml/css/cssparser.cpp:
286 (CSSParser::parseValue):
287 * khtml/css/cssproperties.c:
290 * khtml/css/cssproperties.h:
291 * khtml/css/cssproperties.in:
292 * khtml/css/cssstyleselector.cpp:
293 (khtml::CSSStyleSelector::applyProperty):
294 * khtml/css/cssvalues.c:
297 * khtml/css/cssvalues.h:
298 * khtml/css/cssvalues.in:
299 * khtml/rendering/render_block.cpp:
300 (khtml::RenderBlock::isSelfCollapsingBlock):
301 (khtml::RenderBlock::layoutBlockChildren):
302 * khtml/rendering/render_style.cpp:
303 (StyleSurroundData::StyleSurroundData):
304 (StyleSurroundData::operator==):
306 * khtml/rendering/render_style.h:
308 (khtml::RenderStyle::marginTopCollapse):
309 (khtml::RenderStyle::marginBottomCollapse):
310 (khtml::RenderStyle::setMarginTopCollapse):
311 (khtml::RenderStyle::setMarginBottomCollapse):
312 (khtml::RenderStyle::initialMarginTopCollapse):
313 (khtml::RenderStyle::initialMarginBottomCollapse):
315 2004-08-24 Ken Kocienda <kocienda@apple.com>
319 Improved the ability of the bridge to report selection state.
321 * khtml/editing/htmlediting_impl.cpp:
322 (khtml::TypingCommandImpl::doApply): Bail when there is no selection.
323 * kwq/WebCoreBridge.h: Added an enum to report selection state. These constants
324 mirror those used in DOM::Selection.
325 * kwq/WebCoreBridge.mm:
326 (-[WebCoreBridge selectionState]): Replacement for haveSelection. Returns a value
327 from an enum telling whether the selection is in the None, Caret, or Range state,
328 rather than just true/false for the Range state as it did before.
330 2004-08-24 David Hyatt <hyatt@apple.com>
332 Make sure the ifdef XSLT is present for Panther.
334 * khtml/xml/xml_tokenizer.cpp:
335 (khtml::XMLTokenizer::insertErrorMessageBlock):
337 2004-08-24 David Hyatt <hyatt@apple.com>
339 Polish the XML error message so that it indicates when a document is the result of an XSL transformation
340 when reporting line/col #s.
342 * khtml/xml/dom_docimpl.cpp:
343 (DocumentImpl::applyXSLTransform):
344 * khtml/xml/xml_tokenizer.cpp:
345 (khtml::XMLTokenizer::insertErrorMessageBlock):
346 * khtml/xsl/xslt_processorimpl.cpp:
347 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
349 2004-08-24 David Hyatt <hyatt@apple.com>
351 Add support for Atom and RSS MIME types to the set of XML types.
355 * khtml/ecma/xmlhttprequest.cpp:
356 (KJS::XMLHttpRequest::getValueProperty):
357 * khtml/khtml_part.cpp:
359 * khtml/misc/loader.cpp:
360 (CachedXSLStyleSheet::CachedXSLStyleSheet):
361 (CachedXBLDocument::CachedXBLDocument):
362 * khtml/xml/dom_xmlimpl.cpp:
363 (DOM::ProcessingInstructionImpl::checkStyleSheet):
365 2004-08-24 Chris Blumenberg <cblu@apple.com>
367 Fixed: <rdar://problem/3746447> hang loading geocities.com/cinemaorchestra
371 * khtml/rendering/render_frames.cpp:
372 (RenderPartObject::updateWidget): do nothing if the src URL is the same as the part's URL
374 2004-08-24 Ken Kocienda <kocienda@apple.com>
380 <rdar://problem/3773564> REGRESSION (125-159): Code to remove HTML styles before applying new HTML styles is broken
382 * khtml/editing/htmlediting_impl.cpp:
383 (khtml::ApplyStyleCommandImpl::doApply): Unrelated change to constrain downstream position of selection
384 start to block boundaries. This is a new feature of the downstream function and I missed this usage
385 when adding the feature.
386 (khtml::ApplyStyleCommandImpl::removeCSSStyle): There once was code to remove style attributes from spans
387 which became emptied as a result of removing CSS properties, but I do not see such code in the
388 tree any more. A quick review of the ChangeLog did not reveal anything. I do not remember making such
391 In any case, I have restored logic to prune out styling spans we insert if the process of
392 removing styles caused a span-plus-styles node to become emptied of markup which changes the style
393 of its contents. This fixes the bug.
395 2004-08-24 Ken Kocienda <kocienda@apple.com>
401 <rdar://problem/3765535> paste of text with newlines into text with newlines results in broken doc, crash
403 This is a "belt and suspenders" fix. The issue is with the paste code path which was creating
404 zero-length DOM text nodes when a selection being pasted ended with a newline. The normal
405 code path for parsing HTML does not allow this, but the code to convert newlines to BR's
406 during paste was creating such nodes. This will no longer happen.
408 In the case where someone inserts such zero-length nodes using the DOM API, the render tree
409 will no longer create render objects for these nodes, and it was these empty render text
410 nodes that was confusing the code doing editing navigation.
412 * khtml/xml/dom_textimpl.cpp:
413 (CharacterDataImpl::rendererIsNeeded): Do not create renderers for zero-length DOM text nodes.
414 * khtml/xml/dom_textimpl.h:
415 * kwq/WebCoreBridge.mm:
416 (-[WebCoreBridge documentFragmentWithText:]): Do not insert zero-length DOM text nodes as part
417 of converting line-end sequences to BR's.
419 2004-08-23 Maciej Stachowiak <mjs@apple.com>
423 - reduce cost of innerHTML from O(N^2) to O(N*D) where N is the
424 number of nodes and D is the maximum DOM tree depth.
426 * khtml/xml/dom_nodeimpl.cpp:
427 (NodeImpl::recursive_toString): New static helper method for
428 recursive_toHTML - this is recursive for children but iterative
430 (NodeImpl::recursive_toHTML): Call the helper with this as the
432 * khtml/xml/dom_nodeimpl.h:
434 2004-08-23 David Hyatt <hyatt@apple.com>
438 Init the encodedURL explicitly for CSSStyleSelectors. Construction time was too early to be passing in the
439 document m_url, since it doesn't get set during construction.
441 Fix for 3769643, crash on vancouverblast.org.
445 * khtml/css/cssstyleselector.cpp:
446 (khtml::CSSStyleSelector::CSSStyleSelector):
447 (khtml::CSSStyleSelector::init):
448 (khtml::CSSStyleSelector::setEncodedURL):
449 * khtml/css/cssstyleselector.h:
450 * khtml/xml/dom_docimpl.cpp:
451 (DocumentImpl::DocumentImpl):
452 (DocumentImpl::setURL):
453 (DocumentImpl::recalcStyleSelector):
454 * khtml/xml/dom_docimpl.h:
455 (DOM::DocumentImpl::URL):
457 2004-08-23 Kevin Decker <kdecker@apple.com>
461 - fixed rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
462 * khtml/ecma/kjs_window.cpp:
463 (WindowFunc::tryCall): since this is an xml document, we get the
464 domain from the xmlDocImpl(), not docImpl().
466 2004-08-23 Maciej Stachowiak <mjs@apple.com>
470 <rdar://problem/3771426> assertion failed due to reentering dispatchImageLoadEventsNow
472 * khtml/xml/dom_docimpl.cpp:
473 (DocumentImpl::dispatchImageLoadEventsNow): Avoid re-entering this
474 function, since it uses a data member for the copy of the list of events
477 2004-08-23 Maciej Stachowiak <mjs@apple.com>
481 <rdar://problem/3770306> XMLHttpRequest does not honor character set encoding
483 * khtml/ecma/xmlhttprequest.cpp:
484 (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
485 * kwq/KWQKJobClasses.h:
486 * kwq/KWQKJobClasses.mm:
487 (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
489 (KIO::TransferJob::retrieveCharset): New method, gets the charset
491 (KIO::TransferJob::queryMetaData): Handle charset.
492 (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
495 (KWQResponseTextEncodingName): New function, gets the encoding from the response.
497 2004-08-23 David Hyatt <hyatt@apple.com>
499 Apply leo's fix to marquees.
503 * khtml/rendering/render_layer.cpp:
506 2004-08-20 Darin Adler <darin@apple.com>
510 - added an ascii() member function to DOMString and DOMStringImpl to help debugging
512 * khtml/dom/dom_string.h: Add ascii member function for debugging.
513 * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
514 * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
515 * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
516 a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
517 some day, but for now this is way better than what we had before.
519 2004-08-20 David Hyatt <hyatt@apple.com>
521 Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.
523 * khtml/ecma/kjs_html.cpp:
524 (KJS::HTMLElementFunction::tryCall):
525 * khtml/rendering/render_layer.cpp:
529 (Marquee::updateMarqueePosition):
530 * khtml/rendering/render_layer.h:
532 2004-08-20 Richard Williamson <rjw@apple.com>
534 Implemented new JNI abstraction. We no longer invoke Java methods
535 directly with JNI, rather we call into the plugin. This allows the
536 plugin to dispatch the call to the appropriate VM thread. This
537 change should (will?) fix a whole class of threading related problems with
542 * kwq/KWQKHTMLPart.mm:
543 (KWQKHTMLPart::getAppletInstanceForView):
544 * kwq/WebCoreBridge.mm:
546 (-[WebCoreBridge executionContextForView:]):
548 2004-08-19 Maciej Stachowiak <mjs@apple.com>
552 More text paint cleanup. Separated the background and foreground
553 passes instead of doing a weird for loop thing. Eliminated
554 redundant if conditions. Added comments.
556 * khtml/rendering/render_text.cpp:
559 2004-08-19 Ken Kocienda <kocienda@apple.com>
563 * khtml/css/css_computedstyle.cpp:
564 (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
565 name change of copy() to copyInheritableProperties()
566 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
567 Now just copies those properties which can be inherited.
568 (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
569 * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
570 * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
571 * khtml/css/css_valueimpl.h: Ditto.
572 * khtml/editing/htmlediting.cpp:
573 (khtml::EditCommand::typingStyle): Added.
574 (khtml::EditCommand::setTypingStyle): Added.
575 * khtml/editing/htmlediting.h:
576 * khtml/editing/htmlediting_impl.cpp:
577 (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
578 (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
579 (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
580 (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
581 (khtml::EditCommandImpl::setTypingStyle): New setter.
582 (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
583 * khtml/editing/htmlediting_impl.h:
584 (khtml::EditCommandImpl::typingStyle): New accessor.
585 * khtml/khtml_part.cpp:
586 (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
587 (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
588 * khtml/khtml_part.h:
589 * khtml/xml/dom_position.cpp:
590 (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
591 CSSStyleDeclarationImpl.
592 * khtml/xml/dom_position.h:
593 * layout-tests/editing/style/style-3681552-fix-002-expected.txt:
595 2004-08-20 Trey Matteson <trey@apple.com>
597 3655407 - Editing: -complete: method unimplemented (WebKit editing API)
599 One new support routine here.
603 * kwq/WebCoreBridge.h:
604 * kwq/WebCoreBridge.mm:
605 (-[WebCoreBridge caretRectAtNode:offset:]): New routine.
606 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
607 Fixed former misleading method name.
609 2004-08-20 Ken Kocienda <kocienda@apple.com>
615 <rdar://problem/3768378> crash typing newline in Blot
617 * khtml/editing/htmlediting_impl.cpp:
618 (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
619 showed up that inserting newlines that was not being handled correctly for the
620 case described in the bug. I added a new case to handle inserting BR's when
621 at the caret max offset for a node, and this new code runs instead of the
622 fall-through case that should not have been running and triggered the assert.
623 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
624 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
625 * layout-tests/editing/inserting/insert-br-case6.html: Added.
627 2004-08-20 Trey Matteson <trey@apple.com>
629 Fixing: Spellchecker called once or twice for every char typed.
633 * khtml/khtml_part.cpp:
634 (KHTMLPart::setSelection): Don't do any spell checking if we're typing (it's done
635 elsewhere, in markMisspellingsAfterTyping)
637 2004-08-19 Maciej Stachowiak <mjs@apple.com>
641 - fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished
643 Probably also fixed the following likely duplicates:
645 <rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
646 <rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
647 <rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
648 <rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8
650 * khtml/xml/dom_docimpl.cpp:
651 (DocumentImpl::open): call setParsing(true), because we need to know we are once again
652 parsing when we re-open a document that has previously completed loading.
654 2004-08-19 Maciej Stachowiak <mjs@apple.com>
656 Reviewed by Dave and Darin.
658 * khtml/rendering/render_text.cpp:
659 (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.
661 2004-08-19 Darin Adler <darin@apple.com>
665 - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)
667 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
668 the widget; no longer needed since we reworked how widgets get their positions.
669 * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.
671 2004-08-19 David Hyatt <hyatt@apple.com>
673 Fix crash when text is contained inside a table-colgroup.
677 * khtml/xml/dom_textimpl.cpp:
678 (TextImpl::rendererIsNeeded):
680 2004-08-19 Trey Matteson <trey@apple.com>
682 Unexpected errors hit while finding word boundaries, leading to crash.
686 * kwq/KWQTextUtilities.cpp:
687 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
688 are param errors, and pass correct mask for forward case. Also fix off-by-one
689 crashers in fallback code.
691 2004-08-19 David Hyatt <hyatt@apple.com>
693 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
698 * khtml/css/css_ruleimpl.cpp:
699 (CSSImportRuleImpl::init):
700 * khtml/xml/dom_docimpl.cpp:
701 (DocumentImpl::DocumentImpl):
702 (DocumentImpl::~DocumentImpl):
703 (DocumentImpl::applyXSLTransform):
704 * khtml/xml/dom_docimpl.h:
705 (DOM::DocumentImpl::setTransformSource):
706 (DOM::DocumentImpl::transformSource):
707 * khtml/xml/dom_xmlimpl.cpp:
708 (DOM::ProcessingInstructionImpl::checkStyleSheet):
709 * khtml/xml/xml_tokenizer.cpp:
714 (khtml::createQStringParser):
715 (khtml::XMLTokenizer::setTransformSource):
716 * khtml/xsl/xsl_stylesheetimpl.cpp:
717 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
718 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
719 (DOM::XSLStyleSheetImpl::isLoading):
720 (DOM::XSLStyleSheetImpl::clearDocuments):
721 (DOM::XSLStyleSheetImpl::parseString):
722 (DOM::XSLStyleSheetImpl::loadChildSheets):
723 (DOM::XSLStyleSheetImpl::loadChildSheet):
724 (DOM::XSLImportRuleImpl::parentStyleSheet):
725 (DOM::XSLStyleSheetImpl::compileStyleSheet):
726 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
727 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
728 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
729 (DOM::XSLImportRuleImpl::setStyleSheet):
730 (DOM::XSLImportRuleImpl::isLoading):
731 (DOM::XSLImportRuleImpl::loadSheet):
732 * khtml/xsl/xsl_stylesheetimpl.h:
733 (DOM::XSLStyleSheetImpl::setOwnerDocument):
734 (DOM::XSLStyleSheetImpl::setDocument):
735 (DOM::XSLStyleSheetImpl::markAsProcessed):
736 (DOM::XSLStyleSheetImpl::processed):
737 (DOM::XSLImportRuleImpl::href):
738 (DOM::XSLImportRuleImpl::styleSheet):
739 (DOM::XSLImportRuleImpl::isImportRule):
740 * khtml/xsl/xslt_processorimpl.cpp:
741 (DOM::m_sourceDocument):
742 (DOM::stylesheetLoadFunc):
743 (DOM::XSLTProcessorImpl::transformDocument):
744 * khtml/xsl/xslt_processorimpl.h:
748 2004-08-18 Trey Matteson <trey@apple.com>
750 3765958 - downstreamPosition() can hit infinite loop when at end of doc
752 The problem was that I had a position that was after the maximum position in the text
753 node, because it was the old caret position before a backspace was processed. Later
754 I happened to call downstream() on that position, and hit the bug. Fix is to consider
755 a position past the end point of its node if it is *greater than* or equal to its max offset.
759 * khtml/xml/dom_positioniterator.cpp:
760 (DOM::PositionIterator::atEnd):
762 2004-08-18 David Hyatt <hyatt@apple.com>
764 - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only
766 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
767 header draws over the footer.
771 * khtml/rendering/render_block.cpp:
772 (khtml::getHeightForLineCount):
774 2004-08-18 Richard Williamson <rjw@apple.com>
776 Replace horrible pollForAppletInView: with new
777 webPlugInGetApplet. The details of how the applet instance
778 is provided now belong to the Java team. Yeh.
782 * kwq/KWQKHTMLPart.mm:
783 (KWQKHTMLPart::getAppletInstanceForView):
784 * kwq/WebCoreBridge.h:
786 2004-08-18 Chris Blumenberg <cblu@apple.com>
788 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
792 * khtml/xml/dom2_rangeimpl.cpp:
793 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
794 * khtml/xml/dom2_rangeimpl.h:
795 * khtml/xml/dom_nodeimpl.cpp:
796 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
797 * khtml/xml/dom_nodeimpl.h:
798 * kwq/WebCoreBridge.mm:
799 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
800 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
802 2004-08-18 Ken Kocienda <kocienda@apple.com>
806 * khtml/css/css_valueimpl.cpp:
807 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
808 Note to self: read code before making changes to it.
810 2004-08-18 Ken Kocienda <kocienda@apple.com>
812 Coded by Darin and Ken
814 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
815 the properties we implement that we also want to copy in the new
816 CSSComputedStyleDeclarationImpl::copy described below.
817 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
818 computed values of all the properties listed in CopyProperties. In essence, this makes
819 a freeze-dired version of a computed style.
820 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
821 CSSStyleDeclarationImpl that is also in the computed style.
822 * khtml/css/css_computedstyle.h:
823 * khtml/css/css_valueimpl.cpp:
824 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
825 straightforward. Returns a copy that will be unchanged when the original changes.
826 * khtml/css/css_valueimpl.h:
827 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
828 CSSStyleDeclarationImpl is const.
830 2004-08-17 Maciej Stachowiak <mjs@apple.com>
834 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
836 * khtml/khtmlview.cpp:
837 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
838 assertion for m_part being null. It seems impossible for this to
839 happen, so we want to debug it ourselves, but in the meantime,
840 let's try to avoid causing crashes for our users.
842 2004-08-17 David Hyatt <hyatt@apple.com>
844 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
849 * khtml/rendering/render_block.cpp:
850 (khtml::getHeightForLineCount):
851 * khtml/rendering/render_flexbox.cpp:
852 (khtml::RenderFlexibleBox::layoutVerticalBox):
854 2004-08-17 Ken Kocienda <kocienda@apple.com>
858 Rewrite of the command that deletes a selection. I deleted great
859 big swaths of bug-ridden code to accomplish this and replaced it
860 with code that is much cleaner and smarter.
862 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
863 upstream to downstream, respectively.
865 Added a couple of new helper methods.
867 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
868 RemoveNodeAndPruneCommand now obsolete. A huge win.
869 * khtml/editing/htmlediting.h: Ditto.
870 * khtml/editing/htmlediting_impl.cpp:
871 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
872 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
874 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
875 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
876 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
877 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
878 passed offset is less than the length of the text node.
879 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
880 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
881 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
882 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
883 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
884 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
885 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
886 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
887 (khtml::TypingCommandImpl::deleteKeyPressed):
888 * khtml/editing/htmlediting_impl.h:
889 * khtml/xml/dom_position.cpp:
890 (DOM::Position::previousWordBoundary):
891 (DOM::Position::nextWordBoundary):
892 (DOM::Position::upstream):
893 (DOM::Position::downstream):
894 (DOM::Position::inRenderedText): Add null check.
895 (DOM::Position::isRenderedCharacter): New helper.
896 (DOM::isWS): New helper in this file.
897 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
898 (DOM::Position::trailingWhitespacePosition): Ditto.
899 (DOM::Position::debugPosition): Add null check.
900 * khtml/xml/dom_position.h:
901 * khtml/xml/dom_selection.cpp:
902 (DOM::Selection::toRange): upstream/downstream name change
903 (DOM::Selection::validate): upstream/downstream name change
904 (DOM::Selection::debugPosition): upstream/downstream name change
905 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
906 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
907 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
908 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
909 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
910 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
911 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
913 2004-08-17 Trey Matteson <trey@apple.com>
915 Various spelling fixes.
919 * khtml/khtml_part.cpp:
920 (KHTMLPart::setSelection): No misspellings in the spelling code comments
921 * khtml/xml/dom_docimpl.cpp:
922 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
923 were not being erased when you clicked in a word.
924 * khtml/xml/dom_position.cpp:
925 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
926 try if the second try will not come out any different.
927 (DOM::Position::nextWordBoundary): Ditto
928 * kwq/KWQKHTMLPart.mm:
929 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
931 2004-08-17 Darin Adler <darin@apple.com>
935 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
937 * khtml/khtml_part.h: Make completeURL public.
938 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
939 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
940 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
941 and also is obviously correct behavior that may fix other sites too.
943 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
946 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
948 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
949 source to nil, so we don't need nil checks in delegate and data source methods.
950 (-[KWQTableView mouseDown:]): Add nil check.
951 (-[KWQTableView keyDown:]): Add nil check.
952 (-[KWQTableView keyUp:]): Add nil check.
953 (-[KWQTableView becomeFirstResponder]): Add nil check.
954 (-[KWQTableView resignFirstResponder]): Add nil check.
955 (-[KWQTableView canBecomeKeyView]): Add nil check.
956 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
957 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
959 (-[KWQTableView drawRow:clipRect:]): Add nil check.
960 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
962 2004-08-17 Trey Matteson <trey@apple.com>
964 Fix ASSERT in spelling marker management.
968 * khtml/xml/dom_docimpl.cpp:
969 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
970 Tweak test to allow for a start position of 0.
972 2004-08-17 Trey Matteson <trey@apple.com>
974 3764147 - failure of subframe to load leaves links in parent doc broken
978 * khtml/khtml_part.cpp:
979 (KHTMLPart::childBegin): New method to mark part as not complete.
980 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
981 later get a failure on load it won't think it's already complete and do nothing.
982 * khtml/khtml_part.h:
986 2004-08-16 David Hyatt <hyatt@apple.com>
988 Fix the #define. I had it all backwards.
992 2004-08-16 David Hyatt <hyatt@apple.com>
994 Land initial support for XSLT using xml-stylesheet PIs.
996 * WebCore.pbproj/project.pbxproj:
997 * khtml/khtml_part.cpp:
998 (KHTMLPart::replaceDocImpl):
999 * khtml/khtml_part.h:
1000 * khtml/khtmlview.h:
1001 * khtml/xml/dom_docimpl.cpp:
1002 (DocumentImpl::DocumentImpl):
1003 (DocumentImpl::~DocumentImpl):
1004 (DocumentImpl::recalcStyleSelector):
1005 (DocumentImpl::applyXSLTransform):
1006 (DocumentImpl::setTransformSourceDocument):
1007 * khtml/xml/dom_docimpl.h:
1008 (DOM::DocumentImpl::setTransformSource):
1009 (DOM::DocumentImpl::transformSource):
1010 (DOM::DocumentImpl::transformSourceDocument):
1011 * khtml/xml/dom_xmlimpl.cpp:
1012 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1013 * khtml/xml/dom_xmlimpl.h:
1014 (DOM::ProcessingInstructionImpl::isXSL):
1015 * khtml/xml/xml_tokenizer.cpp:
1018 (khtml::createQStringParser):
1019 (khtml::XMLTokenizer::processingInstruction):
1020 (khtml::XMLTokenizer::finish):
1021 (khtml::XMLTokenizer::setTransformSource):
1022 * khtml/xml/xml_tokenizer.h:
1023 (khtml::Tokenizer::setTransformSource):
1024 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
1025 * khtml/xml/xsl_stylesheetimpl.h: Removed.
1026 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
1027 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
1028 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
1029 (DOM::XSLStyleSheetImpl::isLoading):
1030 (DOM::XSLStyleSheetImpl::checkLoaded):
1031 (DOM::XSLStyleSheetImpl::docLoader):
1032 (DOM::XSLStyleSheetImpl::parseString):
1033 * khtml/xsl/xsl_stylesheetimpl.h: Added.
1034 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
1035 (DOM::XSLStyleSheetImpl::type):
1036 (DOM::XSLStyleSheetImpl::ownerDocument):
1037 (DOM::XSLStyleSheetImpl::document):
1038 (DOM::XSLStyleSheetImpl::clearDocument):
1039 * khtml/xsl/xslt_processorimpl.cpp: Added.
1040 (DOM::m_sourceDocument):
1041 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
1042 (DOM::XSLTProcessorImpl::transformDocument):
1044 (DOM::XSLTProcessorImpl::addToResult):
1045 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
1046 * khtml/xsl/xslt_processorimpl.h: Added.
1048 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1052 * khtml/khtml_part.cpp:
1053 (KHTMLPart::isImmediateRedirectPending):
1055 2004-08-16 Richard Williamson <rjw@apple.com>
1057 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
1059 Use floats instead of ints to draw images.
1063 * khtml/ecma/kjs_html.cpp:
1064 (KJS::Context2DFunction::tryCall):
1066 * kwq/KWQPainter.mm:
1067 (QPainter::drawPixmap):
1068 (QPainter::drawFloatPixmap):
1070 2004-08-13 Maciej Stachowiak <mjs@apple.com>
1074 - fixed <rdar://problem/3752509> Pop up windows not showing up within SAP's BW Module (changing location.href on new window created by window.open)
1076 (actually the previous fix for this bug was mostly correct, but
1077 this additional change is needed to avoid the regression in
1078 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
1079 as "need to upgrade to IE 6", but didn't reject 125.8
1081 So if merging for a software update, make sure to include both
1082 this and the previous fix.
1084 * khtml/html/htmltokenizer.cpp:
1085 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
1086 make sure to stop tokenizing, because we need to make sure no further
1087 script tags are processed beyond the one that triggered the redirect.
1088 * khtml/khtml_part.cpp:
1089 (KHTMLPart::isImmediateRedirectPending): New method to allow
1090 checking if a redirect is pending.
1091 * khtml/khtml_part.h:
1093 2004-08-15 David Hyatt <hyatt@apple.com>
1095 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
1097 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
1098 to resync with the DOM. This behavior matches WinIE.
1100 Reviewed by kocienda
1102 * khtml/html/html_formimpl.cpp:
1103 (HTMLTextAreaElementImpl::childrenChanged):
1104 * khtml/html/html_formimpl.h:
1106 2004-08-13 Trey Matteson <trey@apple.com>
1108 3761794 Slider doesn't call onmouseup handler
1112 * khtml/rendering/render_form.cpp:
1113 (RenderSlider::RenderSlider): Listen for signal.
1114 (RenderSlider::slotClicked): Pass to superclass.
1115 * khtml/rendering/render_form.h:
1118 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
1119 since AK consumes the mouseUp event in a modal tracking loop.
1120 (QSlider::QSlider): Make signal.
1121 (QSlider::clicked): Send signal.
1123 2004-08-12 Trey Matteson <trey@apple.com>
1125 3761329 - query result links all dead in ingrammicro.com (sometimes)
1126 3761328 - links in some docs dead when doc is loaded from WebArchive
1128 Make sure to get part to completed state when end is called,
1129 even if we have no doc. See WebKit changelog for more info.
1131 Reviewed by Richard and Darin.
1133 * khtml/khtml_part.cpp:
1136 2004-08-13 Trey Matteson <trey@apple.com>
1138 3761098 - red dotted underline for misspelled words shows up in drag image
1142 * khtml/rendering/render_text.cpp:
1143 (RenderText::paint): Don't draw misspelling when creating selection image.
1145 2004-08-12 Richard Williamson <rjw@apple.com>
1147 Bring npruntime.h and friends closer to compliance with
1152 * kwq/KWQKHTMLPart.mm:
1153 (KWQKHTMLPart::windowScriptNPObject):
1155 2004-08-12 Maciej Stachowiak <mjs@apple.com>
1157 Reviewed by Richard.
1159 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
1160 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
1163 (substituteBackslashes): Helper method
1164 (KURL::KURL): If the URL contains any backslashes, substitute all
1165 that appear before the query or fragment.
1167 2004-08-12 Ken Kocienda <kocienda@apple.com>
1173 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
1175 * khtml/xml/dom_selection.cpp:
1176 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
1177 document element was beyond the last node in the document. But this is not true, since the document
1178 element is the HTML element (generally). Instead, move to the index equal to the number of children
1179 of the document element. This puts us past everything.
1180 (DOM::Selection::modifyMovingRightForward): Ditto.
1182 2004-08-12 Ken Kocienda <kocienda@apple.com>
1188 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
1190 Detect when current position is on first or last line and move to the
1191 start or end of that line, respectively.
1193 * khtml/xml/dom_position.cpp:
1194 (DOM::Position::previousLinePosition)
1195 (DOM::Position::nextLinePosition)
1199 2004-08-12 Ken Kocienda <kocienda@apple.com>
1203 Some consolidation in style application code.
1205 * khtml/editing/htmlediting_impl.cpp:
1206 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
1207 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
1208 well as from a CSSStyleDeclarationImpl and a Position.
1209 (khtml::StyleChange::init): Common init function for StyleChange constructors.
1210 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
1211 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
1213 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
1214 * khtml/editing/htmlediting_impl.h:
1215 (khtml::StyleChange::StyleChange):
1216 (khtml::StyleChange::cssStyle): New accessor.
1217 (khtml::StyleChange::applyBold): Ditto.
1218 (khtml::StyleChange::applyItalic): Ditto.
1219 * khtml/xml/dom_position.cpp:
1220 (DOM::Position::computedStyle): New helper.
1221 * khtml/xml/dom_position.h: Ditto.
1223 2004-08-12 Ken Kocienda <kocienda@apple.com>
1228 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
1230 Progress on this bug:
1231 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
1233 * khtml/editing/htmlediting_impl.cpp:
1234 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
1235 Also, interface changed to take the node to which the typing style is to be applied.
1236 This makes it easier to apply what may be up to three levels of nested tags to get the
1237 desired style (<B>, <I>, and <SPAN STYLE="">).
1238 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
1239 italic tags for applying styles when that is apprpriate. This creates on opportunity to
1240 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
1241 share the implementation. I will follow up with a change to do that after landing this
1242 change. Some future code factoring could be done here to bring together some similar code
1244 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
1245 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
1246 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
1248 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
1249 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
1250 * khtml/editing/htmlediting_impl.h:
1251 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
1252 CompositeEditCommandImpl can use it.
1253 * khtml/khtml_part.cpp:
1254 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
1255 changes, not only when closing typing. This fixes 3751098.
1257 These three tests actually had results that treated the buggy behavior as correct!
1259 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
1260 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
1261 * layout-tests/editing/style/typing-style-002-expected.txt
1263 2004-08-12 Darin Adler <darin@apple.com>
1267 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
1269 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
1270 effect of making the text field be first responder, call to bridge first to make it first responder.
1271 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
1272 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
1273 an additional setFocusNode(0) call, which is unnecessary and incorrect.
1275 2004-08-12 Darin Adler <darin@apple.com>
1279 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
1281 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
1282 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
1283 one node too far in the case where the end container was not a text node.
1285 * khtml/xml/dom_nodeimpl.cpp:
1286 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
1287 to fix bug where it would run past the end node, including too many nodes in the generated
1288 HTML. Nice side benefit: easier to read the code.
1290 2004-08-11 Chris Blumenberg <cblu@apple.com>
1292 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
1296 * kwq/KWQKHTMLPart.mm:
1297 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
1299 2004-08-11 Darin Adler <darin@apple.com>
1303 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
1305 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
1306 Enhanced workaround for shifting focus from one secure text field to another so that it works
1307 even for the case of shifting focus from a secure text field back to itself.
1309 2004-08-11 Ken Kocienda <kocienda@apple.com>
1313 Missed adding this file before.
1315 * kwq/KWQTextUtilities.mm: Added.
1316 (KWQFindNextWordFromIndex):
1318 2004-08-11 Ken Kocienda <kocienda@apple.com>
1322 Efficiency improvements on string manipulations in these two new function
1323 implementations. Use the versions of QString append/prepend that take
1324 (QChar *c, uint length) instead of creating new strings each time.
1326 * khtml/xml/dom_position.cpp:
1327 (DOM::Position::previousWordPosition): Changed, as described above.
1328 (DOM::Position::nextWordPosition): Ditto.
1330 2004-08-11 Ken Kocienda <kocienda@apple.com>
1335 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
1337 I have implemented versions of previousWordPosition and nextWordPosition that are now
1338 different than previousWordBoundary and nextWordBoundary. The behavior of the new
1339 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
1341 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
1342 * khtml/misc/helper.cpp:
1343 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
1344 * khtml/misc/helper.h: Declare the function above.
1345 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
1346 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
1347 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
1348 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
1349 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
1350 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
1351 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
1352 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
1353 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
1354 * khtml/misc/khtml_text_operations.h:
1355 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
1356 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
1357 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
1358 * khtml/xml/dom_position.cpp:
1359 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
1360 AppKit to perform the same calculations NSText uses.
1361 (DOM::Position::nextWordBoundary): Ditto.
1362 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
1363 (DOM::Position::nextWordPosition): Ditto
1364 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
1365 to the number of child nodes it has. This handles more cases correctly, like when the position is
1366 gives as one beyond the end of a document element's last child.
1367 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
1368 * kwq/KWQTextUtilities.mm: Added.
1369 (KWQFindNextWordFromIndex): New function.
1371 2004-08-11 Ken Kocienda <kocienda@apple.com>
1377 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
1379 * khtml/khtml_part.cpp:
1380 (KHTMLPart::selectionComputedStyle): Added a null check.
1382 2004-08-10 Darin Adler <darin@apple.com>
1386 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
1388 I fixed three problems:
1390 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
1391 2) code trying to get to view after view was detached from part, caused nil-deref
1392 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
1394 Now the test page works fine. Hope the real sites do too.
1396 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
1397 * khtml/khtml_part.cpp:
1398 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
1399 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
1400 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
1401 the interpreter itself is running.
1402 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
1404 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
1405 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
1406 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
1407 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
1408 the bug fix, but an earlier version of the fix had changes in this function.
1409 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
1410 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
1412 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
1413 child from the frames list.
1415 2004-08-09 Maciej Stachowiak <mjs@apple.com>
1421 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
1423 * kwq/WebCoreBridge.mm:
1424 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
1425 a marked range in WebCore. The provided DOMRange must start and end in the same
1426 node, which must be a text node.
1427 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
1428 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
1429 * kwq/WebCoreBridge.h: Prototype new methods.
1430 * kwq/KWQKHTMLPart.mm:
1431 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
1432 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
1433 store the marked range, and repaint new and old nodes if needed.
1434 (KWQKHTMLPart::clear): Clear marked range.
1435 * kwq/KWQKHTMLPart.h: Prototype new methods.
1436 * khtml/rendering/render_text.cpp:
1437 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
1438 for marked text, modeled on paintSelection.
1439 (RenderText::paint): Optionally handle painting marked text
1440 background as well as selection background in the marked text
1442 * khtml/rendering/render_text.h: Prototype new method.
1444 2004-08-10 Darin Adler <darin@apple.com>
1448 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1451 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
1452 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1454 2004-08-10 Darin Adler <darin@apple.com>
1460 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
1461 The dictionary lookup is case insensitive.
1463 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
1465 2004-08-10 Trey Matteson <trey@apple.com>
1467 3757094 - crash spell checking after a paste
1471 * khtml/rendering/render_text.cpp:
1472 (InlineTextBox::paintSelection): Add nil check.
1474 2004-08-09 Trey Matteson <trey@apple.com>
1476 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
1477 ... and other follow-on spell check fixes
1481 * khtml/rendering/render_text.cpp:
1482 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
1483 misspelling marker one pixel lower than AK, and one pixel outside the selection
1484 rect we draw, in the case of Times-16. So move it up one. Still not an exact
1485 match for AK, but less bad.
1486 * khtml/xml/dom_docimpl.cpp:
1487 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
1488 repaint if something actually changed.
1489 (DocumentImpl::removeAllMarkers): New utility.
1490 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
1491 hand-rolled loop to empty array.
1492 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
1493 repaint if something actually changed.
1494 * khtml/xml/dom_docimpl.h:
1495 * khtml/xml/dom_textimpl.cpp:
1496 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
1497 remove any markers in the deleted range. Fixes 3756195.
1498 (CharacterDataImpl::replaceData): Ditto for the replaced range.
1499 * kwq/KWQKHTMLPart.mm:
1500 (KWQKHTMLPart::updateSpellChecking): comment
1502 2004-08-08 Trey Matteson <trey@apple.com>
1504 3745023 - Safari crashes trying to access anchor while downloading
1506 I bet this is behind a few other crashers as well. In this bug the start of the
1507 download leaves a KWQPageState hanging around, and when that is freed it damages
1508 the part and view. If you're still using that page, you're dead.
1510 The fix is to properly invalidate the PageState when we receive an error before
1511 reaching WebFrameCommitted state. Normally this happens when a page is reheated
1512 from the PageState, but in this case we never manage to leave the page to begin
1513 with, although we've already created the PageState.
1515 Other errors besides the synthetic one download generates would have caused similar
1516 crashing. Another example would be clicking on a second link before the load
1517 caused by clicking on the first link reached committed state.
1521 * kwq/WebCoreBridge.h:
1522 * kwq/WebCoreBridge.mm:
1523 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
1524 when a load doesn't get off the ground.
1526 2004-08-06 Ken Kocienda <kocienda@apple.com>
1530 Finish off spellchecking support to HTML editing. Includes work to
1531 enable continuous spellchecking.
1533 * khtml/editing/htmlediting_impl.cpp:
1534 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
1535 make the call over to the KWQKHTMLPart.
1536 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
1537 inserted content can be spell-checked. The function is basically the same, except for
1538 the addition of calls to markMisspellingsInSelection.
1539 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
1540 selection that results after typing and determines whether it needs to spellcheck.
1541 Since the word containing the current selection is never marked, this does a check to
1542 see if typing made a new word that is not in the current selection. Basically, you
1543 get this by being at the end of a word and typing a space.
1544 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
1545 * khtml/editing/htmlediting_impl.h: Add new function declarations.
1546 * khtml/khtml_part.cpp:
1547 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
1548 and every selection change passes through here, this is a good place to put the call
1549 to the spellchecker.
1550 * khtml/rendering/render_text.cpp:
1551 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
1552 call that does AppKit-style drawing. Fix up some comments.
1553 * khtml/xml/dom_docimpl.cpp:
1554 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
1556 (DocumentImpl::removeMarker): Ditto.
1557 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
1558 Used when not in continuous spellchecking mode.
1559 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
1560 This shifts the marker offsets by a given amount. This keeps the markers in the right
1561 place when a user types in a node with markers already set on it.
1562 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
1564 * khtml/xml/dom_position.cpp:
1565 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
1566 needlessly so. Basically, if the current position is at a word boundary, run the code again
1567 to find the previous word boundary.
1568 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
1569 * khtml/xml/dom_textimpl.cpp:
1570 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
1571 (CharacterDataImpl::insertData): Ditto.
1572 (CharacterDataImpl::deleteData): Ditto.
1573 (CharacterDataImpl::replaceData): Ditto.
1574 * kwq/KWQKHTMLPart.h:
1575 * kwq/KWQKHTMLPart.mm:
1576 (KWQKHTMLPart::advanceToNextMisspelling):
1577 (KWQKHTMLPart::markMisspellingsInSelection):
1578 (KWQKHTMLPart::updateSpellChecking):
1579 (KWQKHTMLPart::respondToChangedSelection):
1581 * kwq/KWQPainter.mm:
1582 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
1583 * kwq/WebCoreBridge.h:
1584 * kwq/WebCoreBridge.mm:
1585 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
1587 * kwq/WebCoreTextRenderer.h:
1591 2004-08-05 David Hyatt <hyatt@apple.com>
1593 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
1594 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
1595 even our <caption> behavior on Panther was incorrect.
1597 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
1598 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
1599 the relevant ancestor table section. This behavior matches other browsers.
1603 * khtml/html/htmlparser.cpp:
1604 (KHTMLParser::insertNode):
1606 2004-08-04 David Hyatt <hyatt@apple.com>
1608 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
1610 Reviewed by kocienda
1612 * WebCore.pbproj/project.pbxproj:
1613 * khtml/css/css_base.h:
1614 (DOM::StyleBaseImpl::isXSLStyleSheet):
1615 * khtml/css/css_stylesheetimpl.cpp:
1616 (CSSStyleSheetImpl::CSSStyleSheetImpl):
1617 * khtml/css/css_stylesheetimpl.h:
1618 (DOM::StyleSheetImpl::isLoading):
1619 * khtml/misc/loader.cpp:
1620 * khtml/xml/dom_xmlimpl.cpp:
1621 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
1622 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1623 (DOM::ProcessingInstructionImpl::sheet):
1624 (DOM::ProcessingInstructionImpl::isLoading):
1625 (DOM::ProcessingInstructionImpl::setStyleSheet):
1626 * khtml/xml/dom_xmlimpl.h:
1628 2004-08-04 David Hyatt <hyatt@apple.com>
1630 Add XSL Stylesheets to the WebCore cache.
1632 Reviewed by kocienda
1634 * khtml/misc/loader.cpp:
1635 (CachedXSLStyleSheet::CachedXSLStyleSheet):
1636 (CachedXSLStyleSheet::ref):
1637 (CachedXSLStyleSheet::deref):
1638 (CachedXSLStyleSheet::data):
1639 (CachedXSLStyleSheet::checkNotify):
1640 (CachedXSLStyleSheet::error):
1641 (DocLoader::requestXSLStyleSheet):
1642 (Cache::requestXSLStyleSheet):
1643 (Cache::getStatistics):
1644 * khtml/misc/loader.h:
1645 (khtml::CachedObject::):
1646 (khtml::CachedXSLStyleSheet::sheet):
1647 (khtml::CachedXSLStyleSheet::schedule):
1649 2004-08-03 Ken Kocienda <kocienda@apple.com>
1653 Changes to improve our handling of object tags during editing, including
1656 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
1658 Part of the fix for this bug involves removing the close() function from render objects.
1659 It was decided that this code was no longer needed, as the work it did could be moved
1660 to other, more modern, places.
1664 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
1666 Finally, I filed and fixed this bug I discovered while fixing the one above:
1668 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
1670 * khtml/editing/htmlediting_impl.cpp:
1671 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
1672 checks. Bail, returning 0 for typing style if any null checks yield a null.
1673 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
1674 up deleting the node where we calculated that we wanted to put the selection after deleting.
1675 If this happens, move this ending selection to a sensible alternative.
1676 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
1677 of traversePreviousNode when doing the prune.
1678 * khtml/html/html_objectimpl.cpp:
1679 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
1680 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
1681 to canRenderImageType.
1682 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
1683 as their children change. This also will help to make object tags respond properly to having their
1684 params changed by DOM calls.
1685 * khtml/html/html_objectimpl.h: Cosmetic change.
1686 * khtml/html/htmlparser.cpp:
1687 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
1688 (KHTMLParser::popOneBlock): Ditto.
1689 * khtml/rendering/render_block.cpp:
1690 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
1691 * khtml/rendering/render_container.cpp:
1692 (RenderContainer::updatePseudoChild): Ditto.
1693 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
1694 * khtml/rendering/render_form.h: Ditto.
1695 * khtml/rendering/render_frames.cpp: Ditto.
1696 * khtml/rendering/render_frames.h: Ditto.
1697 * khtml/rendering/render_inline.cpp:
1698 (RenderInline::splitFlow): Remove calls to obsolete close() function.
1699 * khtml/rendering/render_object.h: Remove obsolete close() function.
1700 * khtml/rendering/render_table.cpp:
1701 (RenderTableCell::layout): Ditto.
1702 * khtml/rendering/render_table.h: Ditto.
1703 * khtml/xml/dom_docimpl.cpp:
1704 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
1705 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
1706 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
1707 (NodeImpl::attach): Remove call to obsolete close() function.
1708 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
1709 be treated as an atomic node for the purposes of editing.
1710 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
1712 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
1713 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
1714 prevent deleting PARAM tag portions of object tags erroneously.
1715 (NodeImpl::nextLeafNode): Ditto.
1716 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
1717 * khtml/xml/dom_position.cpp:
1718 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
1720 * khtml/xml/xml_tokenizer.cpp:
1721 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
1723 2004-08-03 David Hyatt <hyatt@apple.com>
1725 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
1730 * khtml/ecma/xmlhttprequest.cpp:
1731 (KJS::XMLHttpRequest::getValueProperty):
1732 * khtml/khtml_part.cpp:
1734 * khtml/misc/loader.cpp:
1735 (CachedXBLDocument::CachedXBLDocument):
1737 2004-08-03 Maciej Stachowiak <mjs@apple.com>
1741 - remove assertions that asserted text is non-empty, just avoid
1742 doing anything for the empty case; this is needed because input
1743 methods like to insert empty text in various cases.
1745 * khtml/editing/htmlediting_impl.cpp:
1746 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
1747 (khtml::InsertTextCommandImpl::doApply):
1748 (khtml::InsertTextCommandImpl::doUnapply):
1750 2004-08-03 Darin Adler <darin@apple.com>
1754 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
1756 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
1757 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
1759 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
1760 * kwq/DOMPrivate.h: Added.
1762 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
1764 2004-08-02 John Sullivan <sullivan@apple.com>
1768 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
1769 Tab key should cycle around toolbar and page content
1771 * kwq/WebCoreBridge.mm:
1772 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
1773 Made this method start looking from the current focus node. This won't
1774 affect any existing callers because there were no existing callers.
1775 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
1778 2004-08-02 David Hyatt <hyatt@apple.com>
1780 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
1782 Reviewed by kocienda
1786 2004-08-02 Ken Kocienda <kocienda@apple.com>
1792 <rdar://problem/3747945> Deleting replaced element can cause crash
1794 * khtml/xml/dom_selection.cpp:
1795 (DOM::Selection::layoutCaret): The crux of the problem is that
1796 the caret drawing code tries to draw the caret at the image
1797 offset after it has been removed from the document. So, make
1798 sure the start node for the selection is in the document before
1799 trying to lay out the caret using that node.
1801 2004-07-31 Ken Kocienda <kocienda@apple.com>
1805 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1806 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
1808 * kwq/KWQKHTMLPart.mm:
1809 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
1810 a good place to put the caret if focus is turning "on", the part is contentEditable,
1811 and it does not currently have a selection. This has the effect of flashing the caret
1812 in a contentEditable view automatically without requiring the programmer to set a
1813 selection explicitly. This also fixes the bug listed above. Both are cases where the
1814 bad behavior happened since the editing code tried to process input without an active
1815 selection. I always took the extra step of setting the selection explicitly when
1816 opening new windows in programs like Blot, but it seems silly to require developers to
1817 do this in general. With this patch, they no longer need to.
1819 2004-07-30 Ken Kocienda <kocienda@apple.com>
1825 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1827 * khtml/xml/dom_selection.cpp:
1828 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
1829 content. The validate() bottleneck function will do all it can to make sure that the start is
1830 moved to rendered content if at all possible before this function runs. If no rendered position can
1831 be found, like in the case of an empty body element, we still want to flash the caret there.
1832 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
1833 base before making this move, and set the selection to the enclosing block flow element of this
1834 original base if no rendered positions can be found. This has the effect of flashing the caret
1835 someplace in an editable block, even if it does not contain any rendered content.
1837 2004-07-30 Ken Kocienda <kocienda@apple.com>
1841 Fix a large number of editing layout test regressions.
1843 * khtml/misc/khtml_text_operations.cpp:
1844 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
1845 purposes of text iteration. The end offset is either child count of a node with children,
1846 or the maxOffset() of a node that does not.
1847 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
1848 conflicted with the usage of this function that is needed for editing.
1849 * khtml/xml/dom_nodeimpl.h: Ditto.
1851 2004-07-30 Trey Matteson <trey@apple.com>
1853 Next steps for spell checking: We have data structures for the marked pieces of
1854 text and the smarts to draw them (although at this point, they just get a green
1855 underline instead of using the real AppKit pattern.)
1857 Note we don't call this code outside of development, since at this point I suspect
1858 it could be made to crash by mixing spelling and editing.
1862 * khtml/rendering/render_text.cpp:
1863 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
1864 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
1865 * khtml/rendering/render_text.h:
1866 * khtml/xml/dom_docimpl.cpp:
1867 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
1868 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
1869 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
1871 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
1872 up previous markers as needed.
1873 (DocumentImpl::markersForNode): Return markers for a Node.
1874 * khtml/xml/dom_docimpl.h:
1875 (DOM::DocumentMarker::): New marker struct
1876 (DOM::DocumentMarker::operator == ):
1877 (DOM::DocumentMarker::operator != ):
1878 * kwq/KWQKHTMLPart.mm:
1879 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
1882 2004-07-29 Maciej Stachowiak <mjs@apple.com>
1886 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
1888 * khtml/html/htmlparser.cpp:
1889 (KHTMLParser::insertNode): When a caption appears in an illegal
1890 place in a table, pop blocks until we hit a place where it's
1895 2004-07-29 Darin Adler <darin@apple.com>
1899 - added constants for motion across entire document for use in operations like
1900 move to beginning of document
1902 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
1903 * khtml/xml/dom_selection.cpp:
1904 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
1905 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
1906 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
1907 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
1908 (DOM::Selection::validate): Changed if statements into switch statement,
1909 added case for DOCUMENT.
1911 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
1913 2004-07-28 Trey Matteson <trey@apple.com>
1915 Small refinement of last checkin. The text iterators now return reasonable values
1916 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
1920 * khtml/misc/khtml_text_operations.cpp:
1921 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
1923 (khtml::TextIterator::range): Implement when atEnd.
1924 (khtml::CharacterIterator::range): Don't massage result when atEnd.
1925 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
1926 longer need this special case.
1927 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
1928 TextIterator::range() always works.
1929 * khtml/xml/dom_nodeimpl.cpp:
1930 (NodeImpl::childNodeCount): Made const
1931 (NodeBaseImpl::maxOffset): Add missing implementation
1932 * khtml/xml/dom_nodeimpl.h:
1933 * kwq/KWQKHTMLPart.mm:
1934 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
1935 range on our iterator even when it is atEnd.
1937 2004-07-28 Maciej Stachowiak <mjs@apple.com>
1941 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
1943 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
1945 * khtml/ecma/kjs_window.cpp:
1947 (Window::locationbar):
1949 (Window::personalbar):
1950 (Window::statusbar):
1952 (Window::scrollbars):
1955 (SelectionFunc::tryCall):
1957 (BarInfo::~BarInfo):
1960 * khtml/ecma/kjs_window.h:
1963 (KJS::BarInfo::part):
1964 (KJS::BarInfo::classInfo):
1965 * khtml/ecma/kjs_window.lut.h:
1967 * kwq/KWQKHTMLPart.h:
1968 * kwq/KWQKHTMLPart.mm:
1969 (KWQKHTMLPart::locationbarVisible):
1970 (KWQKHTMLPart::menubarVisible):
1971 (KWQKHTMLPart::personalbarVisible):
1972 (KWQKHTMLPart::scrollbarsVisible):
1973 (KWQKHTMLPart::statusbarVisible):
1974 (KWQKHTMLPart::toolbarVisible):
1976 2004-07-28 Ken Kocienda <kocienda@apple.com>
1980 Added more layout tests.
1982 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
1983 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
1984 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
1985 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
1986 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
1987 * layout-tests/editing/style/style-3690704-fix.html: Added.
1988 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
1989 * layout-tests/editing/style/typing-style-001.html: Added.
1990 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
1991 * layout-tests/editing/style/typing-style-002.html: Added.
1993 2004-07-28 Ken Kocienda <kocienda@apple.com>
1997 Added some layout tests.
1999 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
2000 * layout-tests/editing/selection/select-all-001.html: Added.
2001 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
2002 * layout-tests/editing/selection/select-all-002.html: Added.
2003 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
2004 * layout-tests/editing/selection/select-all-003.html: Added.
2006 2004-07-28 Trey Matteson <trey@apple.com>
2008 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
2010 At this point, no special marking of misspellings, no grammar check, no context
2011 menu integration, no "check continually" mode.
2013 Much of the TextIterator and CharacterIterator interface got published outside
2014 of khtml_text_operations.cpp, with a little API rationalizing.
2018 * khtml/misc/khtml_text_operations.cpp:
2019 (khtml::TextIterator::range): Name changes.
2020 (khtml::CharacterIterator::CharacterIterator): Ditto.
2021 (khtml::CharacterIterator::range): Ditto.
2022 (khtml::CharacterIterator::advance): Ditto.
2023 (khtml::CharacterIterator::string): New method to consume chars into a string.
2024 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
2025 the text respecting word boundaries.
2026 (khtml::WordAwareIterator::advance):
2027 (khtml::WordAwareIterator::length):
2028 (khtml::WordAwareIterator::characters):
2029 (khtml::plainText): Name changes.
2030 (khtml::findPlainText): Ditto.
2032 API moved from cpp to header file.
2033 * khtml/misc/khtml_text_operations.h:
2034 (khtml::TextIterator::atEnd):
2035 (khtml::TextIterator::length):
2036 (khtml::TextIterator::characters):
2037 (khtml::CharacterIterator::atBreak):
2038 (khtml::CharacterIterator::atEnd):
2039 (khtml::CharacterIterator::length):
2040 (khtml::CharacterIterator::characters):
2041 (khtml::CharacterIterator::characterOffset):
2042 (khtml::WordAwareIterator::atEnd):
2043 (khtml::WordAwareIterator::range):
2045 * khtml/xml/dom_position.cpp:
2046 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
2047 match the current behavior of this code.
2048 (DOM::Position::nextWordBoundary): Ditto.
2049 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
2050 word advancement, this routine will have its own impl.
2051 (DOM::Position::nextWordPosition): Ditto.
2052 * khtml/xml/dom_position.h:
2053 * khtml/xml/dom_selection.h:
2054 (DOM::Selection::rangeStart): New convenience methods
2055 (DOM::Selection::rangeEnd):
2056 * kwq/KWQKHTMLPart.h:
2057 * kwq/KWQKHTMLPart.mm:
2058 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
2059 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
2060 * kwq/WebCoreBridge.h:
2061 * kwq/WebCoreBridge.mm:
2062 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
2064 2004-07-28 Ken Kocienda <kocienda@apple.com>
2070 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
2072 * khtml/editing/htmlediting_impl.cpp:
2073 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
2074 pass off to the function that applies styles. While this is meant to be conservative in
2075 order to leave the DOM well-formed in all cases, it contained an error where the set
2076 of nodes to be styled together erroneously could include a node that was meant for
2077 the next set. Fixed.
2078 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
2079 resolution qualifier. Unneeded here.
2081 2004-07-28 Darin Adler <darin@apple.com>
2085 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
2087 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
2088 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
2089 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
2090 that it does not consider a node an ancestor of itself.
2092 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
2093 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
2094 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
2095 any cases where the pointer might be 0.
2097 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
2098 new uses to all compile.
2100 2004-07-28 Ken Kocienda <kocienda@apple.com>
2106 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
2108 * khtml/css/css_valueimpl.cpp:
2109 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
2110 dealing with typing styles.
2111 * khtml/css/css_valueimpl.h:
2112 * khtml/editing/htmlediting_impl.cpp:
2113 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
2114 typing style based on the current selection. This is a convenient bottleneck for all
2115 the code that needs to worry about typing style.
2116 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
2117 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
2119 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
2120 figuring out where to insert style node. Not even sure what I was trying to do here, but
2121 it does not seem to be needed any more.
2122 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
2123 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
2124 * khtml/khtml_part.cpp:
2125 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
2126 in this function. The selection did not change simply by calling this function, but it
2128 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
2129 instead of clearing it unconditionally.
2130 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
2131 style being applied with any current typing style that already exists.
2133 2004-07-28 Darin Adler <darin@apple.com>
2137 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
2139 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
2140 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
2141 we decided that hard-coding the size of the borders of a text field was the best
2142 way for WebCore to handle this.
2144 2004-07-28 Darin Adler <darin@apple.com>
2148 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
2150 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
2151 Added a check for nil.
2153 2004-07-27 Darin Adler <darin@apple.com>
2157 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
2159 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
2160 "rgba" when alpha is 0xFF, not when alpha is 0.
2162 2004-07-27 Ken Kocienda <kocienda@apple.com>
2166 Fixed the problem where BR elements on lines by themselves don't paint when selected.
2168 * khtml/khtml_part.cpp:
2169 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
2170 * khtml/rendering/render_br.cpp:
2171 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
2172 * khtml/rendering/render_br.h:
2173 * khtml/rendering/render_text.cpp:
2174 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
2175 reuse function argument as a local). Also, improve the logic for determining whether to
2176 extend the selection to block boundaries.
2177 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
2178 extensions is now fully contained in paintSelection.
2179 * khtml/rendering/render_text.h:
2181 2004-07-27 David Hyatt <hyatt@apple.com>
2183 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
2185 Reviewed by kocienda
2187 * khtml/rendering/render_block.cpp:
2188 (khtml::RenderBlock::removeChild):
2190 2004-07-26 Chris Blumenberg <cblu@apple.com>
2192 Fixed: WebView scrolls to the top after making an editing change via drag & drop
2194 Fixed by Ken, reviewed by me.
2196 * kwq/WebCoreBridge.mm:
2197 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
2201 2004-07-26 Maciej Stachowiak <mjs@apple.com>
2205 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
2207 * khtml/html/htmltokenizer.cpp:
2208 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
2209 trick as for inline script execution.
2211 Added new layout tests covering this and other recent tokenizer
2214 * layout-tests/fast/tokenizer/001-expected.txt: Added.
2215 * layout-tests/fast/tokenizer/001.html: Added.
2216 * layout-tests/fast/tokenizer/002-expected.txt: Added.
2217 * layout-tests/fast/tokenizer/002.html: Added.
2218 * layout-tests/fast/tokenizer/003-expected.txt: Added.
2219 * layout-tests/fast/tokenizer/003.html: Added.
2220 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
2222 2004-07-23 Ken Kocienda <kocienda@apple.com>
2228 <rdar://problem/3738920> Caret blinks in inactive window
2230 As part of the fix, I cleaned up the way we handle special drawing that needs
2231 to be done in the HTML view that is first responder in the key window (e.g the
2232 drawing of text selection highlight and caret blinking).
2234 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
2235 is now done in setDisplaysWithFocusAttributes, described below.
2236 * khtml/khtml_part.h: Ditto.
2237 * khtml/khtmlpart_p.h:
2238 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
2239 the caret from blinking when an app is started from the command line and remains in the
2241 * khtml/khtmlview.cpp:
2242 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
2243 (KHTMLView::focusOutEvent): Ditto.
2244 * kwq/KWQKHTMLPart.h:
2245 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
2247 * kwq/KWQKHTMLPart.mm:
2248 (KWQKHTMLPart::KWQKHTMLPart):
2249 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
2250 to do the display updating in a clearer way....and now has comments!
2251 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
2252 setDisplaysWithFocusAttributes function (and did so less well).
2253 * kwq/WebCoreBridge.mm:
2254 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
2255 text selection background.
2256 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
2258 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
2259 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
2260 (-[WebCoreBridge setCaretVisible:]): Removed.
2262 2004-07-23 John Sullivan <sullivan@apple.com>
2266 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
2267 now also extends selection (even if there wasn't one before)
2269 * khtml/khtml_part.cpp:
2270 (KHTMLPart::handleMousePressEventSingleClick):
2271 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
2272 than ever. I did test this before, so my best guess is an accidental undo or
2273 something before committing.
2275 2004-07-23 David Hyatt <hyatt@apple.com>
2277 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
2278 should be the *first* line box and not the last.
2280 Reviewed by kocienda
2282 * khtml/rendering/render_flow.cpp:
2283 (RenderFlow::dirtyLinesFromChangedChild):
2285 2004-07-23 Ken Kocienda <kocienda@apple.com>
2289 * khtml/xml/dom_selection.cpp:
2290 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
2291 of how selection validation works. The idea is to let the selection validation process
2292 end up with an empty selection given real DOM position inputs if the validation code
2293 cannot find a rendered position. Since selection is all about display, this makes sense.
2294 Currently, the code will allow the selection to be placed in a location that is not
2295 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
2296 in a div that is set to display:none.
2298 2004-07-23 Ken Kocienda <kocienda@apple.com>
2302 Updated layout tests with new expected results.
2304 * layout-tests/editing/execCommand/boldSelection-expected.txt
2305 * layout-tests/editing/selection/extend-by-character-001-expected.txt
2306 * layout-tests/editing/selection/extend-by-character-003-expected.txt
2307 * layout-tests/editing/selection/unrendered-005-expected.txt
2309 2004-07-22 Maciej Stachowiak <mjs@apple.com>
2313 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
2314 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
2316 * khtml/rendering/render_frames.cpp:
2317 (RenderFrameSet::layout): When returning early because there are
2318 no children, make sure to mark self as no longer needing
2319 layout. Otherwise, when children are added, we'll fail to
2320 propagate childrenNeedLayout to our own parent! This is almost
2321 certainly a long-standing bug that was just masked by our old
2324 2004-07-22 Kevin Decker <kdecker@apple.com>
2328 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
2330 * khtml/ecma/kjs_events.cpp:
2331 (JSLazyEventListener::JSLazyEventListener):
2332 (JSLazyEventListener::parseCode):
2333 * khtml/ecma/kjs_events.h:
2334 * khtml/ecma/kjs_proxy.cpp:
2335 (KJSProxyImpl::createHTMLEventHandler):
2336 * khtml/ecma/kjs_window.cpp:
2337 (Window::getJSLazyEventListener):
2338 * khtml/ecma/kjs_window.h:
2340 2004-07-22 Ken Kocienda <kocienda@apple.com>
2346 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
2348 * khtml/editing/htmlediting_impl.cpp:
2349 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
2350 before calling removeStyle. This makes sure we remove all styles that could apply to the
2351 selection, and not just ones in from the start position of the selection passed to us.
2353 * khtml/xml/dom_selection.cpp:
2354 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
2355 smallest equivalent range of nodes, in effect making a "canonical" version of the
2356 selection. While this is not strictly necessary to fix the bug, it is a step I have been
2357 wanting to take this step for a long time, and some recent improvements made it
2358 possible for me to do now in just two lines of code.
2360 2004-07-22 Ken Kocienda <kocienda@apple.com>
2366 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
2368 * khtml/rendering/render_container.cpp:
2369 (RenderContainer::positionForCoordinates): Don't assume you can pass off
2370 the check to a first child if there is one, since the child can be an element
2371 we do not want to place the caret in, like a table row with no cells (the case
2372 in the bug above). So now, we iterate of the renderer's children looking for
2373 the closest one, but only consider those renderers which either have children
2374 themselves, or are render block flows or are render inlines.
2376 2004-07-22 Darin Adler <darin@apple.com>
2378 - remove a bunch of now-unused code
2380 * ForwardingHeaders/qxml.h: Removed.
2381 * kwq/KWQXmlAttributes.h: Removed.
2382 * kwq/KWQXmlAttributes.mm: Removed.
2383 * kwq/KWQXmlDefaultHandler.h: Removed.
2384 * kwq/KWQXmlDefaultHandler.mm: Removed.
2385 * kwq/KWQXmlSimpleReader.h: Removed.
2386 * kwq/KWQXmlSimpleReader.mm: Removed.
2388 2004-07-22 Darin Adler <darin@apple.com>
2392 - got rid of QXml classes and changed XML parsing to use libxml directly
2394 This is the first step toward more direct use of libxml and libxslt.
2395 Dave is planning to build on this to implement XSLT and to improve our handling
2396 of XML documents (faster and more feature complete, including DTDs).
2398 * khtml/html/html_elementimpl.cpp:
2399 (HTMLElementImpl::createContextualFragment):
2400 * khtml/html/htmltokenizer.cpp:
2401 (khtml::HTMLTokenizer::HTMLTokenizer):
2402 * khtml/html/htmltokenizer.h:
2403 * khtml/xml/dom_docimpl.cpp:
2404 (DocumentImpl::createTokenizer):
2405 (DocumentImpl::open):
2406 * khtml/xml/dom_docimpl.h:
2407 (DOM::DocumentImpl::tokenizer):
2408 * khtml/xml/dom_xmlimpl.cpp:
2409 (DOM::ProcessingInstructionImpl::checkStyleSheet):
2410 * khtml/xml/dom_xmlimpl.h:
2411 * khtml/xml/xml_tokenizer.h:
2412 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
2414 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
2416 2004-07-21 Trey Matteson <trey@apple.com>
2418 DHTML dragging should use UTI for MIME-pboard type conversion
2422 * kwq/KWQClipboard.mm:
2423 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
2424 MIME args following a semi-colon for text/plain.
2425 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
2426 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
2428 2004-07-21 Ken Kocienda <kocienda@apple.com>
2432 Remove handling of HTML editing key events from WebCore.
2433 This now happens in WebKit if an event passes all the
2434 way through WebCore without being handled by the DOM.
2436 In each case below, function were removed, as their
2437 only purpose was to handle editing key events.
2439 * khtml/xml/dom_elementimpl.cpp
2440 * khtml/xml/dom_elementimpl.h
2441 * kwq/KWQKHTMLPart.h
2442 * kwq/KWQKHTMLPart.mm
2443 * kwq/WebCoreBridge.h
2445 2004-07-21 Ken Kocienda <kocienda@apple.com>
2449 * khtml/xml/dom_selection.cpp:
2450 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
2451 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
2453 (DOM::Selection::modifyMovingRightForward): Ditto
2454 (DOM::Selection::modifyExtendingLeftBackward): Ditto
2455 (DOM::Selection::modifyMovingLeftBackward): Ditto
2456 * khtml/xml/dom_selection.h:
2457 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
2458 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
2459 behavior which AppKit binds to cmd+left/right arrow keys.
2460 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
2462 2004-07-20 David Hyatt <hyatt@apple.com>
2464 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
2468 * khtml/css/cssstyleselector.cpp:
2469 (khtml::CSSStyleSelector::CSSStyleSelector):
2471 2004-07-20 Ken Kocienda <kocienda@apple.com>
2475 * khtml/xml/dom_elementimpl.cpp:
2476 (ElementImpl::defaultEventHandler): No longer check whether
2477 the command key is modifying the key event. This check is
2478 now done elsewhere in the code. See the WebKit checkin that
2479 added the _web_keyBindingManagerHasBinding method to
2482 2004-07-20 Chris Blumenberg <cblu@apple.com>
2485 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
2486 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
2490 * kwq/WebCoreBridge.mm:
2491 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
2493 2004-07-20 David Hyatt <hyatt@apple.com>
2495 Fix for alt text not working on images.
2499 * khtml/rendering/render_image.cpp:
2500 (RenderImage::RenderImage):
2501 (RenderImage::setPixmap):
2502 (RenderImage::paint):
2503 (RenderImage::calcReplacedWidth):
2504 (RenderImage::calcReplacedHeight):
2506 2004-07-20 Maciej Stachowiak <mjs@apple.com>
2510 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
2512 * khtml/html/htmltokenizer.cpp:
2513 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
2514 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
2515 active prependingSrc variable on the stack, the better to handle weird cases
2516 of scripts writing out additional script tags and so forth.
2517 (khtml::HTMLTokenizer::write): Deal with the above.
2518 * khtml/html/htmltokenizer.h: Declare new member field.
2520 2004-07-20 David Hyatt <hyatt@apple.com>
2522 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
2527 * khtml/rendering/render_layer.cpp:
2528 (RenderLayer::updateLayerPosition):
2530 2004-07-20 Trey Matteson <trey@apple.com>
2532 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
2534 A subtle problem stemming from some interaction between focus handing and
2535 event propagation. We previously made it so when a focus shift fails we
2536 don't propagate the event to KHTML. The fix is to get rid of the inverse
2537 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
2538 the page already canceled default behavior.
2540 In this specific case, the page is cancelling default behavior since it
2541 does its own dragging, and the bug was our new system dragging was
2546 * khtml/khtmlview.cpp:
2547 (KHTMLView::dispatchMouseEvent): What he said.
2549 2004-07-20 Ken Kocienda <kocienda@apple.com>
2555 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
2557 * kwq/WebCoreBridge.mm:
2558 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
2559 line endings into BR elements.
2561 2004-07-20 Ken Kocienda <kocienda@apple.com>
2567 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
2569 * khtml/khtml_part.cpp:
2570 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
2571 on the caret, this seems like a better name.
2572 * khtml/khtml_part.h:
2573 * khtml/khtmlview.cpp:
2574 (KHTMLView::focusInEvent): Call setCaretVisible(true)
2575 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
2576 * kwq/KWQKHTMLPart.mm:
2577 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
2578 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
2579 * kwq/WebCoreBridge.mm:
2580 (-[WebCoreBridge setCaretVisible:]): Ditto.
2582 2004-07-19 Maciej Stachowiak <mjs@apple.com>
2586 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
2588 * khtml/misc/stringit.h:
2589 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
2590 stableUnicode() method to get the unicode pointer.
2593 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
2594 It does not leave around a zombie internal data handle but rather destroys it right away,
2595 and leaves the object pointing to the new handle (which it can then deref). This makes
2596 the code more clear.
2597 (QString::~QString): Simplify.
2598 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
2599 is internal to a string besides this one. This guarantees that if you get the unicode()
2600 pointer, it won't go bad so long as this string is still alive.
2602 2004-07-19 David Hyatt <hyatt@apple.com>
2604 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
2605 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
2606 make node removal more efficient.
2608 Reviewed by kocienda
2610 * khtml/xml/dom_nodeimpl.cpp:
2612 2004-07-19 John Sullivan <sullivan@apple.com>
2616 - fixed <rdar://problem/3141150> can't undo in form textarea fields
2618 * kwq/KWQTextArea.mm:
2619 (-[KWQTextArea _createTextView]):
2620 call setAllowsUndo:YES. My, wasn't this easy?
2622 2004-07-19 David Hyatt <hyatt@apple.com>
2624 Merge @import fix for CSS1 test suite from Stephan Kulow.
2628 * khtml/css/parser.cpp:
2629 * khtml/css/parser.y:
2630 * layout-tests/css1/basic/containment-expected.txt:
2632 2004-07-19 David Hyatt <hyatt@apple.com>
2634 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
2636 Reviewed by kocienda
2638 * khtml/rendering/render_flow.cpp:
2639 (RenderFlow::detach):
2640 (RenderFlow::dirtyLinesFromChangedChild):
2641 * khtml/rendering/render_flow.h:
2642 * khtml/rendering/render_object.cpp:
2643 (RenderObject::dirtyLinesFromChangedChild):
2644 * khtml/rendering/render_object.h:
2646 2004-07-16 David Hyatt <hyatt@apple.com>
2648 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
2649 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
2654 * khtml/khtmlview.cpp:
2655 (KHTMLView::layout):
2657 2004-07-16 Ken Kocienda <kocienda@apple.com>
2663 <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
2665 * khtml/editing/htmlediting_impl.cpp:
2666 (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
2667 more robust. I do not understand how Grant ended up with null start or end
2668 blocks in the case of his bug report, but by adding two null checks, the code is
2669 now hardened a bit in case it happens again.
2671 2004-07-16 Ken Kocienda <kocienda@apple.com>
2677 <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
2678 <rdar://problem/3730790> Caret does not blink when placed in empty table cell
2680 * khtml/rendering/render_block.cpp:
2681 (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
2682 don't block the painting of the caret in this case. This was the case in 3730790.
2683 We had the right geometry for the caret but blocked its painting.
2684 * khtml/xml/dom_position.cpp:
2685 (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
2686 that the new position we would navigate to had a line box, but empty table cells, for
2687 instance will not. So, deal with this situation as well. The end result is a
2688 function that worked like it did before in cases where the previous line position has
2689 a line box, but now also will allow navigation to work when it does not.
2690 (DOM::Position::nextLinePosition): Ditto.
2692 2004-07-16 Ken Kocienda <kocienda@apple.com>
2698 <rdar://problem/3687216> editable inline causes crash when focused
2700 * khtml/xml/dom_docimpl.cpp:
2701 (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
2702 (DocumentImpl::acceptsEditingFocus): Ditto.
2704 2004-07-16 David Hyatt <hyatt@apple.com>
2706 Fix for 3709337, crash when using display: compact. Need to make sure that the isCompact() check in bidi.cpp is
2707 also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
2709 Reviewed by kocienda
2711 * khtml/rendering/bidi.cpp:
2712 (khtml::RenderBlock::layoutInlineChildren):
2716 2004-07-15 David Hyatt <hyatt@apple.com>
2718 Fix for 3625611, images offset on first visit to page. The method for determining the last clean line was
2719 flawed and would incorrectly miss dirty lines that occurred after the first clean line.
2723 * khtml/rendering/bidi.cpp:
2724 (khtml::RenderBlock::determineEndPosition):
2726 2004-07-15 Ken Kocienda <kocienda@apple.com>
2731 <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
2733 * khtml/editing/htmlediting_impl.cpp:
2734 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
2735 that nodes are text nodes during the walk of eligible nodes that could possibly be
2736 deleted. Change the assertion to an conditional check for text nodes. We may have
2737 unrendered nodes in the mix here (as is the case in the bug where the assertion
2738 failed on an AREA element), and the conditional check is sufficient to
2739 skip them while leaving the delete logic we want unperturbed.
2741 2004-07-14 Ken Kocienda <kocienda@apple.com>
2745 * khtml/rendering/render_block.cpp:
2746 (khtml::RenderBlock::paintObject): Add null check on DOM node before
2747 asking if it is contentEditable.
2749 2004-07-14 David Hyatt <hyatt@apple.com>
2751 Fix for 3595073, setting innerHTML on a <table> should work.
2755 * khtml/html/html_elementimpl.cpp:
2756 (HTMLElementImpl::createContextualFragment):
2758 2004-07-14 Ken Kocienda <kocienda@apple.com>
2762 Updated these layout tests as a result of the last patch.
2763 These results are better.
2765 * layout-tests/editing/execCommand/selectAll-expected.txt
2766 * layout-tests/editing/selection/extend-by-character-006-expected.txt
2767 * layout-tests/editing/selection/unrendered-001-expected.txt
2768 * layout-tests/editing/selection/unrendered-003-expected.txt
2770 2004-07-14 Ken Kocienda <kocienda@apple.com>
2774 * khtml/rendering/render_block.cpp:
2775 (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
2776 Since the policy is now to move the selection to rendered content, if possible,
2777 when the selection is set, there is no longer any reason to have the additional
2778 caretPosition() function to store where the caret should be drawn.
2779 * khtml/xml/dom_docimpl.cpp:
2780 (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
2781 This is done in Selection::validate.
2782 * khtml/xml/dom_position.cpp:
2783 (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
2784 * khtml/xml/dom_selection.cpp:
2785 (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
2786 (DOM::Selection::init): Ditto.
2787 (DOM::Selection::modifyExtendingRightForward): No longer any need to call
2788 closestRenderedPosition here. This is done in Selection::validate.
2789 (DOM::Selection::modifyMovingRightForward): Ditto.
2790 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2791 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2792 (DOM::Selection::layoutCaret): Ditto.
2793 (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
2794 * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.
2796 2004-07-14 David Hyatt <hyatt@apple.com>
2798 Fix for 3716082, assert when you dynamically remove float or position styles.
2802 * khtml/rendering/render_object.cpp:
2803 (RenderObject::setStyle):
2805 2004-07-14 David Hyatt <hyatt@apple.com>
2807 Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
2810 Reviewed by kocienda
2812 * khtml/rendering/render_box.cpp:
2813 (RenderBox::calcPercentageHeight):
2814 (RenderBox::availableHeightUsing):
2815 * khtml/rendering/render_table.cpp:
2816 (RenderTable::layout):
2817 (RenderTableSection::calcRowHeight):
2818 (RenderTableSection::layoutRows):
2819 (RenderTableCell::updateFromElement):
2820 * khtml/rendering/render_table.h:
2822 2004-07-14 Ken Kocienda <kocienda@apple.com>
2826 * khtml/xml/dom_position.cpp:
2827 (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
2828 Soon, I plan to land some changes that use this new function.
2829 * khtml/xml/dom_position.h:
2831 2004-07-14 Ken Kocienda <kocienda@apple.com>
2835 * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
2836 data formatting change that is to come.
2837 * WebCore-tests.exp:
2839 2004-07-13 John Sullivan <sullivan@apple.com>
2843 - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an
2844 HTML page puts a trailing space on Find pasteboard
2846 * khtml/misc/khtml_text_operations.cpp:
2847 (khtml::TextIterator::handleTextBox):
2848 In the case where a subrun doesn't extend to the end of the text box,
2849 the well-commented code was supposed to return from this routine, but
2850 the wrong variable was being compared. This would send us through another
2851 pass of the loop, which would end up worrying about collapsed space at the
2852 end of the current box, even though we only cared about the beginning of the
2855 2004-07-12 Richard Williamson <rjw@apple.com>
2857 Fixed 3717982. Implemented navigator.language!
2861 * khtml/ecma/kjs_navigator.cpp:
2862 (Navigator::getValueProperty):
2864 2004-07-12 Ken Kocienda <kocienda@apple.com>
2868 * khtml/xml/dom_position.cpp:
2869 (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This
2870 function is now used in selection drawing, and it was making an unneeded check to see
2871 that content was editable to answer whether or not is was rendered. Bad. Fixed.
2873 2004-07-12 David Hyatt <hyatt@apple.com>
2875 Fix for 3621138, crash on hrweb.apple.com. Make sure that in the case where objects get pulled up from merging
2876 blocks that we just delete all line boxes.
2878 Reviewed by kocienda
2880 * khtml/rendering/render_block.cpp:
2881 (khtml::RenderBlock::removeChild):
2883 2004-07-10 Maciej Stachowiak <mjs@apple.com>
2887 <rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
2888 <rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
2891 * kwq/KWQPainter.mm:
2892 (CGColorFromNSColor):
2893 (QPainter::drawEllipse):
2894 (QPainter::setShadow):
2896 2004-07-12 Ken Kocienda <kocienda@apple.com>
2900 Added new editing-related layout tests
2902 * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
2903 * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
2904 * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
2905 * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
2906 * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
2907 * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
2908 * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
2909 * layout-tests/editing/selection/unrendered-001.html: Added.
2910 * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
2911 * layout-tests/editing/selection/unrendered-002.html: Added.
2912 * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
2913 * layout-tests/editing/selection/unrendered-003.html: Added.
2914 * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
2915 * layout-tests/editing/selection/unrendered-004.html: Added.
2916 * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
2917 * layout-tests/editing/selection/unrendered-005.html: Added.
2918 * layout-tests/traversal/node-iterator-008-expected.txt: Added.
2919 * layout-tests/traversal/node-iterator-008.html: Added.
2920 * layout-tests/traversal/tree-walker-005-expected.txt: Added.
2921 * layout-tests/traversal/tree-walker-005.html: Added.
2923 2004-07-12 Ken Kocienda <kocienda@apple.com>
2927 Fixes for these bugs:
2929 <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
2930 <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
2932 * khtml/editing/htmlediting_impl.cpp:
2933 (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
2934 only in the special case. It was throwing its net too widely, catching the case described in 3724626.
2935 By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
2937 * khtml/xml/dom_docimpl.cpp:
2938 (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
2939 to figure out the start and end positions for selection drawing.
2940 * khtml/xml/dom_position.cpp:
2941 (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
2942 (DOM::Position::equivalentDownstreamPosition): Ditto.
2943 (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
2944 (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
2946 (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
2947 * khtml/xml/dom_selection.cpp:
2948 (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
2949 The equivalence case is new, and fixes 3723359.
2951 2004-07-09 Kevin Decker <kdecker@apple.com>
2955 fixes the width:auto problem in
2956 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
2958 * khtml/css/cssstyleselector.cpp:
2959 (khtml::CSSStyleSelector::applyProperty):
2961 2004-07-09 Ken Kocienda <kocienda@apple.com>
2965 Updated some layout test results.
2967 * layout-tests/editing/deleting/delete-image-004-expected.txt:
2968 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
2970 2004-07-09 Chris Blumenberg <cblu@apple.com>
2972 Allowed my change for 3715785 to compile on Jaguar.
2974 Reviewed by kocienda.
2976 * kwq/WebCoreBridge.h:
2977 * kwq/WebCoreBridge.mm:
2978 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
2980 2004-07-09 Ken Kocienda <kocienda@apple.com>
2984 Some improvements to fix:
2986 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
2988 * khtml/editing/htmlediting_impl.cpp:
2989 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
2990 selected position is not rendered.
2991 * khtml/rendering/render_block.cpp:
2992 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
2993 figure out whether to paint.
2994 * khtml/xml/dom_position.cpp:
2995 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
2996 position that is not rendered.
2997 (DOM::Position::nextCharacterPosition): Ditto.
2998 (DOM::Position::closestRenderedPosition): New helper.
2999 * khtml/xml/dom_position.h:
3000 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
3001 * khtml/xml/dom_selection.cpp:
3002 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
3003 after a caret layout. This may be different from start or end if start and end are not rendered.
3004 (DOM::Selection::init):
3005 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
3006 (DOM::Selection::modifyMovingRightForward): Ditto.
3007 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3008 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3009 (DOM::Selection::modify): Use new helpers to make this more readble.
3010 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
3012 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
3013 * khtml/xml/dom_selection.h:
3014 (DOM::Selection::caretPosition): New accessor.
3015 * kwq/WebCoreBridge.mm:
3016 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
3018 2004-07-08 David Hyatt <hyatt@apple.com>
3020 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
3021 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
3022 that might otherwise be out of date.
3024 Reviewed by kocienda
3026 * khtml/html/html_elementimpl.cpp:
3027 (HTMLElementImpl::innerText):
3029 2004-07-08 John Sullivan <sullivan@apple.com>
3033 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
3034 now also extends selection (even if there wasn't one before)
3036 * khtml/khtml_part.cpp:
3037 (KHTMLPart::handleMousePressEventSingleClick):
3038 if there's a URL associated with the event, don't extend the selection
3040 2004-07-08 Ken Kocienda <kocienda@apple.com>
3044 Added some helper functions which provide strings to display in the
3045 Xcode debugger's variable inspector window. These functions are called
3046 from the LabyrinthDataFormatter debugger plugin I just checked in to
3047 the Labyrinth/Tools directory.
3049 Note that these functions are compiled in on Development builds only.
3051 * WebCore-combined.exp:
3052 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
3053 debugger program can link with them.
3054 * khtml/xml/dom2_rangeimpl.cpp:
3055 (DOM::RangeImpl::formatForDebugger):
3056 * khtml/xml/dom2_rangeimpl.h:
3057 * khtml/xml/dom_elementimpl.cpp:
3058 (ElementImpl::formatForDebugger):
3059 * khtml/xml/dom_elementimpl.h:
3060 * khtml/xml/dom_nodeimpl.cpp:
3061 * khtml/xml/dom_nodeimpl.h:
3062 * khtml/xml/dom_position.cpp:
3063 (DOM::Position::formatForDebugger):
3064 * khtml/xml/dom_position.h:
3065 * khtml/xml/dom_selection.cpp:
3066 (DOM::Selection::formatForDebugger):
3067 * khtml/xml/dom_selection.h:
3068 * khtml/xml/dom_textimpl.cpp:
3069 (TextImpl::formatForDebugger):
3070 * khtml/xml/dom_textimpl.h:
3072 2004-07-08 John Sullivan <sullivan@apple.com>
3076 - fixed <rdar://problem/3721544> crash increasing font size;
3077 entrezeroetun.com (works in IE and Firefox)
3079 * khtml/rendering/render_block.cpp:
3080 (khtml::RenderBlock::updateFirstLetter):
3081 Check for nil originalString() before dereffing
3083 2004-07-08 David Hyatt <hyatt@apple.com>
3085 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
3089 * khtml/css/cssstyleselector.cpp:
3093 2004-07-07 David Hyatt <hyatt@apple.com>
3095 Fix for 3712133, crash from first-line pseudo-style use.
3097 Reviewed by kocienda
3099 * khtml/css/cssstyleselector.cpp:
3100 (khtml::CSSStyleSelector::styleForElement):
3101 * khtml/css/cssstyleselector.h:
3102 * khtml/rendering/render_object.cpp:
3103 (RenderObject::getPseudoStyle):
3105 2004-07-07 Ken Kocienda <kocienda@apple.com>
3111 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
3113 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
3114 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
3115 do their action in some code a way different than other commands. This type of command
3116 application is different than for all other commands since TypingCommands can be coalesced.
3117 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
3118 consequence of causing editing delegate notifications to be sent before the command
3119 has actually run. This change takes a small step towards making TypingCommandImpl function like
3120 other commands, where the command work is done in doApply. This makes the notification
3121 happen in the right order.
3123 * khtml/editing/htmlediting.cpp:
3124 (khtml::TypingCommand::TypingCommand):
3125 (khtml::TypingCommand::insertText):
3126 (khtml::TypingCommand::insertNewline):
3127 (khtml::TypingCommand::deleteKeyPressed):
3128 * khtml/editing/htmlediting.h:
3129 (khtml::TypingCommand::):
3130 * khtml/editing/htmlediting_impl.cpp:
3131 (khtml::TypingCommandImpl::TypingCommandImpl):
3132 (khtml::TypingCommandImpl::doApply):
3133 * khtml/editing/htmlediting_impl.h:
3135 2004-07-06 Ken Kocienda <kocienda@apple.com>
3139 * khtml/html/html_tableimpl.cpp:
3140 (HTMLTableElementImpl::addChild): Added a better comment in the
3141 code I just checked in a few minutes ago.
3143 2004-07-06 Ken Kocienda <kocienda@apple.com>
3149 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
3150 due to non-0 exception code trying to insert a DIV markup string
3152 The solution was to revert to the code that was rolled out, and removing
3153 the child checks from NodeImpl::checkAddChild. However, this time, I added
3154 code very similar to this check into the code that runs while HTML is
3155 being parsed to build up tables. This code relies on child-add failure
3156 to ensure the proper construction of well-formed tables (as gross as that
3157 sounds), so the check needs to be retained there. No other code seems to
3158 be so affected. Layout tests are unchanged by this patch.
3160 * khtml/html/html_tableimpl.cpp:
3161 (HTMLTableElementImpl::addChild):
3162 * khtml/xml/dom_nodeimpl.cpp:
3163 (NodeImpl::checkAddChild):
3165 2004-07-06 Ken Kocienda <kocienda@apple.com>
3169 Simple change. I switched the arguments of the appendNode helper function
3170 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
3171 insert now comes before the parent node in the argument list. I did this
3172 to make this function match the convention of others in the HTML editing code.
3173 This was the only one that was "different" in the way that it ordered arguments.
3174 As a result, I was always looking to see that I was passing things in the right
3177 * khtml/editing/htmlediting.cpp:
3178 (khtml::AppendNodeCommand::AppendNodeCommand):
3179 (khtml::AppendNodeCommand::appendChild):
3180 (khtml::AppendNodeCommand::parentNode):
3181 * khtml/editing/htmlediting.h:
3182 * khtml/editing/htmlediting_impl.cpp:
3183 (khtml::CompositeEditCommandImpl::insertNodeAfter):
3184 (khtml::CompositeEditCommandImpl::insertNodeAt):
3185 (khtml::CompositeEditCommandImpl::appendNode):
3186 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
3187 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
3188 (khtml::AppendNodeCommandImpl::doApply):
3189 (khtml::AppendNodeCommandImpl::doUnapply):
3190 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
3191 (khtml::DeleteSelectionCommandImpl::doApply):
3192 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
3193 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
3194 (khtml::InputTextCommandImpl::prepareForTextInsertion):
3195 * khtml/editing/htmlediting_impl.h:
3196 (khtml::AppendNodeCommandImpl::parentNode):
3198 2004-07-06 Ken Kocienda <kocienda@apple.com>
3202 Fixed several problems with traversal classes. For one, NodeIterators treat
3203 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
3204 flat collection of nodes free of hierarchy. The code before this change did
3205 not do this correctly. It sure pays to go back and read the specs. :)
3207 Also, the code to traverse from node to node when filters were applied was
3208 not working correctly. My first attemmpt to implement this was just plain
3209 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
3210 settled on an implementation which is much simpler and worked for all the
3211 tests I threw at it.
3213 * khtml/xml/dom2_traversalimpl.cpp:
3214 (DOM::NodeIteratorImpl::findNextNode):
3215 (DOM::NodeIteratorImpl::nextNode):
3216 (DOM::NodeIteratorImpl::findPreviousNode):
3217 (DOM::NodeIteratorImpl::previousNode):
3218 (DOM::TreeWalkerImpl::parentNode):
3219 (DOM::TreeWalkerImpl::firstChild):
3220 (DOM::TreeWalkerImpl::lastChild):
3221 (DOM::TreeWalkerImpl::previousSibling):
3222 (DOM::TreeWalkerImpl::nextSibling):
3223 (DOM::TreeWalkerImpl::previousNode):
3224 (DOM::TreeWalkerImpl::nextNode):
3225 (DOM::TreeWalkerImpl::ancestorRejected):
3226 * khtml/xml/dom2_traversalimpl.h:
3228 2004-07-06 Vicki Murley <vicki@apple.com>
3230 Reviewed by kocienda.
3232 - added backColorCommand, foreColorCommand, fontNameCommand,
3235 * layout-tests/editing/editing.js:
3237 2004-07-06 Trey Matteson <trey@apple.com>
3239 3716053 - www.theage.com.au has extra back/forward items due to ads
3241 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
3242 addition to the b/f list not just during an onload event, but during any non-user
3243 gesture, which includes top level script executing.
3245 Reviewed by Richard.
3247 * kwq/KWQKHTMLPart.mm:
3248 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
3250 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
3251 (KWQKHTMLPart::submitForm): Ditto
3252 (KWQKHTMLPart::urlSelected): Ditto
3253 * kwq/KWQKHTMLPartBrowserExtension.mm:
3254 (KHTMLPartBrowserExtension::createNewWindow): Ditto
3255 * kwq/WebCoreBridge.h:
3257 2004-07-02 Darin Adler <darin@apple.com>
3261 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
3263 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
3264 are done with the header.
3266 2004-06-30 Trey Matteson <trey@apple.com>
3268 Dragging within a web view should be allowed to start when the window isn't key.
3270 A few months ago, Chris made this work, but it relied on the fact that all dragging
3271 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
3272 have a new scheme that gets it working again that properly involves WebCore.
3274 The general idea is that when AK asks us whether to accept the first mouse and do
3275 "delayed window ordering", we must consult WC to see if we might start a drag. In
3276 addition, instead of these drags in non-active windows being started as a special
3277 case in WK, they go through the normal WK-WC drag machinery.
3281 * khtml/khtml_part.cpp:
3282 (KHTMLPart::shouldDragAutoNode): New x,y args.
3283 * khtml/khtml_part.h:
3284 * khtml/rendering/render_object.cpp:
3285 (RenderObject::draggableNode): Pass through new x,y args.
3286 * khtml/rendering/render_object.h:
3287 * kwq/KWQKHTMLPart.h:
3288 (KWQKHTMLPart::setActivationEventNumber): New setter.
3289 * kwq/KWQKHTMLPart.mm:
3290 (KWQKHTMLPart::KWQKHTMLPart): Init new ivar.
3291 (KWQKHTMLPart::eventMayStartDrag): New routine that checks if we might start
3292 a drag in response to a mouseDown.
3293 (KWQKHTMLPart::khtmlMouseMoveEvent): Pass x,y to the routine that finds a draggable
3294 node. This eventually gets back up to WK's _mayStartDragAtEventLocation:.
3295 Delay requirement when dragging the selection now implemented here.
3296 (KWQKHTMLPart::khtmlMouseReleaseEvent): Must avoid changing the selection if we
3297 wind up here as part of the first click in a window (because we started handling
3298 the click to possible start a drag, but that never came through).
3299 (KWQKHTMLPart::mouseDown): Save away event timestamp.
3300 (KWQKHTMLPart::shouldDragAutoNode): Pass location up to WK instead of the
3301 most recent event we stashed.
3302 * kwq/WebCoreBridge.h:
3303 * kwq/WebCoreBridge.mm:
3304 (-[WebCoreBridge setActivationEventNumber:]): Trivial glue.
3305 (-[WebCoreBridge eventMayStartDrag:]): Ditto.
3307 2004-06-29 Trey Matteson <trey@apple.com>
3309 Need to tighten up JS error checking for requesting drag props
3314 * khtml/ecma/kjs_events.cpp:
3315 (Clipboard::getValueProperty): Assert if someone somehow set
3316 dropEffect or effectAllowed and it's a copy/paste clipboard
3317 instead of a dragging clipboard.
3318 (Clipboard::putValue): Don't let anyone set dropEffect or
3319 effectAllowed on a copy/paste clipboard.
3320 (ClipboardProtoFunc::tryCall): Disallow setting dragImage on
3321 a copy/paste clipboard.
3323 2004-06-29 Trey Matteson <trey@apple.com>
3325 DHTML dragging - source should have access to the operation chosen
3330 * kwq/KWQKHTMLPart.h:
3331 * kwq/KWQKHTMLPart.mm:
3332 (KWQKHTMLPart::dragSourceEndedAt): Set the destination's operation
3334 * kwq/WebCoreBridge.mm:
3335 (-[WebCoreBridge dragExitedWithDraggingInfo:]): For completeness
3336 we set the source op for the ondragexit event.
3337 (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto for the
3339 (-[WebCoreBridge dragSourceEndedAt:operation:]): Pass through of operation.
3341 2004-06-24 Trey Matteson <trey@apple.com>
3343 3710422 - REGRESSION: Safari crashes trying to send onbeforecut event at about://blank
3345 Simple fix - don't try to send the event to the body element if we have no body element.
3349 * kwq/KWQKHTMLPart.mm:
3350 (KWQKHTMLPart::dispatchCPPEvent):
3352 2004-06-24 Trey Matteson <trey@apple.com>
3354 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript
3356 When we generate a drag image (or a selection image too, for that matter) we
3357 translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern
3358 phase based on the CTM of the focused view, which doesn't include our translate.