1 2004-08-27 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website
7 Because we will stop parsing when there is a pending redirection,
8 avoid setting one if no navigation would actually take place
9 because the number of steps is out of range.
11 * khtml/khtml_part.cpp:
12 (KHTMLPart::scheduleHistoryNavigation):
14 * kwq/KWQKHTMLPart.mm:
15 (KWQKHTMLPart::canGoBackOrForward):
16 * kwq/KWQKPartsBrowserInterface.h:
17 * kwq/WebCoreBridge.h:
19 2004-08-27 Maciej Stachowiak <mjs@apple.com>
23 - fixed <rdar://problem/3778043> REGRESSION: innerHTML is broken, breaks automated iBench testing
24 - also fixed outerHTML, which would spill over past the node for whch it was supposed to get HTML
26 * khtml/html/html_elementimpl.cpp:
27 (HTMLElementImpl::outerHTML):
28 * khtml/xml/dom2_rangeimpl.cpp:
29 (DOM::RangeImpl::toHTML):
30 * khtml/xml/dom_nodeimpl.cpp:
32 (NodeImpl::recursive_toString):
33 (NodeImpl::recursive_toHTML):
34 * khtml/xml/dom_nodeimpl.h:
35 * kwq/WebCoreBridge.mm:
36 (-[WebCoreBridge markupStringFromNode:nodes:]):
38 - added new layout tests to cover the problems I fixed
40 * layout-tests/fast/innerHTML/001-expected.txt: Added.
41 * layout-tests/fast/innerHTML/001.html: Added.
42 * layout-tests/fast/innerHTML/002-expected.txt: Added.
43 * layout-tests/fast/innerHTML/002.html: Added.
44 * layout-tests/fast/innerHTML/003-expected.txt: Added.
45 * layout-tests/fast/innerHTML/003.html: Added.
47 2004-08-27 David Hyatt <hyatt@apple.com>
49 Fix for 3739239, getComputedStyle of top not being implemented broke a site that checked for it.
53 * khtml/css/css_computedstyle.cpp:
54 (DOM::valueForLength):
55 (DOM::CSSComputedStyleDeclarationImpl::getPositionOffsetValue):
56 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
57 * khtml/css/css_computedstyle.h:
59 2004-08-27 John Sullivan <sullivan@apple.com>
63 Tweaked option-tab handling to match good suggestion from Tim Omernick of OmniWeb
66 removed override of textDidChange:
67 (-[KWQTextAreaTextView keyDown:]):
68 moved option-tab handling that was in textDidChange to here. Rearranged existing code
71 2004-08-27 Adele Amchan <adele@apple.com>
76 <rdar://problem/3689949> Provide contentWindow access on an iframe
78 * khtml/ecma/kjs_html.cpp:
79 (KJS::HTMLElement::getValueProperty): added cases for contentWindow for frames and iframes
80 * khtml/ecma/kjs_html.h: added contentWindow to the list of properties for frames and iframes
81 * khtml/ecma/kjs_html.lut.h: regenerated file
82 * khtml/html/html_baseimpl.cpp:
83 (HTMLFrameElementImpl::contentPart): factored out old contentDocument code to return KHTMLPart for frame
84 (HTMLFrameElementImpl::contentDocument): now just gets the contentDocument from contentPart
85 * khtml/html/html_baseimpl.h: added declaration for contentPart
89 2004-08-27 Ken Kocienda <kocienda@apple.com>
95 <rdar://problem/3778059> Odd behaviour when editing between blockquote elements
97 * khtml/editing/htmlediting_impl.cpp:
98 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): This function should not move
99 the selection out of the current block, ever. This is exactly what the bug reported.
100 What was I thinking? Now, the code looks at the passed-in position and then the equivalent
101 upstream and downstream positions to see if the selection can be placed there after the
102 delete, and settles on the block containing the passed-in position as a fallback.
103 * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
104 * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
106 2004-08-26 Richard Williamson <rjw@apple.com>
108 Boiler plate for canvas gradients and patterns.
112 * khtml/ecma/kjs_html.cpp:
113 (KJS::Context2DFunction::tryCall):
115 (Context2D::~Context2D):
116 (KJS::GradientFunction::tryCall):
117 (Gradient::Gradient):
119 (Gradient::getValueProperty):
121 (Gradient::putValue):
122 (Gradient::~Gradient):
123 (ImagePattern::ImagePattern):
124 (ImagePattern::tryGet):
125 (ImagePattern::getValueProperty):
126 (ImagePattern::tryPut):
127 (ImagePattern::putValue):
128 (ImagePattern::~ImagePattern):
129 * khtml/ecma/kjs_html.h:
130 (KJS::Gradient::toBoolean):
131 (KJS::Gradient::classInfo):
133 (KJS::ImagePattern::toBoolean):
134 (KJS::ImagePattern::classInfo):
135 (KJS::ImagePattern::):
136 * khtml/ecma/kjs_html.lut.h:
139 2004-08-26 Ken Kocienda <kocienda@apple.com>
145 <rdar://problem/3777899> REGRESSION (Mail): only first of several misspelled words separated by
146 carriage returns is marked
148 * khtml/editing/htmlediting_impl.cpp:
149 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Give the spellchecker a slightly larger
150 selection to work with while typing. This should preclude bugs of this type.
152 2004-08-26 Ken Kocienda <kocienda@apple.com>
158 <rdar://problem/3777804> Deleting all content in a document can result in giant tall-as-window insertion point
160 * khtml/rendering/render_box.cpp:
161 (RenderBox::caretPos): Always use the font height for calculating the caret height in
162 non-replaced elements (like blocks), rather than the height of the box.
164 2004-08-26 Ken Kocienda <kocienda@apple.com>
168 Silly me. Forgot to add this file before.
170 * layout-tests/editing/inserting/insert-3775316-fix-expected.txt: Added.
172 2004-08-26 David Hyatt <hyatt@apple.com>
174 Fix for 3777172, crash from nested colgroup. Don't allow nested table sections or col groups.
178 * khtml/html/htmlparser.cpp:
179 (KHTMLParser::insertNode):
181 2004-08-26 Ken Kocienda <kocienda@apple.com>
187 <rdar://problem/3775316> document sprouts an extra newline character at the end
189 * khtml/editing/htmlediting_impl.cpp:
190 (khtml::InputNewlineCommandImpl::doApply): There was in insufficient check
191 in the code which adds extra BR elements at the ends of blocks, which we do
192 to work around the fact that BR elements, when they are the last element in a
193 block, do not render. Now the code sees whether there already is one of these
194 extra BR's in the document and won't add and "extra" extra.
195 * layout-tests/editing/inserting/insert-3775316-fix.html: Added.
197 2004-08-26 David Hyatt <hyatt@apple.com>
199 Fix for 3710721 and 3504114, crashes because of bad ownership model for list markers.
203 * khtml/rendering/render_container.cpp:
204 (RenderContainer::detach):
205 * khtml/rendering/render_list.cpp:
206 (RenderListItem::setStyle):
207 (RenderListItem::detach):
208 (RenderListItem::updateMarkerLocation):
209 * khtml/rendering/render_list.h:
211 2004-08-26 Ken Kocienda <kocienda@apple.com>
215 * khtml/editing/htmlediting_impl.cpp:
216 (khtml::ApplyStyleCommandImpl::doApply): Remove the StayInBlock modifier from the
217 call to upstream when passing the start position to removeStyle(). This makes the
218 start position sufficiently upstream so that all relevant style tags are removed.
219 (khtml::ApplyStyleCommandImpl::removeStyle): Pass the start position to nodeFullySelected.
220 (khtml::ApplyStyleCommandImpl::nodeFullySelected): Change interface so start position
221 for calculation is passed in, rather than recalculating it every time.
222 * khtml/editing/htmlediting_impl.h: nodeFullySelected interface change.
223 * khtml/xml/dom_position.h: Add a comment about the working of upstream() and
226 2004-08-26 Ken Kocienda <kocienda@apple.com>
230 Fix garbled contenteditable attribute. I must have checked
233 * layout-tests/editing/deleting/delete-3775172-fix.html
235 2004-08-25 Kevin Decker <kdecker@apple.com>
237 Reviewed by John and Maciej.
239 - Fixes SAP bug <rdar://problem/3751295> Personalize link at the
240 top gives an error in the pop-up window.
242 * khtml/ecma/kjs_window.cpp:
243 (WindowFunc::tryCall): Passes a referrer to KHTMLPart::begin()
245 2004-08-25 Richard Williamson <rjw@apple.com>
247 Updated to <canvas> API to match the spec. (Still need
248 to implement gradients and patterns.)
252 * khtml/ecma/kjs_html.cpp:
253 (KJS::Context2DFunction::tryCall):
254 (Context2D::getValueProperty):
255 (Context2D::drawingContext):
256 (Context2D::colorRefFromValue):
257 (Context2D::colorFromValue):
258 (Context2D::setShadow):
259 (Context2D::putValue):
261 (Context2D::restore):
262 (Context2D::Context2D):
263 * khtml/ecma/kjs_html.h:
265 * khtml/ecma/kjs_html.lut.h:
268 2004-08-25 Ken Kocienda <kocienda@apple.com>
272 * layout-tests/editing/deleting/delete-3775172-fix.html: Wrong version of test checked in
275 2004-08-25 Ken Kocienda <kocienda@apple.com>
279 Added test case for <rdar://problem/3775172> Blot crashes after typing one character then deleting it
281 * layout-tests/editing/deleting/delete-3775172-fix-expected.txt: Added.
282 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
284 2004-08-25 Ken Kocienda <kocienda@apple.com>
288 * layout-tests/editing/style/style-3690704-fix-expected.txt: Fewer styling spans added
289 on this test as a result of the previously-checked-in fix.
291 2004-08-25 Ken Kocienda <kocienda@apple.com>
297 <rdar://problem/3775214> BR elements cause unnecessary spans to be added when applying style
299 * khtml/editing/htmlediting_impl.cpp:
300 (khtml::ApplyStyleCommandImpl::doApply): BR elements can be grouped more liberally with other nodes
301 now in the iteration when attempting to find nodes that can be styled together with one span.
302 * layout-tests/editing/style/style-3690704-fix-expected.txt: Updated with new results after
305 2004-08-25 Ken Kocienda <kocienda@apple.com>
311 <rdar://problem/3775172> Blot crashes after typing one character then deleting it
313 * khtml/css/css_computedstyle.cpp:
314 (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Bail early if the element
315 being queried does not have a renderer or that renderer does not have a style. Prevents
316 a crash in the cases that it does not.
317 * khtml/editing/htmlediting_impl.cpp:
318 (khtml::DeleteSelectionCommandImpl::doApply): Add one more case to deleting when the
319 start and end nodes are different. If the downstream end node is the last node in the
320 block, then it may need to be deleted completely. Before this patch, the code
321 erroneously assumed that any deletion in this node had to be trimming of a text node.
322 This was asserted, and the description in 3775172 shows a simple case where this assertion
323 does not hold. The additional case and associated checks now make it all better.
324 * layout-tests/editing/deleting/delete-3775172-fix.html: Added.
326 2004-08-25 David Hyatt <hyatt@apple.com>
328 Fix for 3365086, large tables crash Safari. Make sure to use ints rather than shorts for row and column
329 counts. Also fix a pathological array resize scenario for tables as rows are added.
333 * khtml/rendering/render_table.cpp:
334 (RenderTable::splitColumn):
335 (RenderTable::appendColumn):
336 (RenderTableSection::RenderTableSection):
337 (RenderTableSection::ensureRows):
338 (RenderTableSection::setCellWidths):
339 (RenderTableSection::calcRowHeight):
340 (RenderTableSection::layoutRows):
341 (RenderTableSection::paint):
342 (RenderTableSection::recalcCells):
343 (RenderTableSection::clearGrid):
344 * khtml/rendering/render_table.h:
345 (khtml::RenderTableSection::numRows):
347 2004-08-25 David Hyatt <hyatt@apple.com>
349 To save memory in the common case, move the margin***Collapse variables into the CSS3 struct instead of
350 bloating the surround struct.
352 * khtml/rendering/render_style.cpp:
353 (StyleSurroundData::StyleSurroundData):
354 (StyleSurroundData::operator==):
355 (marginBottomCollapse):
356 (StyleCSS3NonInheritedData::operator==):
358 * khtml/rendering/render_style.h:
359 (khtml::RenderStyle::marginTopCollapse):
360 (khtml::RenderStyle::marginBottomCollapse):
361 (khtml::RenderStyle::setMarginTopCollapse):
362 (khtml::RenderStyle::setMarginBottomCollapse):
364 2004-08-25 David Hyatt <hyatt@apple.com>
366 Fix the "extra space in TypePad blogs" Emerson problem by adding the ability to collapse away margins.
367 Also added support for explicitly preventing margin collapsing.
371 * khtml/css/cssparser.cpp:
372 (CSSParser::parseValue):
373 * khtml/css/cssproperties.c:
376 * khtml/css/cssproperties.h:
377 * khtml/css/cssproperties.in:
378 * khtml/css/cssstyleselector.cpp:
379 (khtml::CSSStyleSelector::applyProperty):
380 * khtml/css/cssvalues.c:
383 * khtml/css/cssvalues.h:
384 * khtml/css/cssvalues.in:
385 * khtml/rendering/render_block.cpp:
386 (khtml::RenderBlock::isSelfCollapsingBlock):
387 (khtml::RenderBlock::layoutBlockChildren):
388 * khtml/rendering/render_style.cpp:
389 (StyleSurroundData::StyleSurroundData):
390 (StyleSurroundData::operator==):
392 * khtml/rendering/render_style.h:
394 (khtml::RenderStyle::marginTopCollapse):
395 (khtml::RenderStyle::marginBottomCollapse):
396 (khtml::RenderStyle::setMarginTopCollapse):
397 (khtml::RenderStyle::setMarginBottomCollapse):
398 (khtml::RenderStyle::initialMarginTopCollapse):
399 (khtml::RenderStyle::initialMarginBottomCollapse):
401 2004-08-24 Ken Kocienda <kocienda@apple.com>
405 Improved the ability of the bridge to report selection state.
407 * khtml/editing/htmlediting_impl.cpp:
408 (khtml::TypingCommandImpl::doApply): Bail when there is no selection.
409 * kwq/WebCoreBridge.h: Added an enum to report selection state. These constants
410 mirror those used in DOM::Selection.
411 * kwq/WebCoreBridge.mm:
412 (-[WebCoreBridge selectionState]): Replacement for haveSelection. Returns a value
413 from an enum telling whether the selection is in the None, Caret, or Range state,
414 rather than just true/false for the Range state as it did before.
416 2004-08-24 David Hyatt <hyatt@apple.com>
418 Make sure the ifdef XSLT is present for Panther.
420 * khtml/xml/xml_tokenizer.cpp:
421 (khtml::XMLTokenizer::insertErrorMessageBlock):
423 2004-08-24 David Hyatt <hyatt@apple.com>
425 Polish the XML error message so that it indicates when a document is the result of an XSL transformation
426 when reporting line/col #s.
428 * khtml/xml/dom_docimpl.cpp:
429 (DocumentImpl::applyXSLTransform):
430 * khtml/xml/xml_tokenizer.cpp:
431 (khtml::XMLTokenizer::insertErrorMessageBlock):
432 * khtml/xsl/xslt_processorimpl.cpp:
433 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
435 2004-08-24 David Hyatt <hyatt@apple.com>
437 Add support for Atom and RSS MIME types to the set of XML types.
441 * khtml/ecma/xmlhttprequest.cpp:
442 (KJS::XMLHttpRequest::getValueProperty):
443 * khtml/khtml_part.cpp:
445 * khtml/misc/loader.cpp:
446 (CachedXSLStyleSheet::CachedXSLStyleSheet):
447 (CachedXBLDocument::CachedXBLDocument):
448 * khtml/xml/dom_xmlimpl.cpp:
449 (DOM::ProcessingInstructionImpl::checkStyleSheet):
451 2004-08-24 Chris Blumenberg <cblu@apple.com>
453 Fixed: <rdar://problem/3746447> hang loading geocities.com/cinemaorchestra
457 * khtml/rendering/render_frames.cpp:
458 (RenderPartObject::updateWidget): do nothing if the src URL is the same as the part's URL
460 2004-08-24 Ken Kocienda <kocienda@apple.com>
466 <rdar://problem/3773564> REGRESSION (125-159): Code to remove HTML styles before applying new HTML styles is broken
468 * khtml/editing/htmlediting_impl.cpp:
469 (khtml::ApplyStyleCommandImpl::doApply): Unrelated change to constrain downstream position of selection
470 start to block boundaries. This is a new feature of the downstream function and I missed this usage
471 when adding the feature.
472 (khtml::ApplyStyleCommandImpl::removeCSSStyle): There once was code to remove style attributes from spans
473 which became emptied as a result of removing CSS properties, but I do not see such code in the
474 tree any more. A quick review of the ChangeLog did not reveal anything. I do not remember making such
477 In any case, I have restored logic to prune out styling spans we insert if the process of
478 removing styles caused a span-plus-styles node to become emptied of markup which changes the style
479 of its contents. This fixes the bug.
481 2004-08-24 Ken Kocienda <kocienda@apple.com>
487 <rdar://problem/3765535> paste of text with newlines into text with newlines results in broken doc, crash
489 This is a "belt and suspenders" fix. The issue is with the paste code path which was creating
490 zero-length DOM text nodes when a selection being pasted ended with a newline. The normal
491 code path for parsing HTML does not allow this, but the code to convert newlines to BR's
492 during paste was creating such nodes. This will no longer happen.
494 In the case where someone inserts such zero-length nodes using the DOM API, the render tree
495 will no longer create render objects for these nodes, and it was these empty render text
496 nodes that was confusing the code doing editing navigation.
498 * khtml/xml/dom_textimpl.cpp:
499 (CharacterDataImpl::rendererIsNeeded): Do not create renderers for zero-length DOM text nodes.
500 * khtml/xml/dom_textimpl.h:
501 * kwq/WebCoreBridge.mm:
502 (-[WebCoreBridge documentFragmentWithText:]): Do not insert zero-length DOM text nodes as part
503 of converting line-end sequences to BR's.
505 2004-08-23 Maciej Stachowiak <mjs@apple.com>
509 - reduce cost of innerHTML from O(N^2) to O(N*D) where N is the
510 number of nodes and D is the maximum DOM tree depth.
512 * khtml/xml/dom_nodeimpl.cpp:
513 (NodeImpl::recursive_toString): New static helper method for
514 recursive_toHTML - this is recursive for children but iterative
516 (NodeImpl::recursive_toHTML): Call the helper with this as the
518 * khtml/xml/dom_nodeimpl.h:
520 2004-08-23 David Hyatt <hyatt@apple.com>
524 Init the encodedURL explicitly for CSSStyleSelectors. Construction time was too early to be passing in the
525 document m_url, since it doesn't get set during construction.
527 Fix for 3769643, crash on vancouverblast.org.
531 * khtml/css/cssstyleselector.cpp:
532 (khtml::CSSStyleSelector::CSSStyleSelector):
533 (khtml::CSSStyleSelector::init):
534 (khtml::CSSStyleSelector::setEncodedURL):
535 * khtml/css/cssstyleselector.h:
536 * khtml/xml/dom_docimpl.cpp:
537 (DocumentImpl::DocumentImpl):
538 (DocumentImpl::setURL):
539 (DocumentImpl::recalcStyleSelector):
540 * khtml/xml/dom_docimpl.h:
541 (DOM::DocumentImpl::URL):
543 2004-08-23 Kevin Decker <kdecker@apple.com>
547 - fixed rdar://problem/3681094> Crash in KJS::WindowFunc::tryCall with application/xhtml+xml Content-Type
548 * khtml/ecma/kjs_window.cpp:
549 (WindowFunc::tryCall): since this is an xml document, we get the
550 domain from the xmlDocImpl(), not docImpl().
552 2004-08-23 Maciej Stachowiak <mjs@apple.com>
556 <rdar://problem/3771426> assertion failed due to reentering dispatchImageLoadEventsNow
558 * khtml/xml/dom_docimpl.cpp:
559 (DocumentImpl::dispatchImageLoadEventsNow): Avoid re-entering this
560 function, since it uses a data member for the copy of the list of events
563 2004-08-23 Maciej Stachowiak <mjs@apple.com>
567 <rdar://problem/3770306> XMLHttpRequest does not honor character set encoding
569 * khtml/ecma/xmlhttprequest.cpp:
570 (KJS::XMLHttpRequest::slotData): Get encoding from the transfer job.
571 * kwq/KWQKJobClasses.h:
572 * kwq/KWQKJobClasses.mm:
573 (KIO::TransferJobPrivate::TransferJobPrivate): Added retrievedCharset
575 (KIO::TransferJob::retrieveCharset): New method, gets the charset
577 (KIO::TransferJob::queryMetaData): Handle charset.
578 (KIO::TransferJob::emitReceivedResponse): Clear retreivedCharset flag.
581 (KWQResponseTextEncodingName): New function, gets the encoding from the response.
583 2004-08-23 David Hyatt <hyatt@apple.com>
585 Apply leo's fix to marquees.
589 * khtml/rendering/render_layer.cpp:
592 2004-08-20 Darin Adler <darin@apple.com>
596 - added an ascii() member function to DOMString and DOMStringImpl to help debugging
598 * khtml/dom/dom_string.h: Add ascii member function for debugging.
599 * khtml/dom/dom_string.cpp: (DOM::DOMString::ascii): Added. Calls through to DOMStringImpl::ascii.
600 * khtml/xml/dom_stringimpl.h: Add ascii member function for debugging.
601 * khtml/xml/dom_stringimpl.cpp: (DOM::DOMStringImpl::ascii): Added. Makes a new buffer and puts
602 a simple ASCII version in it. Maybe make it better about characters outside the 0x20-0x7E range
603 some day, but for now this is way better than what we had before.
605 2004-08-20 David Hyatt <hyatt@apple.com>
607 Divorce the notion of a marquee being stopped from JS from the notion of being suspended by the back/forward cache.
609 * khtml/ecma/kjs_html.cpp:
610 (KJS::HTMLElementFunction::tryCall):
611 * khtml/rendering/render_layer.cpp:
615 (Marquee::updateMarqueePosition):
616 * khtml/rendering/render_layer.h:
618 2004-08-20 Richard Williamson <rjw@apple.com>
620 Implemented new JNI abstraction. We no longer invoke Java methods
621 directly with JNI, rather we call into the plugin. This allows the
622 plugin to dispatch the call to the appropriate VM thread. This
623 change should (will?) fix a whole class of threading related problems with
628 * kwq/KWQKHTMLPart.mm:
629 (KWQKHTMLPart::getAppletInstanceForView):
630 * kwq/WebCoreBridge.mm:
632 (-[WebCoreBridge executionContextForView:]):
634 2004-08-19 Maciej Stachowiak <mjs@apple.com>
638 More text paint cleanup. Separated the background and foreground
639 passes instead of doing a weird for loop thing. Eliminated
640 redundant if conditions. Added comments.
642 * khtml/rendering/render_text.cpp:
645 2004-08-19 Ken Kocienda <kocienda@apple.com>
649 * khtml/css/css_computedstyle.cpp:
650 (DOM::): Changed CopyProperties constant to InheritableProperties. This reflects the
651 name change of copy() to copyInheritableProperties()
652 (DOM::CSSComputedStyleDeclarationImpl::copyInheritableProperties: Renamed from copy().
653 Now just copies those properties which can be inherited.
654 (DOM::CSSComputedStyleDeclarationImpl::diff): Add a couple null checks.
655 * khtml/css/css_computedstyle.h: copyInheritableProperties name change. No longer needs to be virtual.
656 * khtml/css/css_valueimpl.cpp: Removed unneeded copy() function from CSSStyleDeclarationImpl.
657 * khtml/css/css_valueimpl.h: Ditto.
658 * khtml/editing/htmlediting.cpp:
659 (khtml::EditCommand::typingStyle): Added.
660 (khtml::EditCommand::setTypingStyle): Added.
661 * khtml/editing/htmlediting.h:
662 * khtml/editing/htmlediting_impl.cpp:
663 (khtml::StyleChange::currentlyHasStyle): Fix leak of computed style used in this function.
664 (khtml::EditCommandImpl::EditCommandImpl): Initialize m_typingStyle.
665 (khtml::EditCommandImpl::~EditCommandImpl): Deref m_typingStyle.
666 (khtml::EditCommandImpl::assignTypingStyle): New helper used in setting typing style.
667 (khtml::EditCommandImpl::setTypingStyle): New setter.
668 (khtml::DeleteSelectionCommandImpl::doApply): Use new method for managing typing style.
669 * khtml/editing/htmlediting_impl.h:
670 (khtml::EditCommandImpl::typingStyle): New accessor.
671 * khtml/khtml_part.cpp:
672 (KHTMLPart::appliedEditing): Restores typing style from command after setting selection.
673 (KHTMLPart::applyStyle): Does a diff between the current style and the style of the caret.
674 * khtml/khtml_part.h:
675 * khtml/xml/dom_position.cpp:
676 (DOM::Position::computedStyle): Now returns a CSSComputedStyleDeclarationImpl instead of a plain
677 CSSStyleDeclarationImpl.
678 * khtml/xml/dom_position.h:
679 * layout-tests/editing/style/style-3681552-fix-002-expected.txt:
681 2004-08-20 Trey Matteson <trey@apple.com>
683 3655407 - Editing: -complete: method unimplemented (WebKit editing API)
685 One new support routine here.
689 * kwq/WebCoreBridge.h:
690 * kwq/WebCoreBridge.mm:
691 (-[WebCoreBridge caretRectAtNode:offset:]): New routine.
692 (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
693 Fixed former misleading method name.
695 2004-08-20 Ken Kocienda <kocienda@apple.com>
701 <rdar://problem/3768378> crash typing newline in Blot
703 * khtml/editing/htmlediting_impl.cpp:
704 (khtml::InputNewlineCommandImpl::doApply): Adding an assert in a recent change
705 showed up that inserting newlines that was not being handled correctly for the
706 case described in the bug. I added a new case to handle inserting BR's when
707 at the caret max offset for a node, and this new code runs instead of the
708 fall-through case that should not have been running and triggered the assert.
709 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Regenerated results.
710 * layout-tests/editing/inserting/insert-br-case6-expected.txt: Added.
711 * layout-tests/editing/inserting/insert-br-case6.html: Added.
713 2004-08-20 Trey Matteson <trey@apple.com>
715 Fixing: Spellchecker called once or twice for every char typed.
719 * khtml/khtml_part.cpp:
720 (KHTMLPart::setSelection): Don't do any spell checking if we're typing (it's done
721 elsewhere, in markMisspellingsAfterTyping)
723 2004-08-19 Maciej Stachowiak <mjs@apple.com>
727 - fixed <rdar://problem/3549369> Crash at www.e1.ru in HTMLTokenizer::notifyFinished
729 Probably also fixed the following likely duplicates:
731 <rdar://problem/3503938> Safari crashed opening many tabs (HTMLTokenizer::notifyFinished(khtml::CachedObject*))
732 <rdar://problem/3566332> CrashTracer: ..405 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
733 <rdar://problem/3703964> CrashTracer: ...86 crashes at com.apple.WebCore: QString::QString[unified] + 0x5c
734 <rdar://problem/3703969> CrashTracer: ..234 crashes at com.apple.WebCore: HTMLTokenizer::notifyFinished + 0x1c8
736 * khtml/xml/dom_docimpl.cpp:
737 (DocumentImpl::open): call setParsing(true), because we need to know we are once again
738 parsing when we re-open a document that has previously completed loading.
740 2004-08-19 Maciej Stachowiak <mjs@apple.com>
742 Reviewed by Dave and Darin.
744 * khtml/rendering/render_text.cpp:
745 (RenderText::paint): Split apple and non-apple code paths to allow further cleanup.
747 2004-08-19 Darin Adler <darin@apple.com>
751 - fixed <rdar://problem/3767274> crash in partForWidget inside setFocus (test page attached)
753 * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Remove code to do position
754 the widget; no longer needed since we reworked how widgets get their positions.
755 * kwq/KWQWidget.mm: (QWidget::setFocus): Ditto. This was the one that caused the bug.
757 2004-08-19 David Hyatt <hyatt@apple.com>
759 Fix crash when text is contained inside a table-colgroup.
763 * khtml/xml/dom_textimpl.cpp:
764 (TextImpl::rendererIsNeeded):
766 2004-08-19 Trey Matteson <trey@apple.com>
768 Unexpected errors hit while finding word boundaries, leading to crash.
772 * kwq/KWQTextUtilities.cpp:
773 (KWQFindWordBoundary): Don't call UCFindTextBreak with edge cases it thinks
774 are param errors, and pass correct mask for forward case. Also fix off-by-one
775 crashers in fallback code.
777 2004-08-19 David Hyatt <hyatt@apple.com>
779 Make XSLT imports/includes work. This code has to be turned off until the newer version of libxslt is
784 * khtml/css/css_ruleimpl.cpp:
785 (CSSImportRuleImpl::init):
786 * khtml/xml/dom_docimpl.cpp:
787 (DocumentImpl::DocumentImpl):
788 (DocumentImpl::~DocumentImpl):
789 (DocumentImpl::applyXSLTransform):
790 * khtml/xml/dom_docimpl.h:
791 (DOM::DocumentImpl::setTransformSource):
792 (DOM::DocumentImpl::transformSource):
793 * khtml/xml/dom_xmlimpl.cpp:
794 (DOM::ProcessingInstructionImpl::checkStyleSheet):
795 * khtml/xml/xml_tokenizer.cpp:
800 (khtml::createQStringParser):
801 (khtml::XMLTokenizer::setTransformSource):
802 * khtml/xsl/xsl_stylesheetimpl.cpp:
803 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
804 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
805 (DOM::XSLStyleSheetImpl::isLoading):
806 (DOM::XSLStyleSheetImpl::clearDocuments):
807 (DOM::XSLStyleSheetImpl::parseString):
808 (DOM::XSLStyleSheetImpl::loadChildSheets):
809 (DOM::XSLStyleSheetImpl::loadChildSheet):
810 (DOM::XSLImportRuleImpl::parentStyleSheet):
811 (DOM::XSLStyleSheetImpl::compileStyleSheet):
812 (DOM::XSLStyleSheetImpl::locateStylesheetSubResource):
813 (DOM::XSLImportRuleImpl::XSLImportRuleImpl):
814 (DOM::XSLImportRuleImpl::~XSLImportRuleImpl):
815 (DOM::XSLImportRuleImpl::setStyleSheet):
816 (DOM::XSLImportRuleImpl::isLoading):
817 (DOM::XSLImportRuleImpl::loadSheet):
818 * khtml/xsl/xsl_stylesheetimpl.h:
819 (DOM::XSLStyleSheetImpl::setOwnerDocument):
820 (DOM::XSLStyleSheetImpl::setDocument):
821 (DOM::XSLStyleSheetImpl::markAsProcessed):
822 (DOM::XSLStyleSheetImpl::processed):
823 (DOM::XSLImportRuleImpl::href):
824 (DOM::XSLImportRuleImpl::styleSheet):
825 (DOM::XSLImportRuleImpl::isImportRule):
826 * khtml/xsl/xslt_processorimpl.cpp:
827 (DOM::m_sourceDocument):
828 (DOM::stylesheetLoadFunc):
829 (DOM::XSLTProcessorImpl::transformDocument):
830 * khtml/xsl/xslt_processorimpl.h:
834 2004-08-18 Trey Matteson <trey@apple.com>
836 3765958 - downstreamPosition() can hit infinite loop when at end of doc
838 The problem was that I had a position that was after the maximum position in the text
839 node, because it was the old caret position before a backspace was processed. Later
840 I happened to call downstream() on that position, and hit the bug. Fix is to consider
841 a position past the end point of its node if it is *greater than* or equal to its max offset.
845 * khtml/xml/dom_positioniterator.cpp:
846 (DOM::PositionIterator::atEnd):
848 2004-08-18 David Hyatt <hyatt@apple.com>
850 - did WebCore part of <rdar://problem/3682969> SLIDER: absolute left position of slider should be headline only
852 Make the header overlap the footer in the zero-line case. Changes to Emerson's template will ensure the
853 header draws over the footer.
857 * khtml/rendering/render_block.cpp:
858 (khtml::getHeightForLineCount):
860 2004-08-18 Richard Williamson <rjw@apple.com>
862 Replace horrible pollForAppletInView: with new
863 webPlugInGetApplet. The details of how the applet instance
864 is provided now belong to the Java team. Yeh.
868 * kwq/KWQKHTMLPart.mm:
869 (KWQKHTMLPart::getAppletInstanceForView):
870 * kwq/WebCoreBridge.h:
872 2004-08-18 Chris Blumenberg <cblu@apple.com>
874 Fixed: <rdar://problem/3692199> 8A146: Safari crashes in toHTMLWithOptions, selection with no renderer (various sites)
878 * khtml/xml/dom2_rangeimpl.cpp:
879 (DOM::RangeImpl::toHTML): renamed, don't assume that nodes of the range had renderers, use the common ancestor of the range as the root
880 * khtml/xml/dom2_rangeimpl.h:
881 * khtml/xml/dom_nodeimpl.cpp:
882 (NodeImpl::recursive_toHTML): renamed, removed code that determines whether to include the root in the HTML, leave this up to the caller
883 * khtml/xml/dom_nodeimpl.h:
884 * kwq/WebCoreBridge.mm:
885 (-[WebCoreBridge markupStringFromNode:nodes:]): call renamed methods
886 (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
888 2004-08-18 Ken Kocienda <kocienda@apple.com>
892 * khtml/css/css_valueimpl.cpp:
893 (CSSStyleDeclarationImpl::copy): Roll back silly last minute change that broke this code.
894 Note to self: read code before making changes to it.
896 2004-08-18 Ken Kocienda <kocienda@apple.com>
898 Coded by Darin and Ken
900 * khtml/css/css_computedstyle.cpp: Added CopyProperties static array. This contains
901 the properties we implement that we also want to copy in the new
902 CSSComputedStyleDeclarationImpl::copy described below.
903 (DOM::CSSComputedStyleDeclarationImpl::copy): New function. In this class, copies the
904 computed values of all the properties listed in CopyProperties. In essence, this makes
905 a freeze-dired version of a computed style.
906 (DOM::CSSComputedStyleDeclarationImpl::diff): Removes every property from the passed-in
907 CSSStyleDeclarationImpl that is also in the computed style.
908 * khtml/css/css_computedstyle.h:
909 * khtml/css/css_valueimpl.cpp:
910 (CSSStyleDeclarationImpl::copy): New function. In this class, the copy operation is
911 straightforward. Returns a copy that will be unchanged when the original changes.
912 * khtml/css/css_valueimpl.h:
913 (DOM::CSSStyleDeclarationImpl::values): Added a accessor suitable for use when the
914 CSSStyleDeclarationImpl is const.
916 2004-08-17 Maciej Stachowiak <mjs@apple.com>
920 <rdar://problem/3703768> CrashTracer: ...50 crashes at com.apple.WebCore: KHTMLPart::xmlDocImpl const + 0
922 * khtml/khtmlview.cpp:
923 (KHTMLView::viewportMouseMoveEvent): Add a nil check and an
924 assertion for m_part being null. It seems impossible for this to
925 happen, so we want to debug it ourselves, but in the meantime,
926 let's try to avoid causing crashes for our users.
928 2004-08-17 David Hyatt <hyatt@apple.com>
930 Fix the line truncation function for Emerson so that at the far left setting of the slider, only the header
935 * khtml/rendering/render_block.cpp:
936 (khtml::getHeightForLineCount):
937 * khtml/rendering/render_flexbox.cpp:
938 (khtml::RenderFlexibleBox::layoutVerticalBox):
940 2004-08-17 Ken Kocienda <kocienda@apple.com>
944 Rewrite of the command that deletes a selection. I deleted great
945 big swaths of bug-ridden code to accomplish this and replaced it
946 with code that is much cleaner and smarter.
948 Also, renamed equivalentUpstreamPosition and equivalentDownstreamPosition to
949 upstream to downstream, respectively.
951 Added a couple of new helper methods.
953 * khtml/editing/htmlediting.cpp: DeleteCollapsibleWhitespaceCommand and
954 RemoveNodeAndPruneCommand now obsolete. A huge win.
955 * khtml/editing/htmlediting.h: Ditto.
956 * khtml/editing/htmlediting_impl.cpp:
957 (khtml::debugPosition): Fix printf which had a placeholder, but no argument passed in the varargs.
958 (khtml::CompositeEditCommandImpl::deleteUnrenderedText): New helper. Much simplified and cleaner
960 (khtml::ApplyStyleCommandImpl::doApply): upstream/downstream name change
961 (khtml::ApplyStyleCommandImpl::nodeFullySelected): upstream/downstream name change
962 (khtml::DeleteSelectionCommandImpl::doApply): upstream/downstream name change
963 (khtml::DeleteTextCommandImpl::DeleteTextCommandImpl): Add an assert to check that the
964 passed offset is less than the length of the text node.
965 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition): upstream/downstream name change
966 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition): upstream/downstream name change
967 (khtml::InputNewlineCommandImpl::doApply): upstream/downstream name change
968 (khtml::InputTextCommandImpl::prepareForTextInsertion): upstream/downstream name change
969 (khtml::InputTextCommandImpl::execute): upstream/downstream name change
970 (khtml::InputTextCommandImpl::insertSpace): upstream/downstream name change
971 (khtml::ReplaceSelectionCommandImpl::doApply): upstream/downstream name change
972 (khtml::TypingCommandImpl::issueCommandForDeleteKey): upstream/downstream name change
973 (khtml::TypingCommandImpl::deleteKeyPressed):
974 * khtml/editing/htmlediting_impl.h:
975 * khtml/xml/dom_position.cpp:
976 (DOM::Position::previousWordBoundary):
977 (DOM::Position::nextWordBoundary):
978 (DOM::Position::upstream):
979 (DOM::Position::downstream):
980 (DOM::Position::inRenderedText): Add null check.
981 (DOM::Position::isRenderedCharacter): New helper.
982 (DOM::isWS): New helper in this file.
983 (DOM::Position::leadingWhitespacePosition): New helper. Factored out from htmlediting_impl.cpp.
984 (DOM::Position::trailingWhitespacePosition): Ditto.
985 (DOM::Position::debugPosition): Add null check.
986 * khtml/xml/dom_position.h:
987 * khtml/xml/dom_selection.cpp:
988 (DOM::Selection::toRange): upstream/downstream name change
989 (DOM::Selection::validate): upstream/downstream name change
990 (DOM::Selection::debugPosition): upstream/downstream name change
991 * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Updated tests with new expected results.
992 * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Ditto.
993 * layout-tests/editing/deleting/delete-selection-001-expected.txt: Ditto.
994 * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Ditto.
995 * layout-tests/editing/inserting/insert-br-case1-expected.txt: Ditto.
996 * layout-tests/editing/inserting/insert-br-case2-expected.txt: Ditto.
997 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Ditto.
999 2004-08-17 Trey Matteson <trey@apple.com>
1001 Various spelling fixes.
1005 * khtml/khtml_part.cpp:
1006 (KHTMLPart::setSelection): No misspellings in the spelling code comments
1007 * khtml/xml/dom_docimpl.cpp:
1008 (DocumentImpl::removeMarker): Repaint if doc changes. Sometimes the markers
1009 were not being erased when you clicked in a word.
1010 * khtml/xml/dom_position.cpp:
1011 (DOM::Position::previousWordBoundary): Small optimization. Bail after first
1012 try if the second try will not come out any different.
1013 (DOM::Position::nextWordBoundary): Ditto
1014 * kwq/KWQKHTMLPart.mm:
1015 (KWQKHTMLPart::markMisspellingsInSelection): Comment.
1017 2004-08-17 Darin Adler <darin@apple.com>
1021 - fixed <rdar://problem/3689700> crash loading page; stoxx.com (works in IE and Firefox)
1023 * khtml/khtml_part.h: Make completeURL public.
1024 * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::KJavaAppletWidget): Complete the base URL
1025 before passing it across the bridge. This sidesteps the crashing bug in CFURL, filed as
1026 '<rdar://problem/3764632> CFURLCreateAbsoluteURLWithBytes crashes if passed the string "../.."'
1027 and also is obviously correct behavior that may fix other sites too.
1029 - fixed <rdar://problem/3547725> Crashes at csuohio.edu, list box vs. mouse event problem (Spoof No Fix)
1031 * kwq/KWQListBox.mm:
1032 (QListBox::~QListBox): Nil out the pointer from the KWQTableView back to the widget by calling
1033 a new detach method.
1034 (-[KWQTableView detach]): Set the pointer to the QListBox to 0. Also set the delegate and data
1035 source to nil, so we don't need nil checks in delegate and data source methods.
1036 (-[KWQTableView mouseDown:]): Add nil check.
1037 (-[KWQTableView keyDown:]): Add nil check.
1038 (-[KWQTableView keyUp:]): Add nil check.
1039 (-[KWQTableView becomeFirstResponder]): Add nil check.
1040 (-[KWQTableView resignFirstResponder]): Add nil check.
1041 (-[KWQTableView canBecomeKeyView]): Add nil check.
1042 (-[KWQTableView tableViewSelectionDidChange:]): Add nil checks, even though this is a delegate
1043 callback, to handle cases where calls to JavaScript result in the QListBox going away partway
1045 (-[KWQTableView drawRow:clipRect:]): Add nil check.
1046 (-[KWQTableView _accessibilityTableCell:tableColumn:]): Add nil check.
1048 2004-08-17 Trey Matteson <trey@apple.com>
1050 Fix ASSERT in spelling marker management.
1054 * khtml/xml/dom_docimpl.cpp:
1055 (DocumentImpl::shiftMarkers): Use assert instead of ASSERT.
1056 Tweak test to allow for a start position of 0.
1058 2004-08-17 Trey Matteson <trey@apple.com>
1060 3764147 - failure of subframe to load leaves links in parent doc broken
1064 * khtml/khtml_part.cpp:
1065 (KHTMLPart::childBegin): New method to mark part as not complete.
1066 (KHTMLPart::processObjectRequest): Mark child part imcomplete, so if we
1067 later get a failure on load it won't think it's already complete and do nothing.
1068 * khtml/khtml_part.h:
1072 2004-08-16 David Hyatt <hyatt@apple.com>
1074 Fix the #define. I had it all backwards.
1078 2004-08-16 David Hyatt <hyatt@apple.com>
1080 Land initial support for XSLT using xml-stylesheet PIs.
1082 * WebCore.pbproj/project.pbxproj:
1083 * khtml/khtml_part.cpp:
1084 (KHTMLPart::replaceDocImpl):
1085 * khtml/khtml_part.h:
1086 * khtml/khtmlview.h:
1087 * khtml/xml/dom_docimpl.cpp:
1088 (DocumentImpl::DocumentImpl):
1089 (DocumentImpl::~DocumentImpl):
1090 (DocumentImpl::recalcStyleSelector):
1091 (DocumentImpl::applyXSLTransform):
1092 (DocumentImpl::setTransformSourceDocument):
1093 * khtml/xml/dom_docimpl.h:
1094 (DOM::DocumentImpl::setTransformSource):
1095 (DOM::DocumentImpl::transformSource):
1096 (DOM::DocumentImpl::transformSourceDocument):
1097 * khtml/xml/dom_xmlimpl.cpp:
1098 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1099 * khtml/xml/dom_xmlimpl.h:
1100 (DOM::ProcessingInstructionImpl::isXSL):
1101 * khtml/xml/xml_tokenizer.cpp:
1104 (khtml::createQStringParser):
1105 (khtml::XMLTokenizer::processingInstruction):
1106 (khtml::XMLTokenizer::finish):
1107 (khtml::XMLTokenizer::setTransformSource):
1108 * khtml/xml/xml_tokenizer.h:
1109 (khtml::Tokenizer::setTransformSource):
1110 * khtml/xml/xsl_stylesheetimpl.cpp: Removed.
1111 * khtml/xml/xsl_stylesheetimpl.h: Removed.
1112 * khtml/xsl/xsl_stylesheetimpl.cpp: Added.
1113 (DOM::XSLStyleSheetImpl::XSLStyleSheetImpl):
1114 (DOM::XSLStyleSheetImpl::~XSLStyleSheetImpl):
1115 (DOM::XSLStyleSheetImpl::isLoading):
1116 (DOM::XSLStyleSheetImpl::checkLoaded):
1117 (DOM::XSLStyleSheetImpl::docLoader):
1118 (DOM::XSLStyleSheetImpl::parseString):
1119 * khtml/xsl/xsl_stylesheetimpl.h: Added.
1120 (DOM::XSLStyleSheetImpl::isXSLStyleSheet):
1121 (DOM::XSLStyleSheetImpl::type):
1122 (DOM::XSLStyleSheetImpl::ownerDocument):
1123 (DOM::XSLStyleSheetImpl::document):
1124 (DOM::XSLStyleSheetImpl::clearDocument):
1125 * khtml/xsl/xslt_processorimpl.cpp: Added.
1126 (DOM::m_sourceDocument):
1127 (DOM::XSLTProcessorImpl::~XSLTProcessorImpl):
1128 (DOM::XSLTProcessorImpl::transformDocument):
1130 (DOM::XSLTProcessorImpl::addToResult):
1131 (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
1132 * khtml/xsl/xslt_processorimpl.h: Added.
1134 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1138 * khtml/khtml_part.cpp:
1139 (KHTMLPart::isImmediateRedirectPending):
1141 2004-08-16 Richard Williamson <rjw@apple.com>
1143 Fixed <rdar://problem/3704339> Context2D forces integer positions in drawImage
1145 Use floats instead of ints to draw images.
1149 * khtml/ecma/kjs_html.cpp:
1150 (KJS::Context2DFunction::tryCall):
1152 * kwq/KWQPainter.mm:
1153 (QPainter::drawPixmap):
1154 (QPainter::drawFloatPixmap):
1156 2004-08-13 Maciej Stachowiak <mjs@apple.com>
1160 - 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)
1162 (actually the previous fix for this bug was mostly correct, but
1163 this additional change is needed to avoid the regression in
1164 <rdar://problem/3751025> REGRESSION: website rejects Safari 125.9
1165 as "need to upgrade to IE 6", but didn't reject 125.8
1167 So if merging for a software update, make sure to include both
1168 this and the previous fix.
1170 * khtml/html/htmltokenizer.cpp:
1171 (khtml::HTMLTokenizer::write): When there is an immediate reidrect pending,
1172 make sure to stop tokenizing, because we need to make sure no further
1173 script tags are processed beyond the one that triggered the redirect.
1174 * khtml/khtml_part.cpp:
1175 (KHTMLPart::isImmediateRedirectPending): New method to allow
1176 checking if a redirect is pending.
1177 * khtml/khtml_part.h:
1179 2004-08-15 David Hyatt <hyatt@apple.com>
1181 - fixed <rdar://problem/3760508> REGRESSION (154-155): No text in textarea
1183 Fix the blank textarea problem by ensuring that any change to a <textarea>'s DOM children causes the form control
1184 to resync with the DOM. This behavior matches WinIE.
1186 Reviewed by kocienda
1188 * khtml/html/html_formimpl.cpp:
1189 (HTMLTextAreaElementImpl::childrenChanged):
1190 * khtml/html/html_formimpl.h:
1192 2004-08-13 Trey Matteson <trey@apple.com>
1194 3761794 Slider doesn't call onmouseup handler
1198 * khtml/rendering/render_form.cpp:
1199 (RenderSlider::RenderSlider): Listen for signal.
1200 (RenderSlider::slotClicked): Pass to superclass.
1201 * khtml/rendering/render_form.h:
1204 (-[KWQSlider mouseDown:]): Generate mouseUp and clicked events,
1205 since AK consumes the mouseUp event in a modal tracking loop.
1206 (QSlider::QSlider): Make signal.
1207 (QSlider::clicked): Send signal.
1209 2004-08-12 Trey Matteson <trey@apple.com>
1211 3761329 - query result links all dead in ingrammicro.com (sometimes)
1212 3761328 - links in some docs dead when doc is loaded from WebArchive
1214 Make sure to get part to completed state when end is called,
1215 even if we have no doc. See WebKit changelog for more info.
1217 Reviewed by Richard and Darin.
1219 * khtml/khtml_part.cpp:
1222 2004-08-13 Trey Matteson <trey@apple.com>
1224 3761098 - red dotted underline for misspelled words shows up in drag image
1228 * khtml/rendering/render_text.cpp:
1229 (RenderText::paint): Don't draw misspelling when creating selection image.
1231 2004-08-12 Richard Williamson <rjw@apple.com>
1233 Bring npruntime.h and friends closer to compliance with
1238 * kwq/KWQKHTMLPart.mm:
1239 (KWQKHTMLPart::windowScriptNPObject):
1241 2004-08-12 Maciej Stachowiak <mjs@apple.com>
1243 Reviewed by Richard.
1245 <rdar://problem/3245706> URLs with backslashes instead of slashes work on WinIE; should work on Safari (SAP)
1246 <rdar://problem/3506429> <BASE> tag containing backslash is breaking images with absolute URLs
1249 (substituteBackslashes): Helper method
1250 (KURL::KURL): If the URL contains any backslashes, substitute all
1251 that appear before the query or fragment.
1253 2004-08-12 Ken Kocienda <kocienda@apple.com>
1259 <rdar://problem/3761014> command-down-arrow takes you to start of document instead of end of document
1261 * khtml/xml/dom_selection.cpp:
1262 (DOM::Selection::modifyExtendingRightForward): Code used to assume, incorrectly, that index 1 of the
1263 document element was beyond the last node in the document. But this is not true, since the document
1264 element is the HTML element (generally). Instead, move to the index equal to the number of children
1265 of the document element. This puts us past everything.
1266 (DOM::Selection::modifyMovingRightForward): Ditto.
1268 2004-08-12 Ken Kocienda <kocienda@apple.com>
1274 <rdar://problem/3695446> shift-down-arrow on last line of editable text should select to end of document
1276 Detect when current position is on first or last line and move to the
1277 start or end of that line, respectively.
1279 * khtml/xml/dom_position.cpp:
1280 (DOM::Position::previousLinePosition)
1281 (DOM::Position::nextLinePosition)
1285 2004-08-12 Ken Kocienda <kocienda@apple.com>
1289 Some consolidation in style application code.
1291 * khtml/editing/htmlediting_impl.cpp:
1292 (khtml::StyleChange::StyleChange): Made this a full-on class and added a couple of
1293 members and a constructors to make a StyleChange from a CSSStyleDeclarationImpl, as
1294 well as from a CSSStyleDeclarationImpl and a Position.
1295 (khtml::StyleChange::init): Common init function for StyleChange constructors.
1296 (khtml::StyleChange::currentlyHasStyle): Moved this here from ApplyStyleCommandImpl.
1297 (khtml::CompositeEditCommandImpl::applyTypingStyle): Tweak to adjust to new StyleChange
1299 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Ditto.
1300 * khtml/editing/htmlediting_impl.h:
1301 (khtml::StyleChange::StyleChange):
1302 (khtml::StyleChange::cssStyle): New accessor.
1303 (khtml::StyleChange::applyBold): Ditto.
1304 (khtml::StyleChange::applyItalic): Ditto.
1305 * khtml/xml/dom_position.cpp:
1306 (DOM::Position::computedStyle): New helper.
1307 * khtml/xml/dom_position.h: Ditto.
1309 2004-08-12 Ken Kocienda <kocienda@apple.com>
1314 <rdar://problem/3751098> HTML email has one set of SPAN tags per character in the message
1316 Progress on this bug:
1317 <rdar://problem/3755562> Typing styles do not use same tag application conventions as font and color panel
1319 * khtml/editing/htmlediting_impl.cpp:
1320 (khtml::CompositeEditCommandImpl::applyTypingStyle): Name changed from createTypingStyleElement.
1321 Also, interface changed to take the node to which the typing style is to be applied.
1322 This makes it easier to apply what may be up to three levels of nested tags to get the
1323 desired style (<B>, <I>, and <SPAN STYLE="">).
1324 Also, Borrow some of the style change smarts from ApplyStyleCommandImpl to use bold and
1325 italic tags for applying styles when that is apprpriate. This creates on opportunity to
1326 factor the code to do this so that this function and the ApplyStyleCommandImpl class can
1327 share the implementation. I will follow up with a change to do that after landing this
1328 change. Some future code factoring could be done here to bring together some similar code
1330 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Add comment about code factoring work.
1331 (khtml::ApplyStyleCommandImpl::computeStyleChange): StyleChange struct no longer a member of the
1332 ApplyStyleCommandImpl class. CompositeEditCommandImpl needs it now in its applyTypingStyle()
1334 (khtml::InputNewlineCommandImpl::doApply): Pass along node to style to applyTypingStyle.
1335 (khtml::InputTextCommandImpl::prepareForTextInsertion): Ditto.
1336 * khtml/editing/htmlediting_impl.h:
1337 (khtml::StyleChange::StyleChange): Pull this struct out of ApplyStyleCommandImpl so
1338 CompositeEditCommandImpl can use it.
1339 * khtml/khtml_part.cpp:
1340 (KHTMLPart::notifySelectionChanged): Always clear typing style when the selection
1341 changes, not only when closing typing. This fixes 3751098.
1343 These three tests actually had results that treated the buggy behavior as correct!
1345 * layout-tests/editing/style/style-3681552-fix-001-expected.txt
1346 * layout-tests/editing/style/style-3681552-fix-002-expected.txt
1347 * layout-tests/editing/style/typing-style-002-expected.txt
1349 2004-08-12 Darin Adler <darin@apple.com>
1353 - fixed <rdar://problem/3740485> Repro crash involving replacing content that includes form field
1355 * kwq/KWQLineEdit.mm: (QLineEdit::selectAll): Since this function calls selectText: which has a side
1356 effect of making the text field be first responder, call to bridge first to make it first responder.
1357 The bridge version lets WebHTMLView know we are changing the responder, avoiding some unpleasantness
1358 because it sets the "changing focus programmatically" flag. Without that flag set, we were getting
1359 an additional setFocusNode(0) call, which is unnecessary and incorrect.
1361 2004-08-12 Darin Adler <darin@apple.com>
1365 - fixed <rdar://problem/3758756> copying text selected with down arrow results in all text to end of document
1367 * khtml/xml/dom2_rangeimpl.h: Make startNode and pastEndNode public.
1368 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::pastEndNode): Fix bug where this would return
1369 one node too far in the case where the end container was not a text node.
1371 * khtml/xml/dom_nodeimpl.cpp:
1372 (NodeImpl::recursive_toHTMLWithOptions): Rewrite loop, using startNode and pastEndNode,
1373 to fix bug where it would run past the end node, including too many nodes in the generated
1374 HTML. Nice side benefit: easier to read the code.
1376 2004-08-11 Chris Blumenberg <cblu@apple.com>
1378 Fixed: <rdar://problem/3758216> PARENTAL: buttons on parental controls page only work once
1382 * kwq/KWQKHTMLPart.mm:
1383 (KWQKHTMLPart::submitForm): prevent a form from being submitted more than once only if it uses a scheme of http or https
1385 2004-08-11 Darin Adler <darin@apple.com>
1389 - fixed <rdar://problem/3715878> 8A162: connect.apple.com password field showed in cleartext
1391 * kwq/KWQTextField.mm: (-[KWQSecureTextField textDidEndEditing:]):
1392 Enhanced workaround for shifting focus from one secure text field to another so that it works
1393 even for the case of shifting focus from a secure text field back to itself.
1395 2004-08-11 Ken Kocienda <kocienda@apple.com>
1399 Missed adding this file before.
1401 * kwq/KWQTextUtilities.mm: Added.
1402 (KWQFindNextWordFromIndex):
1404 2004-08-11 Ken Kocienda <kocienda@apple.com>
1408 Efficiency improvements on string manipulations in these two new function
1409 implementations. Use the versions of QString append/prepend that take
1410 (QChar *c, uint length) instead of creating new strings each time.
1412 * khtml/xml/dom_position.cpp:
1413 (DOM::Position::previousWordPosition): Changed, as described above.
1414 (DOM::Position::nextWordPosition): Ditto.
1416 2004-08-11 Ken Kocienda <kocienda@apple.com>
1421 <rdar://problem/3675812> Moving a word at a time does not use the correct conception of "word"
1423 I have implemented versions of previousWordPosition and nextWordPosition that are now
1424 different than previousWordBoundary and nextWordBoundary. The behavior of the new
1425 functions attempts to match what Cocoa does as closely as it can. Let the bug filing begin!
1427 * WebCore.pbproj/project.pbxproj: Added KWQTextUtilities.mm
1428 * khtml/misc/helper.cpp:
1429 (khtml::nextWordFromIndex): Glue to call through to KWQFindNextWordFromIndex.
1430 * khtml/misc/helper.h: Declare the function above.
1431 * khtml/misc/khtml_text_operations.cpp: Added SimplifiedBackwardsTextIterator class.
1432 (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): New
1433 (khtml::SimplifiedBackwardsTextIterator::advance): Ditto.
1434 (khtml::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
1435 (khtml::SimplifiedBackwardsTextIterator::handleReplacedElement): Ditto.
1436 (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Ditto.
1437 (khtml::SimplifiedBackwardsTextIterator::exitNode): Ditto.
1438 (khtml::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
1439 (khtml::SimplifiedBackwardsTextIterator::range): Ditto.
1440 * khtml/misc/khtml_text_operations.h:
1441 (khtml::SimplifiedBackwardsTextIterator::atEnd): Ditto.
1442 (khtml::SimplifiedBackwardsTextIterator::length): Ditto.
1443 (khtml::SimplifiedBackwardsTextIterator::characters): Ditto.
1444 * khtml/xml/dom_position.cpp:
1445 (DOM::Position::previousWordBoundary): Updated to gather appropriate text and call through to
1446 AppKit to perform the same calculations NSText uses.
1447 (DOM::Position::nextWordBoundary): Ditto.
1448 (DOM::Position::previousWordPosition): Unrelated change to fix case where the function could get "stuck".
1449 (DOM::Position::nextWordPosition): Ditto
1450 (DOM::Position::equivalentDeepPosition): Changed to look backwards if the position's offset is equal
1451 to the number of child nodes it has. This handles more cases correctly, like when the position is
1452 gives as one beyond the end of a document element's last child.
1453 * kwq/KWQTextUtilities.h: Declared KWQFindNextWordFromIndex.
1454 * kwq/KWQTextUtilities.mm: Added.
1455 (KWQFindNextWordFromIndex): New function.
1457 2004-08-11 Ken Kocienda <kocienda@apple.com>
1463 <rdar://problem/3732702> crash in CSSComputedStyleDeclarationImpl running devtools.com editing sample code
1465 * khtml/khtml_part.cpp:
1466 (KHTMLPart::selectionComputedStyle): Added a null check.
1468 2004-08-10 Darin Adler <darin@apple.com>
1472 - fixed <rdar://problem/3710123> Loading iframe that replaces content in the parent document crashes Safari
1474 I fixed three problems:
1476 1) script interpreter destroyed while it was interpreting scripts, caused random havoc
1477 2) code trying to get to view after view was detached from part, caused nil-deref
1478 3) signals sent to parent after child was no longer in the parent's frames list, caused nil-deref
1480 Now the test page works fine. Hope the real sites do too.
1482 * khtml/khtml_part.h: Add connectChild and disconnectChild helper functions (private).
1483 * khtml/khtml_part.cpp:
1484 (KHTMLPart::clear): Call disconnectChild on each frame as we detach it (see below).
1485 (KHTMLPart::end): Ref the part at the start, and deref the part at the end, of this function.
1486 Otherwise, we can end up destroying the part, and hence the interpreter, inside a script that
1487 the interpreter itself is running.
1488 (KHTMLPart::slotFinishedParsing): Add another check for a nil m_view, after the call to
1490 (KHTMLPart::checkCompleted): Remove bogus if statement with empty body.
1491 (KHTMLPart::processObjectRequest): Call disconnectChild to disconnect the child <-> parent signals of the
1492 old child that the new one is replacing, and connectChild to connect the signals (nicer factoring).
1493 (KHTMLPart::slotChildCompleted): Fixed up a confusing boolean if/expression to be simpler. Not related to
1494 the bug fix, but an earlier version of the fix had changes in this function.
1495 (KHTMLPart::connectChild): Added. Connects the appropriate signals for a child frame.
1496 (KHTMLPart::disconnectChild): Added. Disconnects the same signals that connectChild connects.
1498 * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Added a call to disconnectChild before removing the
1499 child from the frames list.
1501 2004-08-09 Maciej Stachowiak <mjs@apple.com>
1507 - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing
1509 * kwq/WebCoreBridge.mm:
1510 (-[WebCoreBridge setMarkedDOMRange:]): Added this new call to support storing
1511 a marked range in WebCore. The provided DOMRange must start and end in the same
1512 node, which must be a text node.
1513 (-[WebCoreBridge markedDOMRange]): New call to get the marked range.
1514 (-[WebCoreBridge clearMarkedDOMRange]): New call to clear the marked range.
1515 * kwq/WebCoreBridge.h: Prototype new methods.
1516 * kwq/KWQKHTMLPart.mm:
1517 (KWQKHTMLPart::markedRange): Implementation of WebCore call above.
1518 (KWQKHTMLPart::setMarkedRange): Implementation of WebCore call above -
1519 store the marked range, and repaint new and old nodes if needed.
1520 (KWQKHTMLPart::clear): Clear marked range.
1521 * kwq/KWQKHTMLPart.h: Prototype new methods.
1522 * khtml/rendering/render_text.cpp:
1523 (InlineTextBox::paintMarkedTextBackground): New method to paint the background
1524 for marked text, modeled on paintSelection.
1525 (RenderText::paint): Optionally handle painting marked text
1526 background as well as selection background in the marked text
1528 * khtml/rendering/render_text.h: Prototype new method.
1530 2004-08-10 Darin Adler <darin@apple.com>
1534 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1537 (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
1538 (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1540 2004-08-10 Darin Adler <darin@apple.com>
1546 * khtml/editing/jsediting.cpp: Capitalize command names to match Windows.
1547 The dictionary lookup is case insensitive.
1549 * kwq/KWQFoundationExtras.h: Remove inaccurate comment.
1551 2004-08-10 Trey Matteson <trey@apple.com>
1553 3757094 - crash spell checking after a paste
1557 * khtml/rendering/render_text.cpp:
1558 (InlineTextBox::paintSelection): Add nil check.
1560 2004-08-09 Trey Matteson <trey@apple.com>
1562 3756195 - spell checking leaves misspelling marker behind after bad word is deleted
1563 ... and other follow-on spell check fixes
1567 * khtml/rendering/render_text.cpp:
1568 (InlineTextBox::paintMarker): Close inspection shows we were drawing the
1569 misspelling marker one pixel lower than AK, and one pixel outside the selection
1570 rect we draw, in the case of Times-16. So move it up one. Still not an exact
1571 match for AK, but less bad.
1572 * khtml/xml/dom_docimpl.cpp:
1573 (DocumentImpl::removeMarker): Track whether we make any changes, so we only
1574 repaint if something actually changed.
1575 (DocumentImpl::removeAllMarkers): New utility.
1576 (DocumentImpl::removeAllMarkers): Use clear() instead of (errant)
1577 hand-rolled loop to empty array.
1578 (DocumentImpl::shiftMarkers): Track whether we make any changes, so we only
1579 repaint if something actually changed.
1580 * khtml/xml/dom_docimpl.h:
1581 * khtml/xml/dom_textimpl.cpp:
1582 (CharacterDataImpl::deleteData): Along with shifting existing markers around,
1583 remove any markers in the deleted range. Fixes 3756195.
1584 (CharacterDataImpl::replaceData): Ditto for the replaced range.
1585 * kwq/KWQKHTMLPart.mm:
1586 (KWQKHTMLPart::updateSpellChecking): comment
1588 2004-08-08 Trey Matteson <trey@apple.com>
1590 3745023 - Safari crashes trying to access anchor while downloading
1592 I bet this is behind a few other crashers as well. In this bug the start of the
1593 download leaves a KWQPageState hanging around, and when that is freed it damages
1594 the part and view. If you're still using that page, you're dead.
1596 The fix is to properly invalidate the PageState when we receive an error before
1597 reaching WebFrameCommitted state. Normally this happens when a page is reheated
1598 from the PageState, but in this case we never manage to leave the page to begin
1599 with, although we've already created the PageState.
1601 Other errors besides the synthetic one download generates would have caused similar
1602 crashing. Another example would be clicking on a second link before the load
1603 caused by clicking on the first link reached committed state.
1607 * kwq/WebCoreBridge.h:
1608 * kwq/WebCoreBridge.mm:
1609 (-[WebCoreBridge didNotOpenURL:pageCache:]): Invalidate the pageCache state
1610 when a load doesn't get off the ground.
1612 2004-08-06 Ken Kocienda <kocienda@apple.com>
1616 Finish off spellchecking support to HTML editing. Includes work to
1617 enable continuous spellchecking.
1619 * khtml/editing/htmlediting_impl.cpp:
1620 (khtml::EditCommandImpl::markMisspellingsInSelection): Basically, a one-liner convenience to
1621 make the call over to the KWQKHTMLPart.
1622 (khtml::ReplaceSelectionCommandImpl::doApply): Did some rearranging of code so that the
1623 inserted content can be spell-checked. The function is basically the same, except for
1624 the addition of calls to markMisspellingsInSelection.
1625 (khtml::TypingCommandImpl::markMisspellingsAfterTyping): New function. Takes a look at the
1626 selection that results after typing and determines whether it needs to spellcheck.
1627 Since the word containing the current selection is never marked, this does a check to
1628 see if typing made a new word that is not in the current selection. Basically, you
1629 get this by being at the end of a word and typing a space.
1630 (khtml::TypingCommandImpl::typingAddedToOpenCommand): Call markMisspellingsAfterTyping.
1631 * khtml/editing/htmlediting_impl.h: Add new function declarations.
1632 * khtml/khtml_part.cpp:
1633 (KHTMLPart::setSelection): Since spell checks are updated when the selection changes,
1634 and every selection change passes through here, this is a good place to put the call
1635 to the spellchecker.
1636 * khtml/rendering/render_text.cpp:
1637 (InlineTextBox::paintMarker): Remove temporary misspelling line drawing code. Replace with
1638 call that does AppKit-style drawing. Fix up some comments.
1639 * khtml/xml/dom_docimpl.cpp:
1640 (DocumentImpl::addMarker): Repaint the node that had the marker added. This makes it show
1642 (DocumentImpl::removeMarker): Ditto.
1643 (DocumentImpl::removeAllMarkers): New function. Convenience for clearing all markers.
1644 Used when not in continuous spellchecking mode.
1645 (DocumentImpl::shiftMarkers): Moves markers in response to changes in a node's contents.
1646 This shifts the marker offsets by a given amount. This keeps the markers in the right
1647 place when a user types in a node with markers already set on it.
1648 * khtml/xml/dom_docimpl.h: Added new functions. Removed unnecessary enum qualifier from some
1650 * khtml/xml/dom_position.cpp:
1651 (DOM::Position::previousWordBoundary): This function was susceptible to endless loops...and
1652 needlessly so. Basically, if the current position is at a word boundary, run the code again
1653 to find the previous word boundary.
1654 (DOM::Position::nextWordBoundary): Same as above, but for next word boundary.
1655 * khtml/xml/dom_textimpl.cpp:
1656 (CharacterDataImpl::setData): Call shiftMarkers to update markers when this node changes.
1657 (CharacterDataImpl::insertData): Ditto.
1658 (CharacterDataImpl::deleteData): Ditto.
1659 (CharacterDataImpl::replaceData): Ditto.
1660 * kwq/KWQKHTMLPart.h:
1661 * kwq/KWQKHTMLPart.mm:
1662 (KWQKHTMLPart::advanceToNextMisspelling):
1663 (KWQKHTMLPart::markMisspellingsInSelection):
1664 (KWQKHTMLPart::updateSpellChecking):
1665 (KWQKHTMLPart::respondToChangedSelection):
1667 * kwq/KWQPainter.mm:
1668 (QPainter::drawLineForMisspelling): New function. Call over to WebKit to do the drawing.
1669 * kwq/WebCoreBridge.h:
1670 * kwq/WebCoreBridge.mm:
1671 (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Pass markMisspellings flag to
1673 * kwq/WebCoreTextRenderer.h:
1677 2004-08-05 David Hyatt <hyatt@apple.com>
1679 Fix for 3752542, stack overflow that crashes Safari at www.dr.dk. This bug is a regression caused by a fix that
1680 attempted to repair <caption> behavior to make it behave like Panther. This fix was incorrect, and in addition
1681 even our <caption> behavior on Panther was incorrect.
1683 The patch that fixes this bug also makes <caption> handling work when <caption>s are contained inside a <td>, a <tr>,
1684 a <th>, or various table section tags (<tbody>, <tfoot>, <thead>). The <caption> is pulled out and inserted just before
1685 the relevant ancestor table section. This behavior matches other browsers.
1689 * khtml/html/htmlparser.cpp:
1690 (KHTMLParser::insertNode):
1692 2004-08-04 David Hyatt <hyatt@apple.com>
1694 The top-level XSL sheet is now loaded and shows up in the activity window. It is not yet parsed.
1696 Reviewed by kocienda
1698 * WebCore.pbproj/project.pbxproj:
1699 * khtml/css/css_base.h:
1700 (DOM::StyleBaseImpl::isXSLStyleSheet):
1701 * khtml/css/css_stylesheetimpl.cpp:
1702 (CSSStyleSheetImpl::CSSStyleSheetImpl):
1703 * khtml/css/css_stylesheetimpl.h:
1704 (DOM::StyleSheetImpl::isLoading):
1705 * khtml/misc/loader.cpp:
1706 * khtml/xml/dom_xmlimpl.cpp:
1707 (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
1708 (DOM::ProcessingInstructionImpl::checkStyleSheet):
1709 (DOM::ProcessingInstructionImpl::sheet):
1710 (DOM::ProcessingInstructionImpl::isLoading):
1711 (DOM::ProcessingInstructionImpl::setStyleSheet):
1712 * khtml/xml/dom_xmlimpl.h:
1714 2004-08-04 David Hyatt <hyatt@apple.com>
1716 Add XSL Stylesheets to the WebCore cache.
1718 Reviewed by kocienda
1720 * khtml/misc/loader.cpp:
1721 (CachedXSLStyleSheet::CachedXSLStyleSheet):
1722 (CachedXSLStyleSheet::ref):
1723 (CachedXSLStyleSheet::deref):
1724 (CachedXSLStyleSheet::data):
1725 (CachedXSLStyleSheet::checkNotify):
1726 (CachedXSLStyleSheet::error):
1727 (DocLoader::requestXSLStyleSheet):
1728 (Cache::requestXSLStyleSheet):
1729 (Cache::getStatistics):
1730 * khtml/misc/loader.h:
1731 (khtml::CachedObject::):
1732 (khtml::CachedXSLStyleSheet::sheet):
1733 (khtml::CachedXSLStyleSheet::schedule):
1735 2004-08-03 Ken Kocienda <kocienda@apple.com>
1739 Changes to improve our handling of object tags during editing, including
1742 <rdar://problem/3744533> Problem editing <OBJECT> elements displayed by WebPlugIns
1744 Part of the fix for this bug involves removing the close() function from render objects.
1745 It was decided that this code was no longer needed, as the work it did could be moved
1746 to other, more modern, places.
1750 <rdar://problem/3748537> crash due to nil node passed into parentNode in computeTypingStyle deleting text
1752 Finally, I filed and fixed this bug I discovered while fixing the one above:
1754 <rdar://problem/3749338> Select-all + delete leaves editing view without blinking caret
1756 * khtml/editing/htmlediting_impl.cpp:
1757 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): Fix for 3748537. Put in some more null
1758 checks. Bail, returning 0 for typing style if any null checks yield a null.
1759 (khtml::DeleteSelectionCommandImpl::doApply): Fix for 3749338. A removeNodeAndPrune call may wind
1760 up deleting the node where we calculated that we wanted to put the selection after deleting.
1761 If this happens, move this ending selection to a sensible alternative.
1762 (khtml::RemoveNodeAndPruneCommandImpl::doApply): Call previousNodeConsideringAtomicNodes instead
1763 of traversePreviousNode when doing the prune.
1764 * khtml/html/html_objectimpl.cpp:
1765 (HTMLObjectElementImpl::attach): Part of the fix for 3744533.
1766 (HTMLObjectElementImpl::recalcStyle): Change old strcmp check for type of renderer to be a call
1767 to canRenderImageType.
1768 (HTMLObjectElementImpl::childrenChanged): New function. Helps to keep object tags up to date
1769 as their children change. This also will help to make object tags respond properly to having their
1770 params changed by DOM calls.
1771 * khtml/html/html_objectimpl.h: Cosmetic change.
1772 * khtml/html/htmlparser.cpp:
1773 (KHTMLParser::insertNode): Remove call to obsolete closeRenderer() function.
1774 (KHTMLParser::popOneBlock): Ditto.
1775 * khtml/rendering/render_block.cpp:
1776 (khtml::RenderBlock::makeChildrenNonInline): Remove call to obsolete close() function.
1777 * khtml/rendering/render_container.cpp:
1778 (RenderContainer::updatePseudoChild): Ditto.
1779 * khtml/rendering/render_form.cpp: Remove obsolete close() function.
1780 * khtml/rendering/render_form.h: Ditto.
1781 * khtml/rendering/render_frames.cpp: Ditto.
1782 * khtml/rendering/render_frames.h: Ditto.
1783 * khtml/rendering/render_inline.cpp:
1784 (RenderInline::splitFlow): Remove calls to obsolete close() function.
1785 * khtml/rendering/render_object.h: Remove obsolete close() function.
1786 * khtml/rendering/render_table.cpp:
1787 (RenderTableCell::layout): Ditto.
1788 * khtml/rendering/render_table.h: Ditto.
1789 * khtml/xml/dom_docimpl.cpp:
1790 (DocumentImpl::closeInternal): Remove call to obsolete close() function.
1791 * khtml/xml/dom_nodeimpl.cpp: Remove obsolete m_rendererNeedsClose initialization.
1792 (NodeImpl::NodeImpl): Remove obsolete closeRenderer() function.
1793 (NodeImpl::attach): Remove call to obsolete close() function.
1794 (NodeImpl::isAtomicNode): New function. Helps to fix 3744533. Determines if a node should
1795 be treated as an atomic node for the purposes of editing.
1796 (NodeImpl::previousNodeConsideringAtomicNodes): New helper to traverse tree taking atomic nodes
1798 (NodeImpl::nextNodeConsideringAtomicNodes): Ditto.
1799 (NodeImpl::previousLeafNode): Now calls nextNodeConsideringAtomicNodes to iterate. This helps to
1800 prevent deleting PARAM tag portions of object tags erroneously.
1801 (NodeImpl::nextLeafNode): Ditto.
1802 * khtml/xml/dom_nodeimpl.h: Removed m_rendererNeedsClose bit. Added declarations for new functions.
1803 * khtml/xml/dom_position.cpp:
1804 (DOM::Position::equivalentDeepPosition): Now takes atomic nodes into account as it drills down into the
1806 * khtml/xml/xml_tokenizer.cpp:
1807 (khtml::XMLTokenizer::endElement): Remove call to obsolete closeRenderer() function.
1809 2004-08-03 David Hyatt <hyatt@apple.com>
1811 Add the deprecated text/xsl MIME type (introduced by Internet Explorer 5) as an acceptable MIME type for XML
1816 * khtml/ecma/xmlhttprequest.cpp:
1817 (KJS::XMLHttpRequest::getValueProperty):
1818 * khtml/khtml_part.cpp:
1820 * khtml/misc/loader.cpp:
1821 (CachedXBLDocument::CachedXBLDocument):
1823 2004-08-03 Maciej Stachowiak <mjs@apple.com>
1827 - remove assertions that asserted text is non-empty, just avoid
1828 doing anything for the empty case; this is needed because input
1829 methods like to insert empty text in various cases.
1831 * khtml/editing/htmlediting_impl.cpp:
1832 (khtml::InsertTextCommandImpl::InsertTextCommandImpl):
1833 (khtml::InsertTextCommandImpl::doApply):
1834 (khtml::InsertTextCommandImpl::doUnapply):
1836 2004-08-03 Darin Adler <darin@apple.com>
1840 - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText)
1842 * khtml/xml/dom2_rangeimpl.h: Added text function. Like innerText, but on a range.
1843 * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::text): Added.
1845 * kwq/DOM.mm: (-[DOMRange _text]): Added. Calls DOM::RangeImpl::text.
1846 * kwq/DOMPrivate.h: Added.
1848 * WebCore.pbproj/project.pbxproj: Added DOMPrivate.h, an internal header (private in WebKit, internal here).
1850 2004-08-02 John Sullivan <sullivan@apple.com>
1854 WebCore part of fix for <rdar://problem/3631868> NSToolbar adoption:
1855 Tab key should cycle around toolbar and page content
1857 * kwq/WebCoreBridge.mm:
1858 (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
1859 Made this method start looking from the current focus node. This won't
1860 affect any existing callers because there were no existing callers.
1861 (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
1864 2004-08-02 David Hyatt <hyatt@apple.com>
1866 Create a #define for XSLT support that at the moment will only be enabled on Tiger.
1868 Reviewed by kocienda
1872 2004-08-02 Ken Kocienda <kocienda@apple.com>
1878 <rdar://problem/3747945> Deleting replaced element can cause crash
1880 * khtml/xml/dom_selection.cpp:
1881 (DOM::Selection::layoutCaret): The crux of the problem is that
1882 the caret drawing code tries to draw the caret at the image
1883 offset after it has been removed from the document. So, make
1884 sure the start node for the selection is in the document before
1885 trying to lay out the caret using that node.
1887 2004-07-31 Ken Kocienda <kocienda@apple.com>
1891 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1892 <rdar://problem/3746408> HTMLCompose: cannot type in message body of new messages (and tabbing causes a crash.)
1894 * kwq/KWQKHTMLPart.mm:
1895 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Add in some smarts to look around for
1896 a good place to put the caret if focus is turning "on", the part is contentEditable,
1897 and it does not currently have a selection. This has the effect of flashing the caret
1898 in a contentEditable view automatically without requiring the programmer to set a
1899 selection explicitly. This also fixes the bug listed above. Both are cases where the
1900 bad behavior happened since the editing code tried to process input without an active
1901 selection. I always took the extra step of setting the selection explicitly when
1902 opening new windows in programs like Blot, but it seems silly to require developers to
1903 do this in general. With this patch, they no longer need to.
1905 2004-07-30 Ken Kocienda <kocienda@apple.com>
1911 <rdar://problem/3745498> HTMLCompose: Can't edit new empty message (and typing eventually crashes)
1913 * khtml/xml/dom_selection.cpp:
1914 (DOM::Selection::layoutCaret): Don't bail when the start position of the selection is not in rendered
1915 content. The validate() bottleneck function will do all it can to make sure that the start is
1916 moved to rendered content if at all possible before this function runs. If no rendered position can
1917 be found, like in the case of an empty body element, we still want to flash the caret there.
1918 (DOM::Selection::validate): Look for rendered positions for the base and extent, but save off the
1919 base before making this move, and set the selection to the enclosing block flow element of this
1920 original base if no rendered positions can be found. This has the effect of flashing the caret
1921 someplace in an editable block, even if it does not contain any rendered content.
1923 2004-07-30 Ken Kocienda <kocienda@apple.com>
1927 Fix a large number of editing layout test regressions.
1929 * khtml/misc/khtml_text_operations.cpp:
1930 (khtml::TextIterator::TextIterator): Use a new way to compute the end offset of a node for
1931 purposes of text iteration. The end offset is either child count of a node with children,
1932 or the maxOffset() of a node that does not.
1933 * khtml/xml/dom_nodeimpl.cpp: Remove maxOffset() implementation from NodeBaseImpl. This
1934 conflicted with the usage of this function that is needed for editing.
1935 * khtml/xml/dom_nodeimpl.h: Ditto.
1937 2004-07-30 Trey Matteson <trey@apple.com>
1939 Next steps for spell checking: We have data structures for the marked pieces of
1940 text and the smarts to draw them (although at this point, they just get a green
1941 underline instead of using the real AppKit pattern.)
1943 Note we don't call this code outside of development, since at this point I suspect
1944 it could be made to crash by mixing spelling and editing.
1948 * khtml/rendering/render_text.cpp:
1949 (InlineTextBox::paintMarker): Paint one marker's intersection with a text run
1950 (RenderText::paint): Find intersections of all markers and runs, call paintMarker
1951 * khtml/rendering/render_text.h:
1952 * khtml/xml/dom_docimpl.cpp:
1953 (DocumentImpl::addMarker): Adds a marker to a DOM Range.
1954 (DocumentImpl::removeMarker): Removes a marker from a DOM Range.
1955 (DocumentImpl::addMarker): Adds a marker to a single DOM Node, merging previous
1957 (DocumentImpl::removeMarker): Removes a marker from a single DOM Node, breaking
1958 up previous markers as needed.
1959 (DocumentImpl::markersForNode): Return markers for a Node.
1960 * khtml/xml/dom_docimpl.h:
1961 (DOM::DocumentMarker::): New marker struct
1962 (DOM::DocumentMarker::operator == ):
1963 (DOM::DocumentMarker::operator != ):
1964 * kwq/KWQKHTMLPart.mm:
1965 (KWQKHTMLPart::advanceToNextMisspelling): Mark misspelled ranges when we find them.
1968 2004-07-29 Maciej Stachowiak <mjs@apple.com>
1972 <rdar://problem/3745808> Seed: WebKit: Table's caption broken
1974 * khtml/html/htmlparser.cpp:
1975 (KHTMLParser::insertNode): When a caption appears in an illegal
1976 place in a table, pop blocks until we hit a place where it's
1981 2004-07-29 Darin Adler <darin@apple.com>
1985 - added constants for motion across entire document for use in operations like
1986 move to beginning of document
1988 * khtml/xml/dom_selection.h: Added DOCUMENT to ETextGranularity.
1989 * khtml/xml/dom_selection.cpp:
1990 (DOM::Selection::modifyExtendingRightForward): Added case for DOCUMENT.
1991 (DOM::Selection::modifyMovingRightForward): Added case for DOCUMENT.
1992 (DOM::Selection::modifyExtendingLeftBackward): Added case for DOCUMENT.
1993 (DOM::Selection::modifyMovingLeftBackward): Added case for DOCUMENT.
1994 (DOM::Selection::validate): Changed if statements into switch statement,
1995 added case for DOCUMENT.
1997 * kwq/WebCoreBridge.h: Added WebCoreBridge to WebSelectionGranularity.
1999 2004-07-28 Trey Matteson <trey@apple.com>
2001 Small refinement of last checkin. The text iterators now return reasonable values
2002 for range() when atEnd, which gets rid of special cases and pitfalls in the client.
2006 * khtml/misc/khtml_text_operations.cpp:
2007 (khtml::TextIterator::TextIterator): Set endOffset to a valid value instead of
2009 (khtml::TextIterator::range): Implement when atEnd.
2010 (khtml::CharacterIterator::range): Don't massage result when atEnd.
2011 (khtml::WordAwareIterator::WordAwareIterator): Now that this is fixed, we no
2012 longer need this special case.
2013 (khtml::WordAwareIterator::advance): Always set range, even when atEnd, now that
2014 TextIterator::range() always works.
2015 * khtml/xml/dom_nodeimpl.cpp:
2016 (NodeImpl::childNodeCount): Made const
2017 (NodeBaseImpl::maxOffset): Add missing implementation
2018 * khtml/xml/dom_nodeimpl.h:
2019 * kwq/KWQKHTMLPart.mm:
2020 (KWQKHTMLPart::advanceToNextMisspelling): Get rid of special cases, always call
2021 range on our iterator even when it is atEnd.
2023 2004-07-28 Maciej Stachowiak <mjs@apple.com>
2027 <rdar://problem/3678534> controls on page at http://help.sap.com don't work properly
2029 To fix this I implemented the various JavaScript BarInfo properties in JavaScript.
2031 * khtml/ecma/kjs_window.cpp:
2033 (Window::locationbar):
2035 (Window::personalbar):
2036 (Window::statusbar):
2038 (Window::scrollbars):
2041 (SelectionFunc::tryCall):
2043 (BarInfo::~BarInfo):
2046 * khtml/ecma/kjs_window.h:
2049 (KJS::BarInfo::part):
2050 (KJS::BarInfo::classInfo):
2051 * khtml/ecma/kjs_window.lut.h:
2053 * kwq/KWQKHTMLPart.h:
2054 * kwq/KWQKHTMLPart.mm:
2055 (KWQKHTMLPart::locationbarVisible):
2056 (KWQKHTMLPart::menubarVisible):
2057 (KWQKHTMLPart::personalbarVisible):
2058 (KWQKHTMLPart::scrollbarsVisible):
2059 (KWQKHTMLPart::statusbarVisible):
2060 (KWQKHTMLPart::toolbarVisible):
2062 2004-07-28 Ken Kocienda <kocienda@apple.com>
2066 Added more layout tests.
2068 * layout-tests/editing/style/style-3681552-fix-001-expected.txt: Added.
2069 * layout-tests/editing/style/style-3681552-fix-001.html: Added.
2070 * layout-tests/editing/style/style-3681552-fix-002-expected.txt: Added.
2071 * layout-tests/editing/style/style-3681552-fix-002.html: Added.
2072 * layout-tests/editing/style/style-3690704-fix-expected.txt: Added.
2073 * layout-tests/editing/style/style-3690704-fix.html: Added.
2074 * layout-tests/editing/style/typing-style-001-expected.txt: Added.
2075 * layout-tests/editing/style/typing-style-001.html: Added.
2076 * layout-tests/editing/style/typing-style-002-expected.txt: Added.
2077 * layout-tests/editing/style/typing-style-002.html: Added.
2079 2004-07-28 Ken Kocienda <kocienda@apple.com>
2083 Added some layout tests.
2085 * layout-tests/editing/selection/select-all-001-expected.txt: Added.
2086 * layout-tests/editing/selection/select-all-001.html: Added.
2087 * layout-tests/editing/selection/select-all-002-expected.txt: Added.
2088 * layout-tests/editing/selection/select-all-002.html: Added.
2089 * layout-tests/editing/selection/select-all-003-expected.txt: Added.
2090 * layout-tests/editing/selection/select-all-003.html: Added.
2092 2004-07-28 Trey Matteson <trey@apple.com>
2094 Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up.
2096 At this point, no special marking of misspellings, no grammar check, no context
2097 menu integration, no "check continually" mode.
2099 Much of the TextIterator and CharacterIterator interface got published outside
2100 of khtml_text_operations.cpp, with a little API rationalizing.
2104 * khtml/misc/khtml_text_operations.cpp:
2105 (khtml::TextIterator::range): Name changes.
2106 (khtml::CharacterIterator::CharacterIterator): Ditto.
2107 (khtml::CharacterIterator::range): Ditto.
2108 (khtml::CharacterIterator::advance): Ditto.
2109 (khtml::CharacterIterator::string): New method to consume chars into a string.
2110 (khtml::WordAwareIterator::WordAwareIterator): New class that iterates over
2111 the text respecting word boundaries.
2112 (khtml::WordAwareIterator::advance):
2113 (khtml::WordAwareIterator::length):
2114 (khtml::WordAwareIterator::characters):
2115 (khtml::plainText): Name changes.
2116 (khtml::findPlainText): Ditto.
2118 API moved from cpp to header file.
2119 * khtml/misc/khtml_text_operations.h:
2120 (khtml::TextIterator::atEnd):
2121 (khtml::TextIterator::length):
2122 (khtml::TextIterator::characters):
2123 (khtml::CharacterIterator::atBreak):
2124 (khtml::CharacterIterator::atEnd):
2125 (khtml::CharacterIterator::length):
2126 (khtml::CharacterIterator::characters):
2127 (khtml::CharacterIterator::characterOffset):
2128 (khtml::WordAwareIterator::atEnd):
2129 (khtml::WordAwareIterator::range):
2131 * khtml/xml/dom_position.cpp:
2132 (DOM::Position::previousWordBoundary): New name for the old routine. This routines semantics
2133 match the current behavior of this code.
2134 (DOM::Position::nextWordBoundary): Ditto.
2135 (DOM::Position::previousWordPosition): Call old code with the new name. When we fix
2136 word advancement, this routine will have its own impl.
2137 (DOM::Position::nextWordPosition): Ditto.
2138 * khtml/xml/dom_position.h:
2139 * khtml/xml/dom_selection.h:
2140 (DOM::Selection::rangeStart): New convenience methods
2141 (DOM::Selection::rangeEnd):
2142 * kwq/KWQKHTMLPart.h:
2143 * kwq/KWQKHTMLPart.mm:
2144 (KWQKHTMLPart::findString): Ensure we use range-compatible positions.
2145 (KWQKHTMLPart::advanceToNextMisspelling): Brand new.
2146 * kwq/WebCoreBridge.h:
2147 * kwq/WebCoreBridge.mm:
2148 (-[WebCoreBridge advanceToNextMisspelling]): Typical bridge glue.
2150 2004-07-28 Ken Kocienda <kocienda@apple.com>
2156 <rdar://problem/3690704> marking partly bold text italic across blocks wrongly extends the bold section
2158 * khtml/editing/htmlediting_impl.cpp:
2159 (khtml::ApplyStyleCommandImpl::doApply): Fixed loop that gathers up groups of nodes to
2160 pass off to the function that applies styles. While this is meant to be conservative in
2161 order to leave the DOM well-formed in all cases, it contained an error where the set
2162 of nodes to be styled together erroneously could include a node that was meant for
2163 the next set. Fixed.
2164 (khtml::ApplyStyleCommandImpl::applyStyleIfNeeded): Unrelated change to remove DOM:: scope
2165 resolution qualifier. Unneeded here.
2167 2004-07-28 Darin Adler <darin@apple.com>
2171 - fixed <rdar://problem/3658471> REGRESSION: Node.appendChild( ) fails when parent already contains that child
2173 * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::isAncestor): Restore the original meaning of this function.
2174 It returns true if the parameter is an ancestor of this, but had been changed to return true if this
2175 is an ancestor of the parameter. However, we do retain one change we made at the same time, which is
2176 that it does not consider a node an ancestor of itself.
2178 * khtml/editing/htmlediting_impl.cpp: (khtml::ApplyStyleCommandImpl::nodeFullySelected):
2179 * khtml/xml/dom2_traversalimpl.cpp: (DOM::NodeIteratorImpl::notifyBeforeNodeRemoval):
2180 Reverse parameters for callers who wanted the new meaning of isAncestor, with care to not use it in
2181 any cases where the pointer might be 0.
2183 * khtml/xml/dom_nodeimpl.h: Added const to the parameter to make things more symmetric and allow the
2184 new uses to all compile.
2186 2004-07-28 Ken Kocienda <kocienda@apple.com>
2192 <rdar://problem/3681552> html editing needs to preserve typing font when replacing selection
2194 * khtml/css/css_valueimpl.cpp:
2195 (CSSStyleDeclarationImpl::merge): New helper that merges styles together. Helpful for
2196 dealing with typing styles.
2197 * khtml/css/css_valueimpl.h:
2198 * khtml/editing/htmlediting_impl.cpp:
2199 (khtml::DeleteSelectionCommandImpl::computeTypingStyle): New helper that updates the
2200 typing style based on the current selection. This is a convenient bottleneck for all
2201 the code that needs to worry about typing style.
2202 (khtml::DeleteSelectionCommandImpl::doApply): Update typing style before doing the delete.
2203 (khtml::InputNewlineCommandImpl::doApply): No need to redeclare exceptionCode local.
2205 (khtml::InputTextCommandImpl::prepareForTextInsertion): Remove unneeded complication when
2206 figuring out where to insert style node. Not even sure what I was trying to do here, but
2207 it does not seem to be needed any more.
2208 (khtml::InputTextCommandImpl::execute): Remove unneeded comment.
2209 * khtml/editing/htmlediting_impl.h: Declare new computeTypingStyle helper.
2210 * khtml/khtml_part.cpp:
2211 (KHTMLPart::setCaretVisible): Call selectionLayoutChanged instead of notifySelectionChanged
2212 in this function. The selection did not change simply by calling this function, but it
2214 (KHTMLPart::notifySelectionChanged): Treat clearing the typing style much like closing typing,
2215 instead of clearing it unconditionally.
2216 (KHTMLPart::applyStyle): In the case where the current selection is a caret, merge the
2217 style being applied with any current typing style that already exists.
2219 2004-07-28 Darin Adler <darin@apple.com>
2223 - fixed <rdar://problem/3711080> REGRESSION (125-146): form fields have shrunk by 1 pixel, and now clip descenders
2225 * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth):
2226 Compute the size without ever calling cellSize. After talking with Andrew Platzer,
2227 we decided that hard-coding the size of the borders of a text field was the best
2228 way for WebCore to handle this.
2230 2004-07-28 Darin Adler <darin@apple.com>
2234 - fixed <rdar://problem/3743204> REGRESSION: crash at startribune.com in InlineBox::root()
2236 * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild):
2237 Added a check for nil.
2239 2004-07-27 Darin Adler <darin@apple.com>
2243 - fixed <rdar://problem/3743138> opaque colors come out of getComputedStyle as "rgba", transparent ones as "rgb"
2245 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cssText): Use "rgb" rather than
2246 "rgba" when alpha is 0xFF, not when alpha is 0.
2248 2004-07-27 Ken Kocienda <kocienda@apple.com>
2252 Fixed the problem where BR elements on lines by themselves don't paint when selected.
2254 * khtml/khtml_part.cpp:
2255 (KHTMLPart::selectAll): Related fix. Include BR's when figuring out what "all" is.
2256 * khtml/rendering/render_br.cpp:
2257 (RenderBR::paint): New function implementation. Teach BR's how to paint selections.
2258 * khtml/rendering/render_br.h:
2259 * khtml/rendering/render_text.cpp:
2260 (InlineTextBox::paintSelection): Fix some geometry calculations to be more readable (i.e. don't
2261 reuse function argument as a local). Also, improve the logic for determining whether to
2262 extend the selection to block boundaries.
2263 (RenderText::paint): Remove extendSelection argument from paintSelection. The logic to figure out
2264 extensions is now fully contained in paintSelection.
2265 * khtml/rendering/render_text.h:
2267 2004-07-27 David Hyatt <hyatt@apple.com>
2269 Fix for 3665211 (again). Make sure not to leave child line boxes pointing to deleted ancestor line boxes.
2271 Reviewed by kocienda
2273 * khtml/rendering/render_block.cpp:
2274 (khtml::RenderBlock::removeChild):
2276 2004-07-26 Chris Blumenberg <cblu@apple.com>
2278 Fixed: WebView scrolls to the top after making an editing change via drag & drop
2280 Fixed by Ken, reviewed by me.
2282 * kwq/WebCoreBridge.mm:
2283 (-[WebCoreBridge ensureCaretVisible]): do nothing if the selection is not a caret
2287 2004-07-26 Maciej Stachowiak <mjs@apple.com>
2291 <rdar://problem/3740855> REGRESSION: Flash incorrectly positioned at macromedia.com
2293 * khtml/html/htmltokenizer.cpp:
2294 (khtml::HTMLTokenizer::scriptExecution): Do the prepending-src
2295 trick as for inline script execution.
2297 Added new layout tests covering this and other recent tokenizer
2300 * layout-tests/fast/tokenizer/001-expected.txt: Added.
2301 * layout-tests/fast/tokenizer/001.html: Added.
2302 * layout-tests/fast/tokenizer/002-expected.txt: Added.
2303 * layout-tests/fast/tokenizer/002.html: Added.
2304 * layout-tests/fast/tokenizer/003-expected.txt: Added.
2305 * layout-tests/fast/tokenizer/003.html: Added.
2306 * layout-tests/fast/tokenizer/resources/003-script.js: Added.
2308 2004-07-23 Ken Kocienda <kocienda@apple.com>
2314 <rdar://problem/3738920> Caret blinks in inactive window
2316 As part of the fix, I cleaned up the way we handle special drawing that needs
2317 to be done in the HTML view that is first responder in the key window (e.g the
2318 drawing of text selection highlight and caret blinking).
2320 * khtml/khtml_part.cpp: Removed setCaretVisible function. Updating caret visibility
2321 is now done in setDisplaysWithFocusAttributes, described below.
2322 * khtml/khtml_part.h: Ditto.
2323 * khtml/khtmlpart_p.h:
2324 (KHTMLPartPrivate::KHTMLPartPrivate): m_caretVisible now defaults to false. This prevents
2325 the caret from blinking when an app is started from the command line and remains in the
2327 * khtml/khtmlview.cpp:
2328 (KHTMLView::focusInEvent): Remove caret code from here. Not needed.
2329 (KHTMLView::focusOutEvent): Ditto.
2330 * kwq/KWQKHTMLPart.h:
2331 (KWQKHTMLPart::displaysWithFocusAttributes): New accessor to return cached value to other code
2333 * kwq/KWQKHTMLPart.mm:
2334 (KWQKHTMLPart::KWQKHTMLPart):
2335 (KWQKHTMLPart::setDisplaysWithFocusAttributes): Renamed from setShowsFirstResponder and modified
2336 to do the display updating in a clearer way....and now has comments!
2337 * kwq/WebCoreBridge.h: Remove several obsolete functions that use to try to do the work of the new
2338 setDisplaysWithFocusAttributes function (and did so less well).
2339 * kwq/WebCoreBridge.mm:
2340 (-[WebCoreBridge drawRect:]): Now calls displaysWithFocusAttributes to figure out how to draw the
2341 text selection background.
2342 (-[WebCoreBridge setDisplaysWithFocusAttributes:]): Calls through to setDisplaysWithFocusAttributes in
2344 (-[WebCoreBridge selectionColor]): Flipped the value of this ternary expression to accommodate the
2345 change from usesInactiveTextBackgroundColor to setDisplaysWithFocusAttributes.
2346 (-[WebCoreBridge setCaretVisible:]): Removed.
2348 2004-07-23 John Sullivan <sullivan@apple.com>
2352 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
2353 now also extends selection (even if there wasn't one before)
2355 * khtml/khtml_part.cpp:
2356 (KHTMLPart::handleMousePressEventSingleClick):
2357 Uh, duh. Got a ! wrong last time somehow, so it did even more the wrong thing
2358 than ever. I did test this before, so my best guess is an accidental undo or
2359 something before committing.
2361 2004-07-23 David Hyatt <hyatt@apple.com>
2363 Fix for 3735084 and 3737209, when you can find no line boxes in your previous sibling, the line box to dirty
2364 should be the *first* line box and not the last.
2366 Reviewed by kocienda
2368 * khtml/rendering/render_flow.cpp:
2369 (RenderFlow::dirtyLinesFromChangedChild):
2371 2004-07-23 Ken Kocienda <kocienda@apple.com>
2375 * khtml/xml/dom_selection.cpp:
2376 (DOM::Selection::validate): Not exactly a fix of anything per se, but more of a refinement
2377 of how selection validation works. The idea is to let the selection validation process
2378 end up with an empty selection given real DOM position inputs if the validation code
2379 cannot find a rendered position. Since selection is all about display, this makes sense.
2380 Currently, the code will allow the selection to be placed in a location that is not
2381 rendered, and this does nobody any good, as it can lead to bugs like accepting key input
2382 in a div that is set to display:none.
2384 2004-07-23 Ken Kocienda <kocienda@apple.com>
2388 Updated layout tests with new expected results.
2390 * layout-tests/editing/execCommand/boldSelection-expected.txt
2391 * layout-tests/editing/selection/extend-by-character-001-expected.txt
2392 * layout-tests/editing/selection/extend-by-character-003-expected.txt
2393 * layout-tests/editing/selection/unrendered-005-expected.txt
2395 2004-07-22 Maciej Stachowiak <mjs@apple.com>
2399 <rdar://problem/3725467> REGRESSION(140-142) nothing displayed at http://Ye-Olde-Movies.tripod.com
2400 <rdar://problem/3599494> REGRESSION (100-125): Frame does not refresh until user clicks on browser.
2402 * khtml/rendering/render_frames.cpp:
2403 (RenderFrameSet::layout): When returning early because there are
2404 no children, make sure to mark self as no longer needing
2405 layout. Otherwise, when children are added, we'll fail to
2406 propagate childrenNeedLayout to our own parent! This is almost
2407 certainly a long-standing bug that was just masked by our old
2410 2004-07-22 Kevin Decker <kdecker@apple.com>
2414 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
2416 * khtml/ecma/kjs_events.cpp:
2417 (JSLazyEventListener::JSLazyEventListener):
2418 (JSLazyEventListener::parseCode):
2419 * khtml/ecma/kjs_events.h:
2420 * khtml/ecma/kjs_proxy.cpp:
2421 (KJSProxyImpl::createHTMLEventHandler):
2422 * khtml/ecma/kjs_window.cpp:
2423 (Window::getJSLazyEventListener):
2424 * khtml/ecma/kjs_window.h:
2426 2004-07-22 Ken Kocienda <kocienda@apple.com>
2432 <rdar://problem/3724344> Bolding and unbolding creates extraneous tags
2434 * khtml/editing/htmlediting_impl.cpp:
2435 (khtml::ApplyStyleCommandImpl::doApply): Move the start of the selection upstream
2436 before calling removeStyle. This makes sure we remove all styles that could apply to the
2437 selection, and not just ones in from the start position of the selection passed to us.
2439 * khtml/xml/dom_selection.cpp:
2440 (DOM::Selection::validate): Related fix to "constrain" the selection to be the
2441 smallest equivalent range of nodes, in effect making a "canonical" version of the
2442 selection. While this is not strictly necessary to fix the bug, it is a step I have been
2443 wanting to take this step for a long time, and some recent improvements made it
2444 possible for me to do now in just two lines of code.
2446 2004-07-22 Ken Kocienda <kocienda@apple.com>
2452 <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
2454 * khtml/rendering/render_container.cpp:
2455 (RenderContainer::positionForCoordinates): Don't assume you can pass off
2456 the check to a first child if there is one, since the child can be an element
2457 we do not want to place the caret in, like a table row with no cells (the case
2458 in the bug above). So now, we iterate of the renderer's children looking for
2459 the closest one, but only consider those renderers which either have children
2460 themselves, or are render block flows or are render inlines.
2462 2004-07-22 Darin Adler <darin@apple.com>
2464 - remove a bunch of now-unused code
2466 * ForwardingHeaders/qxml.h: Removed.
2467 * kwq/KWQXmlAttributes.h: Removed.
2468 * kwq/KWQXmlAttributes.mm: Removed.
2469 * kwq/KWQXmlDefaultHandler.h: Removed.
2470 * kwq/KWQXmlDefaultHandler.mm: Removed.
2471 * kwq/KWQXmlSimpleReader.h: Removed.
2472 * kwq/KWQXmlSimpleReader.mm: Removed.
2474 2004-07-22 Darin Adler <darin@apple.com>
2478 - got rid of QXml classes and changed XML parsing to use libxml directly
2480 This is the first step toward more direct use of libxml and libxslt.
2481 Dave is planning to build on this to implement XSLT and to improve our handling
2482 of XML documents (faster and more feature complete, including DTDs).
2484 * khtml/html/html_elementimpl.cpp:
2485 (HTMLElementImpl::createContextualFragment):
2486 * khtml/html/htmltokenizer.cpp:
2487 (khtml::HTMLTokenizer::HTMLTokenizer):
2488 * khtml/html/htmltokenizer.h:
2489 * khtml/xml/dom_docimpl.cpp:
2490 (DocumentImpl::createTokenizer):
2491 (DocumentImpl::open):
2492 * khtml/xml/dom_docimpl.h:
2493 (DOM::DocumentImpl::tokenizer):
2494 * khtml/xml/dom_xmlimpl.cpp:
2495 (DOM::ProcessingInstructionImpl::checkStyleSheet):
2496 * khtml/xml/dom_xmlimpl.h:
2497 * khtml/xml/xml_tokenizer.h:
2498 * khtml/xml/xml_tokenizer.cpp: Redid this all to use libxml directly.
2500 * WebCore.pbproj/project.pbxproj: Removed a bunch of files.
2502 2004-07-21 Trey Matteson <trey@apple.com>
2504 DHTML dragging should use UTI for MIME-pboard type conversion
2508 * kwq/KWQClipboard.mm:
2509 (cocoaTypeFromMIMEType): Use UTI, except for cases we need to hardwire. Only cut off
2510 MIME args following a semi-colon for text/plain.
2511 (MIMETypeFromCocoaType): Use UTI, except for cases we need to hardwire.
2512 (KWQClipboard::types): Filter out ancient NSAsciiPboardType so DHTML never sees this cruft.
2514 2004-07-21 Ken Kocienda <kocienda@apple.com>
2518 Remove handling of HTML editing key events from WebCore.
2519 This now happens in WebKit if an event passes all the
2520 way through WebCore without being handled by the DOM.
2522 In each case below, function were removed, as their
2523 only purpose was to handle editing key events.
2525 * khtml/xml/dom_elementimpl.cpp
2526 * khtml/xml/dom_elementimpl.h
2527 * kwq/KWQKHTMLPart.h
2528 * kwq/KWQKHTMLPart.mm
2529 * kwq/WebCoreBridge.h
2531 2004-07-21 Ken Kocienda <kocienda@apple.com>
2535 * khtml/xml/dom_selection.cpp:
2536 (DOM::Selection::modifyExtendingRightForward): Add LINE_BOUNDARY case to the switch statement in this
2537 function. Use the startAndEndLineNodesIncludingNode helper which already existed to get the right
2539 (DOM::Selection::modifyMovingRightForward): Ditto
2540 (DOM::Selection::modifyExtendingLeftBackward): Ditto
2541 (DOM::Selection::modifyMovingLeftBackward): Ditto
2542 * khtml/xml/dom_selection.h:
2543 (DOM::Selection::): Add LINE_BOUNDARY constant to ETextGranularity enum. This
2544 specifies a new kind of movement that we need to implement the "move-to beggining/end of line"
2545 behavior which AppKit binds to cmd+left/right arrow keys.
2546 * kwq/WebCoreBridge.h: Add WebSelectToLineBoundary constant. This matches
2548 2004-07-20 David Hyatt <hyatt@apple.com>
2550 Fix for 3714434, user stylesheet is always parsed in strict mode, when it should honor the document's setting.
2554 * khtml/css/cssstyleselector.cpp:
2555 (khtml::CSSStyleSelector::CSSStyleSelector):
2557 2004-07-20 Ken Kocienda <kocienda@apple.com>
2561 * khtml/xml/dom_elementimpl.cpp:
2562 (ElementImpl::defaultEventHandler): No longer check whether
2563 the command key is modifying the key event. This check is
2564 now done elsewhere in the code. See the WebKit checkin that
2565 added the _web_keyBindingManagerHasBinding method to
2568 2004-07-20 Chris Blumenberg <cblu@apple.com>
2571 <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded
2572 <rdar://problem/3612691> Missing image icons (blue ?) lack context menu
2576 * kwq/WebCoreBridge.mm:
2577 (-[WebCoreBridge elementAtPoint:]): if there is no image, put the image URL on the element anyway
2579 2004-07-20 David Hyatt <hyatt@apple.com>
2581 Fix for alt text not working on images.
2585 * khtml/rendering/render_image.cpp:
2586 (RenderImage::RenderImage):
2587 (RenderImage::setPixmap):
2588 (RenderImage::paint):
2589 (RenderImage::calcReplacedWidth):
2590 (RenderImage::calcReplacedHeight):
2592 2004-07-20 Maciej Stachowiak <mjs@apple.com>
2596 <rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
2598 * khtml/html/htmltokenizer.cpp:
2599 (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
2600 (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
2601 active prependingSrc variable on the stack, the better to handle weird cases
2602 of scripts writing out additional script tags and so forth.
2603 (khtml::HTMLTokenizer::write): Deal with the above.
2604 * khtml/html/htmltokenizer.h: Declare new member field.
2606 2004-07-20 David Hyatt <hyatt@apple.com>
2608 Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
2613 * khtml/rendering/render_layer.cpp:
2614 (RenderLayer::updateLayerPosition):
2616 2004-07-20 Trey Matteson <trey@apple.com>
2618 3705624 REGRESSION: can't rearrange photos on homepage.mac.com album
2620 A subtle problem stemming from some interaction between focus handing and
2621 event propagation. We previously made it so when a focus shift fails we
2622 don't propagate the event to KHTML. The fix is to get rid of the inverse
2623 effect, so now even if a focus shift succeeds, we don't propagate to KHTML if
2624 the page already canceled default behavior.
2626 In this specific case, the page is cancelling default behavior since it
2627 does its own dragging, and the bug was our new system dragging was
2632 * khtml/khtmlview.cpp:
2633 (KHTMLView::dispatchMouseEvent): What he said.
2635 2004-07-20 Ken Kocienda <kocienda@apple.com>
2641 <rdar://problem/3695240> pasting plain text with newlines in it turns them into spaces
2643 * kwq/WebCoreBridge.mm:
2644 (-[WebCoreBridge documentFragmentWithText:]): Refine this function to be smart about converting
2645 line endings into BR elements.
2647 2004-07-20 Ken Kocienda <kocienda@apple.com>
2653 <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body
2655 * khtml/khtml_part.cpp:
2656 (KHTMLPart::setCaretVisible): This method renamed from setSelectionVisible. Since it really only operates
2657 on the caret, this seems like a better name.
2658 * khtml/khtml_part.h:
2659 * khtml/khtmlview.cpp:
2660 (KHTMLView::focusInEvent): Call setCaretVisible(true)
2661 (KHTMLView::focusOutEvent): Call setCaretVisible(false)
2662 * kwq/KWQKHTMLPart.mm:
2663 (KWQKHTMLPart::setShowsFirstResponder): Name change: setSelectionVisible becomes setCaretVisible.
2664 * kwq/WebCoreBridge.h: Expose setCaretVisible as a bridge method.
2665 * kwq/WebCoreBridge.mm:
2666 (-[WebCoreBridge setCaretVisible:]): Ditto.
2668 2004-07-19 Maciej Stachowiak <mjs@apple.com>
2672 <rdar://problem/3721428> REGRESSION (125.8-146): external javascript statements produce extra garbage character (sina.com)
2674 * khtml/misc/stringit.h:
2675 (khtml::TokenizerSubstring::TokenizerSubstring): For the apple branch, use the new
2676 stableUnicode() method to get the unicode pointer.
2679 (QString::detachIfInternal): Reorganize this to be a bit less wacky about refcounts.
2680 It does not leave around a zombie internal data handle but rather destroys it right away,
2681 and leaves the object pointing to the new handle (which it can then deref). This makes
2682 the code more clear.
2683 (QString::~QString): Simplify.
2684 (QString::stableUnicode): New method that detaches a copy of the KWQStringData if it
2685 is internal to a string besides this one. This guarantees that if you get the unicode()
2686 pointer, it won't go bad so long as this string is still alive.
2688 2004-07-19 David Hyatt <hyatt@apple.com>
2690 Fix for 3715117, crash from a bug in removeChildren. Clean up node removal and fix an n-squared removal
2691 bug. Also clean up checks in removeChild and in the dispatch of removedFromDocument mutation events to
2692 make node removal more efficient.
2694 Reviewed by kocienda
2696 * khtml/xml/dom_nodeimpl.cpp:
2698 2004-07-19 John Sullivan <sullivan@apple.com>
2702 - fixed <rdar://problem/3141150> can't undo in form textarea fields
2704 * kwq/KWQTextArea.mm:
2705 (-[KWQTextArea _createTextView]):
2706 call setAllowsUndo:YES. My, wasn't this easy?
2708 2004-07-19 David Hyatt <hyatt@apple.com>
2710 Merge @import fix for CSS1 test suite from Stephan Kulow.
2714 * khtml/css/parser.cpp:
2715 * khtml/css/parser.y:
2716 * layout-tests/css1/basic/containment-expected.txt:
2718 2004-07-19 David Hyatt <hyatt@apple.com>
2720 Fix for 3718697, crash clicking on JS tab at alaskaair.com.
2722 Reviewed by kocienda
2724 * khtml/rendering/render_flow.cpp:
2725 (RenderFlow::detach):
2726 (RenderFlow::dirtyLinesFromChangedChild):
2727 * khtml/rendering/render_flow.h:
2728 * khtml/rendering/render_object.cpp:
2729 (RenderObject::dirtyLinesFromChangedChild):
2730 * khtml/rendering/render_object.h:
2732 2004-07-16 David Hyatt <hyatt@apple.com>
2734 Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
2735 relies on it. The fix is to just recalcStyle up front before beginning the layout, so that all of our renderobjects
2740 * khtml/khtmlview.cpp:
2741 (KHTMLView::layout):
2743 2004-07-16 Ken Kocienda <kocienda@apple.com>
2749 <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
2751 * khtml/editing/htmlediting_impl.cpp:
2752 (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
2753 more robust. I do not understand how Grant ended up with null start or end
2754 blocks in the case of his bug report, but by adding two null checks, the code is
2755 now hardened a bit in case it happens again.
2757 2004-07-16 Ken Kocienda <kocienda@apple.com>
2763 <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
2764 <rdar://problem/3730790> Caret does not blink when placed in empty table cell
2766 * khtml/rendering/render_block.cpp:
2767 (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
2768 don't block the painting of the caret in this case. This was the case in 3730790.
2769 We had the right geometry for the caret but blocked its painting.
2770 * khtml/xml/dom_position.cpp:
2771 (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
2772 that the new position we would navigate to had a line box, but empty table cells, for
2773 instance will not. So, deal with this situation as well. The end result is a
2774 function that worked like it did before in cases where the previous line position has
2775 a line box, but now also will allow navigation to work when it does not.
2776 (DOM::Position::nextLinePosition): Ditto.
2778 2004-07-16 Ken Kocienda <kocienda@apple.com>
2784 <rdar://problem/3687216> editable inline causes crash when focused
2786 * khtml/xml/dom_docimpl.cpp:
2787 (DocumentImpl::relinquishesEditingFocus): Add null check for rootEditableElement.
2788 (DocumentImpl::acceptsEditingFocus): Ditto.
2790 2004-07-16 David Hyatt <hyatt@apple.com>
2792 Fix for 3709337, crash when using display: compact. Need to make sure that the isCompact() check in bidi.cpp is
2793 also checking for RenderBlocks, since otherwise you match text nodes (and that's just wrong).
2795 Reviewed by kocienda
2797 * khtml/rendering/bidi.cpp:
2798 (khtml::RenderBlock::layoutInlineChildren):
2802 2004-07-15 David Hyatt <hyatt@apple.com>
2804 Fix for 3625611, images offset on first visit to page. The method for determining the last clean line was
2805 flawed and would incorrectly miss dirty lines that occurred after the first clean line.
2809 * khtml/rendering/bidi.cpp:
2810 (khtml::RenderBlock::determineEndPosition):
2812 2004-07-15 Ken Kocienda <kocienda@apple.com>
2817 <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
2819 * khtml/editing/htmlediting_impl.cpp:
2820 (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
2821 that nodes are text nodes during the walk of eligible nodes that could possibly be
2822 deleted. Change the assertion to an conditional check for text nodes. We may have
2823 unrendered nodes in the mix here (as is the case in the bug where the assertion
2824 failed on an AREA element), and the conditional check is sufficient to
2825 skip them while leaving the delete logic we want unperturbed.
2827 2004-07-14 Ken Kocienda <kocienda@apple.com>
2831 * khtml/rendering/render_block.cpp:
2832 (khtml::RenderBlock::paintObject): Add null check on DOM node before
2833 asking if it is contentEditable.
2835 2004-07-14 David Hyatt <hyatt@apple.com>
2837 Fix for 3595073, setting innerHTML on a <table> should work.
2841 * khtml/html/html_elementimpl.cpp:
2842 (HTMLElementImpl::createContextualFragment):
2844 2004-07-14 Ken Kocienda <kocienda@apple.com>
2848 Updated these layout tests as a result of the last patch.
2849 These results are better.
2851 * layout-tests/editing/execCommand/selectAll-expected.txt
2852 * layout-tests/editing/selection/extend-by-character-006-expected.txt
2853 * layout-tests/editing/selection/unrendered-001-expected.txt
2854 * layout-tests/editing/selection/unrendered-003-expected.txt
2856 2004-07-14 Ken Kocienda <kocienda@apple.com>
2860 * khtml/rendering/render_block.cpp:
2861 (khtml::RenderBlock::paintObject): Change back to start() from caretPosition().
2862 Since the policy is now to move the selection to rendered content, if possible,
2863 when the selection is set, there is no longer any reason to have the additional
2864 caretPosition() function to store where the caret should be drawn.
2865 * khtml/xml/dom_docimpl.cpp:
2866 (DocumentImpl::updateSelection): No longer any need to call closestRenderedPosition here.
2867 This is done in Selection::validate.
2868 * khtml/xml/dom_position.cpp:
2869 (DOM::Position::closestRenderedPosition): Improved algorithm. Now much simpler.
2870 * khtml/xml/dom_selection.cpp:
2871 (DOM::Selection::Selection): caretPosition() and m_caretPosition now obsolete.
2872 (DOM::Selection::init): Ditto.
2873 (DOM::Selection::modifyExtendingRightForward): No longer any need to call
2874 closestRenderedPosition here. This is done in Selection::validate.
2875 (DOM::Selection::modifyMovingRightForward): Ditto.
2876 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
2877 (DOM::Selection::modifyMovingLeftBackward): Ditto.
2878 (DOM::Selection::layoutCaret): Ditto.
2879 (DOM::Selection::validate): Add code to move the selection to rendered content if possible.
2880 * khtml/xml/dom_selection.h: caretPosition() and m_caretPosition now obsolete.
2882 2004-07-14 David Hyatt <hyatt@apple.com>
2884 Fix for 3716082, assert when you dynamically remove float or position styles.
2888 * khtml/rendering/render_object.cpp:
2889 (RenderObject::setStyle):
2891 2004-07-14 David Hyatt <hyatt@apple.com>
2893 Fix for various table regressions (malumovies.com and cityofheroes.gameamp.com) involving bungling of
2896 Reviewed by kocienda
2898 * khtml/rendering/render_box.cpp:
2899 (RenderBox::calcPercentageHeight):
2900 (RenderBox::availableHeightUsing):
2901 * khtml/rendering/render_table.cpp:
2902 (RenderTable::layout):
2903 (RenderTableSection::calcRowHeight):
2904 (RenderTableSection::layoutRows):
2905 (RenderTableCell::updateFromElement):
2906 * khtml/rendering/render_table.h:
2908 2004-07-14 Ken Kocienda <kocienda@apple.com>
2912 * khtml/xml/dom_position.cpp:
2913 (DOM::Position::equivalentDeepPosition): New helper function to improve selection handling.
2914 Soon, I plan to land some changes that use this new function.
2915 * khtml/xml/dom_position.h:
2917 2004-07-14 Ken Kocienda <kocienda@apple.com>
2921 * WebCore-combined.exp: Added QString.at symbol to tests exports to facilitate debugging
2922 data formatting change that is to come.
2923 * WebCore-tests.exp:
2925 2004-07-13 John Sullivan <sullivan@apple.com>
2929 - fixed <rdar://problem/3705500> REGRESSION (125.8-146): Cmd-E on an
2930 HTML page puts a trailing space on Find pasteboard
2932 * khtml/misc/khtml_text_operations.cpp:
2933 (khtml::TextIterator::handleTextBox):
2934 In the case where a subrun doesn't extend to the end of the text box,
2935 the well-commented code was supposed to return from this routine, but
2936 the wrong variable was being compared. This would send us through another
2937 pass of the loop, which would end up worrying about collapsed space at the
2938 end of the current box, even though we only cared about the beginning of the
2941 2004-07-12 Richard Williamson <rjw@apple.com>
2943 Fixed 3717982. Implemented navigator.language!
2947 * khtml/ecma/kjs_navigator.cpp:
2948 (Navigator::getValueProperty):
2950 2004-07-12 Ken Kocienda <kocienda@apple.com>
2954 * khtml/xml/dom_position.cpp:
2955 (DOM::Position::inRenderedContent): I broke selection drawing with my last patch. This
2956 function is now used in selection drawing, and it was making an unneeded check to see
2957 that content was editable to answer whether or not is was rendered. Bad. Fixed.
2959 2004-07-12 David Hyatt <hyatt@apple.com>
2961 Fix for 3621138, crash on hrweb.apple.com. Make sure that in the case where objects get pulled up from merging
2962 blocks that we just delete all line boxes.
2964 Reviewed by kocienda
2966 * khtml/rendering/render_block.cpp:
2967 (khtml::RenderBlock::removeChild):
2969 2004-07-10 Maciej Stachowiak <mjs@apple.com>
2973 <rdar://problem/3706080>: (REGRESSION (125.8-147u): Nested <ul> do not display bullets)
2974 <rdar://problem/3676376>: (Second level bullets not printed when printing Xcode release notes)
2977 * kwq/KWQPainter.mm:
2978 (CGColorFromNSColor):
2979 (QPainter::drawEllipse):
2980 (QPainter::setShadow):
2982 2004-07-12 Ken Kocienda <kocienda@apple.com>
2986 Added new editing-related layout tests
2988 * layout-tests/editing/deleting/delete-after-span-ws-001-expected.txt: Added.
2989 * layout-tests/editing/deleting/delete-after-span-ws-001.html: Added.
2990 * layout-tests/editing/deleting/delete-after-span-ws-002-expected.txt: Added.
2991 * layout-tests/editing/deleting/delete-after-span-ws-002.html: Added.
2992 * layout-tests/editing/deleting/delete-after-span-ws-003-expected.txt: Added.
2993 * layout-tests/editing/deleting/delete-after-span-ws-003.html: Added.
2994 * layout-tests/editing/selection/unrendered-001-expected.txt: Added.
2995 * layout-tests/editing/selection/unrendered-001.html: Added.
2996 * layout-tests/editing/selection/unrendered-002-expected.txt: Added.
2997 * layout-tests/editing/selection/unrendered-002.html: Added.
2998 * layout-tests/editing/selection/unrendered-003-expected.txt: Added.
2999 * layout-tests/editing/selection/unrendered-003.html: Added.
3000 * layout-tests/editing/selection/unrendered-004-expected.txt: Added.
3001 * layout-tests/editing/selection/unrendered-004.html: Added.
3002 * layout-tests/editing/selection/unrendered-005-expected.txt: Added.
3003 * layout-tests/editing/selection/unrendered-005.html: Added.
3004 * layout-tests/traversal/node-iterator-008-expected.txt: Added.
3005 * layout-tests/traversal/node-iterator-008.html: Added.
3006 * layout-tests/traversal/tree-walker-005-expected.txt: Added.
3007 * layout-tests/traversal/tree-walker-005.html: Added.
3009 2004-07-12 Ken Kocienda <kocienda@apple.com>
3013 Fixes for these bugs:
3015 <rdar://problem/3723359> Extending then "unextending" selection with arrow keys should draw caret but doesn't
3016 <rdar://problem/3724626> White-space deletion code deletes wrong character when space follows span
3018 * khtml/editing/htmlediting_impl.cpp:
3019 (khtml::DeleteSelectionCommandImpl::doApply): Modify special-case white-space deletion code so it runs
3020 only in the special case. It was throwing its net too widely, catching the case described in 3724626.
3021 By tightening up the special-case white-space deletion, and allowing the more general-purpose code to run,
3023 * khtml/xml/dom_docimpl.cpp:
3024 (DocumentImpl::updateSelection): Use recently-added closestRenderedPosition helper in Position class
3025 to figure out the start and end positions for selection drawing.
3026 * khtml/xml/dom_position.cpp:
3027 (DOM::Position::equivalentUpstreamPosition): Added code to handle white-space that causes line breaks.
3028 (DOM::Position::equivalentDownstreamPosition): Ditto.
3029 (DOM::Position::closestRenderedPosition): Trap empty selections at function entry, return *this.
3030 (DOM::Position::isFirstRenderedPositionOnLine): Can't be first rendered position on line if not rendered.
3032 (DOM::Position::isLastRenderedPositionOnLine): Ditto, but s/first/last/
3033 * khtml/xml/dom_selection.cpp:
3034 (DOM::Selection::validate): A selection is in caret state if the start and end are equal *or* equivalent.
3035 The equivalence case is new, and fixes 3723359.
3037 2004-07-09 Kevin Decker <kdecker@apple.com>
3041 fixes the width:auto problem in
3042 <rdar://problem/3698344> REGRESSION (143?-144): macrumors.com tabs are compressed and illegible
3044 * khtml/css/cssstyleselector.cpp:
3045 (khtml::CSSStyleSelector::applyProperty):
3047 2004-07-09 Ken Kocienda <kocienda@apple.com>
3051 Updated some layout test results.
3053 * layout-tests/editing/deleting/delete-image-004-expected.txt:
3054 * layout-tests/editing/selection/extend-by-character-006-expected.txt:
3056 2004-07-09 Chris Blumenberg <cblu@apple.com>
3058 Allowed my change for 3715785 to compile on Jaguar.
3060 Reviewed by kocienda.
3062 * kwq/WebCoreBridge.h:
3063 * kwq/WebCoreBridge.mm:
3064 (-[WebCoreBridge domain]): new, allows access to the domain without using the DOM API which doesn't exist on Jaguar
3066 2004-07-09 Ken Kocienda <kocienda@apple.com>
3070 Some improvements to fix:
3072 <rdar://problem/3723111> Caret not drawn when selection set to unrendered content
3074 * khtml/editing/htmlediting_impl.cpp:
3075 (khtml::TypingCommandImpl::issueCommandForDeleteKey): Adjust selection to delete if
3076 selected position is not rendered.
3077 * khtml/rendering/render_block.cpp:
3078 (khtml::RenderBlock::paintObject): Use new caretPosition() function on Selection to
3079 figure out whether to paint.
3080 * khtml/xml/dom_position.cpp:
3081 (DOM::Position::previousCharacterPosition): Now correctly deals with a start
3082 position that is not rendered.
3083 (DOM::Position::nextCharacterPosition): Ditto.
3084 (DOM::Position::closestRenderedPosition): New helper.
3085 * khtml/xml/dom_position.h:
3086 (DOM::): Moved in EAffinity from Selection header. Now used in closestRenderedPosition function.
3087 * khtml/xml/dom_selection.cpp:
3088 (DOM::Selection::Selection): Added new m_caretPosition member. This is the position of the caret
3089 after a caret layout. This may be different from start or end if start and end are not rendered.
3090 (DOM::Selection::init):
3091 (DOM::Selection::modifyExtendingRightForward): New helper to clean up modify() and make it more readble.
3092 (DOM::Selection::modifyMovingRightForward): Ditto.
3093 (DOM::Selection::modifyExtendingLeftBackward): Ditto.
3094 (DOM::Selection::modifyMovingLeftBackward): Ditto.
3095 (DOM::Selection::modify): Use new helpers to make this more readble.
3096 (DOM::Selection::layoutCaret): Uses new closestRenderedPosition helper to place the caret if in unrendered
3098 (DOM::Selection::paintCaret): Remove moveToRenderedContent. obsolete.
3099 * khtml/xml/dom_selection.h:
3100 (DOM::Selection::caretPosition): New accessor.
3101 * kwq/WebCoreBridge.mm:
3102 (-[WebCoreBridge setSelectedDOMRange:affinity:]): EAffinity no longer a member enum of Selection class.
3104 2004-07-08 David Hyatt <hyatt@apple.com>
3106 Fix for the table layout test that failed because of a change in how innerText worked. We need to do
3107 updateLayout now when using innerText, since the method has been changed to use line boxes in the render tree
3108 that might otherwise be out of date.
3110 Reviewed by kocienda
3112 * khtml/html/html_elementimpl.cpp:
3113 (HTMLElementImpl::innerText):
3115 2004-07-08 John Sullivan <sullivan@apple.com>
3119 - fixed <rdar://problem/3691569> REGRESSION (142): cmd-shift-clicking on a link
3120 now also extends selection (even if there wasn't one before)
3122 * khtml/khtml_part.cpp:
3123 (KHTMLPart::handleMousePressEventSingleClick):
3124 if there's a URL associated with the event, don't extend the selection
3126 2004-07-08 Ken Kocienda <kocienda@apple.com>
3130 Added some helper functions which provide strings to display in the
3131 Xcode debugger's variable inspector window. These functions are called
3132 from the LabyrinthDataFormatter debugger plugin I just checked in to
3133 the Labyrinth/Tools directory.
3135 Note that these functions are compiled in on Development builds only.
3137 * WebCore-combined.exp:
3138 * WebCore-tests.exp: Export all the formatForDebugger symbols so the
3139 debugger program can link with them.
3140 * khtml/xml/dom2_rangeimpl.cpp:
3141 (DOM::RangeImpl::formatForDebugger):
3142 * khtml/xml/dom2_rangeimpl.h:
3143 * khtml/xml/dom_elementimpl.cpp:
3144 (ElementImpl::formatForDebugger):
3145 * khtml/xml/dom_elementimpl.h:
3146 * khtml/xml/dom_nodeimpl.cpp:
3147 * khtml/xml/dom_nodeimpl.h:
3148 * khtml/xml/dom_position.cpp:
3149 (DOM::Position::formatForDebugger):
3150 * khtml/xml/dom_position.h:
3151 * khtml/xml/dom_selection.cpp:
3152 (DOM::Selection::formatForDebugger):
3153 * khtml/xml/dom_selection.h:
3154 * khtml/xml/dom_textimpl.cpp:
3155 (TextImpl::formatForDebugger):
3156 * khtml/xml/dom_textimpl.h:
3158 2004-07-08 John Sullivan <sullivan@apple.com>
3162 - fixed <rdar://problem/3721544> crash increasing font size;
3163 entrezeroetun.com (works in IE and Firefox)
3165 * khtml/rendering/render_block.cpp:
3166 (khtml::RenderBlock::updateFirstLetter):
3167 Check for nil originalString() before dereffing
3169 2004-07-08 David Hyatt <hyatt@apple.com>
3171 Fix for 3721453, CSS3 initial property caused crashes because the macros were not written correctly.
3175 * khtml/css/cssstyleselector.cpp:
3179 2004-07-07 David Hyatt <hyatt@apple.com>
3181 Fix for 3712133, crash from first-line pseudo-style use.
3183 Reviewed by kocienda
3185 * khtml/css/cssstyleselector.cpp:
3186 (khtml::CSSStyleSelector::styleForElement):
3187 * khtml/css/cssstyleselector.h:
3188 * khtml/rendering/render_object.cpp:
3189 (RenderObject::getPseudoStyle):
3191 2004-07-07 Ken Kocienda <kocienda@apple.com>
3197 <rdar://problem/3716479> calling setInnerHTML during a webViewDidChange delegate call causes a crash
3199 The fix involves some rearrangement of code in TypingCommand and TypingCommandImpl.
3200 Formerly, new TypingCommands would apply themselves (which was a no-op) and then
3201 do their action in some code a way different than other commands. This type of command
3202 application is different than for all other commands since TypingCommands can be coalesced.
3203 The crash occurred as a result of the "no-op" TypingCommand having the unconsidered
3204 consequence of causing editing delegate notifications to be sent before the command
3205 has actually run. This change takes a small step towards making TypingCommandImpl function like
3206 other commands, where the command work is done in doApply. This makes the notification
3207 happen in the right order.
3209 * khtml/editing/htmlediting.cpp:
3210 (khtml::TypingCommand::TypingCommand):
3211 (khtml::TypingCommand::insertText):
3212 (khtml::TypingCommand::insertNewline):
3213 (khtml::TypingCommand::deleteKeyPressed):
3214 * khtml/editing/htmlediting.h:
3215 (khtml::TypingCommand::):
3216 * khtml/editing/htmlediting_impl.cpp:
3217 (khtml::TypingCommandImpl::TypingCommandImpl):
3218 (khtml::TypingCommandImpl::doApply):
3219 * khtml/editing/htmlediting_impl.h:
3221 2004-07-06 Ken Kocienda <kocienda@apple.com>
3225 * khtml/html/html_tableimpl.cpp:
3226 (HTMLTableElementImpl::addChild): Added a better comment in the
3227 code I just checked in a few minutes ago.
3229 2004-07-06 Ken Kocienda <kocienda@apple.com>
3235 <rdar://problem/3672377> assertion failure in AppendNodeCommandImpl::doApply
3236 due to non-0 exception code trying to insert a DIV markup string
3238 The solution was to revert to the code that was rolled out, and removing
3239 the child checks from NodeImpl::checkAddChild. However, this time, I added
3240 code very similar to this check into the code that runs while HTML is
3241 being parsed to build up tables. This code relies on child-add failure
3242 to ensure the proper construction of well-formed tables (as gross as that
3243 sounds), so the check needs to be retained there. No other code seems to
3244 be so affected. Layout tests are unchanged by this patch.
3246 * khtml/html/html_tableimpl.cpp:
3247 (HTMLTableElementImpl::addChild):
3248 * khtml/xml/dom_nodeimpl.cpp:
3249 (NodeImpl::checkAddChild):
3251 2004-07-06 Ken Kocienda <kocienda@apple.com>
3255 Simple change. I switched the arguments of the appendNode helper function
3256 and the AppendNodeCommand and AppendNodeCommandImpl classes. The node to
3257 insert now comes before the parent node in the argument list. I did this
3258 to make this function match the convention of others in the HTML editing code.
3259 This was the only one that was "different" in the way that it ordered arguments.
3260 As a result, I was always looking to see that I was passing things in the right
3263 * khtml/editing/htmlediting.cpp:
3264 (khtml::AppendNodeCommand::AppendNodeCommand):
3265 (khtml::AppendNodeCommand::appendChild):
3266 (khtml::AppendNodeCommand::parentNode):
3267 * khtml/editing/htmlediting.h:
3268 * khtml/editing/htmlediting_impl.cpp:
3269 (khtml::CompositeEditCommandImpl::insertNodeAfter):
3270 (khtml::CompositeEditCommandImpl::insertNodeAt):
3271 (khtml::CompositeEditCommandImpl::appendNode):
3272 (khtml::AppendNodeCommandImpl::AppendNodeCommandImpl):
3273 (khtml::AppendNodeCommandImpl::~AppendNodeCommandImpl):
3274 (khtml::AppendNodeCommandImpl::doApply):
3275 (khtml::AppendNodeCommandImpl::doUnapply):
3276 (khtml::ApplyStyleCommandImpl::surroundNodeRangeWithElement):
3277 (khtml::DeleteSelectionCommandImpl::doApply):
3278 (khtml::InputNewlineCommandImpl::insertNodeAfterPosition):
3279 (khtml::InputNewlineCommandImpl::insertNodeBeforePosition):
3280 (khtml::InputTextCommandImpl::prepareForTextInsertion):
3281 * khtml/editing/htmlediting_impl.h:
3282 (khtml::AppendNodeCommandImpl::parentNode):
3284 2004-07-06 Ken Kocienda <kocienda@apple.com>
3288 Fixed several problems with traversal classes. For one, NodeIterators treat
3289 FILTER_REJECT and FILTER_SKIP the same, since it treats the DOM tree as a
3290 flat collection of nodes free of hierarchy. The code before this change did
3291 not do this correctly. It sure pays to go back and read the specs. :)
3293 Also, the code to traverse from node to node when filters were applied was
3294 not working correctly. My first attemmpt to implement this was just plain
3295 buggy, as I discovered when I tried to write tests for my WWDC talk. I have
3296 settled on an implementation which is much simpler and worked for all the
3297 tests I threw at it.
3299 * khtml/xml/dom2_traversalimpl.cpp:
3300 (DOM::NodeIteratorImpl::findNextNode):
3301 (DOM::NodeIteratorImpl::nextNode):
3302 (DOM::NodeIteratorImpl::findPreviousNode):
3303 (DOM::NodeIteratorImpl::previousNode):
3304 (DOM::TreeWalkerImpl::parentNode):
3305 (DOM::TreeWalkerImpl::firstChild):
3306 (DOM::TreeWalkerImpl::lastChild):
3307 (DOM::TreeWalkerImpl::previousSibling):
3308 (DOM::TreeWalkerImpl::nextSibling):
3309 (DOM::TreeWalkerImpl::previousNode):
3310 (DOM::TreeWalkerImpl::nextNode):
3311 (DOM::TreeWalkerImpl::ancestorRejected):
3312 * khtml/xml/dom2_traversalimpl.h:
3314 2004-07-06 Vicki Murley <vicki@apple.com>
3316 Reviewed by kocienda.
3318 - added backColorCommand, foreColorCommand, fontNameCommand,
3321 * layout-tests/editing/editing.js:
3323 2004-07-06 Trey Matteson <trey@apple.com>
3325 3716053 - www.theage.com.au has extra back/forward items due to ads
3327 This turned out to be easily fixed by generalizing the fix to 3438441. We prevent
3328 addition to the b/f list not just during an onload event, but during any non-user
3329 gesture, which includes top level script executing.
3331 Reviewed by Richard.
3333 * kwq/KWQKHTMLPart.mm:
3334 (KWQKHTMLPart::openURL): Only real change - prevent adding to b/f list if not
3336 (KWQKHTMLPart::openURLRequest): Rename "onLoadEvent" to "userGesture", swap sense
3337 (KWQKHTMLPart::submitForm): Ditto
3338 (KWQKHTMLPart::urlSelected): Ditto
3339 * kwq/KWQKHTMLPartBrowserExtension.mm:
3340 (KHTMLPartBrowserExtension::createNewWindow): Ditto
3341 * kwq/WebCoreBridge.h:
3343 2004-07-02 Darin Adler <darin@apple.com>
3347 - fixed half of <rdar://problem/3709244> utf-8 meta tag not parsed when page title contains angle brackets or if </meta> tag used
3349 * khtml/misc/decoder.cpp: (Decoder::decode): Allow </meta> tags without deciding we
3350 are done with the header.
3352 2004-06-30 Trey Matteson <trey@apple.com>
3354 Dragging within a web view should be allowed to start when the window isn't key.
3356 A few months ago, Chris made this work, but it relied on the fact that all dragging
3357 was done in WebKit. When WebCore got involved in dragging, it was broken. Now we
3358 have a new scheme that gets it working again that properly involves WebCore.
3360 The general idea is that when AK asks us whether to accept the first mouse and do
3361 "delayed window ordering", we must consult WC to see if we might start a drag. In