WebKit-https.git
15 years agoWebCore:
cblu [Wed, 23 Feb 2005 02:34:08 +0000 (02:34 +0000)]
WebCore:

Fixed: <rdar://problem/3976872> Pasted plain text doesn't get the proper style if pasted into newlines

        Reviewed by mjs.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): don't clear the typing style when matching style
        (khtml::ReplaceSelectionCommand::completeHTMLReplacement): apply the typing style when matching style
        * khtml/editing/jsediting.cpp:
        * khtml/khtml_part.cpp:
        (KHTMLPart::pasteAndMatchStyle): new
        * khtml/khtml_part.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::issuePasteAndMatchStyleCommand): new
        * kwq/WebCoreBridge.h:
        * layout-tests/editing/editing.js:

WebKit:

        Reviewed by mjs.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge issuePasteAndMatchStyleCommand]): support for new "PasteAndMatchStyle" exec command

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8663 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Adele.
darin [Wed, 23 Feb 2005 01:27:59 +0000 (01:27 +0000)]
    Reviewed by Adele.

        - fixed <rdar://problem/4006596> REGRESSION (183-184): crash in DOM::DocumentImpl::setFocusNode(DOM::NodeImpl*)

        * khtml/xml/dom_docimpl.cpp:
        (widgetForNode): Added helper.
        (DocumentImpl::setFocusNode): Re-get the widget for the node after calling updateLayout.
        The updateLayout can destroy the old widget, so we can't keep a stale widget pointer around.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8662 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Wed, 23 Feb 2005 00:10:45 +0000 (00:10 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora

        * khtml/editing/htmlediting.cpp:
        (khtml::isEmptyFontTag): Helper for removing <font> tags.
        (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
        legacy-html-styles value.
        (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
        (khtml::ApplyStyleCommand::isHTMLStyleNode):
        (khtml::ApplyStyleCommand::removeHTMLFontStyle):
        (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
        whether to use legacy html styles or not.
        (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
        (khtml::createFontElement): Helper for applying <font> elements.
        * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
        (khtml::StyleChange::applyFontColor)
        (khtml::StyleChange::applyFontFace)
        (khtml::StyleChange::applyFontSize)
        (khtml::StyleChange::fontColor)
        (khtml::StyleChange::fontFace)
        (khtml::StyleChange::fontSize)

        Test results updated now that we will write out <font> tags for quirks mode documents.

        * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
        * layout-tests/editing/style/block-style-004-expected.txt
        * layout-tests/editing/editing/pasteboard/paste-text-011-expected.txt
        * layout-tests/editing/style/block-style-005-expected.txt
        * layout-tests/editing/style/block-style-006-expected.txt
        * layout-tests/editing/style/smoosh-styles-001-expected.txt
        * layout-tests/editing/style/smoosh-styles-002-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8661 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Kevin.
mjs [Wed, 23 Feb 2005 00:00:12 +0000 (00:00 +0000)]
    Reviewed by Kevin.

<rdar://problem/4017066> crash in KJS::ValueImp::dispatchType() every time I load www.nytimes.com/pages/automobiles

When creating option elements, use lowercase "option" instead of
uppercase "OPTION" to create option elements, because only
lowercase works for XHTML.

        * khtml/ecma/kjs_html.cpp:
        (KJS::HTMLSelectCollection::tryPut):
        (OptionConstructorImp::construct):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8660 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted...
cblu [Tue, 22 Feb 2005 23:22:22 +0000 (23:22 +0000)]
WebCore fix for: <rdar://problem/3918056> Mail not line breaking my <pre> formatted emails on replies

Mail must 4018993 to fully address the problem.

        Reviewed by kocienda.

        * khtml/editing/markup.cpp:
        (khtml::startMarkup): don't compute style for text in PRE tags
        (khtml::createMarkup): include PRE if it is an ancestor of the nodes in the range

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8659 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working,...
rjw [Tue, 22 Feb 2005 01:32:52 +0000 (01:32 +0000)]
Fixed <rdar://problem/4008338> REGRESSION (125-178): opacity style not working, breaks fading images on okcupid.com

There was a long standing bug in cssText().  Double value were always cast int!  So,
opacity values values were incorrectly converted to text, i.e. 0.75 became 0.

The problem was newly triggered because we parse the css for opacity *TWICE*.  This is a result of
incorrectly "invalidating" the style attribute (from fix for 3790449).  The second parse was from
the cssText() of the style.

        Reviewed by Hyatt.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSPrimitiveValueImpl::cssText):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8658 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already...
hyatt [Tue, 22 Feb 2005 00:19:31 +0000 (00:19 +0000)]
Fix for 4017204, apply the same fix to the base class nodeAtPoint that was already applied to RenderBlock.
Skip elements with layers and inline flows.  Demoted <form>s can end up causing trouble otherwise.

        Reviewed by Richard Williamson

        * khtml/rendering/render_box.cpp:
        (RenderBox::nodeAtPoint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8657 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 4017033, CSS is being parsed twice. Make sure to always validate the style...
hyatt [Mon, 21 Feb 2005 23:36:16 +0000 (23:36 +0000)]
Fix for 4017033, CSS is being parsed twice.  Make sure to always validate the style attribute when it is
initially parsed.  Add code to clean up decls when the style attribute is completely removed.  Add a new
synchronizing boolean that avoids reparsing the style declaration when the attribute is simply
being synced up to the declaration.

        Reviewed by John

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::setChanged):
        * khtml/html/html_elementimpl.cpp:
        (HTMLElementImpl::invalidateStyleAttribute):
        (HTMLElementImpl::updateStyleAttributeIfNeeded):
        (HTMLElementImpl::HTMLElementImpl):
        (HTMLElementImpl::~HTMLElementImpl):
        (HTMLElementImpl::destroyInlineStyleDecl):
        (HTMLElementImpl::mapToEntry):
        (HTMLElementImpl::parseHTMLAttribute):
        * khtml/html/html_elementimpl.h:
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::ElementImpl):
        (ElementImpl::setAttribute):
        * khtml/xml/dom_elementimpl.h:
        (DOM::ElementImpl::updateStyleAttributeIfNeeded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8656 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoversioning for TOT, Safari 2.0 (188+)
vicki [Mon, 21 Feb 2005 23:24:42 +0000 (23:24 +0000)]
versioning for TOT, Safari 2.0 (188+)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8655 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoSafari-188 stamp
vicki [Mon, 21 Feb 2005 23:17:19 +0000 (23:17 +0000)]
Safari-188 stamp

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8653 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoTree was closed. Rolling out.
kocienda [Mon, 21 Feb 2005 22:02:34 +0000 (22:02 +0000)]
Tree was closed. Rolling out.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8652 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Mon, 21 Feb 2005 22:01:07 +0000 (22:01 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora

        * khtml/editing/htmlediting.cpp:
        (khtml::isEmptyFontTag): Helper for removing <font> tags.
        (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
        legacy-html-styles value.
        (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
        (khtml::ApplyStyleCommand::isHTMLStyleNode):
        (khtml::ApplyStyleCommand::removeHTMLFontStyle):
        (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
        whether to use legacy html styles or not.
        (khtml::ApplyStyleCommand::removeInlineStyle): Now properly removes <font> styles.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
        (khtml::createFontElement): Helper for applying <font> elements.
        * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
        (khtml::StyleChange::applyFontColor)
        (khtml::StyleChange::applyFontFace)
        (khtml::StyleChange::applyFontSize)
        (khtml::StyleChange::fontColor)
        (khtml::StyleChange::fontFace)
        (khtml::StyleChange::fontSize)

        Test results updated now that we will write out <font> tags for quirks mode documents.

        * layout-tests/editing/execCommand/modifyForeColorByCharacter-expected.txt
        * layout-tests/editing/style/block-style-004-expected.txt
        * layout-tests/editing/style/block-style-005-expected.txt
        * layout-tests/editing/style/block-style-006-expected.txt
        * layout-tests/editing/style/smoosh-styles-001-expected.txt
        * layout-tests/editing/style/smoosh-styles-002-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8651 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago - fixed Panther deployment build
darin [Mon, 21 Feb 2005 21:55:42 +0000 (21:55 +0000)]
    - fixed Panther deployment build

        * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Put more stuff inside #if.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8650 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Mon, 21 Feb 2005 19:56:24 +0000 (19:56 +0000)]
    Reviewed by Darin.

        <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer misspellingLineThickness]):
        (-[WebTextRenderer misspellingLinePatternWidth]):
        Replaced #defines with these methods, so others can get the same info.

        (-[WebTextRenderer drawLineForMisspelling:withWidth:]):
        Keep underline within originally specified bounds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8649 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Mon, 21 Feb 2005 19:56:06 +0000 (19:56 +0000)]
    Reviewed by Darin.

        <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps

        * khtml/rendering/render_text.cpp:
        (InlineTextBox::paintMarker):
        Make sure underline is placed within the text bounds.

        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainter::misspellingLineThickness):
        * kwq/WebCoreTextRenderer.h:
        Add misspellingLineThickness for use by InlineTextBox::paintMarker.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8648 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John.
darin [Mon, 21 Feb 2005 19:50:08 +0000 (19:50 +0000)]
    Reviewed by John.

        - fixed <rdar://problem/4012978> -[DOMRange markupString] crashes when range contains only a text node with a single space

        * khtml/editing/markup.cpp: (khtml::createMarkup): Added updateLayout calls, and added a missing
        nil check.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8647 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John.
darin [Mon, 21 Feb 2005 17:50:57 +0000 (17:50 +0000)]
    Reviewed by John.

        - fixed <rdar://problem/4005435> Safari hung while pasting text into a <textarea> (Panther-only)

        * kwq/KWQTextEdit.mm: (QTextEdit::setScrollBarModes): Don't setAutohidesScrollers:YES on Panther.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8646 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John.
darin [Mon, 21 Feb 2005 17:45:57 +0000 (17:45 +0000)]
    Reviewed by John.

        - fixed <rdar://problem/4016358> don't ever display IDN URLs with characters from "possible Latin look-alike" scripts

        * Misc.subproj/WebNSURLExtras.m:
        (containsPossibleLatinLookalikes): Added.
        (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Call containsPossibleLatinLookalikes, and if true,
        don't decode the host name.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8645 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John
kocienda [Mon, 21 Feb 2005 17:33:47 +0000 (17:33 +0000)]
    Reviewed by John

        Fix for this bug:

        <rdar://problem/4015499> REGRESSION (186-187): pasted quoted text starting with a blank line increases quote level of pasted text when pasted

        * khtml/editing/markup.cpp:
        (khtml::markup): Changed over to ASSERT instead of assert.
        (khtml::createMarkup): The issue was that the code to add parents all the way back to the common ancestor
        block did not check for blocks whose markup had already been added, and could result in adding markup for
        nodes twice (hence the additional and erroneous quote level). Now there is a new check that will
        only add markup for those nodes before the start of the selection range. This fixes the bug.
        (khtml::createFragmentFromMarkup): Changed over to ASSERT instead of assert.
        (khtml::createFragmentFromText): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8644 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
darin [Mon, 21 Feb 2005 17:32:35 +0000 (17:32 +0000)]
    * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8643 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Maciej
kocienda [Sun, 20 Feb 2005 02:24:40 +0000 (02:24 +0000)]
    Reviewed by Maciej

        * khtml/editing/htmlediting.cpp:
        (khtml::matchNearestBlockquoteColorString): New function which abstracts away the CSS property we use
        for this pseudo-color.
        (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Set the new nearestBlockquoteColorString
        psuedo-color here, rather than removing colors as was done before.
        (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): Check for the pseudo-color in the desired
        style, and determine the real color based on the nearest blockquote (or none) to the node.
        (khtml::nearestMailBlockquote): Name change from closestMailBlockquote to match new property better.

        All the rest of this change is the mechanical coding you need to do to add a new CSS property, in this
        case, -khtml-match-nearest-mail-blockquote-color.

        * khtml/css/css_computedstyle.cpp:
        (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue)
        * khtml/css/cssparser.cpp:
        (CSSParser::parseValue):
        * khtml/css/cssproperties.c:
        (hash_prop):
        (findProp):
        * khtml/css/cssproperties.h:
        * khtml/css/cssproperties.in:
        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty)
        * khtml/css/cssvalues.c:
        (findValue)
        * khtml/css/cssvalues.h:
        * khtml/css/cssvalues.in:
        * khtml/rendering/render_style.h:
        (khtml::RenderStyle::matchNearestMailBlockquoteColor)
        (khtml::RenderStyle::setMatchNearestMailBlockquoteColor)
        (khtml::RenderStyle::initialMatchNearestMailBlockquoteColor)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Chris
kocienda [Sat, 19 Feb 2005 22:53:43 +0000 (22:53 +0000)]
    Reviewed by Chris

        Fix for these bugs:

        <rdar://problem/4014228> REGRESSION (186-187) extra, uneditable lines inserted above and below a line of pasted quoted text
        <rdar://problem/4014393> REGRESSION (186-187) pasted quoted text gets extra <cr>s when pasted at top of document

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Part of a general refactoring of how
        the fragment is inserted into the document, rendered, and then tested for certain
        important pieces of information that are required for pasting.
        (khtml::ReplacementFragment::insertFragmentForTestRendering): New helper. Handles inserting
        the fragment nodes into the document.
        (khtml::ReplacementFragment::restoreTestRenderingNodesToFragment): Removes nodes from the
        document, and restores them to the fragment.
        (khtml::ReplacementFragment::computeStylesUsingTestRendering): Factored out code that
        did this before into its own function.
        (khtml::ReplacementFragment::removeUnrenderedNodesUsingTestRendering): Ditto.
        (khtml::ReplacementFragment::countRenderedBlocks): This is a real improvement, as it
        eliminates a major use of the isProbablyBlock() function. Now, the blocks that are
        counted are real, rendered blocks.
        (khtml::ReplacementFragment::removeStyleNodes): Made this function retain margin-zeroing
        CSS properties on paragraphs. This does two things: 1) It helps us to maintain good behavior
        in the short term while there are still versions of Mail out there that use <p> elements
        instead of <div> elements for new paragraphs; and 2) It will help to maintain the compatibility
        with other mail clients that use <p> elements for their paragraphs but render them themselves
        with no margins as the result of quirks.
        (khtml::ReplaceSelectionCommand::doApply): Do some work to fix up and improve the handling
        of blank lines, be they <p> elements or <br> elements, that can be removed after pasting. This,
        coupled with the refactoring, fixes 4014393.
        * khtml/editing/htmlediting.h: Updated for new functions.
        * layout-tests/editing/pasteboard/paste-text-010-expected.txt: Updated results, actually improved with this change.
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8641 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Chris.
kdecker [Sat, 19 Feb 2005 21:46:34 +0000 (21:46 +0000)]
    Reviewed by Chris.

Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission

Our window.open() policy is to refuse the <script>window.open(...)</script> case and allow the inline the <a href="javascript:window.open('foo')> case.  Clever advertisers at some point realized that by executing their Javascript through the Flash plugin, Safari would always treat their code as the inline case, and thus, they were able to work around our popup blocker.

        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Changed this to invoke the new stringByEvaluatingJavaScriptFromString:forceUserGesture method below.
        (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Let the WebKit make the determination if this was a user originated gesture or not; we must no longer assume this is always the case.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Chris.
kdecker [Sat, 19 Feb 2005 21:40:02 +0000 (21:40 +0000)]
    Reviewed by Chris.

Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission

Our window.open() policy is to refuse the <script>window.open(...)</script> case and allow the inline the <a href="javascript:window.open('foo')> case.  Clever advertisers at some point realized that by executing their Javascript through the Flash plugin, Safari would always treat their code as the inline case, and thus, they were able to work around our popup blocker.

        * Plugins.subproj/WebBaseNetscapePluginView.h: Addded currentEventIsUserGesture boolean ivar.
        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView sendEvent:]): If at any point the user clicks or presses a key from within a plugin, set the currentEventIsUserGesture flag to true. This is important to differentiate legitimate window.open() calls originating from plugins;  we still want to allow those.
        (-[WebBaseNetscapePluginView initWithFrame:]): In our asynchronous load, pass along currentEventIsUserGesture to the PluginRequest.
        (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Inform WebCore if this was a user originated gesture when calling executeScript().
        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
        (-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]):
        (-[WebPluginRequest isCurrentEventUserGesture]): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8639 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes...
cblu [Sat, 19 Feb 2005 21:36:03 +0000 (21:36 +0000)]
Fixed: <rdar://problem/3951196> REGRESSION (Mail): too many levels of reply quotes after certain steps

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::InsertParagraphSeparatorInQuotedContentCommand::doApply):
- If we find a new start node, update topBlockquote so we don't use too many block quotes for the contents following the new line.
- Build up the list of ancestors after we've determined the actual topBlockquote.
- Don't insert an extra new line if there is a new start node.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8638 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed: <rdar://problem/3978461> smart paste is broken
cblu [Sat, 19 Feb 2005 18:59:07 +0000 (18:59 +0000)]
Fixed: <rdar://problem/3978461> smart paste is broken

        Reviewed by kevin.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): properly check for leading and trailing whitespace. These checks were incorrectly reversed. Also check if we're pasting at the beginning or end of a line. We should not insert spaces in either case.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8637 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
adele [Sat, 19 Feb 2005 01:13:01 +0000 (01:13 +0000)]
    Reviewed by Darin.

        Fix for <rdar://problem/3975568> REGRESSION(125-180)Australian Open pages have drawing problem

        This patch fixes two problems caused by our added support for custom tags.  First, the layout problem at the sites mentioned in the bug
        was caused by custom tags within tables.  In checkChild, we needed to treat these tags as spans so they get placed correctly in the DOM tree.
        Also, we were indexing the tagPriority and endTag arrays with id values from the custom tags that were greater than the size of the array.  So now
        we have functions to check for the custom tags, and again, treat them as spans.  To avoid confusion, we changed the names of the arrays to
        endTagArray and tagPriorityArray.

        * khtml/html/dtd.h: changed all uses of the endTag array to endTagArray for our new wrapper functions
        (DOM::tagPriority): added function to check array bounds and to treat custom tags as spans
        (DOM::endTagRequirement): added function to check array bounds and to treat custom tags as spans
        * khtml/html/dtd.cpp: changed name of endTag and tagPriority arrays to endTagArray and tagPriorityArray
        (DOM::checkChild): treat custom tags as spans during this check
        * khtml/html/html_elementimpl.cpp: changed all uses of the endTag array to the endTagRequirement function
        (HTMLElementImpl::createContextualFragment):
        (HTMLElementImpl::setInnerText):
        (HTMLElementImpl::setOuterText):
        (HTMLElementImpl::toString):
        * khtml/html/htmlparser.cpp: changed all uses of the endTag array to the endTagRequirement function and all uses of the tagPriority array to the tagPriority function.
        (KHTMLParser::parseToken):
        (KHTMLParser::insertNode):
        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): changed all uses of the endTag array to the endTagRequirement function
       * khtml/editing/markup.cpp: changed all uses of the endTag array to the endTagRequirement function
        (khtml::endMarkup):
        (khtml::markup):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8636 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoFixed build: Whoops, setNeedsLayout's parameter is NOT optional!
jens [Fri, 18 Feb 2005 22:10:25 +0000 (22:10 +0000)]
Fixed build: Whoops, setNeedsLayout's parameter is NOT optional!

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago[3603191] REGRESSION: Applets not receiving all of the Applet Parameters in Java...
jens [Fri, 18 Feb 2005 21:39:27 +0000 (21:39 +0000)]
[3603191] REGRESSION: Applets not receiving all of the Applet Parameters in Java 1.4.1/1.4.2. Fix is to defer instantiating the applet plugin until the applet tag and its nested param tags have been completely parsed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8634 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions
rjw [Fri, 18 Feb 2005 20:49:01 +0000 (20:49 +0000)]
Fixed <rdar://problem/4006161> Tiger8A380: Widgets leak dashboard regions

We were leaking the DashboardRegionImpls.

        Reviewed by Kevin.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSPrimitiveValueImpl::cleanup):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8633 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoWebCore:
cblu [Fri, 18 Feb 2005 20:11:13 +0000 (20:11 +0000)]
WebCore:

Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled

        Reviewed by kocienda.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): don't set class on element returned by createStyleSpanElement since that's already done
        (khtml::ReplacementFragment::ReplacementFragment): take matchStyle param, don't call computeStylesAndRemoveUnrendered() if !matchStyle
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): take matchStyle param
        (khtml::ReplaceSelectionCommand::doApply): if m_matchStyle, use selection.start() as the insertion position and don't call applyStyleToInsertedNodes()
        * khtml/editing/htmlediting.h:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): take matchStyle param and pass it
        (-[WebCoreBridge replaceSelectionWithNode:selectReplacement:smartReplace:]): pass NO for matchStyle
        (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): pass NO for matchStyle
        (-[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]): pass YES for matchStyle

WebKit:

Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled

        Reviewed by kocienda.

        * WebView.subproj/WebDataSource.m:
        (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): pass NO for matchStyle to replaceSelection
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:chosePlainText:]): return new chosePlainText parameter
        (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): pass chosePlainText for matchStyle to replaceSelection
        (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8632 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Chris
kocienda [Fri, 18 Feb 2005 19:55:57 +0000 (19:55 +0000)]
    Reviewed by Chris

        Fix for these bugs:

        <rdar://problem/4013025> Copy/Paste of quoted word results in removal of any following <cr>
        <rdar://problem/4013100> Copy/Paste quoted text and then decrease quote level does not change text color

        For the most part, these bugs were caused by errors and lack of foresight on my part when
        I added the better paste code. Chalk these fixes up to the result of bake time.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Need to move count of number of blocks in
        fragment after the call to remove unrendered nodes. Meant to do this before, but forgot to.
        (khtml::ReplacementFragment::removeStyleNodes): Need to remove inline styles from elements!
        Terrible omission now fixed.
        (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): Remove blockquote colors for now.
        Code has a more extensive comment in it now to explain the difficulty, and the need for more
        study and changes.
        (khtml::ReplaceSelectionCommand::doApply): Need to call applyStyleToInsertedNodes() in the
        m_fragment.hasInterchangeNewline() case. This was just missed before.
        * layout-tests/editing/pasteboard/paste-text-011-expected.txt: Updated results, subtly different, but OK.
        * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Updated for <p> to <div> change in test content.
        * layout-tests/editing/pasteboard/paste-text-017.html: Needed to change <p> to <div> to
        make this test go with the new design of using <div> tags for default paragraphs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8631 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 3974263 (and possibly others). Don't let fixed tables use maxint as their...
hyatt [Fri, 18 Feb 2005 19:37:48 +0000 (19:37 +0000)]
Fix for 3974263 (and possibly others).  Don't let fixed tables use maxint as their maxwidth when some
cells have percentage values.

        Reviewed by kocienda

        * khtml/misc/arena.cpp:
        (ArenaAllocate):
        * khtml/rendering/table_layout.cpp:
        (FixedTableLayout::calcWidthArray):
        (FixedTableLayout::calcMinMaxWidth):
        (AutoTableLayout::layout):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8630 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agonew layout test
hyatt [Fri, 18 Feb 2005 19:35:29 +0000 (19:35 +0000)]
new layout test

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Removed code that should not have been checked in from
rjw [Fri, 18 Feb 2005 01:51:55 +0000 (01:51 +0000)]
Removed code that should not have been checked in from
last patch.

        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (-[WebTextRendererFactory isFontFixedPitch:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8628 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Kevin.
darin [Fri, 18 Feb 2005 01:30:10 +0000 (01:30 +0000)]
    Reviewed by Kevin.

        - fixed <rdar://problem/3998627> WebKit crashes when deleting text in a modified div

        * khtml/khtml_part.cpp: (KHTMLPart::selectionComputedStyle): Add a ref and deref to keep
        the element alive until it's added to the DOM tree.
        * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::styleForSelectionStart): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8627 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoWebCore:
rjw [Fri, 18 Feb 2005 01:26:11 +0000 (01:26 +0000)]
WebCore:
        Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead

Fixed w/o introducing a performance regression.  Add early
check for Osaka-Mono to avoid expensive call into WebKit.

        Reviewed by Vicki.

        * kwq/KWQFont.mm:
        (QFont::isFixedPitch):

WebKit:
        Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead

Fixed w/o introducing a performance regression.

        Reviewed by Vicki (and earlier by Dave Harrison).

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer _computeWidthForSpace]):
        (widthForNextCharacter):
        * WebCoreSupport.subproj/WebTextRendererFactory.h:
        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (-[NSFont _web_isFakeFixedPitch]):
        (-[WebTextRendererFactory isFontFixedPitch:]):
        (-[WebTextRendererFactory fontWithFamily:traits:size:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8626 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Kevin.
darin [Fri, 18 Feb 2005 01:25:05 +0000 (01:25 +0000)]
    Reviewed by Kevin.

        - fixed <rdar://problem/4011210> REGRESSION (180-181): Maxlength property for INPUT object not working

        * kwq/KWQTextField.mm:
        (-[KWQTextField textView:shouldChangeTextInRange:replacementString:]): If controller returns
        YES, go on to call super, since super does the text formatter handling, which we need.
        (-[KWQSecureTextField textView:shouldChangeTextInRange:replacementString:]): Ditto.
        (-[KWQSearchField textView:shouldChangeTextInRange:replacementString:]): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8625 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agomove the Safari-187 release marker in the WebCore Changelog, since we're going to...
vicki [Fri, 18 Feb 2005 01:23:07 +0000 (01:23 +0000)]
move the Safari-187 release marker in the WebCore Changelog, since we're going to include <rdar://problem/4012058>  in Safari-187

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8623 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect...
rjw [Fri, 18 Feb 2005 01:13:50 +0000 (01:13 +0000)]
Fixed <rdar://problem/4003251> Safari crashed at icelandair.com in LiveConnect code converting a Java object to a string

Added nil check.

        Reviewed by John Sullivan.

        * bindings/jni/jni_runtime.cpp:
        (JavaField::valueFromInstance):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Fri, 18 Feb 2005 00:38:08 +0000 (00:38 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/4012058> Copy from quoted text and paste results in blue text

        The relatively-new paste code tries hard to retain style of the content from the
        source location. However, in the case of quoted material in mail messages, we do
        not want to carry the quoting color along. This fixes the problem by factoring
        out such colors.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Now calls removeBlockquoteColorsIfNeeded()
        to fix bug.
        (khtml::ReplacementFragment::removeBlockquoteColorsIfNeeded): New function. Factors out colors that are
        the result of text being quoted.
        (khtml::isNodeRendered): Function moved in file. No other change.
        (khtml::isProbablyBlock): Function moved in file. No other change.
        (khtml::closestMailBlockquote): New function. Helps fix bug.
        (khtml::isMailBlockquote): Function moved to be free-floating instead of being a
        member of CompositeEditCommand. No other change.
        * khtml/editing/htmlediting.h: Moved around some functions. Added removeBlockquoteColorsIfNeeded().
        * khtml/editing/markup.cpp: Remove redundant static implementation of isMailBlockquote.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8621 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/3959304> PDF in img tag is not rendered correctly anymore
rjw [Fri, 18 Feb 2005 00:11:18 +0000 (00:11 +0000)]
Fixed <rdar://problem/3959304> PDF in img tag is not rendered correctly anymore

We were incorrectly adding image position when flipping coordinates.

        Reviewed by David Harrison.

        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData _PDFDrawFromRect:toRect:operation:alpha:flipped:context:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8620 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/4007262> Seed: Flight tracker scrolling moves to the left
rjw [Fri, 18 Feb 2005 00:09:39 +0000 (00:09 +0000)]
Fixed <rdar://problem/4007262> Seed: Flight tracker scrolling moves to the left

Added SPI for dashboard to disable wheel scrolling of the WebClipView.

        Reviewed by Ken.

        * ChangeLog:
        * WebView.subproj/WebClipView.m:
        (-[WebClipView _focusRingVisibleRect]):
        (-[WebClipView scrollWheel:]):
        * WebView.subproj/WebView.m:
        (-[WebViewPrivate init]):
        (-[WebView drawRect:]):
        (-[WebView _dashboardBehavior:]):
        * WebView.subproj/WebViewInternal.h:
        * WebView.subproj/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8619 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoversioning for TOT, Safari 2.0 (187+)
vicki [Fri, 18 Feb 2005 00:05:13 +0000 (00:05 +0000)]
versioning for TOT, Safari 2.0 (187+)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8618 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoSafari-187 stamp
vicki [Thu, 17 Feb 2005 23:59:13 +0000 (23:59 +0000)]
Safari-187 stamp

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8617 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoI checked in when the tree was closed. Rolling out.
kocienda [Thu, 17 Feb 2005 23:31:18 +0000 (23:31 +0000)]
I checked in when the tree was closed. Rolling out.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8616 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Thu, 17 Feb 2005 23:27:43 +0000 (23:27 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/4003463> Mail.app HTML uses inline styling markup not understood by Entourage and Eudora

        * khtml/editing/htmlediting.cpp:
        (khtml::StyleChange::styleModeForParseMode): Helper to map a document parse mode to a use/don't use
        legacy-html-styles value.
        (khtml::StyleChange::checkForLegacyHTMLStyleChange): Add support for colors, font faces, and font sizes.
        (khtml::ApplyStyleCommand::applyTextDecorationStyle): Now call styleModeForParseMode to determine
        whether to use legacy html styles or not.
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Ditto.
        (khtml::ApplyStyleCommand::addInlineStyleIfNeeded): Ditto.
        * khtml/editing/htmlediting.h: All the following support the new bits of data we need to store.
        (khtml::StyleChange::applyFontColor)
        (khtml::StyleChange::applyFontFace)
        (khtml::StyleChange::applyFontSize)
        (khtml::StyleChange::fontColor)
        (khtml::StyleChange::fontFace)
        (khtml::StyleChange::fontSize)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8615 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago - roll out this change, since it causes a 1.5% performance regression
vicki [Thu, 17 Feb 2005 23:04:38 +0000 (23:04 +0000)]
- roll out this change, since it causes a 1.5% performance regression

    2005-02-15  Richard Williamson   <rjw@apple.com>

        Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead

        Lie about Osaka-Mono.  Treat it as fixed pitch, even though,
        strictly speaking it isn't.  (Similar to what we do with
        Courier New.)

        Reviewed by David Harrison.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer _computeWidthForSpace]):
        * WebCoreSupport.subproj/WebTextRendererFactory.h:
        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (-[NSFont _web_isFakeFixedPitch]):
        (-[WebTextRendererFactory isFontFixedPitch:]):
        (-[WebTextRendererFactory fontWithFamily:traits:size:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8614 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey
rjw [Thu, 17 Feb 2005 21:24:17 +0000 (21:24 +0000)]
Fixed <rdar://problem/4008163> dynamic support for -apple-dashboard-region is flakey

Style operator== wasn't including regions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8613 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Chris.
adele [Thu, 17 Feb 2005 21:17:26 +0000 (21:17 +0000)]
    Reviewed by Chris.

        fix for <rdar://problem/4010028> 8A383: Safari v185 crash loading united.com multi city fare finder page.

        * khtml/dom/dom_string.cpp: (DOM::DOMString::operator += ): prevent nil dereference when DOMString being added is nil

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8612 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoFix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message...
jens [Thu, 17 Feb 2005 19:53:50 +0000 (19:53 +0000)]
Fix for rdar://3963151 "Mail only pasted ~950 of 1407 text lines into my message!" Force tokenizer to run synchronously while parsing document fragments, so it doesnt stop halfway through and cause truncated content.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8611 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Ken.
sullivan [Thu, 17 Feb 2005 17:48:06 +0000 (17:48 +0000)]
    Reviewed by Ken.

        - fixed <rdar://problem/3997185> The Web view on .Mac Prefs caused System Prefs
        to lockup (resolved by re-boot only)

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge nextKeyViewOutsideWebFrameViews]):
        Don't allow recursion here; assert on debug build, return nil on deployment. I
        couldn't get my machine into a state to repro this problem (and neither could the
        originator), but it's obvious from the stack crawl that this method was recursing
        when it shouldn't have.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8610 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Thu, 17 Feb 2005 17:35:05 +0000 (17:35 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/3982183> Mail's HTML paragraphs appear with unintended margins in Entourage and Eudora

        * khtml/editing/htmlediting.cpp:
        (khtml::createDefaultParagraphElement): Change element we make from <p> to <div>.
        This fixes the problem, as these other mailers show <div> elements without margins.

        Some test files needed to change to preserve the ability to "eyeball" the results.
        Many others changed just because their <p> elements changed to <div> elements.

        * layout-tests/editing/deleting/delete-3928305-fix-expected.txt
        * layout-tests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
        * layout-tests/editing/inserting/insert-div-013-expected.txt
        * layout-tests/editing/inserting/insert-div-013.html
        * layout-tests/editing/inserting/insert-div-014-expected.txt
        * layout-tests/editing/inserting/insert-div-014.html
        * layout-tests/editing/inserting/insert-div-018-expected.txt
        * layout-tests/editing/inserting/insert-div-018.html
        * layout-tests/editing/inserting/insert-div-019-expected.txt
        * layout-tests/editing/inserting/insert-div-019.html
        * layout-tests/editing/inserting/insert-div-020-expected.txt
        * layout-tests/editing/inserting/insert-div-020.html
        * layout-tests/editing/inserting/insert-div-021-expected.txt
        * layout-tests/editing/inserting/insert-div-021.html
        * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
        * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
        * layout-tests/editing/style/remove-underline-after-paragraph-expected.txt
        * layout-tests/editing/style/remove-underline-after-paragraph-in-bold-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8609 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Thu, 17 Feb 2005 17:28:00 +0000 (17:28 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/3996737> REGRESSION (Mail): Copy/paste in Mail inserts returns

        The root cause of the problem is that a couple of pieces of code in AppKit and Mail
        insert newlines into markup as it is generated, and the paste code in WebCore was
        not smart about nodes that do not render (as is the case with these added newlines).
        So, the solution is to remove these unrendered nodes in the paste code in a pre-pass.
        Fortunately, my recent addition of such a pass to the paste code to handle styles
        gave me a convenient place to put this new logic.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplacementFragment::ReplacementFragment): Use new name for function below.
        (khtml::ReplacementFragment::computeStylesAndRemoveUnrendered): Name change from computeStylesForNodes().
        Now does the additional work of removing unrendered nodes, as mentioned above.
        (khtml::isNodeRendered): New helper function.
        * khtml/editing/htmlediting.h: Updated as necessary.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8608 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoForgot to paste in radar URL to show which bug I fixed
kocienda [Thu, 17 Feb 2005 17:23:29 +0000 (17:23 +0000)]
Forgot to paste in radar URL to show which bug I fixed

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8607 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Thu, 17 Feb 2005 17:21:58 +0000 (17:21 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        The styling code did not move to the next node when the starting position was
        at the last offset of a node. Instead, it styled it. Clearly wrong. Solution
        is to borrow a check from the delete algorithm. Though I call caretMaxOffset(),
        which I consider deprecated, it is still the simplest and most strightforward
        way to ask the right question for this kind of problem.

        * khtml/editing/htmlediting.cpp:
        (khtml::ApplyStyleCommand::applyInlineStyle): Fixed, as described above.
        * layout-tests/editing/style/style-3998892-fix-expected.txt: Added.
        * layout-tests/editing/style/style-3998892-fix.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8606 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing...
cblu [Thu, 17 Feb 2005 01:39:20 +0000 (01:39 +0000)]
Fixed: <rdar://problem/3954842> Forward/reply to an HTML email can result in nothing (in cases with <link> tags for CSS)

        Reviewed by john.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeBaseImpl::addChild): don't call insertedIntoDocument on the added child if "this" itself is not in the document.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8605 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Written by Darin, reviewed by Maciej and me
sullivan [Thu, 17 Feb 2005 01:34:06 +0000 (01:34 +0000)]
    Written by Darin, reviewed by Maciej and me

        - change required to make previous checkin work with English language RSS pages

        * kwq/KWQKURL.h:
        new private method isHierarchical
        * kwq/KWQKURL.mm:
        (KURL::KURL):
        add hierarchical base URL check when determining whether the URL is absolute
        (KURL::isHierarchical):
        new method, returns true if this is a valid URL with a slash just past the scheme's trailing colon

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8604 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago- added extensions to toLocalString, toLocaleTimeString, toLocaleDateString to give...
kali [Thu, 17 Feb 2005 00:55:29 +0000 (00:55 +0000)]
- added extensions to toLocalString, toLocaleTimeString, toLocaleDateString to give more control over date formating (4007277)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8603 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Written by Darin, reviewed by me.
sullivan [Thu, 17 Feb 2005 00:15:03 +0000 (00:15 +0000)]
    Written by Darin, reviewed by me.

        - WebKit part of fix for <rdar://problem/4007384>
        FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter

        * DOM.subproj/DOMPrivate.h:
        updated this file, which is a copy of the WebCore version

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8602 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Written by Darin, reviewed by me.
sullivan [Thu, 17 Feb 2005 00:14:30 +0000 (00:14 +0000)]
    Written by Darin, reviewed by me.

        - WebCore part of fix for <rdar://problem/4007384>
        FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter

        * kwq/DOM.mm:
        (-[DOMElement _getURLAttribute:]):
        new SPI method, uses parseURL and completeURL to get valid URL from attribute value

        * kwq/DOMPrivate.h:
        declare new SPI method

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/3966973> Tiger 8A357: Binary Compatiblity: frequent Webstracto...
rjw [Wed, 16 Feb 2005 21:20:53 +0000 (21:20 +0000)]
Fixed <rdar://problem/3966973> Tiger 8A357: Binary Compatiblity: frequent Webstractor.app crashes [WebImageData _nextFrame]

Webstractor.app was playing tricks to create thumbnails of
pages.  This caused the 'focusView' to be incorrect during
animated GIF frame rendering.

        Reviewed by Chris.

        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebImageRenderer _startOrContinueAnimationIfNecessary]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8600 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by me, code change by Darin.
vicki [Wed, 16 Feb 2005 19:55:51 +0000 (19:55 +0000)]
    Reviewed by me, code change by Darin.

        - fixed the build on Panther

        * WebView.subproj/WebFormDataStream.m: (webSetHTTPBody):
        Added a Panther-specific code path that just loads all the data into one big
        NSData object. This means that bug 3686434 won't be fixed on SUPanWheat; we'll
        still load the file into memory before sending it to the server on Panther.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8599 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/3998368> Tiger8A376: WebTextRenderer assertion failure in...
rjw [Wed, 16 Feb 2005 00:31:12 +0000 (00:31 +0000)]
Fixed <rdar://problem/3998368> Tiger8A376: WebTextRenderer assertion failure in Safari while browsing news.bbc.co.uk

Removed use of FATAL_ALWAYS from getUncachedWidth().  It's unclear
why we would trigger the FATAL_ALWAYS.  In the past we've seen
the message triggered because of corrupt fonts.  Anyway, in this
particular case, we will now return 0 for the character width,
rather than exiting.

        Reviewed by David Harrison.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (getUncachedWidth):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8598 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
mjs [Tue, 15 Feb 2005 23:48:00 +0000 (23:48 +0000)]
    Reviewed by Darin.

<rdar://problem/3942428> reproducible crash loading cbs.sportsline.com

This change reverts the fix for <rdar://problem/3805311>, and
re-fixes it in a different (better) way. Instead of preventing
programmatic open from setting the parsing flag, instead make sure
that programmatic close resets it.

        * khtml/khtml_part.cpp:
        (KHTMLPart::openURL):
        (KHTMLPart::didExplicitOpen):
        (KHTMLPart::closeURL):
        (KHTMLPart::begin):
        (KHTMLPart::end):
        (KHTMLPart::endIfNotLoading):
        (KHTMLPart::slotFinishedParsing):
        (KHTMLPart::checkEmitLoadEvent):
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        (KHTMLPartPrivate::KHTMLPartPrivate):
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::open):
        (DocumentImpl::implicitOpen):
        (DocumentImpl::close):
        (DocumentImpl::implicitClose):
        * khtml/xml/dom_docimpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Maciej.
harrison [Tue, 15 Feb 2005 23:41:53 +0000 (23:41 +0000)]
    Reviewed by Maciej.

        <rdar://problem/3933665> smart delete seems to delete too much after expanding selection with arrow keys

        Fixed by updating the selection granularity.  Only byWord granularity enables smart delete, but in this
        case the granularity changed from byWord to byCharacter.

        * khtml/khtml_part.cpp:
        (KHTMLPart::setSelectionGranularity):
        * khtml/khtml_part.h:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
        (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8596 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Tue, 15 Feb 2005 23:31:40 +0000 (23:31 +0000)]
    Reviewed by Darin.

        (continued) <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line

        This was supposed have been committed yesterday with the other part of the fix, but was not.

        * khtml/editing/visible_units.cpp:
        (khtml::endOfWord):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font...
rjw [Tue, 15 Feb 2005 22:53:42 +0000 (22:53 +0000)]
Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead

Lie about Osaka-Mono.  Treat it as fixed pitch, even though,
strictly speaking it isn't.  (Similar to what we do with
Courier New.)

        Reviewed by David Harrison.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer _computeWidthForSpace]):
        * WebCoreSupport.subproj/WebTextRendererFactory.h:
        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (-[NSFont _web_isFakeFixedPitch]):
        (-[WebTextRendererFactory isFontFixedPitch:]):
        (-[WebTextRendererFactory fontWithFamily:traits:size:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8594 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John
kocienda [Tue, 15 Feb 2005 17:01:57 +0000 (17:01 +0000)]
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3951178> REGRESSION (Mail): blank line lost after pasting as quotation

        Problem was that the blank line after the selection was getting deleted incorrectly since the
        paste code thought this was an unneeded placeholder rather than a placeholder outside of the
        selection.

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::removeBlockPlaceholderIfNeeded): Now calls findBlockPlaceholder.
        (khtml::CompositeEditCommand::findBlockPlaceholder): Moved finding code formerly in
        removeBlockPlaceholderIfNeeded to this new helper.
        (khtml::ReplaceSelectionCommand::doApply): Do not delete placeholder up front. Call
        findBlockPlaceholder, and delete it later if needed in the already-existing cleanup step.
        * khtml/editing/htmlediting.h: Add new function.

        New layout test.

        * layout-tests/editing/pasteboard/paste-text-017-expected.txt: Added.
        * layout-tests/editing/pasteboard/paste-text-017.html: Added.

        Result changed for the better.

        * layout-tests/editing/pasteboard/paste-text-011-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8593 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Tue, 15 Feb 2005 01:52:35 +0000 (01:52 +0000)]
    Reviewed by Darin.

        <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line

        * khtml/editing/visible_text.cpp:
        (khtml::SimplifiedBackwardsTextIterator::advance):
        Add BR in for <rdar://problem/3917929> fix only if leaving a visible text node.

        * khtml/editing/visible_units.cpp:
        (khtml::endOfWord):
        Do not move left over a paragraph boundary.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8592 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John.
darin [Mon, 14 Feb 2005 21:09:29 +0000 (21:09 +0000)]
    Reviewed by John.

        - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)

        * khtml/html/html_formimpl.cpp:
        (DOM::FormDataList::begin): Updated to use a list of FormDataListItem instead of QCString.
        (DOM::FormDataList::end): Ditto.
        (DOM::HTMLFormElementImpl::formData): Same here, and also use appendFile rather than appendData
        when we encounter a path name rather than data.
        (DOM::HTMLInputElementImpl::appendFormData): Use appendFile here rather than reading the file
        in; the reading now happens inside WebKit.
        (DOM::FormDataList::appendString): Updated for FormDataListItem.
        (DOM::FormDataList::appendFile): Added.

        * ForwardingHeaders/kfileitem.h: Emptied out the file; no longer includes KWQKFileItem.h.
        * ForwardingHeaders/netaccess.h: Emptied out the file; no longer includes KWQKIONetAccess.h.
        * kwq/KWQKFileItem.h: Removed.
        * kwq/KWQKFileItem.mm: Removed.
        * kwq/KWQKIONetAccess.h: Removed.
        * kwq/KWQKIONetAccess.mm: Removed.
        * WebCore.pbproj/project.pbxproj: Removed the 4 files above.

        - small unrelated fix (not reviewed by John)

        * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Put some logging code outside if statements so it works all the time.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8591 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John.
darin [Mon, 14 Feb 2005 20:06:55 +0000 (20:06 +0000)]
    Reviewed by John.

        - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers)

        * WebView.subproj/WebFormDataStream.h: Added webSetHTTPBody, which creates and connects an appropriate
        stream to an NSMutableURLRequest.
        * WebView.subproj/WebFormDataStream.m: Added implementation here.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
        Use webSetHTTPBody.
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]):
        Use webSetHTTPBody.
        * WebView.subproj/WebFrame.m:
        (-[WebFrame _loadItem:withLoadType:]): Use webSetHTTPBody.
        (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto.

        * English.lproj/StringsNotToBeLocalized.txt: Updated for this change and other recent changes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Mon, 14 Feb 2005 18:19:18 +0000 (18:19 +0000)]
    Reviewed by Darin.

        <rdar://problem/4004305> REGRESSION (Mail): Command-right-arrow on wrapped text goes to end of previous line

        Fixed nextLinePosition to calculate affinity rather than take it as a parameter.  Propagated the parameter change out to related methods.

        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData):
        (khtml::InsertLineBreakCommand::doApply):
        (khtml::InsertParagraphSeparatorCommand::doApply):
        (khtml::InsertTextCommand::input):
        (khtml::ReplaceSelectionCommand::doApply):
        (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes):
        * khtml/editing/selection.cpp:
        (khtml::Selection::modifyExtendingRightForward):
        (khtml::Selection::modifyMovingRightForward):
        (khtml::Selection::modifyExtendingLeftBackward):
        (khtml::Selection::modifyMovingLeftBackward):
        (khtml::Selection::modify):
        (khtml::Selection::validate):
        * khtml/editing/visible_position.cpp:
        (khtml::visiblePositionsOnDifferentLines):
        * khtml/editing/visible_units.cpp:
        (khtml::rootBoxForLine):
        (khtml::startOfLine):
        (khtml::endOfLine):
        (khtml::inSameLine):
        (khtml::isStartOfLine):
        (khtml::isEndOfLine):
        (khtml::previousLinePosition):
        (khtml::nextLinePosition):
        (khtml::previousSentencePosition):
        (khtml::nextSentencePosition):
        (khtml::previousParagraphPosition):
        (khtml::nextParagraphPosition):
        * khtml/editing/visible_units.h:
        * khtml/khtml_events.cpp:
        (khtml::MouseEvent::offset):
        * khtml/khtml_part.cpp:
        (KHTMLPart::isPointInsideSelection):
        (KHTMLPart::selectClosestWordFromMouseEvent):
        (KHTMLPart::handleMousePressEventTripleClick):
        (KHTMLPart::handleMousePressEventSingleClick):
        (KHTMLPart::handleMouseMoveEventSelection):
        (KHTMLPart::khtmlMouseReleaseEvent):
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates):
        * khtml/rendering/render_block.h:
        * khtml/rendering/render_br.cpp:
        (RenderBR::positionForCoordinates):
        * khtml/rendering/render_br.h:
        * khtml/rendering/render_container.cpp:
        (RenderContainer::positionForCoordinates):
        * khtml/rendering/render_container.h:
        * khtml/rendering/render_inline.cpp:
        (RenderInline::positionForCoordinates):
        * khtml/rendering/render_inline.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::caretRect):
        (RenderObject::positionForCoordinates):
        * khtml/rendering/render_object.h:
        * khtml/rendering/render_replaced.cpp:
        (RenderReplaced::positionForCoordinates):
        * khtml/rendering/render_replaced.h:
        * khtml/rendering/render_text.cpp:
        (RenderText::positionForCoordinates):
        * khtml/rendering/render_text.h:
        * khtml/xml/dom_position.cpp:
        (DOM::Position::previousCharacterPosition):
        (DOM::Position::nextCharacterPosition):
        (DOM::Position::leadingWhitespacePosition):
        (DOM::Position::trailingWhitespacePosition):
        * khtml/xml/dom_position.h:
        * kwq/KWQAccObject.mm:
        (-[KWQAccObject value]):
        (-[KWQAccObject accessibilityAttributeValue:]):
        (-[KWQAccObject doAXLineForTextMarker:]):
        (-[KWQAccObject doAXTextMarkerRangeForLine:]):
        (-[KWQAccObject doAXTextMarkerForPosition:]):
        (-[KWQAccObject doAXLeftLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXRightLineTextMarkerRangeForTextMarker:]):
        (-[KWQAccObject doAXNextLineEndTextMarkerForTextMarker:]):
        (-[KWQAccObject doAXPreviousLineStartTextMarkerForTextMarker:]):
        * kwq/KWQKHTMLPart.mm:
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge _visiblePositionForPoint:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8589 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Ken and John.
mjs [Sun, 13 Feb 2005 04:08:13 +0000 (04:08 +0000)]
    Reviewed by Ken and John.

Re-fixed a specific case of the following:

<rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration

Oddly, Cmd-B, Cmd-U, type some text, return, Cmd-U, Cmd-B, type
some text, worked fine. But hitting the second Cmd-B before the
second Cmd-U still failed to remove underlining. The reason for
this is that our code to compute the style of the current position
did not work when you had a typing style and were positioned right
at a <br> element. For various reasons, this did not show up for
bold and italic, since those are handled through the font manager.

The following change fixes this - for elements that can't have
children, we add the dummy span after the element of interest,
rather than as a child of it.

        * khtml/khtml_part.cpp:
        (KHTMLPart::selectionComputedStyle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed <rdar://problem/4002505> 8A378: Endlessly animating gif's on http://www.entropy.ch
rjw [Sat, 12 Feb 2005 01:51:47 +0000 (01:51 +0000)]
Fixed <rdar://problem/4002505> 8A378: Endlessly animating gif's on entropy.ch

If animated images had no loop count property we were incorrectly
looping forver.  Note, that in the course of fixing this bug
I found that ImageIO is incorrectly NOT reporting the loop count
for a whole class of animated GIFs.

        Reviewed by Ken Kocienda.

        * WebCoreSupport.subproj/WebImageData.m:
        (-[WebImageData _repetitionCount]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8587 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Sat, 12 Feb 2005 01:03:34 +0000 (01:03 +0000)]
    Reviewed by Darin.

        <rdar://problem/3978980> Double Clicking on a line in Mail selected the entire body

        * khtml/editing/visible_units.cpp:
        (khtml::startOfWord):
        (khtml::endOfWord):
        Pay attention to being at the end of a paragraph.

        (khtml::previousLinePosition):
        (khtml::nextLinePosition):
        (khtml::endOfParagraph):
        Use DOWNSTREAM per recent affinity changes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8586 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoWebCore:
rjw [Sat, 12 Feb 2005 00:58:13 +0000 (00:58 +0000)]
WebCore:
Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls

Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
creates these wrappers.  The WebCore subclass of the interpreter now overrides
createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.

        * WebCore.pbproj/project.pbxproj:
        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::createLanguageInstanceForValue):
        * khtml/ecma/kjs_binding.h:
        * kwq/DOMUtility.mm: Added.
        (KJS::ScriptInterpreter::createObjcInstanceForValue):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::getAppletInstanceForView):
        (getInstanceForView):
        (KWQKHTMLPart::getEmbedInstanceForView):
        (KWQKHTMLPart::getObjectInstanceForView):

JavaScriptCore:
Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls

Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
creates these wrappers.  The WebCore subclass of the interpreter now overrides
createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.

        Reviewed by Ken.

        * bindings/c/c_utility.cpp:
        (convertValueToNPVariant):
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_runtime.cpp:
        (JavaField::valueFromInstance):
        (JavaArray::valueAt):
        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        * bindings/objc/WebScriptObjectPrivate.h:
        * bindings/objc/objc_utility.h:
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertObjcValueToValue):
        (KJS::Bindings::createObjcInstanceForValue):
        * bindings/runtime.cpp:
        (Instance::createBindingForLanguageInstance):
        (Instance::createRuntimeObject):
        (Instance::createLanguageInstanceForValue):
        * bindings/runtime.h:
        * kjs/interpreter.cpp:
        (Interpreter::createLanguageInstanceForValue):
        * kjs/interpreter.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8585 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted...
cblu [Fri, 11 Feb 2005 23:50:09 +0000 (23:50 +0000)]
Fixed: <rdar://problem/3937352> Quote level not maintained when copied and pasted within a Mail message

        Reviewed by harrison.

        * khtml/editing/markup.cpp:
        (khtml::isMailBlockquote): new
        (khtml::createMarkup): retain the Mail quote level by including all ancestor mail block quotes
        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::positionForCoordinates): default to downstream for the affinity since the affinity is only upstream when the cursor is clicked to the right of a wrapped line
        * khtml/rendering/render_text.cpp:
        (RenderText::positionForCoordinates): ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8584 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
adele [Fri, 11 Feb 2005 23:22:33 +0000 (23:22 +0000)]
    Reviewed by Darin.

        fix for <rdar://problem/4004004> no need to add body element for xml documents

        In the fix for <rdar://problem/3758785> we decided to add a body element when closing a document
        to ensure that the onload handler would fire.  This is unnecessary for xml documents,
        so now we also check to see if we're dealing with an html document before adding the body element.

        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::close):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8583 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
adele [Fri, 11 Feb 2005 22:59:07 +0000 (22:59 +0000)]
    Reviewed by Darin.

        * layout-tests/apple-only/base/www.excite.com/index-expected.txt: updates tests because of custom tag change.
        * layout-tests/apple-only/base/www.msnbc.com/index-expected.txt:
        * layout-tests/apple-only/base/www.time.com/index-expected.txt:
        * layout-tests/apple-only/base/www.travelocity.com/index-expected.txt:
        * layout-tests/apple-only/base/www.zdnet.com/index-expected.txt:
        * layout-tests/fast/overflow/003-expected.txt:

        * layout-tests/fast/js/window-object-cross-frame-calls-expected.txt: updated test because of added Body (see rdar://problem/3758785)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8582 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoversioning for TOT, Safari 2.0 (186+)
vicki [Fri, 11 Feb 2005 22:47:07 +0000 (22:47 +0000)]
versioning for TOT, Safari 2.0 (186+)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8581 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years agoSafari-186 stamp
vicki [Fri, 11 Feb 2005 22:22:38 +0000 (22:22 +0000)]
Safari-186 stamp

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8579 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
vicki [Fri, 11 Feb 2005 19:59:10 +0000 (19:59 +0000)]
    Reviewed by Darin.

- fix deployment build on Panther

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView changeBaseWritingDirection:]): ifdef out NSWritingDirectionNatural
        (-[WebHTMLView toggleBaseWritingDirection:]): fix a spacing issue

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8578 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by John.
darin [Fri, 11 Feb 2005 17:05:32 +0000 (17:05 +0000)]
    Reviewed by John.

        - fixed <rdar://problem/3915449> paths are relative to the old src URL after document.open, which is supposed to clear the document, including the URL

        * khtml/xml/dom_docimpl.h: Added a new openInternal function for use by KHTMLPart.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::open): Changed to do everything we did before, but also clear the URL and set the
        base URL based on the enclosing document. This is the basic JavaScript/DOM operation of opening a
        document, which is supposed to clear the document, including the URL. In the long run we might want
        to do even more document "resetting and clearing" in here, but this URL clearing is what's needed
        now to fix the most important problem.
        (DocumentImpl::openInternal): Moved the old open code in here, except for the "parsing" check, which
        is unnecessary and inappropriate in the one place we call this.

        * khtml/khtml_part.cpp: (KHTMLPart::begin): Call openInternal instead of open.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8577 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Richard.
harrison [Fri, 11 Feb 2005 01:38:31 +0000 (01:38 +0000)]
    Reviewed by Richard.

        <rdar://problem/3991652> REGRESSION (Mail): Deleting entire line in reply deletes extra blank line and moves insertion point

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:isTypingAction:]):
        (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]):
        (-[WebHTMLView selectToMark:]):
        (-[WebHTMLView swapWithMark:]):
        (-[WebHTMLView transpose:]):
        (-[WebHTMLView _selectMarkedText]):
        (-[WebHTMLView _selectRangeInMarkedText:]):
        Adopt new default affinity of NSSelectionAffinityDownstream as of <rdar://problem/3937447>.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8573 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Hyatt
kocienda [Fri, 11 Feb 2005 00:35:54 +0000 (00:35 +0000)]
    Reviewed by Hyatt

        Fix for this bug:

        <rdar://problem/3992092> 8A374: Mail crash while pasting - RemoveNodeCommand

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Code tried to remove a node that was no longer in
        the document. We try to do a good job of detecting all these cases, and generally do. This
        one was missed. Fixed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8572 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Harrison.
darin [Thu, 10 Feb 2005 23:50:51 +0000 (23:50 +0000)]
    Reviewed by Harrison.

        - fixed <rdar://problem/4002084> Setting ResourceLoadDelegate to nil can cause a crash

        * WebView.subproj/WebView.m: (-[WebView _cacheResourceLoadDelegateImplementations]):
        Set booleans to either YES or NO, rather than setting them only in the YES case.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8571 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Harrison.
darin [Thu, 10 Feb 2005 23:48:08 +0000 (23:48 +0000)]
    Reviewed by Harrison.

        - fixed <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView validateUserInterfaceItem:]): Added tons of additional cases in here for all the
        "action" style methods in this class that don't always want to be valid. For the ones where state
        makes sense, added the state-checking code too for the menu item case.
        (-[WebHTMLView ignoreSpelling:]): Removed unnecessary "editable text only" check since this command
        would work fine on a non-editable selection.
        (-[WebHTMLView swapWithMark:]): Ditto.
        (-[WebHTMLView changeBaseWritingDirection:]): Added. Like toggle, but based on the sender's tag.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8570 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Harrison.
darin [Thu, 10 Feb 2005 23:47:48 +0000 (23:47 +0000)]
    Reviewed by Harrison.

        - added support needed to fix <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined

        * kwq/WebCoreBridge.h: Added selectionHasStyle: method.
        * kwq/WebCoreBridge.mm: (-[WebCoreBridge selectionHasStyle:]): Added. Calls selectionHasStyle on the part.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Harrison.
darin [Thu, 10 Feb 2005 22:51:39 +0000 (22:51 +0000)]
    Reviewed by Harrison.

        - fixed <rdar://problem/3990484> cursor changes to I-beam when moving over text in widgets, even when selection off via CSS

        * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent): Changed code to check canSelect when deciding
        whether to show an I-beam cursor.

        * khtml/rendering/render_object.h: Added canSelect.
        * khtml/rendering/render_object.cpp:
        (selectStartNode): Added. Helper function with the guts of shouldSelect.
        (RenderObject::canSelect): Added. Like shouldSelect, but does not call the "start selecting" event handler.
        (RenderObject::shouldSelect): Refactored to use selectStartNode.

        * khtml/css/cssvalues.c: Regnerated with newer gperf.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 3867759, .mac regression where scrollers don't show up. Make sure you can...
hyatt [Thu, 10 Feb 2005 22:30:56 +0000 (22:30 +0000)]
Fix for 3867759, .mac regression where scrollers don't show up.  Make sure you can set the .width and
.height properties on the Image object.

        Reviewed by John Sullivan

        * khtml/ecma/kjs_html.cpp:
        (ImageConstructorImp::construct):
        (Image::getValueProperty):
        (Image::putValue):
        (Image::Image):
        * khtml/ecma/kjs_html.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8567 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Chris
kocienda [Thu, 10 Feb 2005 22:25:28 +0000 (22:25 +0000)]
    Reviewed by Chris

        Fix for this bug:

        <rdar://problem/3965158> Drag-n-drop within a rich text message sometimes changes the color of the dragged text

        This change fixes the bug....and much more. Now, for the first time, the paste code can do "smart merging"
        or "smooshing" of styles during its operation. Since this new code is actively, rather than passively
        working with styles, it fixes the bug, and lays the groundwork for similar work we need to do to
        preserve quote levels in Mail.

        * khtml/css/css_valueimpl.cpp:
        (DOM::CSSMutableStyleDeclarationImpl::clear): New method.
        (DOM::CSSMutableStyleDeclarationImpl::removeBlockProperties): Ditto.
        (DOM::CSSMutableStyleDeclarationImpl::removePropertiesInSet): Ditto.
        (DOM::operator==): Add operator for CSSProperty.
        * khtml/css/css_valueimpl.h: Declare new functions.
        * khtml/editing/htmlediting.cpp:
        (khtml::isEmptyStyleSpan): Improved the test in this function, rolling together the old implementation
        with some code that did this work inline elsewhere. Sum of the parts is better than either test was by itself.
        (khtml::isStyleSpan): Check for ID_SPAN.
        (khtml::ApplyStyleCommand::removeCSSStyle): Call isEmptyStyleSpan. This was the place with an inline implementation before.
        (khtml::ReplacementFragment::ReplacementFragment): Now takes a DocumentImpl argument. No longer does a "default style"
        check, but rather calls functions which do a similar check to that, and much more.
        (khtml::ReplacementFragment::~ReplacementFragment): Deref document, and computed styles.
        (khtml::ReplacementFragment::styleForNode): New helper. Looks up and returns computed style for a node.
        (khtml::ReplacementFragment::removeNodePreservingChildren): New helper.
        (khtml::ReplacementFragment::computeStylesForNodes): New function which computes the "desired" style for
        every node in the fragment. This information is used later after paste is done as a reference for testing
        what styles need to be added, and which can be removed as redundant, from all the nodes inserted by the
        replacement code.
        (khtml::ReplacementFragment::removeStyleNodes): Clears out all style nodes from the fragment. They are
        no longer needed after the call to computeStylesForNodes(),
        (khtml::ReplaceSelectionCommand::ReplaceSelectionCommand): Add a document to the call to initialize the
        command's ReplacementFragment.
        (khtml::ReplaceSelectionCommand::doApply): Call applyStyleToInsertedNodes() after inserting nodes to make
        styles come out right.
        (khtml::ReplaceSelectionCommand::applyStyleToInsertedNodes): This is the "style smooshing" function. It
        computes the styles that need to be added to each node inserted, comparing the style it gets from just
        being inserted into its correct destination with the computed "desired style" done in the
        ReplacementFragment constructor. It then adds in all the necessary styles, and will also remove redundant styles.
        * khtml/editing/htmlediting.h: Update declarations and member variables as needed.
        * khtml/editing/markup.cpp:
        (khtml::startMarkup): Add additional style annotations to the markup we generate, so that paste code can preserve it.
        (khtml::markup): Ditto.
        (khtml::createMarkup): Ditto.

        These test results are subtly better with this change. They no longer have an unneeded empty span.
        Visually the same as before.

        * layout-tests/editing/style/remove-underline-across-paragraph-expected.txt
        * layout-tests/editing/style/remove-underline-across-paragraph-in-bold-expected.txt
        * layout-tests/editing/style/remove-underline-expected.txt
        * layout-tests/editing/style/remove-underline-from-stylesheet-expected.txt

        New tests:

        * layout-tests/editing/style/smoosh-styles-001-expected.txt
        * layout-tests/editing/style/smoosh-styles-002-expected.txt
        * layout-tests/editing/style/smoosh-styles-001.html
        * layout-tests/editing/style/smoosh-styles-002.html

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Adele.
darin [Thu, 10 Feb 2005 21:29:32 +0000 (21:29 +0000)]
    Reviewed by Adele.

        - fixed <rdar://problem/3974988> WebHTMLView drops scroll wheel events when deltas are 0

        * kwq/WebCoreScrollView.m: (-[WebCoreScrollView autoforwardsScrollWheelEvents]): Added, for Tiger only.
        For Tiger, removed the override of scrollWheel:, which doesn't work quite right because of how the
        delta attributes return all 0 for newfangled scrolling events from the new trackpads.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8565 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago "Reviewed" by Richard (he told me the file was obsolete).
darin [Thu, 10 Feb 2005 19:46:10 +0000 (19:46 +0000)]
    "Reviewed" by Richard (he told me the file was obsolete).

        - got rid of an obsolete file

        * bindings/npsap.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8564 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago "Reviewed" by Richard (he told me the file was obsolete).
darin [Thu, 10 Feb 2005 19:45:30 +0000 (19:45 +0000)]
    "Reviewed" by Richard (he told me the file was obsolete).

        - got rid of an obsolete file

        * Plugins.subproj/npsap.h: Removed.
        * copy-webcore-files-to-webkit: Removed npsap.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8563 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Thu, 10 Feb 2005 19:12:24 +0000 (19:12 +0000)]
    Reviewed by Darin.

        <rdar://problem/3991532> REGRESSION (Mail): Triple-click on trailing blank line should select previous line but doesn't

        * khtml/css/cssvalues.c:
        (hash_val):
        (findValue):
        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):
        Do moral equiavalent of LeftWordIfOnBoundary for PARAGRAPH.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8562 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Reviewed by Darin.
harrison [Thu, 10 Feb 2005 19:03:36 +0000 (19:03 +0000)]
    Reviewed by Darin.

        <rdar://problem/3991848> Double-click on first character selects wrong item

        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):
        Honor the fact that clicking on a character positions the cursor on the left side of the character.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8561 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 3980778, repro crash in RootInlineBox::paint. Make sure that when merging...
hyatt [Thu, 10 Feb 2005 10:21:00 +0000 (10:21 +0000)]
Fix for 3980778, repro crash in RootInlineBox::paint.  Make sure that when merging blocks we dirty them for layout
up front. That way as we do the merge, we dont attempt to examine the lines in dirtyLinesForChangedChild.

        Reviewed by mjs

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::removeChild):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8560 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit...
hyatt [Thu, 10 Feb 2005 09:55:35 +0000 (09:55 +0000)]
Fix for 3987010, fix a bug that caused the self-collapsing-block-cleared-float bit to never get set correctly.

        Reviewed by mjs

        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::MarginInfo::setSelfCollapsingBlockClearedFloat):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8559 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 years ago Fix for 3992440, text not wrapping correctly on half moon bay web site. Refine...
hyatt [Thu, 10 Feb 2005 09:34:27 +0000 (09:34 +0000)]
Fix  for 3992440, text not wrapping correctly on half moon bay web site.  Refine an incorrect optimization I
added to be less restrictive.

        Reviewed by mjs

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlockChildren):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8558 268f45cc-cd09-0410-ab3c-d52691b4dbfc