2005-01-24 Darin Adler Reviewed by Kevin. - fixed REGRESSION (179-180): Typing password not echoed as "bullets" at paypal.com when field is first focused * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Sizing up the form editor, which fixes things for normal fields and search fields, screws things up for password fields. Eventually, I'll need to figure out why this is and file a bug so that the AppKit team fixes it. In the mean time, just check for the case of the secure text field, and don't size up in that case. 2005-01-24 Ken Kocienda Reviewed by Hyatt Fix for this bug: 8A354: Inserting Japanese text to the line head causes line break * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): Add one more case where we merge content into the existing line. This covers the situation see using the steps to reproduce this bug. 2005-01-21 Maciej Stachowiak Reviewed by Darin. Editing should split elements before removing style * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::splitElement): (khtml::CompositeEditCommand::mergeIdenticalElements): (khtml::CompositeEditCommand::wrapContentsInDummySpan): (khtml::CompositeEditCommand::splitTextNodeContainingElement): (khtml::ApplyStyleCommand::applyInlineStyle): (khtml::ApplyStyleCommand::splitTextAtStartIfNeeded): (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): (khtml::ApplyStyleCommand::splitTextElementAtStartIfNeeded): (khtml::ApplyStyleCommand::splitTextElementAtEndIfNeeded): (khtml::areIdenticalElements): (khtml::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): (khtml::ApplyStyleCommand::mergeEndWithNextIfIdentical): (khtml::ApplyStyleCommand::cleanUpEmptyStyleSpans): (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): (khtml::InsertParagraphSeparatorCommand::doApply): (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): (khtml::InsertTextCommand::prepareForTextInsertion): (khtml::SplitTextNodeCommand::doUnapply): (khtml::SplitElementCommand::SplitElementCommand): (khtml::SplitElementCommand::~SplitElementCommand): (khtml::SplitElementCommand::doApply): (khtml::SplitElementCommand::doUnapply): (khtml::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand): (khtml::MergeIdenticalElementsCommand::~MergeIdenticalElementsCommand): (khtml::MergeIdenticalElementsCommand::doApply): (khtml::MergeIdenticalElementsCommand::doUnapply): (khtml::WrapContentsInDummySpanCommand::WrapContentsInDummySpanCommand): (khtml::WrapContentsInDummySpanCommand::~WrapContentsInDummySpanCommand): (khtml::WrapContentsInDummySpanCommand::doApply): (khtml::WrapContentsInDummySpanCommand::doUnapply): (khtml::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand): (khtml::SplitTextNodeContainingElementCommand::~SplitTextNodeContainingElementCommand): (khtml::SplitTextNodeContainingElementCommand::doApply): * khtml/editing/htmlediting.h: New layout test that shows the side benefit of this. * layout-tests/editing/style/unbold-in-bold-expected.txt: Added. * layout-tests/editing/style/unbold-in-bold.html: Added. 2005-01-24 Darin Adler Reviewed by John. - fixed -[DOMRange cloneContents] sometimes alters the original DOMRange * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::processContents): Fixed code that was collapsing the range after processing the contents. That's right for extract and delete, but not clone. - fixed inline input works incorrectly when I type Korean slowly in textfield in form on www.google.co.kr - fixed Can't enter SSN to sign up for Chase visa online account (changing focus inside key press handler) - fixed REGRESSION (161-162): Crash after typing command-Z to undo after pasting text with newline in it into a text field * kwq/KWQLineEdit.mm: (QLineEdit::text): Changed to call a new string method on the controller instead of calling stringValue, since stringValue has a bad side effect of ending inline input. (QLineEdit::selectAll): Changed to only call selectText: when the field is already selected. When you are giving the field focus, it automatically gets all selected, and this change is required in the case where we defer the focus change. * kwq/KWQTextField.h: Added a new string method to the controller. * kwq/KWQTextField.mm: (-[KWQTextFieldController setMaximumLength:]): Call the new string method instead of using stringValue. (-[KWQTextFieldController controlTextDidChange:]): Removed the code to truncate at the first CR or LF. That's now handled in the shouldChangeTextInRange method instead. (-[KWQTextFieldController textView:shouldHandleEvent:]): Add new logic to defer responder changes until after the event is handled. This makes sure the key gets into the field that's already handling it at rather than ending up in the newly-focused field if the key press handler focuses a different element. (-[KWQTextFieldController textView:didHandleEvent:]): Turn off deferral here, now that the key press has been handled. (-[KWQTextFieldController string]): Added. Calls stringValue only if there's no editor. If there is an editor, calls string on that instead. (-[KWQTextFieldController textView:shouldChangeTextInRange:replacementString:]): Added. Called by the three field subclasses. Truncates incoming strings at the first CR or LF character. This works properly with Undo, and the old technique did not. (-[KWQTextFieldController preprocessString:]): Added. Helper used for all the setStringValue methods so they all truncate at the first CR or LF as well as truncating to the appropriate length. (-[KWQTextField setStringValue:]): Changed to call the controller. (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): Added. Calls the controller. (-[KWQSecureTextField setStringValue:]): More of the same. (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto. (-[KWQSearchField setStringValue:]): Ditto. (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto. * kwq/KWQWidget.h: Added the new setDeferFirstResponderChanges function. * kwq/KWQWidget.mm: (QWidget::~QWidget): Clear out the deferredFirstResponder global just in case we are destroyed while we "have the ball". (QWidget::hasFocus): If we are in the deferred mode, use the global to decide who to say is focused. (QWidget::setFocus): If we are in the deferred mode, set the global instead of making something be the first responder. (QWidget::setDeferFirstResponderChanges): Set the boolean. If the boolean is being cleared, then get the deferred first responder and call setFocus on it again, which will do the work we didn't want to do earlier. 2005-01-24 Ken Kocienda Reviewed by John Fix for this bug: Deleting all content and typing in a message gets one letter, then beeps This is a problem with the way we turn key events, when a user starts typing, into editing commands. Right now, that initial delete key in an empty window is turned into an editing command, and much editing code runs that need not run. What's more, this is confusing the selection machinery. The solution is to detect the "delete in an empty window" case and don't turn this into an editing command at all. * khtml/editing/htmlediting.cpp: (khtml::TypingCommand::deleteKeyPressed) 2005-01-23 Adele Amchan Fixed REGRESSION (178-179): menus and "go to old site" link at Ameritrade's new site don't work Removed check for document from checkCompleted. In this case, WebCore never knew that a WebImageView was complete because it fell into this document check case in checkCompleted. Added check for document to tokenizerProcessedData (see ) Reviewed by Darin. * khtml/khtml_part.cpp: (KHTMLPart::stop): (KHTMLPart::checkCompleted): * khtml/khtml_part.h: * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::tokenizerProcessedData): 2005-01-21 Richard Williamson Fixed Javascript / Liveconnect problems ((event handler):Undefined value) Java applets specified with or weren't scriptable. Now they are. Reviewed by Chris. * khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::getEmbedInstance): (HTMLObjectElementImpl::getObjectInstance): 2005-01-21 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): Insertion point goes back to beginning of document after deleting * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::handleGeneralDelete): Add special case to handle retaining a fully-selected block. This fixes the bug. * layout-tests/editing/deleting/delete-3959464-fix-expected.txt: Added. * layout-tests/editing/deleting/delete-3959464-fix.html: Added. 2005-01-21 Richard Williamson Fixed REGRESSION(179-TOT) clicking on gmail message brings me to blank screen getElementById() sometimes returns Undefined() instead of Null(). Reviewed by Hyatt. * khtml/ecma/kjs_dom.cpp: (DOMDocumentProtoFunc::tryCall): 2005-01-21 David Hyatt Fix for 3773809, make sure that overflow regions never end up at an invalid scroll offset because of a layout change. Reviewed by kocienda * khtml/rendering/render_layer.cpp: (RenderLayer::updateScrollInfoAfterLayout): 2005-01-21 David Hyatt Fix for 3966349, hang loading page. Make sure that loops using popOneBlock properly check for a null blockStack to avoid an infinite loop. Reviewed by kocienda * khtml/html/htmlparser.cpp: (KHTMLParser::parseToken): (KHTMLParser::insertNode): (KHTMLParser::popInlineBlocks): 2005-01-21 Ken Kocienda Reviewed by John Fix for this bug: Mail crashed when sending a message in ~InsertParagraphSeparatorInQuotedContentCommand * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorInQuotedContentCommand::InsertParagraphSeparatorInQuotedContentCommand): InsertParagraphSeparatorInQuotedContentCommand has this member variable: DOM::ElementImpl *m_breakNode; I failed to initialize this variable to null in the constructor, and there is an uncommonly-traveled code path which does not set this variable to something good. In the destructor, we check for null, and deref if non-null. Obvious "BOOM" potential. Fixed. 2005-01-21 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): Hitting return makes space character disappear * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): When writing the code to insert a block in response to the return key, I did not write code to cover the case described in the bug. Now I have. * layout-tests/editing/inserting/insert-div-025-expected.txt: Added. * layout-tests/editing/inserting/insert-div-025.html: Added. 2005-01-20 Maciej Stachowiak Reviewed by Ken. security fix for javascript: exploit missed one case (already fixed in updates) * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): correct mistake in earlier fix for the following bug, caught by Adele: REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration 2005-01-20 Maciej Stachowiak Reviewed by Ken. editing needs to insert text before applying typing style * khtml/editing/htmlediting.cpp: (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Remove a FIXME comment. (khtml::InsertLineBreakCommand::doApply): Apply style to the BR node after inserting it. (khtml::InsertTextCommand::prepareForTextInsertion): Don't try to apply style to any new nodes created before inserting. (khtml::InsertTextCommand::input): Apply style to the inserted range after doing the text insert. * khtml/editing/htmlediting.h: This change leads to improved results on one of the layout tests: * layout-tests/editing/inserting/insert-div-024-expected.txt: === Safari-180 === 2005-01-20 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (179-180): Typing space at end of line makes following paragraph disappear * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Recent change to block placeholder removal code caused this regression. The code became too aggressive in removing block placeholders, and would remove them from blocks other than the block containing the selection. * layout-tests/editing/inserting/insert-div-023-expected.txt: This file had a spurious BR element in it that I did not notice earlier. * layout-tests/editing/inserting/insert-div-024-expected.txt: Ditto. 2005-01-20 David Hyatt Fix for oddness on albertsons.com. Make sure not to crash when setting/removing style properties on a node with no document. The bug # is 3813900. Reviewed by john 2005-01-20 David Harrison Reviewed by Darin. PARTIAL fix for following bug. Create attributed string with fonts and links. Still need to add attachments. AX: Support kAXAttributedStringForTextMarkerRangeParameterizedAttribute * kwq/KWQAccObject.mm: (-[KWQAccObject textUnderElement]): Touched up previous checkin to match code review comments. (-[KWQAccObject value]): Use plainText for this one instead of obsolete attributedString. (-[KWQAccObject accessibilityParameterizedAttributeNames]): Advertise AXAttributedStringForTextMarkerRange. (AXAttributeStringAddFont): (AXAttributeStringAddElement): (-[KWQAccObject linkUIElementForNode:]): (-[KWQAccObject _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]): (-[KWQAccObject accessibilityAttributedStringForRange:]): New routines to support AXAttributedStringForTextMarkerRange. (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]): Use new routines instead of obsolete attributedString. 2005-01-20 David Harrison Reviewed by Darin. AX Crash in DOM::Range::setStartBefore * khtml/xml/dom_docimpl.cpp: (DocumentImpl::getAccObjectCache): Adjust when detecting cache in non-top level WebArea. * kwq/KWQAccObject.mm: (-[KWQAccObject textUnderElement]): (-[KWQAccObject accessibilityAttributeValue:]): Make sure the elements document is the current one for the part. 2005-01-20 Darin Adler Reviewed by John. - fixed Mail not crashing, just quitting itself suddenly in -[WebHTMLView(MailExtras) findString:options:] * khtml/dom/dom2_range.cpp: (DOM::operator==): Handle null and detached ranges without raising exceptions. The uncaught exception would make the entire program terminate. - fixed attempting to modify a computed style does nothing, but should raise a DOM exception * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration setProperty:::]): Uncommented this code which I had to disable back in November because Mail was stumbling over it. - fixed focus() called during onload handler results in square text field on * kwq/KWQLineEdit.mm: (QLineEdit::baselinePosition): Change computation so it will work even for fields that position their text in a way that depends on vertical size. In the case of a search field, the text is centered, so the old logic was broken. * kwq/KWQTextField.mm: (-[KWQTextFieldController initWithTextField:QLineEdit:]): Set the frame size to something large enough to accomodate the field editor. If we start the frame at size 0,0 we run into AppKit trouble when it insets the frame to figure out the frame for the field editor. In the case of this bug this happens because we become first responder before being sized and positioned by the HTML layout code. - improved debugging output when using "po" from gdb with Objective-C DOM * kwq/DOM.mm: (-[DOMNode description]): Added. Includes node name ("") and node value (e.g., string for text node). (-[DOMRange description]): Tweaked format. 2005-01-19 Richard Williamson After further discussion with Real we have decided to NOT include the additional CLSID for the real plugin. See 3958601. Reviewed by Darin. * khtml/rendering/render_frames.cpp: (RenderPartObject::updateWidget): 2005-01-19 David Harrison Reviewed by Maciej. AX: word marker routines returns incorrect data for empty line Previous checkin for this bug was missing some of the patch. Editing snafu with multiple changes in tree. * kwq/KWQAccObject.mm: (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]): 2005-01-19 Ken Kocienda Reviewed by John * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Small, cosmetic change John and I decided to do on my last checkin, but I forgot to do before landing. 2005-01-19 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): Style not preserved on blank lines * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::applyStyle): (khtml::CompositeEditCommand::insertBlockPlaceholder): New function that unconditionally adds a block placeholder. (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Now returns bool based on whether placeholder was added or not. (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now searches all the descendents of a block looking for a placeholder. The old code, which just looked at the last child of a node, started missing once block placeholders became styled (which started happening with this patch). (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Now handles applying typing style to a block placeholder at call time, rather than setting the typing style as a latent style that might be applied later. This is an important part of the bug fix. (khtml::DeleteSelectionCommand::doApply): Now uses bool return value from insertBlockPlaceholderIfNeeded() and passes it along to calculateStyleBeforeInsertion, so the case where a block placeholder needs to be styled can be detected. (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Changed the way this class managed style. Before it would calculate and set typing style for the block added. This is not sufficient. Added blocks need to styled immediately. Some name changes to instance variables in this class due to the change to accommodate this change. (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Name changes, as above. (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto. (khtml::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto. (khtml::InsertParagraphSeparatorCommand::doApply): Ditto. (khtml::ReplaceSelectionCommand::doApply): Improve check for testing when a placeholder block can be removed in its entirety after the insertion. * khtml/editing/htmlediting.h: Update header accordingly. * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Move position for computed style check downstream before doing check when the position is in an empty block (this makes sure any style on any block placeholder is accounted for). New layout tests to check bug fix. * layout-tests/editing/style/block-style-004-expected.txt: Added. * layout-tests/editing/style/block-style-004.html: Added. * layout-tests/editing/style/block-style-005-expected.txt: Added. * layout-tests/editing/style/block-style-005.html: Added. * layout-tests/editing/style/block-style-006-expected.txt: Added. * layout-tests/editing/style/block-style-006.html: Added. Results updated to reflect new block placeholder code. * layout-tests/editing/inserting/insert-div-004-expected.txt * layout-tests/editing/inserting/insert-div-005-expected.txt * layout-tests/editing/inserting/insert-div-006-expected.txt * layout-tests/editing/inserting/insert-div-008-expected.txt * layout-tests/editing/inserting/insert-div-011-expected.txt * layout-tests/editing/inserting/insert-div-012-expected.txt * layout-tests/editing/inserting/insert-div-013-expected.txt * layout-tests/editing/inserting/insert-div-014-expected.txt * layout-tests/editing/inserting/insert-div-015-expected.txt * layout-tests/editing/inserting/insert-div-016-expected.txt * layout-tests/editing/inserting/insert-div-017-expected.txt * layout-tests/editing/inserting/insert-div-018-expected.txt * layout-tests/editing/inserting/insert-div-019-expected.txt * layout-tests/editing/inserting/insert-div-021-expected.txt * layout-tests/editing/inserting/insert-div-022-expected.txt * layout-tests/editing/inserting/insert-div-023-expected.txt * layout-tests/editing/inserting/insert-div-024-expected.txt 2005-01-19 David Hyatt Dont null-check the renderer before submitting, since a script can set it to display:none and still expect the submission to occur. Fixes bug #3477282. Reviewed by kdecker (DOM::HTMLInputElementImpl::defaultEventHandler): 2005-01-18 Richard Williamson Fixed several issues all arising from analysis of plugin detection code at ifilm.com: Fixed can't script plug-ins if plug-in is invoked with element instead of Fixed elements with IDs do not show up as named properties of the document Fixed DOM objects for plugin elements are not accessible Fixed need an additional class ID in WebCore for the Real plug-in We now support accessing scriptable plugin objects that are specified with , , or tags. Also, if any of these elements are named they can be accessed from the document or window objects. Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object. Reviewed by Chris. * khtml/dom/html_document.cpp: (HTMLDocument::objects): * khtml/dom/html_document.h: * khtml/ecma/kjs_dom.cpp: (DOMDocumentProtoFunc::tryCall): (DOMElementProtoFunc::tryCall): (KJS::getRuntimeObject): * khtml/ecma/kjs_dom.h: * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::tryGet): (KJS::HTMLElement::tryGet): (KJS::HTMLCollection::tryGet): (KJS::HTMLCollection::getNamedItems): * khtml/ecma/kjs_window.cpp: (Window::get): * khtml/html/html_miscimpl.cpp: (HTMLCollectionImpl::traverseNextItem): * khtml/html/html_miscimpl.h: (DOM::HTMLCollectionImpl::): * khtml/html/html_objectimpl.cpp: (HTMLAppletElementImpl::getAppletInstance): (HTMLObjectElementImpl::HTMLObjectElementImpl): (HTMLObjectElementImpl::getObjectInstance): * khtml/html/html_objectimpl.h: * khtml/rendering/render_frames.cpp: (RenderPartObject::updateWidget): * kwq/KWQKHTMLPart.h: * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::getObjectInstanceForView): 2005-01-18 David Hyatt Fix for 3948123, rolling over link erases nearby text. The repaint rect check for lines was wrong whenever two lines overlapped. Reviewed by kocienda * khtml/rendering/render_flow.cpp: (RenderFlow::paintLines): 2005-01-18 Ken Kocienda Reviewed by Hyatt Fix for this bug: Focus rings paint incorrectly for contenteditable blocks in web pages * khtml/rendering/render_flow.cpp: (RenderFlow::addFocusRingRects): Fix painting of focus rings so that ring only paints around outermost contenteditable elements. 2005-01-18 David Harrison Reviewed by Darin. accessibilityFocusedUIElement sometimes returns an ignored element; it must not * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityFocusedUIElement]): Return parentObjectUnignored if focused object is ignored. 2005-01-18 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): Command-left/right-arrows don't work with file attachment * khtml/editing/selection.cpp: (khtml::nodeForInlineBox): New helper function used in reimplementation of function below. (khtml::selectionForLine): Reimplemented using line box smarts. I originally wrote this code when I had a less than full understanding of line layout. I can do better now, and my new version no longer fails to notice attachments when doing the kind of navigation mentioned in the bug. 2005-01-17 David Harrison Reviewed by John Sullivan. AX: word marker routines returns incorrect data for empty line AX: paragraph marker routines do not work when given a paragraph end marker Also fixed sentence support in the same way. * kwq/KWQAccObject.mm: (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]): Move one position in desired direction before calling visible_units.cpp code. 2005-01-17 David Harrison Updated expected test results. line-ending space seems not to be present * layout-tests/editing/deleting/delete-ws-fixup-001-expected.txt: * layout-tests/editing/deleting/delete-ws-fixup-002-expected.txt: * layout-tests/editing/inserting/insert-div-020-expected.txt: * layout-tests/editing/inserting/insert-div-021-expected.txt: * layout-tests/editing/inserting/insert-div-022-expected.txt: * layout-tests/editing/inserting/insert-div-023-expected.txt: * layout-tests/editing/inserting/insert-div-024-expected.txt: 2005-01-17 David Harrison Reviewed by Dave Hyatt (bidi.cpp) and Darin Adler (selection.cpp). line-ending space seems not to be present * khtml/editing/selection.cpp: (khtml::Selection::validate): Extend AFTER_WHITE_SPACE code to support white spac in the middle of paragraphs, not just the end. * khtml/rendering/bidi.cpp: (khtml::RenderBlock::findNextLineBreak): Pick left/rightness of word selection based on being at the end of paragraph (i.e. after a hard line break). 2005-01-17 Darin Adler Reviewed by John Louch. - fixed need screenX and screenY to use WebKit windowFrame delegate * khtml/ecma/kjs_window.cpp: (Window::get): Change screenX and screenY to use frameGeometry instead of using mapToGlobal and screen in a complicated way. * kwq/KWQKHTMLView.mm: Removed unused mapToGlobal function. * kwq/KWQWindowWidget.h: Ditto. * kwq/KWQWindowWidget.mm: Ditto. 2005-01-17 David Hyatt Fix a screwup in rightmost/lowets position computation. 3955207. Make sure floats with layers are still checked. Reviewed by kocienda * khtml/rendering/render_block.cpp 2005-01-17 Ken Kocienda Reviewed by John Problems with typing attributes in HTML compose * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Remove misguided "optimization" that tried to sense when typing style could be cleared without actually doing a style diff between before-delete and after-delete positions. Removing this extra check and running the general-purpose code fixes the bug. 2005-01-17 Richard Williamson Fixed Need to ensure same origin for plugin binding invocations (origin security rules) Keep track of originating execution context and target execution context for native JS object wrappers, and perform appropriate security checks. Reviewed by David Harrison. * khtml/ecma/kjs_binding.cpp: (ScriptInterpreter::isGlobalObject): (ScriptInterpreter::isSafeScript): (ScriptInterpreter::interpreterForGlobalObject): * khtml/ecma/kjs_binding.h: * khtml/ecma/kjs_window.cpp: (Window::interpreter): (Window::isSafeScript): * khtml/ecma/kjs_window.h: * kwq/DOMInternal.mm: (-[WebScriptObject _initializeScriptDOMNodeImp]): * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::windowScriptObject): (KWQKHTMLPart::windowScriptNPObject): * kwq/WebCoreBridge.mm: (rootForView): (-[WebCoreBridge init]): 2005-01-17 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): editable WebViews don't work with "size up" and "size down" NSFontManager changes * khtml/css/cssparser.cpp: (CSSParser::parseValue): Add support for parsing new font size delta property. * khtml/css/cssproperties.c: Generated file. * khtml/css/cssproperties.h: Ditto. * khtml/css/cssproperties.in: Add support for parsing new font size delta property. * khtml/editing/htmlediting.cpp: (khtml::isEmptyStyleSpan): New helper function. Code existed before, but now factored out for convenient use. (khtml::CompositeEditCommand::removeNodeAttribute): Does check on value to see it exists before creating and running command to do the removal. (khtml::ApplyStyleCommand::doApply): Now calls new applyRelativeFontStyleChange() function as part of its work. (khtml::ApplyStyleCommand::applyRelativeFontStyleChange): New function that does the "heavy lifting" to handle relative font size changes. (khtml::ApplyStyleCommand::applyInlineStyle): Range check the start and end positions to make sure the start is before or equal to the end. Swap them if not true. I ran into this problem in some similar code in applyRelativeFontStyleChange(). Moving that goodness here too. (khtml::ApplyStyleCommand::splitTextAtEndIfNeeded): Uses a local variable to save a value used often. Code is the same, but reads better now. Function now returns bool as well, just like splitTextAtStartIfNeeded. I use the bool return value now (I obviously did not need it before). (khtml::ApplyStyleCommand::computedFontSize): New helper function. (khtml::ApplyStyleCommand::joinChildTextNodes): Ditto. (khtml::createStyleSpanElement): Ditto. * khtml/editing/htmlediting.h: Update header accordingly. * khtml/editing/jsediting.cpp: Add new command string to enable relative font size changes. * kwq/DOM-CSS.mm: (-[DOMCSSStyleDeclaration _fontSizeDelta]): New convenience. (-[DOMCSSStyleDeclaration _setFontSizeDelta:]): Ditto. * kwq/DOMPrivate.h: Declare new conveniences. * layout-tests/editing/editing.js: Add new JS to enable relative font size changes, as well as explicit font size setting. * layout-tests/editing/style/relative-font-size-change-001-expected.txt: Added. * layout-tests/editing/style/relative-font-size-change-001.html: Added. * layout-tests/editing/style/relative-font-size-change-002-expected.txt: Added. * layout-tests/editing/style/relative-font-size-change-002.html: Added. * layout-tests/editing/style/relative-font-size-change-003-expected.txt: Added. * layout-tests/editing/style/relative-font-size-change-003.html: Added. * layout-tests/editing/style/relative-font-size-change-004-expected.txt: Added. * layout-tests/editing/style/relative-font-size-change-004.html: Added. 2005-01-14 Darin Adler * khtml/css/cssproperties.c: Regenerated with gperf 3.0.1. * khtml/css/cssvalues.c: Regenerated with gperf 3.0.1. * khtml/misc/htmlattrs.c: Regenerated with gperf 3.0.1. * khtml/misc/htmltags.c: Regenerated with gperf 3.0.1. 2005-01-14 Chris Blumenberg Fixed: arrow keys don't work when the user hits Back to return to RSS page Reviewed by hyatt. (KWQKHTMLPart::openURLFromPageCache): restore mousePressNode (KWQKHTMLPart::mousePressNode): new * kwq/KWQPageState.h: * kwq/KWQPageState.mm: (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): save the mousePressNode (-[KWQPageState clear]): clear the mousePressNode (-[KWQPageState dealloc]): deref the mousePressNode (-[KWQPageState mousePressNode]): new === Safari-179 === 2005-01-13 Vicki Murley Reviewed by Adele. - fix Safari about box lists 2004 instead of 2005 * WebCore.pbproj/project.pbxproj: bump "2004" to "2005" 2005-01-13 David Harrison Reviewed by Ken Kocienda. Better fix for 3905066. * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): 2005-01-10 Maciej Stachowiak Reviewed by Darin. REGRESSION (Mail): Support attributes in marked text (International input) * khtml/rendering/render_text.cpp: (InlineTextBox::paint): Support painting custom underline markers for marked text in place of generic yellow. (InlineTextBox::paintMarkedTextUnderline): New method that handles this. * khtml/rendering/render_text.h: * kwq/KWQKHTMLPart.h: Declare new methods and structs. * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::clear): Clear marked test underlines. (KWQKHTMLPart::setMarkedTextRange): Takes attributes and ranges now. (convertAttributesToUnderlines): Converts NSAttributedString attributes to simplified and C++-friendly form. (KWQKHTMLPart::markedTextUsesUnderlines): New method. (KWQKHTMLPart::markedTextUnderlines): New method. * kwq/KWQPainter.mm: (QPainter::drawLineForText): Handle pen width. * kwq/WebCoreBridge.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge setMarkedTextDOMRange:customAttributes:ranges:]): Take attributes and ranges. * kwq/WebCoreTextRenderer.h: 2005-01-12 David Harrison Reviewed by Dave Hyatt. AX: Parent AXWebArea of nested AXWebAreas is messed up * kwq/KWQAccObject.mm: (-[KWQAccObject addChildrenToArray:]): Use the widget's outer view. 2005-01-12 David Harrison Reviewed by Darin Adler. Crash when asking for the kAXLengthForTextMarkerRangeParameterizedAttribute * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Add quotes around text node content. (NodeBaseImpl::childNode): Add nil check to return nil rather than crash when child node not found. * kwq/KWQAccObject.mm: (-[KWQAccObject doAXStringForTextMarkerRange:]): Pass range compliant positions to TextIterator. 2005-01-12 David Hyatt Fix for 3951203, CSS border style incorrectly clipped on inline elements. Make sure the repaint rect set during line layout is smarter about including the overflow for both old states and new states. Reviewed by john * khtml/rendering/bidi.cpp: (khtml::RenderBlock::layoutInlineChildren): 2005-01-12 David Hyatt Fix for bug 3937608, versiontracker.com flashes and displays the right column below content. Make sure to move tables/overflows that dont fit within a block only in strict mode. Fix for bug 3931049, characters dont show up when typing. Make sure to dirty the right lines when this specific case in editing is hit. Reviewed by darin (first one), kocienda (second one) * khtml/rendering/render_block.cpp: (khtml::RenderBlock::getClearDelta): * khtml/rendering/render_flow.cpp: (RenderFlow::dirtyLinesFromChangedChild): * khtml/rendering/render_line.cpp: (khtml::InlineFlowBox::verticallyAlignBoxes): 2005-01-12 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): Deleting text decreases quote level * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::initializePositionData): Change test that will prevent block merging. End-of-line test was just wrong. Call new start-of and end-of paragraph functions added to visible_position files. (khtml::DeleteSelectionCommand::moveNodesAfterNode): Add tests for BR elements, which makes tests to determine when to stop moving nodes more complete and correct. Also improved comments. * khtml/editing/visible_position.cpp: (khtml::isFirstVisiblePositionInParagraph): New function. (khtml::isLastVisiblePositionInParagraph): New function. * khtml/editing/visible_position.h: Update header accordingly. * layout-tests/editing/deleting/delete-block-merge-contents-002-expected.txt: New results, slightly different from former results but still correct. * layout-tests/editing/deleting/delete-block-merge-contents-007-expected.txt: Ditto. * layout-tests/editing/deleting/delete-block-merge-contents-018-expected.txt: Added. * layout-tests/editing/deleting/delete-block-merge-contents-018.html: Added. * layout-tests/editing/deleting/delete-block-merge-contents-019-expected.txt: Added. * layout-tests/editing/deleting/delete-block-merge-contents-019.html: Added. * layout-tests/editing/deleting/delete-block-merge-contents-020-expected.txt: Added. * layout-tests/editing/deleting/delete-block-merge-contents-020.html: Added. * layout-tests/editing/deleting/delete-block-merge-contents-021-expected.txt: Added. * layout-tests/editing/deleting/delete-block-merge-contents-021.html: Added. * layout-tests/editing/deleting/delete-line-014-expected.txt: These new results are actually better, and fix a bug. 2005-01-11 Richard Williamson Fixed 3922875. Fall back to DOM object is EMBED element has no associated runtime object. Reviewed by Chris. * khtml/ecma/kjs_dom.cpp: (KJS::getRuntimeObject): * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::tryGet): (KJS::HTMLElement::tryGet): (KJS::HTMLCollection::tryGet): (KJS::HTMLCollection::getNamedItems): 2005-01-11 David Hyatt Fix for 3882299, missing content on gibson.com. Change our handling of " and ' in certain states of the parser to match other browsers. Reviewed by Maciej * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): 2005-01-11 Chris Blumenberg Fixed: Mail prints second page of email blank Reviewed by dave. * khtml/rendering/render_canvas.cpp: (RenderCanvas::paint): cache the print rect since the dirty rect can get changed during printing * khtml/rendering/render_flow.cpp: (RenderFlow::paintLines): removed null check since the print rect should never be null * khtml/rendering/render_list.cpp: (RenderListMarker::paint): ditto * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::adjustPageHeight): don't set the print rect here since this method is not called for the last page 2005-01-10 Ken Kocienda Reviewed by Hyatt Fix for this bug: extra line is inserted after pressing return within quoted text of reply * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): This bug was the result of a simple coding mistake. A local variable was erroneously redefined in a deeper scope, and so the result calculated in that deeper scope was not available when tested. 2005-01-10 Ken Kocienda Reviewed by John Fix for this bug: Option-e goes to next line * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): Tweak case used to determine when merging content into the start line is done. We plan to change pretty substantially soon to better handle the problem described in Quote level not maintained when copied and pasted within a Mail message. In the meantime, this change does no harm, and fixes the bug. 2005-01-10 Ken Kocienda Reviewed by Darin Fix for this bug: Applying block styles to a line of text can unexpectedly affect other lines * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs" to their own blocks if needed so that a block style can be applied. (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally. (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded(). (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling. This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current paragraph is styled. (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null. Should remove attributue instead. * khtml/editing/htmlediting.h: Touch function declarations accordingly. * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-001.html: Added. * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-002.html: Added. * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-003.html: Added. * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-004.html: Added. * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-005.html: Added. * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-006.html: Added. * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-007.html: Added. * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-008.html: Added. * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-009.html: Added. * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-010.html: Added. * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-011.html: Added. * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-012.html: Added. * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added. * layout-tests/editing/style/create-block-for-style-013.html: Added. Unrelated updates to these expected results. * layout-tests/editing/inserting/insert-div-007-expected.txt * layout-tests/editing/pasteboard/paste-text-013-expected.txt 2005-01-10 Chris Blumenberg Fixed: Mail: Messages with rich text do not print Reviewed by john. * khtml/rendering/render_flow.cpp: (RenderFlow::paintLines): don't do pagination work if printRect is not set * khtml/rendering/render_list.cpp: (RenderListMarker::paint): ditto 2005-01-10 David Harrison Reviewed by Darin. * kwq/KWQTextUtilities.mm: (currentTextBreakLocaleID): Return empty string (AKA root locale) if locale pref can not be canonicalized. 2005-01-10 John Sullivan Fixed broken Panther build. * kwq/KWQTextUtilities.mm: (currentTextBreakLocaleID): This recently-added function was using code copy/pasted from CarbonCore UnicodeUtilities. That code used a Tiger-only function, CFLocaleCreateCanonicalLanguageIdentifierFromString. To fix the build, I added a BUILDING_ON_PANTHER #ifdef that avoids the call to the Tiger function. However, the Tiger-only code was wrong; the string generated using CFLocaleCreateCanonicalLanguageIdentifierFromString was not used at all, so I fixed that as well. 2005-01-09 David Harrison Reviewed by Ken Kocienda. REGRESSION (Mail): pasted text loses one newline * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): Tune check for need for insertParagraphSeparator when hasInterchangeNewline. 2005-01-09 Darin Adler Reviewed by Harrison. - fixed select() method does not work on * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::select): Changed if statement to a switch statement. Added SEARCH to the set of types that treat the renderer as a RenderLineEdit. 2005-01-09 David Harrison Reviewed by Ken Kocienda. REGRESSION (Mail): Hitting return key with caret in front of space causes space to become lost (resize fixes) Problem was that InsertParagraphSeparatorCommand::doApply() was not collapsing whitespace to a single non-breaking space when splitting a text node. * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): 2005-01-08 Kevin Decker Reviewed by Ken. Fixed: Calling setOuterHTML: on a DOMHTMLHtmlElement can crash a program * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::setOuterHTML): Added a nil check for fragments who don't have parents. 2005-01-07 Maciej Stachowiak Reviewed by Darin. REGRESSION (125-TOT): my bank's website doesn't work (Societe Generale, socgen.com) * Khtml/khtml_part.cpp: (KHTMLPart::checkCompleted): If the document is NULL, assume this frame has not started loading yet so it could not possibly be finishing here... (KHTMLPart::stop): ...unless the part is explicitly stopped and there is still no document, in this case we must have hit an error or been loading a non-HTML frame. * khtml/khtml_part.h: 2005-01-08 David Harrison Reviewed by Maciej. REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space * khtml/editing/selection.cpp: (khtml::Selection::validate): Tune word selections left/right choice to use right if on empty last line. 2005-01-07 David Harrison Reviewed by Darin. AX: Support sentence ax attributes Needed to use the unicode utilities properly. Twas lame before. * khtml/editing/visible_units.cpp: (khtml::previousBoundary): (khtml::nextBoundary): (khtml::startOfWord): (khtml::endOfWord): (khtml::previousWordPosition): (khtml::nextWordPosition): (khtml::startOfSentence): (khtml::endOfSentence): (khtml::previousSentencePosition): (khtml::nextSentencePosition): * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityAttributeNames]): (-[KWQAccObject accessibilityAttributeValue:]): (-[KWQAccObject accessibilityParameterizedAttributeNames]): (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]): * kwq/KWQTextUtilities.mm: (currentTextBreakLocaleID): (KWQFindSentenceBoundary): (KWQFindNextSentenceFromIndex): 2005-01-07 Ken Kocienda Reviewed by Kevin Fix for these bugs: in some cases, text does not retain style info after pressing return twice after pressing return twice, text is bold when it shouldn't be * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): Merge the typing style with the computed style for the current position. Fixes both bugs. * khtml/editing/htmlediting.h: * layout-tests/editing/inserting/insert-div-023-expected.txt: Added. * layout-tests/editing/inserting/insert-div-023.html: Added. * layout-tests/editing/inserting/insert-div-024-expected.txt: Added. * layout-tests/editing/inserting/insert-div-024.html: Added. 2005-01-07 David Hyatt Fix for 3941364, make sure tables reset overflowWidth/Height when they lay out again. Fixes the odd scrolling behavior on worldofwarcraft.com. Reviewed by kevin * khtml/rendering/render_table.cpp: (RenderTable::layout): 2005-01-06 David Hyatt Fix for 3932418 and 3920998, assertion failures caused by stray inline content inside tables. Bulletproof the hit testing to ignore inline flows in this case. Reviewed by kevin * khtml/rendering/render_block.cpp: (khtml::RenderBlock::nodeAtPoint): 2005-01-07 Ken Kocienda Reviewed by Hyatt Fix for this bug: for forwarded message, tabbing to message view scrolls to bottom of view * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrame): Don't scroll the focus node to visible if it is not in the document, or if it is not a descendent of the document element. In the case of the bug, since the selection has not yet been set up, the focus node passed here is the HTML element, and that does not yield a rect that is useful to us here. So now, in the case the bug mentions, we do nothing. 2005-01-06 Kevin Decker Reviewed by mjs. Fixed: REGRESSION (125-177): iFrame example at developer.apple.com fails in Safari * khtml/khtml_part.cpp: (KHTMLPart::processObjectRequest): m_bComplete was never true for frames generated by Javascript due to our synchronous loading and as a result, scheduled redirects wouldn't fire in KHTMLPart::scheduleLocationChange(). By virtue of being an empty document, a document is complete. In this special case it's safe at this point to call checkCompleted() which sets m_bComplete true. === Safari-178 === 2005-01-06 David Harrison Reviewed by Chris. (addendum to previous checkin for this bug) AX: Editable HTML should not be viewed as AXStaticText Fix line navigation. Add AXUIElementForTextMarker. * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityParameterizedAttributeNames]): (-[KWQAccObject doAXUIElementForTextMarker:]): (-[KWQAccObject doAXLineForTextMarker:]): (-[KWQAccObject doAXTextMarkerRangeForLine:]): (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]): (-[KWQAccObject accessibilityAttributeValue:forParameter:]): 2005-01-06 Darin Adler Reviewed by Ken. - re-fixed Request to include support for custom tag names in HTML (they already work in XML) (turns out the PLT regression was a false alarm) * khtml/html/htmlparser.h: Change forbidden tag array to be allocated in the object rather than on the heap. Also use ID_LAST_TAG for the array size; the old code used ID_CLOSE_TAG which is now a much larger number. * khtml/html/htmlparser.cpp: (KHTMLParser::KHTMLParser): Remove code that creates the forbidden tag array on the heap; makes more sense to just have the array be a member so we don't have to use new and delete on it. Also needed to eliminate code that used ID_CLOSE_TAG for an array size. (KHTMLParser::~KHTMLParser): Remove code that deletes the forbidden tag array. Also changed the code that manages isindex to use deref instead of delete. (KHTMLParser::reset): Use safer sizeof for clearing the forbidden tag array. Old code had the mistake of using ID_CLOSE_TAG for the array size too. (KHTMLParser::parseToken): Removed code that checks for bogus tags; it's not clear why it was ever there and it would prevent custom tags from working. Added range check before using the forbidden tag array with the token ID since custom tags will use index values past the end of the array. (KHTMLParser::getElement): Removed most of the code that makes an element by ID; now the work is done inside the DocumentImpl createHTMLElement. Any code that needs to be different than a dynamic createElement call is still here. Last time I left out a few form element types from this switch; fixed now. * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): Call the tagId function in the document if getTagID fails; this creates a unique per-document ID. * khtml/misc/htmltags.c: Regenerated. * khtml/misc/htmltags.h: Regenerated. * khtml/misc/maketags: Changed the generated constants to use "const unsigned short" instead of "#define". Changed ID_CLOSE_TAG to be a fixed value of 32000 rather than being just past the IDs of the HTML tags. Also rewrote getTagName to work with the new scheme. 2005-01-06 David Harrison Fixed Panther build. Also, do not advertize sentence support since it is incomplete. * kwq/KWQAccObject.mm: (-[KWQAccObject visiblePositionForEndOfTextMarkerRange:]): (-[KWQAccObject accessibilityParameterizedAttributeNames]): (-[KWQAccObject accessibilityIsAttributeSettable:]): 2005-01-06 David Harrison Reviewed by Dave Hyatt. AX: Editable HTML should not be viewed as AXStaticText AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work Many more AX attributes supported. Numerous fixes to previous AX work. * khtml/editing/visible_units.cpp: (khtml::startSentenceBoundary): (khtml::startOfSentence): (khtml::endSentenceBoundary): (khtml::endOfSentence): (khtml::previousSentencePositionBoundary): (khtml::previousSentencePosition): (khtml::nextSentencePositionBoundary): (khtml::nextSentencePosition): * khtml/editing/visible_units.h: * khtml/khtmlview.cpp: (KHTMLView::layout): * khtml/misc/helper.cpp: (khtml::findSentenceBoundary): (khtml::nextSentenceFromIndex): * khtml/misc/helper.h: * khtml/misc/htmltags.c: (hash_tag): (findTag): * khtml/rendering/render_container.cpp: (RenderContainer::removeChildNode): (RenderContainer::appendChildNode): (RenderContainer::insertChildNode): * khtml/rendering/render_object.cpp: (RenderObject::remove): * khtml/xml/dom_docimpl.cpp: (DocumentImpl::getAccObjectCache): (DocumentImpl::updateSelection): (DocumentImpl::close): (DocumentImpl::setFocusNode): (DocumentImpl::parentDocument): (DocumentImpl::topDocument): * khtml/xml/dom_docimpl.h: * kwq/KWQAccObject.mm: (-[KWQAccObject accessibilityShouldUseUniqueId]): (-[KWQAccObject detach]): (-[KWQAccObject anchorElement]): (-[KWQAccObject firstChild]): (-[KWQAccObject lastChild]): (-[KWQAccObject previousSibling]): (-[KWQAccObject nextSibling]): (-[KWQAccObject parentObject]): (-[KWQAccObject value]): (-[KWQAccObject accessibilityAttributeNames]): (-[KWQAccObject accessibilityPerformAction:]): (-[KWQAccObject textMarkerForVisiblePosition:]): (-[KWQAccObject visiblePositionForTextMarker:]): (-[KWQAccObject textMarkerRangeFromVisiblePositions:andEndPos:]): (-[KWQAccObject topDocument]): (-[KWQAccObject topRenderer]): (-[KWQAccObject topView]): (-[KWQAccObject accessibilityAttributeValue:]): (-[KWQAccObject accessibilityParameterizedAttributeNames]): (-[KWQAccObject doAXLineForTextMarker:]): (-[KWQAccObject doAXTextMarkerRangeForLine:]): (-[KWQAccObject doAXStringForTextMarkerRange:]): (-[KWQAccObject doAXTextMarkerForPosition:]): (-[KWQAccObject doAXBoundsForTextMarkerRange:]): (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]): (-[KWQAccObject doAXTextMarkerRangeForUnorderedTextMarkers:]): (-[KWQAccObject doAXNextTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousTextMarkerForTextMarker:]): (-[KWQAccObject doAXLeftWordTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXRightWordTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXSentenceTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXParagraphTextMarkerRangeForTextMarker:]): (-[KWQAccObject doAXNextWordEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousWordStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextSentenceEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousSentenceStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXNextParagraphEndTextMarkerForTextMarker:]): (-[KWQAccObject doAXPreviousParagraphStartTextMarkerForTextMarker:]): (-[KWQAccObject doAXLengthForTextMarkerRange:]): (-[KWQAccObject accessibilityAttributeValue:forParameter:]): (-[KWQAccObject accessibilityHitTest:]): (-[KWQAccObject accessibilityFocusedUIElement]): (-[KWQAccObject accessibilityIsAttributeSettable:]): (-[KWQAccObject doSetAXSelectedTextMarkerRange:]): (-[KWQAccObject setAccObjectID:]): (-[KWQAccObject removeAccObjectID]): * kwq/KWQAccObjectCache.h: * kwq/KWQAccObjectCache.mm: (KWQAccObjectCache::setAccObject): (KWQAccObjectCache::removeAccObject): (KWQAccObjectCache::visiblePositionForTextMarker): (KWQAccObjectCache::postNotificationToTopWebArea): (KWQAccObjectCache::postNotification): (KWQAccObjectCache::handleFocusedUIElementChanged): * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::respondToChangedContents): * kwq/KWQTextUtilities.h: * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): (KWQFindSentenceBoundary): (KWQFindNextSentenceFromIndex): * kwq/WebCoreBridge.mm: (-[WebCoreBridge accessibilityTree]): 2005-01-05 Darin Adler Reviewed by Ken. - re-landing a subset of my custom tag change that does not fix the bug, but also does not introduce a performance regression * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::checkOneSelector): Changed some code that used ID_LAST_TAG in a slightly wrong, but harmless, way. * khtml/editing/htmlediting.cpp: (khtml::debugPosition): Use nodeName rather than getTagName, since the latter works for per-document tags and is just better all around for things like the document. (khtml::debugNode): Ditto. * khtml/editing/selection.cpp: (khtml::Selection::debugPosition): Ditto. * khtml/editing/visible_position.cpp: (khtml::VisiblePosition::debugPosition): Ditto. * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::displayNode): Ditto. * khtml/xml/dom_position.cpp: (DOM::Position::debugPosition): Ditto. * khtml/html/dtd.cpp: (DOM::checkChild): Use ID_LAST_TAG rather than 1000 for the check that allows non-HTML elements to be nested as desired. * khtml/misc/htmlhashes.h: Changed return types to unsigned short. * khtml/misc/htmlhashes.cpp: (khtml::getTagID): Changed return type to unsigned short. (khtml::getAttrID): Ditto. * khtml/xml/dom_docimpl.h: Added overload of createHTMLElement, made it non-virtual since it's not overriden. * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createHTMLElement): Refactored into two separate functions, one that takes the tag ID. Also updated for a few tags that the parser handled but this did not. * kwq/KWQRenderTreeDebug.cpp: (getTagName): Added. Works for custom nodes, because it calls nodeName rather than using getTagName on the tag ID directly, which only works for standard nodes. (operator<<): Update to call getTagName. (nodePositionRelativeToRoot): Ditto. (writeSelection): Ditto. 2005-01-05 Ken Kocienda Reviewed by Hyatt Fix for this bug: REGRESSION (Mail): Paste inserts content in wrong place * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): Some cleanup and refinement of the concepts used to make this operation work correctly, particularly in the logic to figure out whether to merge content, and also performing merges. * khtml/editing/visible_position.cpp: (khtml::isFirstVisiblePositionInBlock): Simplification of test used to make this determination. * khtml/editing/visible_units.cpp: (khtml::isStartOfParagraph): New helper, used in khtml::ReplaceSelectionCommand::doApply(). (khtml::isEndOfParagraph): Ditto. * khtml/editing/visible_units.h: Declare new functions. 2005-01-04 Ken Kocienda Reviewed by John Fix for this bug: Pressing return in a quoted block inserts too many newlines * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Call to insertBlockPlaceholderIfNeeded() for the block we are adding was being done at the wrong time, which led to the placeholder remaining in the document when it was not needed. This resulted in the extra space reported in the bug. 2005-01-04 Kevin Decker Reviewed by Hyatt. Fixed: nil-deref, crash in InlineFlowBox::nodeAtPoint closing DHTML menus at hrweb.apple.com * khtml/rendering/render_block.cpp: (khtml::RenderBlock::fillInlineSelectionGaps): Added a nil check. If there is no selection, don't try to get the selection's containing block. If we do, we'll crash. 2005-01-04 David Hyatt Fix for 3937203, force an update of the dashboard regions when scrollbars are added/removed. Reviewed by kevin * khtml/rendering/render_layer.cpp: (RenderLayer::updateScrollInfoAfterLayout): 2005-01-04 Ken Kocienda Reviewed by John Fix for these two bugs: REGRESSION (Mail): Pasting into an empty document mangles content REGRESSION (Mail): Pasting mistakenly reverses lines * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): For 3938935, add one more case to handle an empty document; merge neither start nor end. For 3939148, improve the code which adjusts the insertion point during the process of pasting. It formerly handled only one of the possible cases. * layout-tests/editing/pasteboard/paste-text-015-expected.txt: Added. * layout-tests/editing/pasteboard/paste-text-015.html: Added. 2005-01-04 David Hyatt Fix for 3936571, placeholder attribute should work for normal inputs for Dashboard. Reviewed by john * khtml/rendering/render_form.cpp: (RenderLineEdit::updateFromElement): * kwq/KWQLineEdit.mm: (QLineEdit::setPlaceholderString): 2005-01-04 David Hyatt Fix for 3830936, hang on changeforamerica.com. Make sure to ignore the style not yet available option when returning pseudo-styles. Reviewed by john * khtml/css/cssstyleselector.cpp: (khtml::CSSStyleSelector::matchRulesForList): (khtml::CSSStyleSelector::pseudoStyleForElement): * khtml/rendering/render_style.cpp: (RenderStyle::addPseudoStyle): 2005-01-04 Darin Adler - rolled out my custom tag name change again -- it caused a 1 ms PLT regression * khtml/css/cssstyleselector.cpp: * khtml/editing/htmlediting.cpp: * khtml/editing/selection.cpp: * khtml/editing/visible_position.cpp: * khtml/html/dtd.cpp: * khtml/html/htmlparser.cpp: * khtml/html/htmlparser.h: * khtml/html/htmltokenizer.cpp: * khtml/misc/htmlhashes.cpp: * khtml/misc/htmlhashes.h: * khtml/misc/htmltags.c: * khtml/misc/htmltags.h: * khtml/misc/maketags: * khtml/xml/dom_docimpl.cpp: * khtml/xml/dom_docimpl.h: * khtml/xml/dom_nodeimpl.cpp: * khtml/xml/dom_position.cpp: * kwq/KWQRenderTreeDebug.cpp: 2005-01-04 Ken Kocienda Reviewed by John Fix for this bug: Style info applied to remainder of document after a newline is entered * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): Clean up and simplification in code that inserts a paragraph separator. The bug was all about applying styles to the new paragraph that did not need to be applied. Now the code will detect when at the end of a style run and will not move and apply that ending style to the new paragraph, though it will place that style into the typing style. This seems to match NSText behavior. * layout-tests/editing/inserting/insert-div-021-expected.txt: This test result exhibited the bug fixed here. The only reason it was not noticed is that the erroneously copied inline was a span, and so did not have any visible effect on the document. * layout-tests/editing/inserting/insert-div-022-expected.txt: Added. * layout-tests/editing/inserting/insert-div-022.html: Added. 2005-01-04 David Hyatt Fix for 3904562, make sure to clear the outline dictionary when drawing so that random focus rings dont get drawn all over the place. Reviewed by john * khtml/rendering/render_flow.cpp: (RenderFlow::paintLines): 2005-01-03 David Hyatt Fix for float painting regressions 3932524, 3931664, and 3933068. Make the noPaint flag setting more robust and make it work regardless of which objects get a layout or not. Reviewed by mjs * khtml/rendering/render_block.cpp: (khtml::RenderBlock::insertFloatingObject): (khtml::RenderBlock::addOverhangingFloats): (khtml::RenderBlock::addIntrudingFloats): * khtml/rendering/render_block.h: (khtml::RenderBlock::FloatingObject::FloatingObject): 2005-01-03 Maciej Stachowiak Reviewed by Kevin. Tiger 8A341: nil deref crash in DOM::NodeImpl::traverseNextNode * khtml/html/html_miscimpl.cpp: (HTMLCollectionImpl::traverseNextItem): Assert that the starting point is not nil, it should not ever be (now). (HTMLCollectionImpl::item): When traversing items stop when we hit nil, meaning the end to avoid triggering above assert (formerly crash). 2005-01-03 Maciej Stachowiak Reviewed by John and Kevin. REGRESSION(125.9-125.11) broken behavior at test.profoundlearning.com - used to * khtml/ecma/kjs_window.cpp: (Window::get): Look up frame names before buitin window properties to match other browsers. This regressed because we added a builtin "toolbar" property but this site had a frame with that name. 2004-12-21 Maciej Stachowiak Reviewed by Darin. frame naming allows malicious site to bring up a window when you click on a link in another Added opener bridge method to help WebKit implement security check for named frame visibility. * khtml/khtml_part.h: * kwq/WebCoreBridge.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge opener]): 2005-01-03 Ken Kocienda Reviewed by John Fix for this bug: Tiger8A341: Mail crashes while forwarding embedded HTML message in -[WebCoreBridge ensureSelectionVisible] * kwq/WebCoreBridge.mm: (-[WebCoreBridge ensureSelectionVisible]): Put in some null checks to prevent crash experienced in bug. 2005-01-03 David Hyatt Fix for 3936881, make sure positioned objects prooperly update y-position. Reviewed by john * khtml/rendering/render_block.cpp: (khtml::RenderBlock::layoutPositionedObjects): 2005-01-03 Ken Kocienda Reviewed by Harrison Fix for this bug: REGRESSION (Mail): Typing style lost after hitting return key * khtml/editing/htmlediting.cpp: (khtml::InsertLineBreakCommand::preservesTypingStyle): Now implemented, returning yes for this command. (khtml::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Initialize new typing style member variable. (khtml::InsertParagraphSeparatorCommand::~InsertParagraphSeparatorCommand): Deref new typing style member variable. (khtml::InsertParagraphSeparatorCommand::preservesTypingStyle): Now implemented, returning yes for this command. (khtml::InsertParagraphSeparatorCommand::setFullTypingStyleBeforeInsertion): New function to set the typing style (khtml::InsertParagraphSeparatorCommand::calculateAndSetTypingStyleAfterInsertion): Function called after the

insertion is done. This function diffs the style created in setFullTypingStyleBeforeInsertion() with the style of the new

and only sets those styles needed to preserve the style in effect before the insertion. (khtml::InsertParagraphSeparatorCommand::doApply): Call new functions. (khtml::TypingCommand::preservesTypingStyle): Now yes for inserting line breaks and paragraphs. * khtml/editing/htmlediting.h: Declare new functions. 2004-12-25 Kevin Decker Reviewed by Hyatt. Fixed: hang in KHTMLParser::parseToken (consulting.soroos.net) * khtml/html/dtd.cpp:

elements no margin rather than 0.1em margin. * layout-tests/editing/inserting/insert-div-013-expected.txt * layout-tests/editing/inserting/insert-div-014-expected.txt 2004-12-17 Ken Kocienda Reviewed by John Fix for this bug: Increase quote in email and with cursor below the quote the new line appears above the quote * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): * khtml/editing/visible_position.cpp: Refine rules for whether to use the starting node or the starting block as the reference node for the insertion of the new block. (khtml::isLastVisiblePositionInBlock): Tweak rules again. Descendants of following blocks should answer true. I worked this all out on the whiteboard this time. This should be the last tweak. 2004-12-17 Kevin Decker Reviewed by Ken. Fixed Need a clean way for Dashboard to detect when an XML parsing error occurs * khtml/xml/xml_tokenizer.cpp: (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic

, use to match Mozilla. 2004-12-16 Ken Kocienda Reviewed by Chris Fix for this bug: REGRESSION (Mail): Hitting return key at end of line does not insert visible newline * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): Tweaked code I added just before to fix 3924486, so that it checks the downstream node for the starting position. 2004-12-16 Ken Kocienda Reviewed by Chris Added new createBreakElement() function that makes creating a
element a one-liner. Converted all the code that used to call the DocumentImpl, and dealt with the exceptionCode, over to this new helper. * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::moveNodesAfterNode): Now uses new helper function. (khtml::InsertLineBreakCommand::doApply): Ditto. (khtml::InsertParagraphSeparatorCommand::doApply): Ditto. (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply): Ditto. (khtml::ReplaceSelectionCommand::doApply): Ditto. (khtml::createBreakElement): New helper. * khtml/editing/htmlediting.h: Ditto. 2004-12-16 David Hyatt Fix a bug where vertical-align values that depended on their parent's value went crazy if the parent was vertical-align top or bottom. The bug is 3771007, bankofamerica's ebills page. Reviewed by kocienda * khtml/rendering/render_object.cpp: (RenderObject::getVerticalPosition): 2004-12-16 Ken Kocienda Reviewed by John Fix for these bugs: REGRESSION (Mail): Hitting return key does not insert visible newline REGRESSION (Mail): After deleting, hitting return key does not insert visible newline * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): For the first bug, detect when inserting a

will make a visible
collapse. For the second bug, move the code that inserts the new

after a check which may move the node used as the reference node for the insertion. Also change this code to insert the

after the last sibling of the starting position, to move it past the nodes we're going to want to shift into the new

. 2004-12-16 Darin Adler Reviewed by Ken. - use

elements rather than
when pasting plain text; also use margin of 0 rather than 0.1 em after talking this over with Dave and Ken * khtml/editing/htmlediting.h: Added createDefaultParagraphElement and createBlockPlaceholderElement. * khtml/editing/htmlediting.cpp: (khtml::CompositeEditCommand::insertBlockPlaceholderIfNeeded): Use new createBlockPlaceholderElement helper so this can share code with the plain-text conversion code. (khtml::InsertParagraphSeparatorCommand::createParagraphElement): Use new createDefaultParagraphElement helper so this can share code with the plain-text conversion code. (khtml::createDefaultParagraphElement): Added. (khtml::createBlockPlaceholderElement): Added. * khtml/editing/markup.cpp: (khtml::createFragmentFromText): Use paragraphs rather than
elements for pasting plain text. - regenerated these files with the newer gperf * khtml/css/cssproperties.c: Regenerated. * khtml/css/cssvalues.c: Regenerated. * khtml/misc/htmlattrs.c: Regenerated. * khtml/misc/htmltags.c: Regenerated. 2004-12-16 Ken Kocienda Reviewed by Hyatt Fix for this bug: REGRESSION (Mail): Crash deleting content following a

element * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::enclosingInlineElement): Fixed problem in this function where recursive search for parent that is not an inline would skip past previous siblings of nodes which were blocks. Now it stops looking in this situation. This problem eventually caused the delete code to try to merge a node under a descendent. 2004-12-16 Adele Amchan Change by Richard, reviewed by me. Fix for: background image decoding prevents page with 0Kb image from finishing to load * khtml/misc/loader.cpp: (CachedImage::data): Added call to notifyFinished so the 0Kb image case finishes loading. 2004-12-16 Adele Amchan Reviewed by Chris. Fix for: VIP: some navigation links on safeway.com don't work due to a JavaScript quirk Added a call to ObjectImp::get before Window::get just returns Undefined. This was preventing us from getting the toString function from a Window object. * khtml/ecma/kjs_window.cpp: (Window::get): 2004-12-16 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail, 173-175+): Return before first char of line leaves insertion point in wrong place * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::doApply): Basically, did a rewrite of this function to do a better job than it was doing before. Added several test cases to prove I am on a better track. * khtml/editing/visible_position.cpp: (khtml::isFirstVisiblePositionInBlock): Tweaked the rules a bit to fix an issue very similar to the leaving-the-bar-node case problem I just fixed in a recent checkin (relevant markup:

foo

bar). This function was returning true for the first position in "bar". Wrong. Also tightened up other rule: Should not report true when relationship between blocks cannot be determined. (khtml::isLastVisiblePositionInBlock): Tightened up rule as above: Should not report true when relationship between blocks cannot be determined. * layout-tests/editing/inserting/insert-div-010-expected.txt: Added. * layout-tests/editing/inserting/insert-div-010.html: Added. * layout-tests/editing/inserting/insert-div-011-expected.txt: Added. * layout-tests/editing/inserting/insert-div-011.html: Added. * layout-tests/editing/inserting/insert-div-012-expected.txt: Added. * layout-tests/editing/inserting/insert-div-012.html: Added. * layout-tests/editing/inserting/insert-div-013-expected.txt: Added. * layout-tests/editing/inserting/insert-div-013.html: Added. * layout-tests/editing/inserting/insert-div-014-expected.txt: Added. * layout-tests/editing/inserting/insert-div-014.html: Added. * layout-tests/editing/inserting/insert-div-015-expected.txt: Added. * layout-tests/editing/inserting/insert-div-015.html: Added. * layout-tests/editing/inserting/insert-div-016-expected.txt: Added. * layout-tests/editing/inserting/insert-div-016.html: Added. * layout-tests/editing/inserting/insert-div-017-expected.txt: Added. * layout-tests/editing/inserting/insert-div-017.html: Added. 2004-12-16 Ken Kocienda Reviewed by me Added a layout test based on my last checkin. * layout-tests/editing/selection/move-by-word-001-expected.txt: Added. * layout-tests/editing/selection/move-by-word-001.html: Added. 2004-12-16 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): Command-left-arrow leaves insertion point too high after specific steps * khtml/editing/visible_text.cpp: (khtml::SimplifiedBackwardsTextIterator::advance): Add new check for leaving a text node and iterating backwards into a different block that is an descendent of the block containing the text node (as in leaving the "bar" node in this example:

foo

bar). (khtml::SimplifiedBackwardsTextIterator::handleNonTextNode): Call new emitNewlineForBROrText helper. (khtml::SimplifiedBackwardsTextIterator::emitNewlineForBROrText): Factor out code from handleNonTextNode, since it is called from there, and now also from advance(). 2004-12-15 Darin Adler Reviewed by Ken. - fixed problem where plain-text would put a blank line between each

even when they have no margins * khtml/editing/visible_text.cpp: (khtml::TextIterator::exitNode): Add more checks and only set the "add one more newline" flag if the margin is sufficient. A more complete fix would ignore the node type altogether and use the render tree instead. 2004-12-14 John Sullivan Reviewed by Ken. - rest of WebCore fix for undoable operations all say "Undo" in the menu, no specific action names * khtml/editing/edit_actions.h: new header, contains EditAction enum (renamed from HTMLEditAction, formerly in htmlediting.h) * ForwardingHeaders/editing/edit_actions.h: new forwarding header * khtml/editing/htmlediting.h: removed HTMLEditAction enum in favor of including edit_actions.h; added khtml:: namespace to EditAction usages; added m_editingAction ivar to ApplyStyleCommand * khtml/editing/htmlediting.cpp: (khtml::EditCommandPtr::editingAction): update for enum name change (khtml::EditCommand::editingAction): ditto (khtml::ApplyStyleCommand::ApplyStyleCommand): added editingAction parameter to this constructor (khtml::ApplyStyleCommand::editingAction): return new ivar (khtml::DeleteSelectionCommand::editingAction): update for enum name change (khtml::MoveSelectionCommand::editingAction): ditto (khtml::TypingCommand::editingAction): ditto (khtml::ReplaceSelectionCommand::editingAction): ditto * khtml/khtml_part.h: added EditAction parameter to applyStyle and computeAndSetTypingStyle * khtml/khtml_part.cpp: (KHTMLPart::computeAndSetTypingStyle): added EditAction parameter (KHTMLPart::applyStyle): ditto * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::registerCommandForUndoOrRedo): do the cast from EditAction to WebUndoAction a different way to match other code * kwq/WebCoreBridge.h: * kwq/WebCoreBridge.mm: (-[WebCoreBridge setTypingStyle:withUndoAction:]): added WebUndoAction parameter, passed into ApplyStyleCommand constructor (-[WebCoreBridge applyStyle:withUndoAction:]): ditto * WebCore.pbproj/project.pbxproj: updated for new files 2004-12-14 David Hyatt Fix for 3562458, rowspan and colspan converted to ints so that large values will work for them. Remove the ridiculous 1024 limit on the span values. * khtml/html/html_tableimpl.cpp: (HTMLTableCellElementImpl::parseHTMLAttribute): * khtml/rendering/render_table.cpp: (RenderTableCell::collapsedBottomBorder): * khtml/rendering/render_table.h: (khtml::RenderTableCell::colSpan): (khtml::RenderTableCell::setColSpan): (khtml::RenderTableCell::rowSpan): (khtml::RenderTableCell::setRowSpan): (khtml::RenderTableCol::span): (khtml::RenderTableCol::setSpan): 2004-12-14 David Hyatt Make sure and can have spans updated dynamically as well. Reviewed by rjw * khtml/html/html_tableimpl.cpp: (HTMLTableColElementImpl::parseHTMLAttribute): * khtml/rendering/render_table.cpp: (RenderTableCell::updateFromElement): (RenderTableCol::updateFromElement): 2004-12-14 David Hyatt Fix for 3833123, setting a cell's colspan does not update rendering like it should. Reviewed by rjw * khtml/html/html_tableimpl.cpp: (HTMLTableCellElementImpl::parseHTMLAttribute): * khtml/rendering/render_table.cpp: (RenderTableCell::RenderTableCell): (RenderTableCell::updateFromElement): 2004-12-14 Chris Blumenberg Fixed: crash copying text from other apps and pasting in a sticky in dashboard Reviewed by hyatt. * khtml/editing/markup.cpp: (khtml::createFragmentFromText): ref and deref the fragment since calling appendChild can completely deref it 2004-12-14 David Hyatt Fix for 3785211. Make sure to do a layout with the old position before doing a layout after changing to the new position. This is actually a regression from my positioned object DHTML optimization. Reviewed by kocienda * khtml/rendering/render_object.cpp: (RenderObject::setStyle): 2004-12-14 David Hyatt Make sure the class attribute works when newlines are present in the attribute. Reviewed by kocienda * khtml/html/html_elementimpl.cpp: (HTMLNamedAttrMapImpl::parseClassAttribute): 2004-12-14 David Hyatt Fix for 3724938, float element is duplicated and paints twice. The logic for when to paint floats was actually fairly screwed up. This patch simplifies the logic and makes addOverhangingFloats easier to read by splitting it into two separate functions. Reviewed by kocienda * khtml/rendering/render_block.cpp: (khtml::RenderBlock::layoutBlockChildren): (khtml::RenderBlock::clearFloats): (khtml::RenderBlock::addOverhangingFloats): (khtml::RenderBlock::addIntrudingFloats): * khtml/rendering/render_block.h: 2004-12-14 John Sullivan Reviewed by Ken. - added Undo action names for Cut, Paste, and Drag * khtml/editing/htmlediting.h: * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::editingAction): overridden to return HTMLEditActionCut (khtml::MoveSelectionCommand::editingAction): overridden to return HTMLEditActionDrag (khtml::ReplaceSelectionCommand::editingAction): overridden to return HTMLEditActionPaste 2004-12-14 John Sullivan Reviewed by Ken. - architecture for WebCore part of fix for undoable operations all say "Undo" in the menu, no specific action names The remaining step is to make each EditCommand subclass override editingAction() to return an appropriate value. (Unfortunately the mapping between subclass and user-distinguishable action is not completely straightforward, so this next step isn't trivial.) * khtml/editing/htmlediting.h: new enum for HTMLEditAction * khtml/editing/htmlediting.cpp: (khtml::EditCommandPtr::editingAction): new method, calls through to EditCommand (khtml::EditCommand::editingAction): new method for subclasses to override, returns HTMLEditActionUnspecified at this level (khtml::TypingCommand::editingAction): proof of concept override, returns HTMLEditActionTyping * kwq/KWQKHTMLPart.h: declare new private bottleneck method registerCommandForUndoOrRedo * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::registerCommandForUndoOrRedo): new bottleneck method to reduce code duplication; now calls over the bridge to get the localized string to use for the Undo action name (KWQKHTMLPart::registerCommandForUndo): now calls new bottleneck method (KWQKHTMLPart::registerCommandForRedo): now calls new bottleneck method * kwq/WebCoreBridge.h: new enum for WebUndoAction, maps directly to HTMLEditAction. Declaration of nameForUndoAction: 2004-12-14 Darin Adler Reviewed by John. - added a bunch of missing nil checks; our old version of inherits used to work for nil (by accident) * khtml/rendering/render_frames.cpp: (RenderPart::~RenderPart): Check widget for nil. (RenderPart::setWidget): Ditto. (RenderFrame::slotViewCleared): Ditto. (RenderPartObject::slotViewCleared): Ditto. 2004-12-13 Darin Adler Reviewed by Ken. - moved markup-related functions into new sources files in the editing directory - removed all of the uses of dynamic_cast, preparing to turn off RTTI to make our code smaller and slightly faster * ForwardingHeaders/editing/markup.h: Added. * khtml/editing/markup.h: Added. * khtml/editing/markup.cpp: Added. * WebCore.pbproj/project.pbxproj: Added markup.h/cpp. * khtml/dom/dom_node.cpp: (Node::toHTML): Call createMarkup since there's no toHTML in NodeImpl any more. * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::innerHTML): Changed to call createMarkup. (HTMLElementImpl::outerHTML): Ditto. * khtml/ecma/kjs_window.cpp: (Window::retrieveWindow): Comment out assert that uses dynamic_cast. (Window::retrieveActive): Ditto. * khtml/editing/htmlediting.h: Added forward class declaration needed now that I removed one elsewhere. * khtml/xml/dom_docimpl.h: Ditto. * khtml/khtml_part.cpp: (KHTMLPart::slotDebugDOMTree): Use createMarkup instead of toHTML. (KHTMLPart::processObjectRequest): Use inherits instead of dynamic_cast. * khtml/rendering/render_image.cpp: (RenderImage::paint): Add an explicit QChar conversion so this code still works even with the additional replace overloads added to QString. * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Ditto. * khtml/rendering/render_object.h: Removed the version of arenaDelete that does not take an object base pointer, because it used dynamic_cast in its implementation. Made the other version public. * khtml/rendering/render_object.cpp: Ditto. * khtml/rendering/render_replaced.cpp: (RenderWidget::deref): Pass object base pointer to arenaDelete. * khtml/xml/dom2_rangeimpl.h: Removed extra parameters from toHTML, and unneeded includes and declarations. * khtml/xml/dom2_rangeimpl.cpp: (DOM::RangeImpl::toHTML): Changed to call createMarkup, and moved all the support code into markup.cpp. * khtml/xml/dom_nodeimpl.h: Moved toHTML and related functions into markup.cpp. * khtml/xml/dom_nodeimpl.cpp: Ditto. * khtml/xml/dom_position.cpp: (DOM::startPosition): Implemented the version of this that takes a RangeImpl. Also added null checks so these return null positions rather than raising exceptions. (DOM::endPosition): Ditto. * khtml/khtmlview.h: Added an APPLE_CHANGES function so inherits can detect this class without dynamic_cast. * kwq/KWQFrame.h: Ditto. * kwq/KWQFrame.mm: (QFrame::isQFrame): Ditto. * kwq/KWQKPartsPart.h: Ditto. * kwq/KWQKPartsPart.mm: (KParts::ReadOnlyPart::isKPartsReadOnlyPart): Ditto. * kwq/KWQScrollView.h: Ditto. * kwq/KWQScrollView.mm: (QScrollView::isQScrollView): Ditto. * kwq/KWQKHTMLPart.h: Ditto. * kwq/KWQKHTMLPart.mm: (KHTMLView::isKHTMLView): Ditto. (KWQKHTMLPart::setTitle): Added an explicit QChar conversion so this code still works even with the additional replace overloads added to QString. (KWQKHTMLPart::setStatusBarText): Ditto. (KWQKHTMLPart::runJavaScriptAlert): Ditto. (KWQKHTMLPart::runJavaScriptConfirm): Ditto. (KWQKHTMLPart::runJavaScriptPrompt): Ditto. (KWQKHTMLPart::attributedString): Ditto. (KWQKHTMLPart::isCharacterSmartReplaceExempt): Ditto. (KWQKHTMLPart::isKHTMLPart): That dynamic_cast thing (see above). * kwq/KWQObject.h: Added virtual methods for the few cases where we need dynamic_cast-like behavior. * kwq/KWQObject.mm: (QObject::inherits): Changed to not use dynamic cast. (QObject::isKHTMLPart): Added. Returns false. (QObject::isKHTMLView): Ditto. (QObject::isKPartsReadOnlyPart): Ditto. (QObject::isQFrame): Ditto. (QObject::isQScrollView): Ditto. * kwq/KWQRenderTreeDebug.cpp: (write): Changed to use inherits rather than dynamic_cast. (writeSelection): Ditto. * kwq/KWQSlot.mm: (KWQSlot::call): Call through to the version with just a job pointer parameter rather than going straight on to the "no parameters at all" version. * kwq/KWQString.h: * kwq/KWQString.mm: (QString::replace): Added overloads. * kwq/WebCoreBridge.mm: (-[WebCoreBridge markupStringFromNode:nodes:]): Changed to call functions in markup.h. (-[WebCoreBridge markupStringFromRange:nodes:]): Ditto. (-[WebCoreBridge selectedString]): Added an explicit QChar conversion so this code still works even with the additional replace overloads added to QString. (-[WebCoreBridge stringForRange:]): Ditto. (-[WebCoreBridge copyDOMNode:copier:]): Changed to call functions in markup.h. (-[WebCoreBridge elementAtPoint:]): QChar conversion. (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Changed to call functions in markup.h. (-[WebCoreBridge documentFragmentWithText:]): Changed to call functions in markup.h. 2004-12-13 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): pasting can leave insertion point inside pasted text * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on leading and trailing whitespace positions was reversed! I must have introduced this error recently when changing around this code. 2004-12-13 David Hyatt Fix for 3915787, macobserver doesn't paint. floatRect() needed to be const in the base class. Also hit-testing and painting was using the wrong rect when setting up the x/y of the rect. Reviewed by mjs * khtml/rendering/render_block.cpp: (khtml::RenderBlock::paint): (khtml::RenderBlock::nodeAtPoint): * khtml/rendering/render_object.h: (khtml::RenderObject::floatRect): 2004-12-13 Ken Kocienda Reviewed by John Fix for this bug: REGRESSION (Mail): pasting two lines of plain text copied from an RTF document results in two styles Code to figuire out the end node to merge was missing the font tag in the second paragraph written out by AppKit convert-to-HTML function. I refined the algorithm to be smarter. * khtml/editing/htmlediting.cpp: (khtml::ReplacementFragment::mergeEndNode): Refine algorithm used to walk through the fragment being pasted looking for the node that is the last inline in the last block of the fragment. The old algorithm was insufficiently powerful. (khtml::ReplacementFragment::enclosingBlock): New helper function. * khtml/editing/htmlediting.h: Add declaration for new helper function. * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Added. * layout-tests/editing/pasteboard/paste-text-011.html: Added. 2004-12-13 Ken Kocienda Reviewed by John WebCore side of fix for this bug: REGRESSION (Mail): paste of text ending in whitespace loses whitespace Note that we are coordinating with Doug Davidson on the AppKit team to make a complete fix for this bug. This change involves our half of the needed changes. Note that a lot of this change has to do with changing code to use a
element instead of a comment node as the mechanism to annotate HTML with information used to fix the bug. In some other places, code to handle comments in markup can be removed since we do not use comments for such annotations after this change. * khtml/editing/htmlediting.cpp: Remove isComment() helper; no longer needed. (khtml::ReplacementFragment::ReplacementFragment): Change m_hasInterchangeNewlineComment name to m_hasInterchangeNewline. (khtml::ReplacementFragment::isInterchangeNewlineNode): Name changed from isInterchangeNewlineComment. (khtml::ReplacementFragment::isInterchangeConvertedSpaceSpan): Local variable name convertedSpaceSpanClass changed to convertedSpaceSpanClassString to match other uses of the idiom used here. (khtml::ReplaceSelectionCommand::doApply): Change hasInterchangeNewlineComment() name to hasInterchangeNewline(). * khtml/editing/htmlediting.h: Change names as noted in .cpp file. Remove isComment() helper; no longer needed. (khtml::ReplacementFragment::hasInterchangeNewline): Change hasInterchangeNewlineComment() name to hasInterchangeNewline(). * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment): No longer has includeCommentsInDOM flag; no longer needed as we do not annotate fragments with comments any longer. * khtml/html/html_elementimpl.h: Ditto. * khtml/xml/dom2_rangeimpl.cpp: Remove addCommentToHTMLMarkup() helper. No longer needed. (DOM::interchangeNewlineMarkupString): New helper to return
element markup we use to annotate content for interchange. (DOM::RangeImpl::toHTML): No longer uses addCommentToHTMLMarkup; now calls interchangeNewlineMarkupString(). Remove spurious semi-colon. * khtml/xml/dom2_rangeimpl.h: Remove obsolete addCommentToHTMLMarkup() function and EAddToMarkup enum. * kwq/WebCoreBridge.mm: (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): No longer pass bool to ask for including comments in DOM when calling createContextualFragment(). 2004-12-10 John Sullivan fixed deployment build bustage that John Louch ran into * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): move bool declaration inside exception-handling block to avoid obscure compiler error 2004-12-10 Maciej Stachowiak Reviewed by Richard. REGRESSION (125-173): crash when KWQTextField is dealloc'ed while setting focus (profoundlearning.com) * kwq/KWQWidget.mm: (QWidget::setFocus): Handle the case where setting focus removed us from the superview - this can happen due to style changes on focus change. 2004-12-10 Ken Kocienda Reviewed by Hyatt Fix for this bug: REGRESSION (Mail): Too much white space between lines separated by carriage returns There are a number of interesting things we could do to fix this bug, including SPI and involving the WebKit delegate, etc., however it seems reasonable to start with a hard-coded default that will fix the bug in the general case until such time as we can come up with more specific solutions. So, I added a helper method to create

elements with an inline style that sets top and bottom margins to 0.1em. * khtml/editing/htmlediting.cpp: (khtml::InsertParagraphSeparatorCommand::createParagraphElement): New factory method to create paragraph elements to insert. Also adds style information to keep the

from having "too-big" margins. (khtml::InsertParagraphSeparatorCommand::doApply): Call new factory method. * khtml/editing/htmlediting.h: Add createParagraphElement() declaration. 2004-12-10 Darin Adler Reviewed by Hyatt. - fixed setting style={overflow:hidden} for