1. 04 Dec, 2007 1 commit
    • aroben@apple.com's avatar
      Make the implementation of Frame::setNeedsReapplyStyles cross-platform · 4cfcb8ae
      aroben@apple.com authored
       WebCore:
      
               Make the implementation of Frame::setNeedsReapplyStyles cross-platform
      
               Reviewed by Hyatt.
      
               No change in functionality.
      
               * page/Frame.cpp:
               (WebCore::Frame::setNeedsReapplyStyles): Added. Invalidates the
               FrameView so that FrameView::layout will be called, which ends up
               calling reapplyStyles.
               (WebCore::Frame::needsReapplyStyles): Added.
               (WebCore::Frame::reapplyStyles): Renamed from reparseConfiguration.
               (WebCore::FramePrivate::FramePrivate):
               * page/Frame.h:
               * page/FramePrivate.h: Added new boolean member.
               * page/FrameView.cpp:
               (WebCore::FrameView::layout): Call Frame::reapplyStyles if needed.
               (WebCore::FrameView::needsLayout): Say that we need layout if the
               Frame needs styles reapplied.
               * page/mac/WebCoreFrameBridge.h: Removed setNeedsReapplyStyles.
               * page/mac/WebCoreFrameBridge.mm:
               (-[WebCoreFrameBridge reapplyStylesForDeviceType:]): Updated for
               rename.
      
               * bridge/win/FrameWin.cpp: Removed Frame::setNeedsReapplyStyles.
               * page/gtk/FrameGtk.cpp: Ditto.
               * page/mac/FrameMac.mm: Ditto.
               * page/qt/FrameQt.cpp: Ditto.
               * platform/wx/TemporaryLinkStubs.cpp: Ditto.
      
       WebKit/mac:
      
               Remove -[WebFrameBridge setNeedsReapplyStyles]
      
               This functionality is now WebCore's responsibility.
      
               Reviewed by Hyatt.
      
               * WebCoreSupport/WebFrameBridge.mm:
               * WebKit.order:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4cfcb8ae
  2. 03 Dec, 2007 2 commits
    • mitz@apple.com's avatar
      WebCore: · fe1e11ac
      mitz@apple.com authored
              Reviewed by Dave Hyatt.
      
              - fix <rdar://problem/5346452> Resize event doesn't fire on body element inside a frame
      
              Test: fast/events/resize-subframe.html
      
              * page/FrameView.cpp:
              (WebCore::FrameViewPrivate::FrameViewPrivate): Added a timer used when
              deferring tasks that need to be done after layout.
              (WebCore::FrameViewPrivate::reset):
              (WebCore::FrameView::~FrameView):
              (WebCore::FrameView::layout): Moved the updating of widget positions,
              loading plug-ins and sending events queued up during layout into
              performPostLayoutTasks(). performPostLayoutTasks() is called after
              layout unless the layout was triggered by a previous layout's post-
              layout tasks. In the latter case, performPostLayoutTasks() is scheduled
              to run later.
              (WebCore::FrameView::performPostLayoutTasks): Performs work that needs
              to be done after layout but which can result in arbitrary code
              execution and therefore may re-invalidate the layout. This includes
              updating widget positions, loading plug-ins, and dispatching layout-
              related DOM events (scroll, overflow and resize).
              (WebCore::FrameView::postLayoutTimerFired):
              (WebCore::FrameView::dispatchScheduledEvents):
              * page/FrameView.h:
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm: Removed -sendResizeEvent since this
              is handled by FrameView now.
      
      WebKit/gtk:
      
              Reviewed by Dave Hyatt.
      
              - fix <rdar://problem/5346452> Resize event doesn't fire on body element inside a frame
      
              * WebView/webkitwebview.cpp: Remove the call to sendResizeEvent() since
              FrameView sends it now.
      
      WebKit/mac:
      
              Reviewed by Dave Hyatt.
      
              - fix <rdar://problem/5346452> Resize event doesn't fire on body element inside a frame
      
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Removed the code
              that checked if the view had resized and sent the resize event, since
              FrameView sends resize events now.
              * WebView/WebHTMLViewInternal.h:
      
      WebKit/win:
      
              Reviewed by Dave Hyatt.
      
              - fix <rdar://problem/5346452> Resize event doesn't fire on body element inside a frame
      
              * WebView.cpp:
              (WebViewWndProc): Removed call to sendResizeEvent() since FrameView
              sends them now.
      
      LayoutTests:
      
              Reviewed by Dave Hyatt.
      
              - test for <rdar://problem/5346452> Resize event doesn't fire on body element inside a frame
      
              * fast/events/resize-subframe-expected.txt: Added.
              * fast/events/resize-subframe.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fe1e11ac
    • ggaren@apple.com's avatar
      JavaScriptCore: · 66bf8cbb
      ggaren@apple.com authored
              Reviewed by Eric Seidel.
      
              Second step in refactoring JSGlobalObject: moved virtual functions from
              Interpreter to JSGlobalObject.
              
              Layout and JS tests pass. SunSpider reports a .7% speedup -- don't 
              believe his lies.
      
      JavaScriptGlue:
      
              Reviewed by Eric Seidel.
      
              Updated to match the JavaScriptCore change to move virtual methods from
              Interpreter to JSGlobalObject.
              
              * JSRun.cpp:
              * JSRun.h:
              * JSValueWrapper.cpp:
              (getThreadGlobalExecState):
              * JavaScriptGlue.cpp:
              (JSRunCopyGlobalObject):
              (JSRunEvaluate):
      
      WebCore:
      
              Reviewed by Eric Seidel.
      
              Updated to match the JavaScriptCore change to move virtual methods from
              Interpreter to JSGlobalObject.
              
              Moved virtual ScriptInterpreter functions to Window.
      
      WebKit/mac:
      
              Reviewed by Eric Seidel.
      
              Updated to match the JavaScriptCore change to move virtual methods from
              Interpreter to JSGlobalObject.
      
              * WebView/WebFrame.mm:
              (-[WebFrame globalContext]): Use the toRef function instead of manually
              casting.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66bf8cbb
  3. 01 Dec, 2007 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · 41893215
      ggaren@apple.com authored
              Reviewed by Beth Dakin.
              
              Reversed the ownership relationship between Interpreter and JSGlobalObject.
              Now, the JSGlobalObject owns the Interpreter, and top-level objects
              that need the two to persist just protect the JSGlobalObject from GC.
              
              Global object bootstrapping looks a little odd right now, but it will
              make much more sense soon, after further rounds of refactoring.
      
              * bindings/runtime_root.h: Made this class inherit from RefCounted,
              to avoid code duplication.
      
              * kjs/collector.cpp:
              (KJS::Collector::collect): No need to give special GC treatment to 
              Interpreters, since we mark their global objects, which mark them.
      
              * kjs/interpreter.cpp:
              (KJS::Interpreter::mark): No need to mark our global object, since it
              marks us.
              * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject 
              owns us directly.
      
              * kjs/testkjs.cpp: Modified to follow the new rules.
              (createGlobalObject):
              (runWithScripts):
      
      JavaScriptGlue:
      
              Reviewed by Beth Dakin.
              
              Modified to follow new JSGlobalObject/Interpreter ownership rules 
              in JavaScriptCore.
      
              * JSRun.cpp:
              (JSRun::JSRun):
              (JSRun::GetInterpreter):
              (JSRun::Evaluate):
              (JSRun::CheckSyntax):
              * JSRun.h:
              * JSValueWrapper.cpp:
              (unprotectGlobalObject):
              (initializeGlobalObjectKey):
              (getThreadGlobalExecState):
      
      WebCore:
      
              Reviewed by Beth Dakin.
              
              Modified WebCore to follow the new JSGlobalObject/Interpreter ownership
              rules in JavaScriptCore.
      
              * bindings/js/kjs_binding.cpp:
              * bindings/js/kjs_binding.h: Removed stale, unused 
              interpreterForGlobalObject().
      
              * bindings/js/kjs_proxy.cpp: Changed to store a global object, rather
              than an interpreter.
              (WebCore::KJSProxy::finishedWithEvent): Need to NULL check 
              m_globalObject here because we no longer unnecessarily instantiate it.
      
              * bindings/js/kjs_window.cpp:
              (KJS::ScheduledAction::execute):
              * bindings/js/kjs_window.h: Removed redundant and less efficient 
              interpreter() function -- global objects have direct access to their
              interpreters now.
      
              Changed these functions to pass around JSGlobalObjects instead of 
              Interpreters:
      
              * page/Frame.cpp:
              (WebCore::Frame::bindingRootObject):
              (WebCore::Frame::createRootObject):
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.mm:
              (createRootObject):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      41893215
  4. 17 Nov, 2007 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · fa4fbed0
      ap@webkit.org authored
              http://bugs.webkit.org/show_bug.cgi?id=15969
              Eliminate Editor::deleteRange()
      
              No change in functionality.
      
      WebCore:
              * editing/CompositeEditCommand.h: Removed unimplemented deleteKeyPressed().
      
              * editing/Editor.cpp:
              (WebCore::Editor::deleteWithDirection):
              (WebCore::Editor::cut):
              (WebCore::Editor::performDelete):
              * editing/Editor.h:
              Moved relevant Editor::deleteRange() functionality to its callers.
              Removed deleteSelectionWithSmartDelete(void), which was more confusing than helpful
              in my opinion.
      
              * editing/mac/EditorMac.mm:
              (WebCore::initializeKillRingIfNeeded):
              (WebCore::Editor::addToKillRing):
              (WebCore::Editor::yank):
              (WebCore::Editor::yankAndSelect):
              (WebCore::Editor::setMark):
              (WebCore::unionDOMRanges):
              (WebCore::Editor::deleteToMark):
              (WebCore::Editor::selectToMark):
              (WebCore::Editor::swapWithMark):
              Pushed kill ring handling down from WebCore.
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
              Removed setMarkDOMRange (the corresponding getter is still needed).
      
              * WebCore.base.exp: No longer need to export Editor::deleteRange() and Editor::insertTextWithoutSendingTextEvent().
              Export the new kill ring functions.
      
      WebKit:
              * WebView/WebHTMLView.mm:
              (+[WebHTMLView initialize]):
              (-[WebHTMLView yank:]):
              (-[WebHTMLView yankAndSelect:]):
              (-[WebHTMLView setMark:]):
              (-[WebHTMLView deleteToMark:]):
              (-[WebHTMLView selectToMark:]):
              (-[WebHTMLView swapWithMark:]):
              Pushed all kill ring methods to WebCore. They were guilty of using Editor::deleteRange()!
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fa4fbed0
  5. 12 Nov, 2007 1 commit
  6. 11 Nov, 2007 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · ff51b523
      ap@webkit.org authored
              http://bugs.webkit.org/show_bug.cgi?id=15896
              More editing cleanup
      
              No functionality changes.
      
              * dom/Node.h: Moved several editing-related methods elsewhere.
              * dom/Node.cpp: (WebCore::Node::maxCharacterOffset): Renamed from maxOffset()
              to highlight that it is a match to offsetInCharacters(), and much different from other
              offset-related methods. Added ASSERT_NOT_REACHED(), as callers are supposed to check
              offsetInCharacters() before calling this.
      
              * dom/CharacterData.cpp: (WebCore::CharacterData::maxCharacterOffset):
              * dom/CharacterData.h: (WebCore::CharacterData::isCharacterDataNode):
              Updated for above renamings.
      
              * dom/Comment.{h,cpp}: Removed an override for offsetInCharacters(), which is already present in CharacterData.
      
              * dom/Document.{h,cpp}: Folded updateSelection() into Frame::selectionLayoutChanged().
      
              * dom/Position.h:
              * dom/Position.cpp:
              (WebCore::Position::uncheckedPreviousOffset): Moved from Node::previousOffset().
              (WebCore::Position::uncheckedNextOffset): Moved from Node::NextOffset().
              (WebCore::Position::previous): Adapted to the above move.
              (WebCore::Position::next): Ditto.
              (WebCore::Position::upstream): Removed an isBR() check, since a non-BR element cannot have a BR renderer (I think),
              and BR elements are covered by editingIgnoresContent().
              (WebCore::Position::downstream): Ditto.
              (WebCore::caretMaxRenderedOffset): Moved from Node::caretMaxRenderedOffset().
              (WebCore::Position::rendersInDifferentPosition): Updated for the above moves.
      
              * dom/PositionIterator.h: Added a comment describing this class from the original check-in.
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::increment): Updated for the above moves.
              (WebCore::PositionIterator::decrement): Ditto.
      
              * dom/ProcessingInstruction.h:
              * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::maxCharacterOffset):
              ProcessingInstruction was already returning true from offsetInCharacters(), but didn't override maxCharacterOffset().
              I think that implementing it has no actual effect, as PIs are not rendered, but it looks cleaner this way.
      
              * dom/Range.cpp:
              (WebCore::Range::selectNodeContents):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::applyInlineStyle):
              (WebCore::maxRangeOffset):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::splitTextAtStartIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextAtEndIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
              (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::positionOutsideTabSpan):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::handleGeneralDelete):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::insertTab):
              * editing/visible_units.cpp:
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              Updated for the above moves.
      
              * editing/Editor.cpp:
              (WebCore::Editor::advanceToNextMisspelling): Added a missing rangeCompliantEquivalent() call.
      
              * editing/TextIterator.cpp:
              (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Changed the condition to obviously
              match a maxCharacterOffset() call made after it; hopefully, this doesn't break any border cases.
              (WebCore::SimplifiedBackwardsTextIterator::advance): Updated for the above moves.
      
              * editing/htmlediting.h:
              * editing/htmlediting.cpp:
              (WebCore::canHaveChildrenForEditing): Removed a bogus comment: I don't thin BRs have a special ability to accept
              child nodes, other than via DOM manipulation, which is not specific to BRs.
              (WebCore::rangeCompliantEquivalent): Removed a check for BR, which is already covered by editingIgnoresContent().
              (WebCore::maxDeepOffset): Ditto.
              (WebCore::caretMinOffset): Moved from Node. Changed some runtime checks that seemingly cannot fail into assertions.
              (WebCore::caretMaxOffset): Ditto.
      
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick): Pass 0 to VisiblePosition constructor instead of
              caretMinOffset. I didn't want to include htmlediting.h here, and I think that VisiblePosition constructor
              will take care of adjusting the offset.
      
              * page/Frame.cpp: (WebCore::Frame::selectionLayoutChanged): Folded Document::updateSelection() here.
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]): Added missing rangeCompliantEquivalent() calls.
              * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForRenderer): Changed to not round-trip via editing.
              Changed some runtime checks that seemingly cannot fail into assertions.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ff51b523
  7. 06 Nov, 2007 1 commit
    • ap's avatar
      Reviewed by Darin. · 7a07131a
      ap authored
              http://bugs.webkit.org/show_bug.cgi?id=15847
              Some editing cleanup
      
              No change in functionality.
      
      WebCore:
              * editing/TextIterator.cpp:
              (WebCore::plainText):
              * editing/TextIterator.h:
              Made WebCore::plainText() return String instead of DeprecatedString.
      
              * bridge/mac/WebCoreAXObject.mm:
              (-[WebCoreAXObject textUnderElement]):
              (-[WebCoreAXObject value]):
              (-[WebCoreAXObject doAXBoundsForTextMarkerRange:]):
              (-[WebCoreAXObject doAXNextSentenceEndTextMarkerForTextMarker:]):
              (-[WebCoreAXObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
              Updated for the above change. There is no need to explicitly convert to NSString now.
      
              * editing/EditCommand.cpp:
              (WebCore::EditCommand::EditCommand): m_startingSelection and m_endingSelection are actually
              initialized in constructor body, so the work done in initializer list was wasted.
      
              (WebCore::EditCommand::apply): Moved some stars.
              (WebCore::EditCommand::unapply): Ditto.
              (WebCore::EditCommand::reapply): Ditto.
              (WebCore::EditCommand::setStartingSelection): The loop exit condition was evaluated twice,
              removed one of the checks.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::toString): plainText() result type now matches what we need here.
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
              Removed unused -[WebCoreFrameBridge deleteKeyPressedWithSmartDelete:granularity:] and
              -[WebCoreFrameBridge forwardDeleteKeyPressedWithSmartDelete:granularity:].
      
      WebKit:
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView deleteToEndOfLine:]):
              (-[WebHTMLView deleteToEndOfParagraph:]):
              WebCore had a duplicate of the same logic already. We are passing a boundary value to
              a function that expects granularity, this may need to be straightened out in the future.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7a07131a
  8. 16 Oct, 2007 1 commit
    • darin's avatar
      WebCore: · d4efa444
      darin authored
              Reviewed by Adele.
      
              - fix http://bugs.webkit.org/show_bug.cgi?id=15525
                transpose (control-T) should do the last two characters on a line if at end of line
              - remove unused CommandByName class
              - move transpose command implementation here from Mac OS X WebKit
      
              * editing/Editor.h:
              * editing/Editor.cpp:
              (WebCore::execTranspose): Added.
              (WebCore::Editor::transpose): Added. This has the transpose implementation from
              WebCoreFrameBridge and WebHTMLView, translated into WebCore-style C++ and with
              a special case for the end of a paragraph.
      
              * page/Frame.h: Removed unused command() function member.
              * page/FramePrivate.h: Removed unused m_command data member.
              * page/Frame.cpp: Ditto.
      
              * page/mac/WebCoreFrameBridge.h: Removed rangeOfCharactersAroundCaret method.
              * page/mac/WebCoreFrameBridge.mm: Ditto.
      
              * WebCore.pro: Removed CommandByName.h/cpp.
              * WebCore.vcproj/WebCore.vcproj: Ditto.
              * WebCore.xcodeproj/project.pbxproj: Ditto.
      
              * editing/CommandByName.cpp: Removed.
              * editing/CommandByName.h: Removed.
      
      WebKit:
      
              Reviewed by Adele.
      
              - moved transpose command implementation into WebCore
      
              * WebView/WebHTMLView.mm: Removed transpose: and replaced it with standard WebCore forwarding.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@26683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d4efa444
  9. 12 Oct, 2007 1 commit
    • oliver's avatar
      WebCore: · 3411ea05
      oliver authored
              Reviewed by Oliver.
      
              - Use Vector<UChar> instead of DeprecatedString for innerHTML, for 35% speedup on CK DOM test
              http://bugs.webkit.org/show_bug.cgi?id=15339
      
              Rewrote both versions of createMarkup to build based on
              Vector<UChar> instead of String. Also other miscellaneous
              speedups (mainly content strings are now encoded in a way that
              doesn't take a function call per character, and switch is avoided).
      
              This also causes a functional change - we no longer escape '>' since this was unnecessary and it's faster
              to avoid testing for it. See updated test results.
      
              * editing/markup.cpp:
              (WebCore::appendString):
              (WebCore::appendAttributeValue):
              (WebCore::escapeContentText):
              (WebCore::appendEscapedContent):
              (WebCore::appendDeprecatedString):
              (WebCore::appendQuotedURLAttributeValue):
              (WebCore::stringValueForRange):
              (WebCore::ucharRange):
              (WebCore::appendUCharRange):
              (WebCore::appendNamespace):
              (WebCore::appendStartMarkup):
              (WebCore::getStartMarkup):
              (WebCore::appendEndMarkup):
              (WebCore::getEndMarkup):
              (WebCore::appendMarkup):
              (WebCore::joinMarkups):
              (WebCore::createMarkup):
              * editing/markup.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge markupStringFromNode:nodes:]):
              (-[WebCoreFrameBridge markupStringFromRange:nodes:]):
      
      LayoutTests:
      
              Reviewed by Oliver.
      
              - test updates for "file:///Volumes/Data/mjs/Work/src/Safari/OpenSource/LayoutTests/fast/dom/serialize-attribute.xhtml"
              http://bugs.webkit.org/show_bug.cgi?id=15339
      
              We no longer entity-escape the '>' character in content or attribute values since this is unnecessary.
      
              * fast/dom/dom-parse-serialize-expected.txt:
              * fast/dom/serialize-attribute.xhtml:
              * fast/xsl/xslt-processor-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@26474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3411ea05
  10. 13 Sep, 2007 1 commit
    • darin's avatar
      WebCore: · ead9a459
      darin authored
              Reviewed by Oliver.
      
              - fix <rdar://problem/5470457> REGRESSION: Input method inline hole is mishandled in text
                <input> elements with maxlength limit
      
              * editing/Editor.h: Moved MarkedTextUnderline here and renamed it CompositionUnderline.
              Moved the rest of the marked text API here and used the term that will be more familiar
              to those on platforms other than Macintosh, "composition". This helps prevent confusion
              with the other kinds of mark -- the emacs "mark" and spelling/grammar marks. Also
              cleaned up the conditionals a bit for the Macintosh-specific parts of this header.
      
              * editing/Editor.cpp:
              (WebCore::Editor::Editor): Updated for name change.
              (WebCore::Editor::clear): Added. To be called by FrameLoader::clear().
              (WebCore::Editor::insertTextWithoutSendingTextEvent): Removed code to make inserted
              text replace the marked text range -- we now deal with this explicitly by not
              calling this function to replace marked text. Also removed unneeded code that was
              specific to the use of this to replace the marked text.
              (WebCore::Editor::selectComposition): Renamed from selectMarkedText. Updated since
              the composition range is not stored as a Range.
              (WebCore::Editor::confirmComposition): Added. To be called when changing a composition
              into actual text. Unlike the old code path, deletes the composition first, then inserts
              the text, triggering the normal insertion code path and events. This is helpful because
              it means the inserted text will be truncated by the <input> element, for example.
              (WebCore::Editor::confirmCompositionWithoutDisturbingSelection): Added.
              (WebCore::Editor::setComposition): Added. To be called when changing the composition.
              Takes parameters for the underlines and selection. Unlike the old code path, this passes
              a flag down that indicates the inserted text is part of a composition. This is helpful
              because we don't send the event that will cause the <input> element to do truncation.
              It's also a better API for future improvements to our input method handling.
              (WebCore::Editor::revealSelectionAfterEditingOperation): Updated for name change.
              (WebCore::Editor::setIgnoreCompositionSelectionChange): Ditto.
              (WebCore::Editor::compositionRange): Added. Needed now that the composition is not
              stored as a Range.
              (WebCore::Editor::getCompositionSelection): Added.
      
              * editing/TypingCommand.h:
              * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertText):
              Added an insertedTextIsComposition parameter, and don't send the BeforeTextInsertedEvent
              if it's true.
      
              * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): Replaced the Macintosh-specific
              call to setMarkedTextRange with a call to the new Editor::clear().
      
              * page/Frame.h:
              * page/Frame.cpp:
              * page/FramePrivate.h:
              * page/mac/FrameMac.mm:
              Removed the marked text code. It was streamlined and moved to Editor, except for the
              Mac-specific code, which was moved into WebKit.
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm: Removed some now-unneeded marked text code.
              (-[WebCoreFrameBridge markedTextNSRange]): Updated for name/API change.
      
              * rendering/InlineTextBox.h:
              * rendering/InlineTextBox.cpp:
              (WebCore::InlineTextBox::paint): Updated marked text code for name changes, and also
              streamlined the code a bit for the case where there is no composition.
              (WebCore::InlineTextBox::paintCompositionBackground): Name change.
              (WebCore::InlineTextBox::paintCompositionUnderline): Ditto.
      
              * rendering/RenderTextControl.h:
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::finishText): Added. Helper function shared by the
              (WebCore::RenderTextControl::text):
              (WebCore::getNextSoftBreak):
              (WebCore::RenderTextControl::textWithHardLineBreaks):
      
              * platform/CharacterNames.h: Added newlineCharacter.
      
              * dom/Range.h: Remove the now-unneeded version of toString that converts <br>
              elements into newlines.
              * dom/Range.cpp:
              (WebCore::Range::toString): Changed this to use a Vector<UChar> instead of
              a String so it will not have pathological reallocation performance, and removed
              the <br> feature.
              (WebCore::Range::pastEndNode): Made this return 0 when there is no start node.
              This bit of extra robustness guarantees you can't do a null dereference if the
              start node is 0 and the end node is not. Not sure this case really exists.
      
              * page/ContextMenuController.cpp: (ContextMenuController::contextMenuItemSelected):
              Removed a semi-bogus use of Range::toString(true). The right function to use here
              is plainText().
      
              * bridge/EditorClient.h: Removed obsolete markedTextAbandoned function.
      
              * WebCore.exp: Updated for above changes. 
      
      WebKit:
      
              Reviewed by Oliver.
      
              - fix <rdar://problem/5470457> REGRESSION: Input method inline hole is mishandled in text
                <input> elements with maxlength limit
      
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView _selectionChanged]): Tweaked code a bit.
              (-[WebHTMLView markedRange]): Simplified logic, since markedTextNSRange works when there's
              no composition range.
              (-[WebHTMLView hasMarkedText]): Call directly to Editor instead of bridge.
              (-[WebHTMLView unmarkText]): Call new confirmComposition to make it clear that this is
              confirming text, not just unmarking it to discard it.
              (extractUnderlines): Added. Converts directly from an NSAttributedString to the
              CompositionUnderline vector that's used by WebCore.
              (-[WebHTMLView setMarkedText:selectedRange:]): Changed to use the new setComposition.
              (-[WebHTMLView insertText:]): Changed to use confirmComposition when appropriate, instead
              of relying on special behavior of Editor::insertText.
              (-[WebHTMLView _updateSelectionForInputManager]): Rewrote to use getCompositionSelection
              and confirmCompositionWithoutDisturbingSelection.
      
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              Removed obsolete markedTextAbandoned function.
      
      win:
      
              Reviewed by Oliver.
      
              - fix <rdar://problem/5470457> REGRESSION: Input method inline hole is mishandled in text
                <input> elements with maxlength limit
      
              * WebView.cpp:
              (WebView::resetIME): Change to use confirmCompositionWithoutDisturbingSelection.
              (WebView::updateSelectionForIME): Update for name changes, and to use new functions
              in Editor.
              (WebView::onIMEStartComposition): Removed unneeded call to unmarkText.
              (compositionToUnderlines): Removed startOffset parameter, since setComposition now
              handles this.
              (WebView::onIMEComposition): Changed to use confirmComposition and setComposition.
              Logic gets a lot cleaner.
              (WebView::onIMEEndComposition): Removed unneeded calls to Editor.
              (WebView::onIMERequestCharPosition): Updated for name changes.
      
      LayoutTests:
      
              Reviewed by Oliver.
      
              - updated test results changed by change in input manager logic
      
              * platform/mac/editing/input/firstrectforcharacterrange-styled-expected.txt:
              * platform/mac/editing/input/text-input-controller-expected.txt:
              * platform/mac/editing/input/wrapped-line-char-rect-expected.txt:
              Updated. Small changes in which delegate methods are called.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ead9a459
  11. 21 Aug, 2007 1 commit
    • sullivan's avatar
      WebCore: · 124cc031
      sullivan authored
              Reviewed by Adam Roben
      
              WebCore part of fix for: 
              <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings
              
              Adele wrote the first version of this patch. No test cases added because I made sure the 
              layout tests are unaffected. Two additional bug fixes were made in passing, but neither 
              of them had any effect on any known real-world case, and both were too difficult to write 
              test cases for to be worthwhile.
      
              * WebCore.exp:
              added symbols for these new functions so WebKit can call them
              
              * WebCore.xcodeproj/project.pbxproj:
              updated for new file
              
              * platform/graphics/mac/ColorMac.h: Added.
              New file to hold the increasing amount of Mac-specific color stuff.
              
              * platform/graphics/Color.h:
              removed #if PLATFORM(MAC) code, which is now in ColorMac.h
              
              * platform/graphics/mac/ColorMac.mm:
              (WebCore::makeRGBAFromNSColor):
              new static function to convert an NSColor object to an RGBA32 struct
              (WebCore::colorFromNSColor):
              new public function to convert an NSColor object to a WebCore-style Color object
              (WebCore::focusRingColor):
              Uses (cached) systemFocusRingColor instead of hardwired values, unless usesTestModeFocusRingColor is true,
              in which case it uses the old hardwired color
              (WebCore::usesTestModeFocusRingColor):
              returns value of global var
              (WebCore::setUsesTestModeFocusRingColor):
              sets value of global var
              (+[WebCoreControlTintObserver controlTintDidChange]):
              Uses [NSColor keyboardFocusIndicatorColor] to set systemFocusRingColor; don't compile if COLORMATCH_EVERYTHING
              is set since we don't know what it would take to satisfy this state.
      
              * bindings/objc/DOMRGBColor.mm:
              now includes ColorMac.h to account for moved declarations
              * bridge/mac/WebCoreAXObject.mm:
              ditto
              
              * page/mac/FrameMac.mm:
              (WebCore::convertAttributesToUnderlines):
              now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
              this function is only used to convert the color of an input manager's marked text underline, which is always black
              
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge setBaseBackgroundColor:]):
              now uses new colorFromNSColor. The old code was swapping G & B, but it didn't matter in practice because
              this function is only called with a grayscale color perhaps containing an alpha value
                      
              * rendering/RenderView.cpp:
              (WebCore::RenderView::paintBoxDecorations):
              just updated a comment
      
      WebKit:
      
              Reviewed by Adam Roben
              
              WebKit part of fix for: 
              <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings
      
              * Misc/WebNSAttributedStringExtras.mm:
              now includes <WebCore/ColorMac.h> to account for moved declaration
              * WebView/WebFrame.mm:
              ditto
              
              * WebView/WebViewPrivate.h:
              * WebView/WebView.mm:
              (+[WebView _setUsesTestModeFocusRingColor:]):
              new SPI, calls through to new WebCore function. This is used by DumpRenderTree to make sure the
              focus ring color is always the same when performing layout tests, regardless of OS X version.
              (+[WebView _usesTestModeFocusRingColor]):
              new SPI, calls through to new WebCore function
      
      WebKitTools:
      
              Reviewed by Adam Roben
      
              * DumpRenderTree/DumpRenderTree.m:
              (runTest):
              call new +[WebView _setUsesTestModeFocusRingColor:YES] so we get the same focus ring colors
              in layout tests on Tiger and Leopard
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      124cc031
  12. 10 Aug, 2007 1 commit
    • thatcher's avatar
      JavaScriptCore: · 43a079ef
      thatcher authored
              Reviewed by Adam.
      
              <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
      
              Disable the NPAPI for 64-bit on Mac OS X.
      
              * Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
              * JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
              that filters out the NPN fnctions.
              * bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
              * bindings/NP_jsobject.h: Ditto.
              * bindings/c/c_class.cpp: Ditto.
              * bindings/c/c_class.h: Ditto.
              * bindings/c/c_instance.cpp: Ditto.
              * bindings/c/c_instance.h: Ditto.
              * bindings/c/c_runtime.cpp: Ditto.
              * bindings/c/c_runtime.h: Ditto.
              * bindings/c/c_utility.cpp: Ditto.
              * bindings/c/c_utility.h: Ditto.
              * bindings/npapi.h: Ditto.
              * bindings/npruntime.cpp: Ditto.
              * bindings/npruntime.h: Ditto.
              * bindings/npruntime_impl.h: Ditto.
              * bindings/npruntime_priv.h: Ditto.
              * bindings/runtime.cpp:
              (KJS::Bindings::Instance::createBindingForLanguageInstance):
               don't creat an NPObject on Mac OS X in 64-bit.
      
      WebCore:
      
              Reviewed by Adam.
      
              <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
      
              Disable NPObject use in 64-bit on Mac OS X.
      
              * Configurations/WebCore.xcconfig: Add a framework search path to the sub-framworks of Carbon.
              * WebCore.xcodeproj/project.pbxproj: Filter out the Frame::windowScriptNPObject() symbol in 64-bit.
              * bindings/objc/DOM.mm:
              (-[DOMElement _NPObject]): Return null in 64-bit.
              * config.h: Set WTF_USE_NPOBJECT to 0 in 64-bit Mac OS X.
              * page/Frame.cpp:
              (WebCore::Frame::cleanupScriptObjects): Add more #if USE(NPOBJECT) blocks where needed.
              * page/Frame.h: Ditto.
              * page/mac/FrameMac.mm:
              (WebCore::Frame::createScriptInstanceForWidget): Ditto.
              * page/mac/WebCoreFrameBridge.h: Ditto.
              * page/mac/WebCoreFrameBridge.mm: Ditto.
      
      WebKit:
      
              Reviewed by Adam.
      
              <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
      
              Disable NPObject use in 64-bit on Mac OS X. Also generate the 64-bit export file.
      
              * Configurations/WebKit.xcconfig: Point to the generated 64-bit export file.
              * Plugins/WebBasePluginPackage.h:
              * Plugins/npfunctions.h: #ifdef out this header in 64-bit on Mac OS X.
              * WebKit.LP64.exp: Removed.
              * WebKit.xcodeproj/project.pbxproj: Generate the the 64-bit export file.
              * WebKitPrefix.h: Define WTF_USE_NPOBJECT.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43a079ef
  13. 02 Aug, 2007 2 commits
    • antti's avatar
      Oops, this change wasn't supposed to be commited. · 3169bd64
      antti authored
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge setBaseBackgroundColor:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3169bd64
    • antti's avatar
      Reviewed by Darin. · 9be94542
      antti authored
              <rdar://problem/5355951>
              plainText() fragments TCMalloc heap badly on large pages
              
              also likely fixes some cases of
              <rdar://problem/5335382>
              CrashTracer: [REGRESSION] 73 crashes in Safari at com.apple.WebCore: WebCore::DeprecatedStringData::increaseUnicodeSize + 52
              
              If you load http://dscoder.com/test.txt with WebKit build with TCMalloc and system malloc you see that
              Safari RPRVT with TCMalloc is 118.8MB
              Safari RPRVT with system malloc is 69.7MB
              
              Difference is almost entirely caused by heap fragmentation from a full document plainText() call (for indexing purposes).
              
              The patch helps in two ways:
              - construct plainText string in pieces to avoid O(n^2) reallocs
              - allocate buffers using system malloc so they can be returned back to OS and don't fragment and grow TCMalloc heap
          
              This shrinks http://dscoder.com/test.txt RPRVT to 79.0MB and makes full document plainText() take 50ms instead of 500ms.
              The benefits are not limited to extreme cases, web pages above ~200kB can show substantial improvement in RPRVT.
      
              * editing/TextIterator.cpp:
              (WebCore::plainTextToMallocAllocatedBuffer):
              (WebCore::plainText):
              * editing/TextIterator.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge selectedString]):
              (-[WebCoreFrameBridge stringForRange:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9be94542
  14. 24 Jul, 2007 1 commit
    • oliver's avatar
      WebCore: · 55cc92b5
      oliver authored
              Reviewed by Adam and Justin.
      
              <rdar://problem/5141779> WebView editableDOMRangeForPoint: & moveDragCaretToPoint: returns last position in DOMText range
      
              Remove bridge implementation for editableDOMRangeForPoint: and moveDragCaretToPoint:. 
              Now use cross-platform code Editor::rangeForPoint and DragController::placeDragCaret instead.
              This required lifting local code from DragController.cpp into the shared methods
              Frame::visiblePositionForPoint and Frame::documentAtPoint.
      
              * WebCore.exp:
              * editing/Editor.cpp:
              (WebCore::Editor::rangeForPoint):
              * editing/Editor.h:
              * page/DragController.cpp:
              (WebCore::DragController::dragEnded):
              (WebCore::DragController::performDrag):
              (WebCore::DragController::dragEnteredOrUpdated):
              (WebCore::DragController::tryDocumentDrag):
              (WebCore::DragController::operationForLoad):
              (WebCore::setSelectionToDragCaret):
              (WebCore::DragController::concludeDrag):
              (WebCore::DragController::placeDragCaret):
              * page/DragController.h:
              * page/Frame.cpp:
              (WebCore::Frame::visiblePositionForPoint):
              (WebCore::Frame::documentAtPoint):
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
      
      WebKit:
      
              Reviewed by Adam and Justin.
      
              <rdar://problem/5141779> WebView editableDOMRangeForPoint: & moveDragCaretToPoint: returns last position in DOMText range
      
              editableDOMRangeForPoint:, moveDragCaretToPoint:, and removeDragCaret now call directly into
              WebCore without relying on bridge look up through the now removed _bridgeAtPoint:.
      
              * WebKit.xcodeproj/project.pbxproj:
              * WebView/WebView.mm:
              (-[WebView moveDragCaretToPoint:]):
              (-[WebView removeDragCaret]):
              (-[WebView editableDOMRangeForPoint:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      55cc92b5
  15. 19 Jul, 2007 1 commit
    • ggaren's avatar
      WebCore: · 8375091b
      ggaren authored
              Reviewed by Darin Adler.
              
              Fixed <rdar://problem/5348384> Restore old return value behavior of 
              stringByEvaluatingJavaScriptFromString
              
              Return an empty string unless you have a string, boolean, or number
              result.
      
              * WebCore.xcodeproj/project.pbxproj:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
      
      WebKitTools:
      
              Reviewed by Darin Adler.
              
              Updated DumpRenderTree for <rdar://problem/5348384> Restore old return 
              value behavior of stringByEvaluatingJavaScriptFromString
      
              * DumpRenderTree/DumpRenderTree.m:
              (testStringByEvaluatingJavaScriptFromString):
              * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8375091b
  16. 18 Jul, 2007 1 commit
    • weinig's avatar
      Rubber-stamped by Adam Roben. · e791808f
      weinig authored
              Rename csshelper.h, csshelper.cpp, cssparser.h, cssparser.cpp,
              cssstyleselector.h, and cssstyleselector.cpp to be CamelCase.
      
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * bindings/objc/DOM.mm:
              * bindings/objc/DOMHTML.mm:
              * css/CSSGrammar.y:
              * css/CSSMediaRule.cpp:
              * css/CSSMutableStyleDeclaration.cpp:
              * css/CSSPrimitiveValue.cpp:
              * css/CSSStyleSheet.cpp:
              * css/MediaList.cpp:
              * css/MediaQueryExp.cpp:
              * css/csshelper.cpp: Removed.
              * css/csshelper.h: Removed.
              * css/CSSHelper.cpp: Copied from css/csshelper.cpp.
              * css/CSSHelper.h: Copied from css/csshelper.h.
              * css/cssparser.cpp: Removed.
              * css/cssparser.h: Removed.
              * css/CSSParser.cpp: Copied from css/cssparser.cpp.
              * css/CSSParser.h: Copied from css/cssparser.h.
              * css/cssstyleselector.cpp: Removed.
              * css/cssstyleselector.h: Removed.
              * css/CSSStyleSelector.cpp: Copied from css/cssstyleselector.cpp.
              * css/CSSStyleSelector.h: Copied from css/cssstyleselector.h.
              * dom/Document.cpp:
              * dom/Element.cpp:
              * dom/StyledElement.cpp:
              * editing/ApplyStyleCommand.cpp:
              * editing/markup.cpp:
              * html/CanvasGradient.cpp:
              * html/CanvasRenderingContext2D.cpp:
              * html/CanvasStyle.cpp:
              * html/HTMLAnchorElement.cpp:
              * html/HTMLBaseElement.cpp:
              * html/HTMLBodyElement.cpp:
              * html/HTMLDocument.cpp:
              * html/HTMLEmbedElement.cpp:
              * html/HTMLFormElement.cpp:
              * html/HTMLFrameElementBase.cpp:
              * html/HTMLImageElement.cpp:
              * html/HTMLImageLoader.cpp:
              * html/HTMLLinkElement.cpp:
              * html/HTMLObjectElement.cpp:
              * html/HTMLOptGroupElement.cpp:
              * html/HTMLOptionElement.cpp:
              * html/HTMLSelectElement.cpp:
              * html/HTMLTableElement.cpp:
              * html/HTMLTablePartElement.cpp:
              * html/HTMLTokenizer.cpp:
              * ksvg2/css/SVGCSSParser.cpp:
              * ksvg2/css/SVGCSSStyleSelector.cpp:
              * ksvg2/svg/SVGAElement.cpp:
              * ksvg2/svg/SVGClipPathElement.cpp:
              * ksvg2/svg/SVGGradientElement.cpp:
              * ksvg2/svg/SVGLength.cpp:
              * ksvg2/svg/SVGMaskElement.cpp:
              * ksvg2/svg/SVGStyledElement.cpp:
              * ksvg2/svg/SVGUseElement.cpp:
              * page/DOMWindow.cpp:
              * page/mac/FrameMac.mm:
              * page/mac/WebCoreFrameBridge.mm:
              * rendering/HitTestResult.cpp:
              * rendering/RenderObject.cpp:
              * rendering/RenderStyle.cpp:
              * rendering/RenderThemeMac.mm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e791808f
  17. 12 Jul, 2007 1 commit
    • weinig's avatar
      LayoutTests: · 8c392cc4
      weinig authored
              Reviewed by Maciej.
      
              Test for <rdar://problem/5329841>
              Calling window.closed on a closed window causes Safari to crash
      
              * fast/dom/Window/window-closed-crash-expected.txt: Added.
              * fast/dom/Window/window-closed-crash.html: Added.
      
      WebCore:
      
              Reviewed by Maciej.
      
              Patch for <rdar://problem/5329841>
              Calling window.closed on a closed window causes Safari to crash
      
              - Replaces the Frame member variable in KJS::Window for more appropriate DOMWindow
              - Adds additional new null checks as necessary
              - Removes bogus toBoolean method
              - Removes unused scheduleClose method
      
              Test: fast/dom/Window/window-closed-crash.html
      
              * bindings/js/JSCustomXPathNSResolver.cpp:
              (WebCore::JSCustomXPathNSResolver::create):
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::customGetOwnPropertySlot):
              (WebCore::JSDOMWindow::customPut):
              * bindings/js/JSXMLHttpRequest.cpp:
              (KJS::JSXMLHttpRequestPrototypeFunction::callAsFunction):
              * bindings/js/kjs_events.cpp:
              (WebCore::JSAbstractEventListener::handleEvent):
              (WebCore::JSLazyEventListener::parseCode):
              * bindings/js/kjs_window.cpp:
              (KJS::Window::Window):
              (KJS::Window::impl):
              (KJS::Window::interpreter):
              (KJS::Window::location):
              (KJS::Window::find):
              (KJS::allowPopUp):
              (KJS::createWindow):
              (KJS::canShowModalDialog):
              (KJS::canShowModalDialogNow):
              (KJS::showModalDialog):
              (KJS::Window::getValueProperty):
              (KJS::Window::childFrameGetter):
              (KJS::Window::indexGetter):
              (KJS::Window::namedItemGetter):
              (KJS::Window::getOwnPropertySlot):
              (KJS::Window::put):
              (KJS::Window::isSafeScript):
              (KJS::Window::setListener):
              (KJS::Window::getListener):
              (KJS::Window::clear):
              (KJS::WindowFunc::callAsFunction):
              (KJS::Window::updateLayout):
              (KJS::ScheduledAction::execute):
              (KJS::Window::disconnectFrame):
              (KJS::Location::put):
              (KJS::LocationFunc::callAsFunction):
              * bindings/js/kjs_window.h:
              * page/mac/WebCoreFrameBridge.mm:
              (updateRenderingForBindings):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8c392cc4
  18. 11 Jul, 2007 1 commit
    • oliver's avatar
      Reviewed by Maciej. · f15ee260
      oliver authored
              Fix <rdar://problem/5329481> Character range rect code for IME support needs to be crossplatform
      
              Move -[WebCoreFrameBridge firstRectForDOMRange:] to Frame::firstRectForRange
      
              * page/Frame.cpp:
              (WebCore::Frame::firstRectForRange):
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge firstRectForDOMRange:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f15ee260
  19. 09 Jul, 2007 1 commit
    • andersca's avatar
      Reviewed by Geoff. · 60206307
      andersca authored
              Get rid of the node argument in our various script execution functions.
              
              * bindings/js/kjs_proxy.cpp:
              (WebCore::KJSProxy::evaluate):
              * bindings/js/kjs_proxy.h:
              * bindings/js/kjs_window.cpp:
              (KJS::ScheduledAction::execute):
              * dom/XMLTokenizer.cpp:
              (WebCore::XMLTokenizer::endElementNs):
              (WebCore::XMLTokenizer::notifyFinished):
              * html/HTMLScriptElement.cpp:
              (WebCore::HTMLScriptElement::evaluateScript):
              * html/HTMLTokenizer.cpp:
              (WebCore::HTMLTokenizer::scriptExecution):
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::changeLocation):
              (WebCore::FrameLoader::urlSelected):
              (WebCore::FrameLoader::submitForm):
              (WebCore::FrameLoader::replaceContentsWithScriptResult):
              (WebCore::FrameLoader::executeScript):
              * loader/FrameLoader.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
              (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      60206307
  20. 06 Jul, 2007 1 commit
    • oliver's avatar
      WebCore: · 4c510c0f
      oliver authored
              Reviewed by Maciej.
      
              Pulled a number of methods from WebKit and WebCoreFrameBridge into 
              C++ objects.
      
              * WebCore.exp:
              * WebCore.xcodeproj/project.pbxproj:
              * editing/Editor.cpp:
              (WebCore::Editor::replaceMarkedText):
                  From -[WebCoreFrameBridge replaceMarkedTextWithText:]
              * editing/Editor.h:
              * page/Frame.cpp:
              (WebCore::Frame::setMarkedTextRange):
                  Pulled platform independent logic from Mac specific implementation
              (WebCore::Frame::selectRangeInMarkedText):
                  Converted from -[WebHTMLView _selectRangeInMarkedText:]
              * page/Frame.h:
              * page/mac/FrameMac.mm:
              (WebCore::Frame::setMarkedTextRange):
                  Now only does Mac specific logic when manipulating initial
                  NSAttributedString
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
                  Removed -[WebCoreFrameBridge replaceMarkedTextWithText:]
      
      WebKit:
      
              Reviewed by Maciej.
      
              <rdar://problem/5318756> Need to refactor IM/Marked text code to share logic with windows.
      
              Moved a number of methods from WebHTMLView into WebCore.
              Replaced bridge methods with calls directly into WebCore objects.
      
              * WebKit.xcodeproj/project.pbxproj:
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView setMarkedText:selectedRange:]):
                Now calls WebCore object methods directly, rather than calling 
                via the bridge.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4c510c0f
  21. 04 Jul, 2007 1 commit
    • aliceli1's avatar
      Reviewed by Adam. · 7f9f8407
      aliceli1 authored
              Fixed <rdar://problem/5225119> support smart pasting on Windows
      
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
                  Added new files
              * editing/SmartReplace.cpp: Added.
              (WebCore::isCharacterSmartReplaceExempt):
                  Added non-CF implementation placeholder
              * editing/SmartReplace.h: Added.
              * editing/SmartReplaceCF.cpp: Added.
              (WebCore::getSmartSet):
              (WebCore::isCharacterSmartReplaceExempt):
                  Added new implementation
      
              * bridge/win/FrameWin.cpp:
              * page/Frame.h:
              * page/mac/FrameMac.mm:
                  Removed old declaration and implementation
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply):
                  Changed to call the new function instead of old
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
                  Removed old declaration and implementation
              (-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
                  Changed to call the new function instead of old
      
              * platform/win/PasteboardWin.cpp:
              (WebCore::Pasteboard::Pasteboard):
                  Register new clipboard format
              (WebCore::Pasteboard::writeSelection):
                  Set data for smartpaste format on clipboard
              (WebCore::Pasteboard::canSmartReplace):
                  Added non-stub implementation
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7f9f8407
  22. 03 Jul, 2007 1 commit
    • andersca's avatar
      LayoutTests: · 336a76bc
      andersca authored
              Reviewed by Darin.
      
              <rdar://problem/5289718>
              http://bugs.webkit.org/show_bug.cgi?id=14437
              CrashTracer: [REGRESSION] 76 crashes in Safari at com.apple.WebCore: WebCore::Frame::settings const + 6 (14437)
              
              Add test from Alexey Proskuryakov.
              
              * plugins/plugin-remove-subframe-expected.txt: Added.
              * plugins/plugin-remove-subframe.html: Added.
      
      WebCore:
      
              Reviewed by Darin.
      
              <rdar://problem/5289718>
              http://bugs.webkit.org/show_bug.cgi?id=14437
              CrashTracer: [REGRESSION] 76 crashes in Safari at com.apple.WebCore: WebCore::Frame::settings const + 6 (14437)
              
              Based on a patch from Maxime Britto.
              
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
              If the script caused the frame to go away, return nil. This can only happen if a plugin in a subframe destroys
              its frame.
      
              (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]):
              ASSERT that this is only called on the main frame.
      
      WebKit:
      
              Reviewed by Darin.
      
              * WebView/WebView.mm:
              (-[WebView stringByEvaluatingJavaScriptFromString:]):
              ASSERT that the value returned isn't nil. It can't be nil when invoked on the main frame.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      336a76bc
  23. 02 Jul, 2007 1 commit
  24. 20 Jun, 2007 1 commit
    • ggaren's avatar
      WebCore: · 007c6565
      ggaren authored
              Reviewed by Adele Peterson, Oliver Hunt, Anders Carlsson.
      
              Fixed <rdar://problem/5222911> Leopard9A446 : VitalSource Bookshelf 4.5: 
              Crashes when you click on sign in (stringByEvaluatingJavaScriptFromString 
              returning nil instead of "")
      
              I'm basically rolling out the change for <rdar://problem/4782422> because
              my testing shows that it was backwards.
              
              * html/HTMLElement.cpp:
              (dumpInnerHTML): New debug-only function to work around gdb being 
              perpetually suck-tastic.
      
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
              
              Return "", not nil. This function never used to return nil, so let's not
              start now. I've filed <rdar://problem/5283271> to cover the documentation bug,
      
      WebKitTools:
      
              Reviewed by Adele Peterson, Oliver Hunt, Anders Carlsson.
      
              Added tests for stringByEvaluatingJavaScriptFromString.
      
              * DumpRenderTree/DumpRenderTree.m:
              (testStringByEvaluatingJavaScriptFromString):
              (dumpRenderTree):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      007c6565
  25. 18 Jun, 2007 1 commit
    • weinig's avatar
      LayoutTests: · b8d23237
      weinig authored
              Reviewed by Geoff.
      
              Updates tests for http://bugs.webkit.org/show_bug.cgi?id=14193
              Move the Screen object out of the JS bindings
      
              * fast/dom/Window/window-appendages-cleared-expected.txt:
              * fast/dom/Window/window-properties-expected.txt:
      
      WebCore:
      
              Reviewed by Geoff.
      
              Patch for http://bugs.webkit.org/show_bug.cgi?id=14193
              Move the Screen object out of the JS bindings
      
              - Renames Screen.h to PlatformScreen.h to accommodate new class.
              - Autogenerates JSScreen.
      
              * DerivedSources.make:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * bindings/js/kjs_window.cpp:
              (KJS::WindowPrivate::WindowPrivate):
              (KJS::Window::mark):
              (KJS::Window::getValueProperty):
              (KJS::Window::clearHelperObjectProperties):
              * bindings/js/kjs_window.h:
              (KJS::Window::):
              * css/MediaQueryEvaluator.cpp:
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::DOMWindow):
              (WebCore::DOMWindow::~DOMWindow):
              (WebCore::DOMWindow::frame):
              (WebCore::DOMWindow::disconnectFrame):
              (WebCore::DOMWindow::screen):
              * page/DOMWindow.h:
              * page/DOMWindow.idl:
              * page/Screen.cpp: Added.
              (WebCore::Screen::Screen):
              (WebCore::Screen::disconnectFrame):
              (WebCore::Screen::height):
              (WebCore::Screen::width):
              (WebCore::Screen::colorDepth):
              (WebCore::Screen::pixelDepth):
              (WebCore::Screen::availLeft):
              (WebCore::Screen::availTop):
              (WebCore::Screen::availHeight):
              (WebCore::Screen::availWidth):
              * page/Screen.h: Added.
              * page/Screen.idl: Added.
              * page/mac/WebCoreFrameBridge.mm:
              * platform/PlatformScreen.h: Copied from WebCore/platform/Screen.h.
              * platform/Screen.h: Removed.
              * platform/gdk/PlatformScreenGdk.cpp: Copied from WebCore/platform/gdk/ScreenGdk.cpp.
              * platform/gdk/ScreenGdk.cpp: Removed.
              * platform/mac/PlatformMouseEventMac.mm:
              * platform/mac/PlatformScreenMac.mm: Copied from WebCore/platform/mac/ScreenMac.mm.
              * platform/mac/ScreenMac.mm: Removed.
              * platform/qt/PlatformScreenQt.cpp: Added.
              (WebCore::WebCore::screenDepth):
              (WebCore::WebCore::screenDepthPerComponent):
              (WebCore::WebCore::screenIsMonochrome):
              (WebCore::WebCore::screenRect):
              (WebCore::WebCore::screenAvailableRect):
              * platform/qt/TemporaryLinkStubs.cpp:
              * platform/win/PlatformScreenWin.cpp: Copied from WebCore/platform/win/ScreenWin.cpp.
              * platform/win/ScreenWin.cpp: Removed.
              * rendering/RenderObject.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b8d23237
  26. 07 Jun, 2007 1 commit
    • oliver's avatar
      WebCore: · ac7f5658
      oliver authored
              Reviewed by Justin.
      
              Remove incorrect assertions.
              
              These assertions were made on the assumption that 
              TSM would always call with a range that was contained 
              by an editable region.
              
              TSM may call -[WebHTMLView characterIndexForPoint:] on a mouse
              event that is otherwise unrelated to editing, which may
              be outside the current editing region, triggering these 
              assertions.
      
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge convertToNSRange:]):
      
      WebKit:
      
              Reviewed by Justin.
              
              Add checks to make sure we don't try to create, use
              or return invalid ranges to TSM when it calls us despite
              not currently being in an editable region.
      
              * WebView/WebHTMLView.mm:
              (isTextInput):
              (-[WebHTMLView textStorage]):
              (-[WebHTMLView firstRectForCharacterRange:]):
              (-[WebHTMLView selectedRange]):
              (-[WebHTMLView attributedSubstringFromRange:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@22058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ac7f5658
  27. 26 May, 2007 1 commit
  28. 10 May, 2007 1 commit
    • mjs's avatar
      LayoutTests: · 8d620d5e
      mjs authored
              Reviewed by Oliver.
              
              - new test case for:
              <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
              <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
      
              (The test case covers both scenarios.)
      
              * http/tests/misc/frame-access-during-load-expected.checksum: Added.
              * http/tests/misc/frame-access-during-load-expected.png: Added.
              * http/tests/misc/frame-access-during-load-expected.txt: Added.
              * http/tests/misc/frame-access-during-load.html: Added.
      
              - test results beneficially or harmlessly changed as a result of the above fixes
      
              * css2.1/t0801-c412-hz-box-00-b-a-expected.checksum:
              * css2.1/t0801-c412-hz-box-00-b-a-expected.png:
              * css2.1/t0801-c412-hz-box-00-b-a-expected.txt: This reflects an <object> containing
              an image now creating an image renderer.
      
              * dom/xhtml/level2/html/HTMLIFrameElement11-expected.txt: This is updated to a slightly
              less bad failure for access to a frame that's not loaded yet.
      
              The following test results now reflect the frame removal that the test was testing:
              
              * fast/dom/clientWidthAfterDocumentIsRemoved-expected.checksum:
              * fast/dom/clientWidthAfterDocumentIsRemoved-expected.png:
              * fast/dom/clientWidthAfterDocumentIsRemoved-expected.txt:
              * fast/dom/replaceChild-expected.checksum:
              * fast/dom/replaceChild-expected.png:
              * fast/dom/replaceChild-expected.txt:
      
              The following tests results now reflect empty document content for iframes that never load anything:
              
              * fast/events/focusingUnloadedFrame-expected.txt:
              * tables/mozilla_expected_failures/bugs/bug137388-1-expected.txt:
              * tables/mozilla_expected_failures/bugs/bug137388-2-expected.txt:
      
      WebCore:
      
              Reviewed by Oliver.
      
              - WebCore part of fix for:
              <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
              <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
      
              The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
              so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
              
              However, this caused many regressions so I had to fix the fallout.
              
              * WebCore.exp: fix symbol exports
              * bindings/js/kjs_window.cpp:
              (KJS::createNewWindow): useless "created" bool (we don't need it here)
              (KJS::WindowFunc::callAsFunction): detect if we created a new frame, because if so,
              we need to initialize the domain (can't count on it not having a document), also
              don't try to make a new document for it.
              Also, stop properly.
              * css/cssstyleselector.cpp:
              (WebCore::CSSStyleSelector::CSSStyleSelector): don't count on document having a view here
              * html/HTMLObjectElement.cpp:
              (WebCore::HTMLObjectElement::isImageType): Ask client, to match how other <object> renderer
              decisions are made.
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::FrameLoader): Initialize new data members
              (WebCore::FrameLoader::init): Do the slightly tricky sequence of steps to properly make
              an empty document with everything hooked up.
              (WebCore::FrameLoader::createWindow): Added "created" bool.
              (WebCore::FrameLoader::stopLoading): (whitespace change)
              (WebCore::FrameLoader::begin): Don't try to create an empty document.
              (WebCore::FrameLoader::finishedParsing): If creating an initial empty document, don't
              do any of this work.
              (WebCore::FrameLoader::checkCompleted): Do checkLoadComplete() as well.
              (WebCore::FrameLoader::baseURL): don't check for null document
              (WebCore::FrameLoader::baseTarget): ditto
              (WebCore::FrameLoader::completeURL): ditto
              (WebCore::FrameLoader::didTellBridgeAboutLoad): ditto
              (WebCore::FrameLoader::scheduleLocationChange): determine duringLoad differently; doc won't
              be null.
              (WebCore::FrameLoader::gotoAnchor): don't check for null document
              (WebCore::FrameLoader::canTarget): don't check for null document
              (WebCore::FrameLoader::stopForUserCancel): new method for explicit stops like window.stop().
              (WebCore::FrameLoader::transitionToCommitted): check for pre-loaded state properly
              (WebCore::FrameLoader::createEmptyDocument): removed
              (WebCore::FrameLoader::checkLoadCompleteForThisFrame): don't send delegate callbacks when making initial
              doc.
              (WebCore::FrameLoader::tokenizerProcessedData): Assume document; just checkCompleted now that it
              does checkLoadComplete.
              (WebCore::FrameLoader::receivedMainResourceError): assume document
              (WebCore::FrameLoader::saveDocumentState): Assume there's a document except during initial load
              (WebCore::FrameLoader::mainReceivedCompleteError): do checkCompleted, not checkLoadComplete
              (WebCore::FrameLoader::continueLoadWithData): assume document
              * loader/FrameLoader.h:
              * loader/MainResourceLoader.cpp:
              (WebCore::MainResourceLoader::receivedError): Add more ref protection and do things in a slightly
              different order.
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::document): don't force document creation, just assert there is one.
              * page/Frame.cpp:
              (WebCore::Frame::init): Added init method.
              (WebCore::Frame::pageDestroyed): when a frame is removed, make sure to check if the parent is
              done loading.
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): No need to force
              document.
              (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]): ditto
              * platform/graphics/svg/SVGImage.cpp:
              (WebCore::SVGImage::dataChanged): init the frame
              * rendering/RenderPart.cpp:
              (WebCore::RenderPart::updateWidgetPosition): If a subframe needs layout, then lay it out even
              if the bounds did not change; the content size might be wrong.
              * rendering/RenderTreeAsText.cpp:
              (WebCore::externalRepresentation): Don't crash if the frame lacks a view.
      
      WebKit:
      
              Reviewed by Oliver.
      
              - WebKit part of fix for:
              <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
              <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
      
              The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
              so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
              
              However, this caused many regressions so I had to fix the fallout.
      
              * WebCoreSupport/WebChromeClient.mm:
              (WebChromeClient::takeFocus): Avoid focus cycle problems (can happen in DumpRenderTree
              with initial empty document now).
              * WebCoreSupport/WebFrameBridge.mm:
              (-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]): init the frame.
              (-[WebFrameBridge determineObjectFromMIMEType:URL:]): return image type when appropriate
              * WebView/WebFrame.mm:
              (-[WebFrame stopLoading]): use stopForUserCancel().
              * WebView/WebFrameView.mm:
              (-[WebFrameView _makeDocumentViewForDataSource:]): assume html when no mime type available.
              * WebView/WebView.mm:
              (-[WebView becomeFirstResponder]): Track whether we are becoming first responder from
              outside the view.
              (-[WebView _becomingFirstResponderFromOutside]): Return this value.
              * WebView/WebViewInternal.h:
      
      WebKitTools:
      
              Reviewed by Oliver.
              
              - don't clear events whenever an EventSendingController goes away, only do it at predictable times, 
              since destroying a subframe can make one go away
              
              (Discovered while fixing:
              
              <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
              <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
      
              * DumpRenderTree/DumpRenderTree.m:
              (runTest): explicitly clear saved events after every page load
              * DumpRenderTree/EventSendingController.h:
              * DumpRenderTree/EventSendingController.m:
              (-[EventSendingController dealloc]): don't clear saved events here...
              (+[EventSendingController clearSavedEvents]): do it here
              * Scripts/check-for-global-initializers:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d620d5e
  29. 27 Apr, 2007 1 commit
    • harrison's avatar
      WebCore: · 218a3991
      harrison authored
              Reviewed by Darin.
      
              <rdar://problem/5160627> Export JS list creation support as ObjC SPI for Mail
      
              * WebCore.exp:
              * editing/Editor.h:
              * editing/Editor.cpp:
              (WebCore::Editor::insertOrderedList):
              (WebCore::Editor::insertUnorderedList):
              (WebCore::Editor::canIncreaseSelectionListLevel):
              (WebCore::Editor::canDecreaseSelectionListLevel):
              (WebCore::Editor::increaseSelectionListLevel):
              (WebCore::Editor::increaseSelectionListLevelOrdered):
              (WebCore::Editor::increaseSelectionListLevelUnordered):
              (WebCore::Editor::decreaseSelectionListLevel):
              Add insertOrderedList() and insertUnorderedList().
              Move existing list management functions from WebCoreFrameBridge.
              The level increasing functions now return a PassRefPtr<Node> instead of Node.
              Add check for canEditRichly.
              
              - in many other functions, condense the check for nil client().
              
              * editing/InsertListCommand.h:
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::insertList):
              (WebCore::InsertListCommand::fixOrphanedListChild):
              (WebCore::InsertListCommand::doApply):
              Add insertList(), which returns the new list element.
              Don't set the list element's ID if the specified ID was an empty string.
                      
              * editing/ModifySelectionListLevel.h:
              * editing/ModifySelectionListLevel.cpp:
              (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelWithType):
              (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
              (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
              (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
              Return PassRefPtr<Node> instead of Node.
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
              Move list management functions to Editor.h and Editor.cpp.
      
      WebKit:
      
              Reviewed by Darin.
      
              <rdar://problem/5160627> Export JS list creation support as ObjC SPI for Mail
      
              * WebKit.xcodeproj/project.pbxproj:
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView _selectedRange]):
              (-[WebHTMLView _shouldDeleteRange:]):
              (-[WebHTMLView _canEdit]):
              (-[WebHTMLView _canEditRichly]):
              (-[WebHTMLView _hasSelection]):
              (-[WebHTMLView _hasSelectionOrInsertionPoint]):
              (-[WebHTMLView _hasInsertionPoint]):
              (-[WebHTMLView _isEditable]):
              Condense the check for nil [self frame].
              Remove canEditRichly checks and rely on the editor to do the check instead.
              
              (-[WebHTMLView _insertOrderedList]):
              (-[WebHTMLView _insertUnorderedList]):
              New.
              
              (-[WebHTMLView _canIncreaseSelectionListLevel]):
              (-[WebHTMLView _canDecreaseSelectionListLevel]):
              (-[WebHTMLView _increaseSelectionListLevel]):
              (-[WebHTMLView _increaseSelectionListLevelOrdered]):
              (-[WebHTMLView _increaseSelectionListLevelUnordered]):
              (-[WebHTMLView _decreaseSelectionListLevel]):
              Moved from bridge to frame editor.
      
              * WebView/WebHTMLViewPrivate.h:
              Add _insertOrderedList and _insertUnorderedList to WebHTMLView(WebPrivate)
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      218a3991
  30. 21 Apr, 2007 1 commit
    • darin's avatar
      Reviewed by Oliver. · da66e216
      darin authored
              - fix <rdar://problem/4782422> REGRESSION: -[stringByEvaluatingJavaScriptFromString]
                returns an empty string instead of nil for non-string results
      
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
              Added a call to nsStringNilIfEmpty to restore the old behavior. It might be nice to
              distinguish the empty string from a non-string result, but there's no obvious way
              to do that, and for compatibility it's probably best to just restore the old
              behavior instead.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      da66e216
  31. 12 Apr, 2007 1 commit
    • oliver's avatar
      2007-04-11 Oliver Hunt <oliver@apple.com> · 1c8776d9
      oliver authored
              Reviewed by Maciej.
      
      WebCore:
              Adding RetainPtr to the many global obj-c pointers we use in
              C/C++ methods.  This is necessary to prevent GC from collecting
              globals we want to keep around.
      
              We use RetainPtr in obj-c++ and c++ files, and CFRetain/Release in pure
              obj-c.
      
              Also made the Pasteboard::m_pasteboard a RetainPtr although it
              shouldn't be necessary as the only NSPasteboard instances that 
              should ever be inserted are the system clipboard and dragging 
              pasteboard.  Neither of which should ever be collected.
      
              * page/mac/WebCoreFrameBridge.mm:
              (_getPreSmartSet):
              (_getPostSmartSet):
              * platform/Pasteboard.h:
              * platform/graphics/mac/ColorMac.mm:
              (WebCore::nsColor):
              * platform/graphics/mac/GraphicsContextMac.mm:
              (WebCore::GraphicsContext::drawLineForMisspellingOrBadGrammar):
              * platform/mac/FontDataMac.mm:
              (WebCore::webFallbackFontFamily):
              * platform/mac/PasteboardMac.mm:
              (WebCore::writableTypesForURL):
              (WebCore::writableTypesForImage):
              (WebCore::Pasteboard::clear):
              (WebCore::Pasteboard::writeSelection):
              (WebCore::Pasteboard::writeURL):
              (WebCore::Pasteboard::writeFileWrapperAsRTFDAttachment):
              (WebCore::Pasteboard::writeImage):
              (WebCore::Pasteboard::canSmartReplace):
              (WebCore::Pasteboard::plainText):
              (WebCore::Pasteboard::documentFragment):
      
      WebKit:
              Adding RetainPtr to the many global obj-c pointers we use in
              C/C++ methods.  This is necessary to prevent GC from collecting
              globals we want to keep around.
      
              We use RetainPtr in obj-c++ and c++ files, and CFRetain/Release in pure
              obj-c.
      
              This fixes <rdar://problem/5058731> -- Crash in 
              WebCore::DragData::containsCompatibleContent due to early release 
              of types array
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1c8776d9
  32. 10 Apr, 2007 1 commit
    • beidson's avatar
      WebCore: · 448a6e77
      beidson authored
              Reviewed by Darin
      
              <rdar://problem/4887095> - PageCache and PageState should be combined
      
              These two objects are a relic of when the PageCache was split between WebCore and WebKit
              It just makes good sense to combine them now, and the new object is more appropriately
              called "CachedPage"
      
              This patch is vast in scope, but simple in depth - anywhere a PageCache or PageState object 
              was used has been adjusted to use a CachedPage object instead.  The most notable change is
              that HistoryItem - which always used to have a PageCache object which may or may not have 
              had a PageState - now may or may not have a CachedPage.  This actually simplifies the 
              HistoryItem code a bit while making the role of CachedPage much more clear.
      
              * WebCore.exp:
              * WebCore.xcodeproj/project.pbxproj:
      
              * history/BackForwardList.cpp:
              (WebCore::BackForwardList::addItem):
              (WebCore::BackForwardList::setCapacity):
              (WebCore::BackForwardList::setPageCacheSize):
              (WebCore::BackForwardList::clearPageCache):
              (WebCore::BackForwardList::close):
      
              * history/PageCache.cpp: Removed.
              * history/PageCache.h: Removed.
              * page/PageState.cpp: Removed.
              * page/PageState.h: Removed.
              * history/CachedPage.cpp: Added.
              (WebCore::CachedPage::create):
              (WebCore::CachedPage::CachedPage):
              (WebCore::CachedPage::~CachedPage):
              (WebCore::CachedPage::restore):
              (WebCore::CachedPage::clear):
              (WebCore::CachedPage::setDocumentLoader):
              (WebCore::CachedPage::documentLoader):
              (WebCore::CachedPage::setTimeStamp):
              (WebCore::CachedPage::setTimeStampToNow):
              (WebCore::CachedPage::timeStamp):
              * history/CachedPage.h: Added.
              (WebCore::CachedPage::document):
              (WebCore::CachedPage::mousePressNode):
              (WebCore::CachedPage::URL):
      
              * history/HistoryItem.cpp:
              (WebCore::HistoryItem::HistoryItem):
              (WebCore::HistoryItem::setCachedPage):
              (WebCore::HistoryItem::setURL):
              (WebCore::HistoryItem::alwaysAttemptToUseCachedPage):
              (WebCore::HistoryItem::setAlwaysAttemptToUseCachedPage):
              (WebCore::HistoryItem::cachedPage):
              (WebCore::cachedPagesPendingRelease):
              (WebCore::HistoryItem::releaseCachedPagesOrReschedule):
              (WebCore::HistoryItem::releaseAllPendingCachedPages):
              (WebCore::HistoryItem::scheduleCachedPageForRelease):
              * history/HistoryItem.h:
              * history/mac/HistoryItemMac.mm:
      
              * history/HistoryItemTimer.cpp:
              (WebCore::HistoryItemTimer::HistoryItemTimer):
              (WebCore::HistoryItemTimer::callReleaseCachedPagesOrReschedule):
              * history/HistoryItemTimer.h:
      
              * history/mac/PageCacheMac.mm: Removed.
              * history/mac/CachedPageMac.mm: Added.
              (WebCore::CachedPage::close):
              (WebCore::CachedPage::setDocumentView):
              (WebCore::CachedPage::documentView):
      
              * loader/DocumentLoader.cpp:
              (WebCore::DocumentLoader::DocumentLoader):
              (WebCore::DocumentLoader::loadFromCachedPage):
              (WebCore::DocumentLoader::setLoadingFromCachedPage):
              (WebCore::DocumentLoader::isLoadingFromCachedPage):
              * loader/DocumentLoader.h:
      
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::provisionalLoadStarted):
              (WebCore::FrameLoader::commitProvisionalLoad):
              (WebCore::FrameLoader::transitionToCommitted):
              (WebCore::FrameLoader::open):
              (WebCore::FrameLoader::startLoading):
              (WebCore::FrameLoader::receivedMainResourceError):
              (WebCore::FrameLoader::opened):
              (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
              (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
              (WebCore::FrameLoader::cachePageToHistoryItem):
              (WebCore::FrameLoader::createHistoryItem):
              (WebCore::FrameLoader::purgePageCache):
              (WebCore::FrameLoader::invalidateCurrentItemCachedPage):
              (WebCore::FrameLoader::loadItem):
              (WebCore::FrameLoader::updateHistoryForStandardLoad):
              (WebCore::FrameLoader::updateHistoryForClientRedirect):
              (WebCore::FrameLoader::updateHistoryForBackForwardNavigation):
              (WebCore::FrameLoader::updateHistoryForReload):
              (WebCore::FrameLoader::updateHistoryForInternalLoad):
              (WebCore::FrameLoader::updateHistoryForCommit):
              * loader/FrameLoader.h:
              * loader/FrameLoaderClient.h:
      
              * page/mac/WebCoreFrameBridge.h: Got rid of unused WebCorePageCacheStateKey
              * page/mac/WebCoreFrameBridge.mm: Ditto
      
              * platform/graphics/svg/SVGImage.cpp:
              * platform/graphics/svg/SVGImageEmptyClients.h: Update to reflect the new names
              (WebCore::SVGEmptyFrameLoaderClient::loadProvisionalItemFromCachedPage):
              (WebCore::SVGEmptyFrameLoaderClient::invalidateCurrentItemCachedPage):
              (WebCore::SVGEmptyFrameLoaderClient::loadedFromCachedPage):
              (WebCore::SVGEmptyFrameLoaderClient::clearLoadingFromCachedPage):
              (WebCore::SVGEmptyFrameLoaderClient::isLoadingFromCachedPage):
              (WebCore::SVGEmptyFrameLoaderClient::setDocumentViewFromCachedPage):
              (WebCore::SVGEmptyFrameLoaderClient::saveDocumentViewToCachedPage):
      
      WebKit:
      
              Reviewed by Darin
      
              <rdar://problem/4887095> - PageCache and PageState should be combined
      
              WebKit side of the change to reflect the new object name of CachedPage and new Client method names
      
              * History/WebHistoryItem.mm:
              (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]):
              (+[WebHistoryItem _releaseAllPendingPageCaches]):
              (-[WebWindowWatcher windowWillClose:]):
      
              * WebCoreSupport/WebFrameLoaderClient.h:
              * WebCoreSupport/WebFrameLoaderClient.mm:
              (WebFrameLoaderClient::setDocumentViewFromCachedPage):
              (WebFrameLoaderClient::loadedFromCachedPage):
              (WebFrameLoaderClient::saveDocumentViewToCachedPage):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      448a6e77
  33. 05 Apr, 2007 1 commit
    • ggaren's avatar
      Reviewed by Beth Dakin. · 85a705e0
      ggaren authored
              More clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
              Reproducible crash loading an old version of amazon.com as a web archive
              
              Layout tests pass.
              
              Removed more superfluous document NULL checks. (Node::document() never 
              returns NULL, and it asserts as much.)
              
              Merged some duplicate editing code into a static inline function.
              
              * page/mac/WebCoreFrameBridge.mm:
              (updateRenderingForBindings): Removed superfluous static_cast.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      85a705e0
  34. 28 Mar, 2007 1 commit
    • adele's avatar
      WebCore: · cc025d83
      adele authored
              Reviewed by Kevin M.
      
              WebCore part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
      
              * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
              Convert return value to a string.  This matches the behavior in Safari 2.0.
      
      WebKit:
      
              Reviewed by Kevin M.
      
              WebKit part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
      
              Added an app specific workaround for VitalSource Bookshelf that strips "return" from the beginning of their script strings.  We used to allow this
              but now we throw a JavaScript exception for return statements that aren't in functions.
      
              Filed this evangelism bug so we can notify VitalSource of the problem:
              <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
      
              * WebView/WebView.mm: (-[WebView stringByEvaluatingJavaScriptFromString:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cc025d83
  35. 24 Mar, 2007 1 commit
    • beidson's avatar
      JavaScriptCore: · 4ce64942
      beidson authored
              Reviewed by Adam
              
              <rdar://problem/5086210> - Move RetainPtr to WTF
      
              * wtf/RetainPtr.h: Added
              * JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
              * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto
      
      WebCore:
      
              Reviewed by Adam
      
              <rdar://problem/5086210> - Move RetainPtr to WTF
      
              * ForwardingHeaders/wtf/RetainPtr.h: Added.
              * WebCore.xcodeproj/project.pbxproj: Removed WebCore/RetainPtr.h
              
              * history/HistoryItem.h: Changed #include to <wtf/RetainPtr.h>
              * history/PageCache.h: Ditto
              * page/mac/WebCoreFrameBridge.mm: Ditto
              * platform/ContextMenu.h: Ditto
              * platform/ContextMenuItem.h: Ditto
              * platform/DragImage.h: Ditto
              * platform/FileChooser.h: Ditto
              * platform/PlatformKeyboardEvent.h: Ditto
              * platform/PopupMenu.h: Ditto
              * platform/SharedBuffer.h: Ditto
              * platform/cf/RetainPtr.h: Removed.
              * platform/graphics/Icon.h: Changed #include
              * platform/mac/ClipboardMac.h: Ditto
              * platform/mac/PasteboardMac.mm: Ditto
              * platform/mac/WidgetMac.mm: Ditto
              * platform/network/AuthenticationChallenge.h: Ditto
              * platform/network/ResourceError.h: Ditto
              * platform/network/ResourceHandle.h: Ditto
              * platform/network/ResourceRequest.h: Ditto
              * platform/network/ResourceResponse.h: Ditto
              * rendering/RenderThemeMac.mm: Ditto
      
      WebKit:
      
              Reviewed by Adam
      
              <rdar://problem/5086210> - Move RetainPtr to WTF
              
              * ForwardingHeaders/wtf/RetainPtr.h: Added.
              * History/WebBackForwardList.mm: Changed #import to <wtf/RetainPtr.h>
              * WebCoreSupport/WebEditorClient.h: Ditto
              * WebCoreSupport/WebFrameLoaderClient.h: Ditto
              * WebView/WebDocumentLoaderMac.h: Ditto
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4ce64942
  36. 23 Mar, 2007 1 commit
  37. 22 Mar, 2007 1 commit
    • hyatt's avatar
      Minor refactoring and cleanup of the bridge calls that want to control... · cebb8f67
      hyatt authored
              Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
              Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
      
              Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
              catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
      
              Reviewed by aroben
      
              * page/FrameView.cpp:
              (WebCore::FrameView::adjustViewSize):
              (WebCore::FrameView::needsLayout):
              (WebCore::FrameView::setNeedsLayout):
              * page/FrameView.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge needsLayout]):
              (-[WebCoreFrameBridge setNeedsLayout]):
              * rendering/RenderView.cpp:
              (WebCore::RenderView::paint):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cebb8f67
  38. 19 Mar, 2007 1 commit
    • adele's avatar
      Reviewed by Hyatt. · 03b55a83
      adele authored
              - fix http://bugs.webkit.org/show_bug.cgi?id=13117
              REGRESSION (r14658): Flickering text fields when updating via javascript
      
              * page/Frame.cpp:
              (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
              if not adjusting view size.
              (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
              layout instead of just whether the root needs layout.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      03b55a83