Skip to content
  • dbates@webkit.org's avatar
    Add ENABLE(TEXT_SELECTION) · d7426cd9
    dbates@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=123827
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    Add compile-time guard, ENABLE(TEXT_SELECTION), to enable or
    disable selection painting in WebCore (enabled by default).
    
    On iOS we disable WebCore selection painting and have UIKit
    paint the selection.
    
    * rendering/InlineTextBox.cpp:
    (WebCore::InlineTextBox::paintSelection): Only paint selection when
    TEXT_SELECTION is enabled.
    * rendering/LogicalSelectionOffsetCaches.h:
    (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
    For now, add a ENABLE(TEXT_SELECTION)-guard around an assertion. Added
    a FIXME comment to investigate the callers and either move the assertion
    to the appropriate callers or structure the code such that we can remove
    the assertion.
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::paintSelection): Only paint selection when
    TEXT_SELECTION is enabled.
    * rendering/TextPaintStyle.cpp:
    (WebCore::computeTextSelectionPaintStyle): Only compute the selection
    paint style when TEXT_SELECTION is enabled. Otherwise, return a paint
    style identical to the text paint style. Also, substitute nullptr for 0.
    
    Source/WTF:
    
    Enable selection painting by default on all ports except iOS.
    
    * wtf/FeatureDefines.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d7426cd9