2012-06-22 Lucas Forschler Rollout 121034 This was 120954 from trunk. 2012-06-22 Lucas Forschler Merge 120954 2012-06-21 Brady Eidson and https://bugs.webkit.org/show_bug.cgi?id=89673 showModalDialog fix creates risk of never returning from RunLoop::performWork, potentially blocking other event sources In case handling a function on the queue places additional functions on the queue, we should limit the number of functions each invocation of performWork() performs so it can return and other event sources have a chance to spin. The showModalDialog fix in question is http://trac.webkit.org/changeset/120879 Reviewed by Darin Adler and Anders Carlson. * platform/RunLoop.cpp: (WebCore::RunLoop::performWork): If there are only N functions in the queue when performWork is called, only handle up to N functions before returning. Any additional functions will be handled the next time the runloop spins. 2012-06-20 Lucas Forschler Merge 120879 2012-06-20 Brady Eidson and https://bugs.webkit.org/show_bug.cgi?id=89590 showModalDialog message handling is flaky in WebKit2 Because RunLoop::performWork() swaps the function queue to a temporary Vector before calling the functions an inner run-loop - such as we see with running a modal dialog - does not have a change to handle any of the functions that were queued after the WebPageProxy::RunModal message. By servicing the functions in the queue one at a time we can give the RunLoop a chance to pick up where it left off if RunLoop::performWork is re-entered. To guarantee RunLoop::performWork is re-entered to handle those functions we also need to signal its source before entering the modal run loop so our RunLoop is woken up. Reviewed by Darin Adler. * WebCore.exp.in: * platform/RunLoop.cpp: (WebCore::RunLoop::performWork): Take the first function off the queue one at a time so subsequent functions remain in the queue and can be handled by an inner modal run loop. * platform/RunLoop.h: (RunLoop): Change the function queue to be a Deque to efficiently support "takeFirst" 2012-06-12 Lucas Forschler Merge 120364 2012-06-14 Andreas Kling Crashes below IconDatabase::performPendingRetainAndReleaseOperations(). Reviewed by Brady Eidson. Put isolatedCopy() strings in the retain/release operation queues to make sure it's safe for secondary threads to ref/deref them in performPendingRetainAndReleaseOperations(). Also added assertions as appropriate. * loader/icon/IconDatabase.cpp: (WebCore::IconDatabase::retainIconForPageURL): (WebCore::IconDatabase::releaseIconForPageURL): (WebCore::IconDatabase::performPendingRetainAndReleaseOperations): 2012-06-12 Lucas Forschler Merge 120357 2012-06-14 Jia Pu Mark text with text alternative with blue underline. https://bugs.webkit.org/show_bug.cgi?id=83047 Reviewed by Enrica Casucci. Tests: platform/mac/editing/input/edit-dictated-text-with-alternative.html platform/mac/editing/input/insert-dictated-text.html This patch implements visual indication on dictated text with alternatives, and provides UI to show alternative text on OS X. Majority of the changes is for generalizing existing AlternativeTextController class to handle dictation alternatives. The two new classes, AlternativeTextUIController and TextAlternativeWithRange, are used by both WebKit and WK2. So WebCore seems to be the natural place for them. * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * editing/AlternativeTextController.cpp: Expanded exising class interface to support dictation alternatives. (DictationAlternativeDetails): Marker detail class for dictation alternative mark. (WebCore::DictationAlternativeDetails::create): (WebCore::DictationAlternativeDetails::dictationContext): (WebCore::DictationAlternativeDetails::DictationAlternativeDetails): (WebCore::markerTypesForAppliedDictationAlternative): (WebCore::AlternativeTextController::applyAlternativeTextToRange): Generalized existing applyAlternativeTextToRange() to handle dictation alternatives. (WebCore::AlternativeTextController::timerFired): Expanded existing code to handle dictation alternatives. (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Expanded existing code to handle dictation alternatives. (WebCore::AlternativeTextController::respondToChangedSelection): Moved part of the function into respondToMarkerAtEndOfWord() to improve readability. (WebCore::AlternativeTextController::shouldStartTimerFor): (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText): (WebCore::AlternativeTextController::removeDictationAlternativesForMarker): (WebCore::AlternativeTextController::dictationAlternativesForMarker): (WebCore::AlternativeTextController::applyDictationAlternative): * editing/AlternativeTextController.h: * editing/Editor.cpp: (WebCore::Editor::notifyComponentsOnChangedSelection): Renamed existing respondToChangedSelection() function to avoid naming collision. (WebCore::Editor::appliedEditing): (WebCore::Editor::unappliedEditing): (WebCore::Editor::reappliedEditing): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::changeSelectionAfterCommand): (WebCore::Editor::respondToChangedSelection): (WebCore::Editor::dictationAlternativesForMarker): (WebCore::Editor::applyDictationAlternativelternative): * editing/Editor.h: * editing/FrameSelection.h: * editing/mac/AlternativeTextUIController.h: Added. WK1 and WK2 use this class to keep track of text alternatives objects. (AlternativeTextUIController): (WebCore::AlternativeTextUIController::AlternativeTextUIController): (AlernativeTextContextController): (WebCore::AlternativeTextUIController::AlernativeTextContextController::AlernativeTextContextController): * editing/mac/AlternativeTextUIController.mm: Added. (WebCore::AlternativeTextUIController::AlernativeTextContextController::addAlternatives): (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext): (WebCore::AlternativeTextUIController::AlernativeTextContextController::removeAlternativesForContext): (WebCore::AlternativeTextUIController::AlernativeTextContextController::clear): (WebCore::AlternativeTextUIController::addAlternatives): (WebCore::AlternativeTextUIController::alternativesForContext): (WebCore::AlternativeTextUIController::clear): (WebCore::AlternativeTextUIController::showAlternatives): (WebCore::AlternativeTextUIController::handleAcceptedAlternative): (WebCore::AlternativeTextUIController::dismissAlternatives): (WebCore::AlternativeTextUIController::removeAlternatives): * editing/mac/TextAlternativeWithRange.h: Added. A simple struct to make it easier to pass around a pair of text alternatives object and range. * editing/mac/TextAlternativeWithRange.mm: Added. (WebCore::TextAlternativeWithRange::TextAlternativeWithRange): (WebCore::collectDictationTextAlternatives): * page/AlternativeTextClient.h: * page/ContextMenuController.cpp: Added code to show alternative dictated text in context menu. (WebCore::ContextMenuController::contextMenuItemSelected): (WebCore::ContextMenuController::populate): (WebCore::ContextMenuController::checkOrEnableIfNeeded): * platform/ContextMenuItem.h: * rendering/HitTestResult.cpp: (WebCore::HitTestResult::dictationAlternatives): * rendering/HitTestResult.h: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintDocumentMarker): 2012-06-12 Lucas Forschler Merge 119739 2012-06-07 Jer Noble sometimes all slaved videos don't start playing https://bugs.webkit.org/show_bug.cgi?id=88553 Reviewed by Darin Adler. Test: media/media-controller-time-clamp.html Some PlatformClock classes will occasionally return times < 0 and will always return times slightly > duration() when playback has ended. Clamp the value of currentTime() to the specified [0..duration] range. * html/MediaController.cpp: (MediaController::currentTime): 2012-06-12 Lucas Forschler Merge 119644 2012-06-06 Brady Eidson and https://bugs.webkit.org/show_bug.cgi?id=88428 REGRESSION (r115654): Opening many non-English WebArchives shows obvious encoding issues Reviewed by Nate Chapin. Test: fast/loader/webarchive-encoding-respected.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): Properly set the main resource encoding from the webarchive. 2012-06-06 Mark Rowe Merge r119548. 2012-06-05 Vitaly Buka Special layout handler should be done on top frame being printed. https://bugs.webkit.org/show_bug.cgi?id=88201 Reviewed by Brady Eidson. No new tests. Root case is already covered by tests. Case described in the issue can be reproduced only by direct call to Frame::setPrinting of subframe. Probably it's not possible with layout tests. * page/Frame.cpp: (WebCore::Frame::setPrinting): Use shouldUsePrintingLayout to choose proper version of forceLayout(). (WebCore::Frame::shouldUsePrintingLayout): Checks if current frame is the top frame being printed. * rendering/RenderView.cpp: (WebCore::RenderView::shouldUsePrintingLayout): Forward to Frame. 2012-06-06 Mark Rowe Merge r119136. 2012-05-31 Brady Eidson and https://bugs.webkit.org/show_bug.cgi?id=87990 Crashes unregistering DOMWindowProperties while releasing CachedPages Reviewed by Jessie Berlin. This patch rewrites DOMWindowProperty to always keep direct track of the DOMWindow it has registered with and to only ever unregister from that very same DOMWindow. No new tests. (While the direct cause of the crash is understood, reproducing it is not) * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::DOMWindowProperty): (WebCore::DOMWindowProperty::~DOMWindowProperty): (WebCore::DOMWindowProperty::disconnectFrameForPageCache): (WebCore::DOMWindowProperty::reconnectFrameFromPageCache): (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): (WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame): * page/DOMWindowProperty.h: (DOMWindowProperty): 2012-06-06 Mark Rowe Merge r119274. 2012-06-01 Beth Dakin https://bugs.webkit.org/show_bug.cgi?id=87774 REGRESSION (r105515): reflection masks are truncated at zoom levels < 1 -and corresponding- Reviewed by Simon Fraser. paintNinePieceImage() expects un-zoomed results from calculateImageIntrinsicDimensions(). This was previously addressed by having paintNinePieceImage() divide the effective zoom out of the result from calculateImageIntrinsicDimensions(). However, that results in buggy behavior for generated images and images with percentage sizes. In the end it seems best to just send a parameter to calculateImageIntrinsicDimensions() indicating whether the caller wants the result to be scaled by the effective zoom when appropriate. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions): (WebCore::RenderBoxModelObject::calculateFillTileSize): (WebCore::RenderBoxModelObject::paintNinePieceImage): * rendering/RenderBoxModelObject.h: (RenderBoxModelObject): 2012-05-31 Tim Horton Disable CSS regions and exclusions on the Ampere branch Reviewed by Alexey Proskuryakov. Fix mismerge of regions-disabling patch (broke -webkit-print-color-adjust) * css/CSSParser.cpp: (WebCore::isValidKeywordPropertyAndValue): * dom/Document.idl: 2012-05-31 Ojan Vafai add back the ability to disable flexbox https://bugs.webkit.org/show_bug.cgi?id=87147 Reviewed by Tony Chang. * Configurations/FeatureDefines.xcconfig: * css/CSSParser.cpp: (WebCore::isValidKeywordPropertyAndValue): 2012-05-31 Tim Horton Disable CSS3 flexbox Reviewed by John Sullivan. * Configurations/FeatureDefines.xcconfig: 2012-05-31 Tim Horton ENABLE_CSS3_FLEXBOX is insufficient to disable all web-facing bits of the feature https://bugs.webkit.org/show_bug.cgi?id=87537 Reviewed by Simon Fraser. Allow the feature flag to disable more web-facing parts of the CSS3 flexbox implementation (primarily fallout from hiding it from computed style). * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::isValidKeywordPropertyAndValue): (WebCore::isKeywordPropertyID): (WebCore::CSSParser::parseValue): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSProperty.cpp: (WebCore::CSSProperty::isInheritedProperty): * css/CSSPropertyNames.in: * css/CSSValueKeywords.in: * css/StyleBuilder.cpp: (WebCore::StyleBuilder::StyleBuilder): * css/StylePropertySet.cpp: (WebCore::StylePropertySet::getPropertyValue): (WebCore::StylePropertySet::asText): * css/StylePropertyShorthand.cpp: (WebCore::shorthandForProperty): * css/StylePropertyShorthand.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::collectMatchingRulesForList): * page/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimation::ensurePropertyMap): * rendering/RenderObject.cpp: (WebCore::RenderObject::createObject): * rendering/style/RenderStyleConstants.h: 2012-05-31 Tim Horton Add feature defines for web-facing parts of CSS Regions and Exclusions https://bugs.webkit.org/show_bug.cgi?id=87442 Reviewed by Dan Bernstein. * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * bindings/generic/RuntimeEnabledFeatures.cpp: * bindings/generic/RuntimeEnabledFeatures.h: (RuntimeEnabledFeatures): (WebCore::RuntimeEnabledFeatures::setCSSExclusionsEnabled): (WebCore::RuntimeEnabledFeatures::cssExclusionsEnabled): * bindings/js/JSCSSRuleCustom.cpp: (WebCore::toJS): * bindings/objc/DOMCSS.mm: (kitClass): * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::isSimpleLengthPropertyID): (WebCore::isValidKeywordPropertyAndValue): (WebCore::isKeywordPropertyID): (WebCore::CSSParser::parseValue): (WebCore::CSSParser::detectAtToken): * css/CSSProperty.cpp: (WebCore::CSSProperty::isInheritedProperty): * css/CSSPropertyNames.in: * css/CSSRule.cpp: (WebCore::CSSRule::cssText): (WebCore::CSSRule::destroy): (WebCore::CSSRule::reattach): * css/CSSRule.h: (WebCore::CSSRule::isRegionRule): * css/CSSRule.idl: * css/StyleBuilder.cpp: (WebCore::StyleBuilder::StyleBuilder): * css/StylePropertySet.cpp: (WebCore::StylePropertySet::getPropertyValue): (WebCore::StylePropertySet::asText): * css/StylePropertyShorthand.cpp: (WebCore::shorthandForProperty): * css/StylePropertyShorthand.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::collectMatchingRulesForList): * css/StyleRule.cpp: (WebCore::StyleRuleBase::destroy): (WebCore::StyleRuleBase::copy): (WebCore::StyleRuleBase::createCSSOMWrapper): * css/WebKitCSSRegionRule.cpp: * css/WebKitCSSRegionRule.h: * css/WebKitCSSRegionRule.idl: * dom/Document.cpp: * dom/Document.h: * dom/Document.idl: * page/DOMWindow.idl: * page/Settings.cpp: (WebCore::Settings::Settings): * page/Settings.h: (WebCore::Settings::setCSSRegionsEnabled): (WebCore::Settings::cssRegionsEnabled): 2012-05-30 Lucas Forschler Merge 118891 2012-05-29 Yoshifumi Inoue REGRESSION(r111497): The "option" element doesn't match CSS pseudo class :enabled https://bugs.webkit.org/show_bug.cgi?id=87719 Reviewed by Kent Tamura. This patch added checking of "option" element for CSS pseudo class :enabled as same as :disabled to selector checker. Before r111497, it was done by using isFormControlElement. After that revision, HTMLOptionElement was no longer derived from HTMLFormControlElement. Test: fast/form/select/optgroup-rendering.html * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOneSelector): Checking element is option element as same as PseudoDisabled in PseudoEnabled case. 2012-05-30 Lucas Forschler Merge 118883 2012-05-29 Eric Seidel Fix ENABLE_IFRAME_SEAMLESS to actually fully disable