Changeset 119528 in webkit


Ignore:
Timestamp:
Jun 5, 2012 2:56:24 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Block selection gaps painted not properly pixel snapped
https://bugs.webkit.org/show_bug.cgi?id=88000

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fixes for selection painting in both inline line heights and block gaps. We were unintentionally
flooring inline and block offsets in RenderBlock, but actually need to intentionally floor the
logical left and right values in logical(Left|Right)SelectionGap to properly align our block
selection gaps. This is to properly mirror the behavior in pixelSnappedLogicalRightOffsetForLine.

We were also unintentionally upcasting LayoutUnits to floats in InlineTextBox's selection painting
routine. Now we're properly rounding.

Test: fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paintSelection): Move paint values to integers and do proper rounding.

  • rendering/RenderBlock.cpp:

(WebCore::blockDirectionOffset): Fix incorrect flooring in return value.
(WebCore::inlineDirectionOffset): Ditto.
(WebCore): Removing previous attempt to properly mirror inline box selection pixel alignment. This
implementation rounded the final x value instead of properly rounding our block offset then flooring
the offset that corresponds to the behavior in InlineTextBox. It also didn't properly pixel snap
the y offset and height.
(WebCore::RenderBlock::blockSelectionGap): Properly pixel snapping the gap rect before painting.
(WebCore::RenderBlock::logicalLeftSelectionGap): Correctly match InlineTextBox's selection pixel
alignment by flooring the logicalLeft and pixel snapping the subsequent rect. We do this in order
to maintain proper render tree pixel snapping while simultaneously mirroring the flooring in the
inline direction that occurs in InlineTextBox.cpp's alignSelectionRectToDevicePixels method.
(WebCore::RenderBlock::logicalRightSelectionGap): Ditto with the right.

LayoutTests:

One new selection test and updated snowleopard expectations for a handful that improved.

Note: a couple of the RTL results appear worse, but sadly are only returning to our old pre-sub-pixel results.

  • fast/sub-pixel/selection: Added.
  • fast/sub-pixel/selection/selection-gaps-at-fractional-offsets-expected.txt: Added.
  • fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html: Added.
  • platform/chromium-mac-snowleopard/editing/selection/3690703-2-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/3690703-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/3690719-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/selection-button-text-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-lr-ltr-extend-line-backward-br-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-lr-ltr-extend-line-forward-br-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-br-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-p-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-br-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-p-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.png:
  • platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.png:
  • platform/chromium-mac-snowleopard/fast/sub-pixel: Added.
  • platform/chromium-mac-snowleopard/fast/sub-pixel/selection: Added.
  • platform/chromium-mac-snowleopard/fast/sub-pixel/selection/selection-gaps-at-fractional-offsets-expected.png: Added.
  • platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-expected.png:
  • platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png:
  • platform/chromium/TestExpectations:
  • platform/efl/Skipped:
  • platform/gtk-wk2/Skipped:
  • platform/mac-lion/Skipped:
  • platform/mac-snowleopard/Skipped:
  • platform/mac-wk2/Skipped:
  • platform/mac/Skipped:
  • platform/qt-4.8/Skipped:
  • platform/qt/Skipped:
  • platform/win-wk2/Skipped:
  • platform/win-xp/Skipped:
  • platform/win/Skipped:
  • platform/wincairo/Skipped:
  • platform/wk2/Skipped:
Location:
trunk
Files:
6 added
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119527 r119528  
     12012-06-05  Levi Weintraub  <leviw@chromium.org>
     2
     3        Block selection gaps painted not properly pixel snapped
     4        https://bugs.webkit.org/show_bug.cgi?id=88000
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        One new selection test and updated snowleopard expectations for a handful that improved.
     9
     10        Note: a couple of the RTL results appear worse, but sadly are only returning to our old pre-sub-pixel results.
     11
     12        * fast/sub-pixel/selection: Added.
     13        * fast/sub-pixel/selection/selection-gaps-at-fractional-offsets-expected.txt: Added.
     14        * fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html: Added.
     15        * platform/chromium-mac-snowleopard/editing/selection/3690703-2-expected.png:
     16        * platform/chromium-mac-snowleopard/editing/selection/3690703-expected.png:
     17        * platform/chromium-mac-snowleopard/editing/selection/3690719-expected.png:
     18        * platform/chromium-mac-snowleopard/editing/selection/selection-button-text-expected.png:
     19        * platform/chromium-mac-snowleopard/editing/selection/vertical-lr-ltr-extend-line-backward-br-expected.png:
     20        * platform/chromium-mac-snowleopard/editing/selection/vertical-lr-ltr-extend-line-forward-br-expected.png:
     21        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-br-expected.png:
     22        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-p-expected.png:
     23        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.png:
     24        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-br-expected.png:
     25        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-p-expected.png:
     26        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.png:
     27        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
     28        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
     29        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.png:
     30        * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.png:
     31        * platform/chromium-mac-snowleopard/fast/sub-pixel: Added.
     32        * platform/chromium-mac-snowleopard/fast/sub-pixel/selection: Added.
     33        * platform/chromium-mac-snowleopard/fast/sub-pixel/selection/selection-gaps-at-fractional-offsets-expected.png: Added.
     34        * platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-expected.png:
     35        * platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png:
     36        * platform/chromium/TestExpectations:
     37        * platform/efl/Skipped:
     38        * platform/gtk-wk2/Skipped:
     39        * platform/mac-lion/Skipped:
     40        * platform/mac-snowleopard/Skipped:
     41        * platform/mac-wk2/Skipped:
     42        * platform/mac/Skipped:
     43        * platform/qt-4.8/Skipped:
     44        * platform/qt/Skipped:
     45        * platform/win-wk2/Skipped:
     46        * platform/win-xp/Skipped:
     47        * platform/win/Skipped:
     48        * platform/wincairo/Skipped:
     49        * platform/wk2/Skipped:
     50
    1512012-06-05  Adam Barth  <abarth@webkit.org>
    252
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r119524 r119528  
    37463746BUGWK87321 XP : fast/history/history-traversal-is-asynchronous.html = TEXT PASS
    37473747
     3748// Need rebaselines after landing the patch on bug 88000
     3749BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-ltr-extend-line-forward-wrap.html = IMAGE
     3750BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-lr-ltr-extend-line-backward-br.html = IMAGE
     3751BUGLEVI WIN LINUX LION LEOPARD : editing/selection/3690703.html = IMAGE
     3752BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-ltr-extend-line-forward-br.html = IMAGE
     3753BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-ltr-extend-line-backward-wrap.html = IMAGE
     3754BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-rtl-extend-line-backward-p.html = IMAGE
     3755BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-rtl-extend-line-backward-br.html = IMAGE
     3756BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-ltr-extend-line-forward-p.html = IMAGE
     3757BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-lr-ltr-extend-line-forward-br.html = IMAGE
     3758BUGLEVI WIN LINUX LION LEOPARD : editing/selection/selection-button-text.html = IMAGE
     3759BUGLEVI WIN LINUX LION LEOPARD : editing/selection/3690703-2.html = IMAGE
     3760BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-rtl-extend-line-forward-br.html = IMAGE
     3761BUGLEVI WIN LINUX LION LEOPARD : editing/selection/3690719.html = IMAGE
     3762BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-ltr-extend-line-backward-p.html = IMAGE
     3763BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-ltr-extend-line-backward-br.html = IMAGE
     3764BUGLEVI WIN LINUX LION LEOPARD : editing/selection/vertical-rl-rtl-extend-line-forward-p.html = IMAGE
     3765BUGLEVI LINUX : fast/repaint/japanese-rl-selection-repaint.html = IMAGE
     3766BUGLEVI WIN LINUX LION LEOPARD : fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html = FAIL MISSING
     3767
    37483768// File blob tests failing after chromium r138702
    37493769BUGWK87356 : fast/files/read-blob-async.html = TEXT
  • trunk/LayoutTests/platform/efl/Skipped

    r119456 r119528  
    11791179fast/sub-pixel/layout-boxes-with-zoom.html
    11801180fast/sub-pixel/size-of-box-with-zoom.html
     1181fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    11811182
    11821183# This should only be a layer change
  • trunk/LayoutTests/platform/gtk-wk2/Skipped

    r119456 r119528  
    350350fast/sub-pixel/layout-boxes-with-zoom.html
    351351fast/sub-pixel/size-of-box-with-zoom.html
     352fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    352353
    353354###############################################################################
  • trunk/LayoutTests/platform/mac-lion/Skipped

    r119456 r119528  
    108108fast/sub-pixel/layout-boxes-with-zoom.html
    109109fast/sub-pixel/size-of-box-with-zoom.html
     110fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    110111
    111112# This media test always failed on Lion
  • trunk/LayoutTests/platform/mac-snowleopard/Skipped

    r119456 r119528  
    206206fast/sub-pixel/layout-boxes-with-zoom.html
    207207fast/sub-pixel/size-of-box-with-zoom.html
     208fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    208209
    209210# Frame::findString does nothing on pages that prevent selection
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r119504 r119528  
    212212fast/sub-pixel/layout-boxes-with-zoom.html
    213213fast/sub-pixel/size-of-box-with-zoom.html
     214fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    214215
    215216# fast/events/pagehide-timeout.html, pageshow-pagehide-on-back-cached-with-frames.html, and
  • trunk/LayoutTests/platform/mac/Skipped

    r119515 r119528  
    808808fast/sub-pixel/layout-boxes-with-zoom.html
    809809fast/sub-pixel/size-of-box-with-zoom.html
     810fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    810811
    811812# media/audio-repaint.html sometimes fails on Lion Debug (Tests)
  • trunk/LayoutTests/platform/qt-4.8/Skipped

    r119456 r119528  
    8888fast/sub-pixel/layout-boxes-with-zoom.html
    8989fast/sub-pixel/size-of-box-with-zoom.html
     90fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    9091
    9192# SVG Fonts are only supported when using QRawFont, which is not
  • trunk/LayoutTests/platform/qt/Skipped

    r119456 r119528  
    224224fast/sub-pixel/layout-boxes-with-zoom.html
    225225fast/sub-pixel/size-of-box-with-zoom.html
     226fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    226227
    227228# CSS Regions support not yet enabled. http://webkit.org/b/57312
  • trunk/LayoutTests/platform/win-wk2/Skipped

    r119456 r119528  
    945945fast/sub-pixel/layout-boxes-with-zoom.html
    946946fast/sub-pixel/size-of-box-with-zoom.html
     947fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    947948
    948949# HiDPI tests require test infrastructure enhancements
  • trunk/LayoutTests/platform/win-xp/Skipped

    r119456 r119528  
    4545fast/sub-pixel/layout-boxes-with-zoom.html
    4646fast/sub-pixel/size-of-box-with-zoom.html
     47fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    4748
    4849# REGRESSION (r83928 or before): Some tests failing assertions in MarkStack::internalAppend / MarkStack::drain
  • trunk/LayoutTests/platform/win/Skipped

    r119456 r119528  
    17471747fast/sub-pixel/layout-boxes-with-zoom.html
    17481748fast/sub-pixel/size-of-box-with-zoom.html
     1749fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
    17491750
    17501751# http://webkit.org/b/82886
  • trunk/LayoutTests/platform/wincairo/Skipped

    r119456 r119528  
    20962096fast/sub-pixel/layout-boxes-with-zoom.html
    20972097fast/sub-pixel/size-of-box-with-zoom.html
     2098fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    20982099
    20992100#Battery Status API is not implemented.
  • trunk/LayoutTests/platform/wk2/Skipped

    r119456 r119528  
    9595fast/sub-pixel/layout-boxes-with-zoom.html
    9696fast/sub-pixel/size-of-box-with-zoom.html
     97fast/sub-pixel/selection-gaps-at-fractional-offsets.html
    9798
    9899# CONSOLE MESSAGE: line 0: SVG animation pause API missing!
  • trunk/Source/WebCore/ChangeLog

    r119527 r119528  
     12012-06-05  Levi Weintraub  <leviw@chromium.org>
     2
     3        Block selection gaps painted not properly pixel snapped
     4        https://bugs.webkit.org/show_bug.cgi?id=88000
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Fixes for selection painting in both inline line heights and block gaps. We were unintentionally
     9        flooring inline and block offsets in RenderBlock, but actually need to intentionally floor the
     10        logical left and right values in logical(Left|Right)SelectionGap to properly align our block
     11        selection gaps. This is to properly mirror the behavior in pixelSnappedLogicalRightOffsetForLine.
     12
     13        We were also unintentionally upcasting LayoutUnits to floats in InlineTextBox's selection painting
     14        routine. Now we're properly rounding.
     15
     16        Test: fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
     17
     18        * rendering/InlineTextBox.cpp:
     19        (WebCore::InlineTextBox::paintSelection): Move paint values to integers and do proper rounding.
     20        * rendering/RenderBlock.cpp:
     21        (WebCore::blockDirectionOffset): Fix incorrect flooring in return value.
     22        (WebCore::inlineDirectionOffset): Ditto.
     23        (WebCore): Removing previous attempt to properly mirror inline box selection pixel alignment. This
     24        implementation rounded the final x value instead of properly rounding our block offset then flooring
     25        the offset that corresponds to the behavior in InlineTextBox. It also didn't properly pixel snap
     26        the y offset and height.
     27        (WebCore::RenderBlock::blockSelectionGap): Properly pixel snapping the gap rect before painting.
     28        (WebCore::RenderBlock::logicalLeftSelectionGap): Correctly match InlineTextBox's selection pixel
     29        alignment by flooring the logicalLeft and pixel snapping the subsequent rect. We do this in order
     30        to maintain proper render tree pixel snapping while simultaneously mirroring the flooring in the
     31        inline direction that occurs in InlineTextBox.cpp's alignSelectionRectToDevicePixels method.
     32        (WebCore::RenderBlock::logicalRightSelectionGap): Ditto with the right.
     33
    1342012-06-05  Adam Barth  <abarth@webkit.org>
    235
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r119367 r119528  
    1 
    21// !$*UTF8*$!
    32{
     
    337336                14E8378409F85D1C00B85AE4 /* JSEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E8378309F85D1C00B85AE4 /* JSEvent.cpp */; };
    338337                14E8378E09F85D4F00B85AE4 /* JSEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E8378D09F85D4F00B85AE4 /* JSEvent.h */; };
    339                 C6A703325C9D0B6CDCBC4D77 /* JSEventTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6A703325C9D0B6CDCBC4D78 /* JSEventTarget.cpp */; };
    340                 5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; };
    341338                14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 14FFE31B0AE1963300136BF5 /* HTMLFrameElementBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
    342339                14FFE31E0AE1963300136BF5 /* HTMLFrameElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14FFE31C0AE1963300136BF5 /* HTMLFrameElementBase.cpp */; };
     
    16751672                5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */; };
    16761673                5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; };
     1674                5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; };
    16771675                626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; };
    16781676                626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */ = {isa = PBXBuildFile; fileRef = 626CDE0D1140424C001E5A68 /* SpatialNavigation.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    19281926                7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E33CD00127F340D00BE8F17 /* PurgePriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19291927                7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */; };
     1928                7E99AF510B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */; };
     1929                7E99AF530B13846468FB01A5 /* WindowFocusAllowedIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    19301930                7EE6845F12D26E3800E79415 /* AuthenticationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */; };
    19311931                7EE6846012D26E3800E79415 /* AuthenticationCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EE6844D12D26E3800E79415 /* AuthenticationCF.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    54325432                BC8243E80D0CFD7500460C8F /* WindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */; };
    54335433                BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243E70D0CFD7500460C8F /* WindowFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
    5434                 7E99AF510B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */; };
    5435                 7E99AF530B13846468FB01A5 /* WindowFocusAllowedIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    54365434                BC85F23D151915E000BC17BE /* RenderNamedFlowThread.h in Headers */ = {isa = PBXBuildFile; fileRef = BC85F23C151915E000BC17BE /* RenderNamedFlowThread.h */; };
    54375435                BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */; };
     
    57355733                C5E9B67710697E1300C7BB1A /* StorageEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5E9B67610697E1300C7BB1A /* StorageEventDispatcher.cpp */; };
    57365734                C5EBDD84105EDDEC0056816F /* StorageEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */; };
     5735                C6A703325C9D0B6CDCBC4D77 /* JSEventTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6A703325C9D0B6CDCBC4D78 /* JSEventTarget.cpp */; };
    57375736                C6B31B2E14F841FB0089F23F /* ScrollbarThemeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C691614714F6EBA70046375C /* ScrollbarThemeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    57385737                C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */; };
     
    72577256                14E8378309F85D1C00B85AE4 /* JSEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSEvent.cpp; sourceTree = "<group>"; };
    72587257                14E8378D09F85D4F00B85AE4 /* JSEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEvent.h; sourceTree = "<group>"; };
    7259                 C6A703325C9D0B6CDCBC4D78 /* JSEventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventTarget.cpp; sourceTree = "<group>"; };
    7260                 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; };
    72617258                14FFE31B0AE1963300136BF5 /* HTMLFrameElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLFrameElementBase.h; sourceTree = "<group>"; };
    72627259                14FFE31C0AE1963300136BF5 /* HTMLFrameElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFrameElementBase.cpp; sourceTree = "<group>"; };
     
    87218718                5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformSourceLibxslt.cpp; sourceTree = "<group>"; };
    87228719                5DC87EEF11716DF2001C0E6D /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; };
     8720                5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; };
    87238721                626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpatialNavigation.cpp; sourceTree = "<group>"; };
    87248722                626CDE0D1140424C001E5A68 /* SpatialNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpatialNavigation.h; sourceTree = "<group>"; };
     
    90069004                7E33CD00127F340D00BE8F17 /* PurgePriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgePriority.h; sourceTree = "<group>"; };
    90079005                7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SubresourceLoaderCF.cpp; path = cf/SubresourceLoaderCF.cpp; sourceTree = "<group>"; };
     9006                7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFocusAllowedIndicator.cpp; sourceTree = "<group>"; };
     9007                7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFocusAllowedIndicator.h; sourceTree = "<group>"; };
    90089008                7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationCF.cpp; sourceTree = "<group>"; };
    90099009                7EE6844D12D26E3800E79415 /* AuthenticationCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationCF.h; sourceTree = "<group>"; };
     
    1257412574                BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFeatures.cpp; sourceTree = "<group>"; };
    1257512575                BC8243E70D0CFD7500460C8F /* WindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFeatures.h; sourceTree = "<group>"; };
    12576                 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFocusAllowedIndicator.cpp; sourceTree = "<group>"; };
    12577                 7E99AF540B13846468FB01A5 /* WindowFocusAllowedIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFocusAllowedIndicator.h; sourceTree = "<group>"; };
    1257812576                BC85F23C151915E000BC17BE /* RenderNamedFlowThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderNamedFlowThread.h; sourceTree = "<group>"; };
    1257912577                BC85F23E1519187300BC17BE /* RenderNamedFlowThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderNamedFlowThread.cpp; sourceTree = "<group>"; };
     
    1290412902                C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformPasteboardMac.mm; sourceTree = "<group>"; };
    1290512903                C691614714F6EBA70046375C /* ScrollbarThemeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeClient.h; sourceTree = "<group>"; };
     12904                C6A703325C9D0B6CDCBC4D78 /* JSEventTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventTarget.cpp; sourceTree = "<group>"; };
    1290612905                C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; };
    1290712906                C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; };
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r117659 r119528  
    852852    LayoutUnit selectionTop = root()->selectionTopAdjustedForPrecedingBlock();
    853853
    854     LayoutUnit deltaY = renderer()->style()->isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop;
    855     LayoutUnit selHeight = max<LayoutUnit>(ZERO_LAYOUT_UNIT, selectionBottom - selectionTop);
     854    int deltaY = roundToInt(renderer()->style()->isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop);
     855    int selHeight = max(0, roundToInt(selectionBottom - selectionTop));
    856856
    857857    FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY);
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r119409 r119528  
    31723172}
    31733173
    3174 static int blockDirectionOffset(RenderBlock* rootBlock, const LayoutSize& offsetFromRootBlock)
     3174static LayoutUnit blockDirectionOffset(RenderBlock* rootBlock, const LayoutSize& offsetFromRootBlock)
    31753175{
    31763176    return rootBlock->isHorizontalWritingMode() ? offsetFromRootBlock.height() : offsetFromRootBlock.width();
    31773177}
    31783178
    3179 static int inlineDirectionOffset(RenderBlock* rootBlock, const LayoutSize& offsetFromRootBlock)
     3179static LayoutUnit inlineDirectionOffset(RenderBlock* rootBlock, const LayoutSize& offsetFromRootBlock)
    31803180{
    31813181    return rootBlock->isHorizontalWritingMode() ? offsetFromRootBlock.width() : offsetFromRootBlock.height();
     
    33833383    LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(logicalLeft, logicalTop, logicalWidth, logicalHeight));
    33843384    if (paintInfo)
    3385         paintInfo->context->fillRect(gapRect, selectionBackgroundColor(), style()->colorSpace());
     3385        paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selectionBackgroundColor(), style()->colorSpace());
    33863386    return gapRect;
    3387 }
    3388 
    3389 static inline void alignSelectionRectToDevicePixels(LayoutRect& rect)
    3390 {
    3391     LayoutUnit maxX = floorToInt(rect.maxX());
    3392     rect.setX(floorToInt(rect.x()));
    3393     rect.setWidth((maxX - rect.x()).round());
    33943387}
    33953388
     
    33993392    LayoutUnit rootBlockLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + logicalTop;
    34003393    LayoutUnit rootBlockLogicalLeft = max(logicalLeftSelectionOffset(rootBlock, logicalTop), logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight));
    3401     LayoutUnit rootBlockLogicalRight = min(inlineDirectionOffset(rootBlock, offsetFromRootBlock) + logicalLeft, min(logicalRightSelectionOffset(rootBlock, logicalTop), logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight)));
     3394    LayoutUnit rootBlockLogicalRight = min(inlineDirectionOffset(rootBlock, offsetFromRootBlock) + floorToInt(logicalLeft), min(logicalRightSelectionOffset(rootBlock, logicalTop), logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight)));
    34023395    LayoutUnit rootBlockLogicalWidth = rootBlockLogicalRight - rootBlockLogicalLeft;
    34033396    if (rootBlockLogicalWidth <= ZERO_LAYOUT_UNIT)
     
    34053398
    34063399    LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
    3407     alignSelectionRectToDevicePixels(gapRect);
    34083400    if (paintInfo)
    3409         paintInfo->context->fillRect(gapRect, selObj->selectionBackgroundColor(), selObj->style()->colorSpace());
     3401        paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selObj->selectionBackgroundColor(), selObj->style()->colorSpace());
    34103402    return gapRect;
    34113403}
     
    34153407{
    34163408    LayoutUnit rootBlockLogicalTop = blockDirectionOffset(rootBlock, offsetFromRootBlock) + logicalTop;
    3417     LayoutUnit rootBlockLogicalLeft = max(inlineDirectionOffset(rootBlock, offsetFromRootBlock) + logicalRight, max(logicalLeftSelectionOffset(rootBlock, logicalTop), logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight)));
     3409    LayoutUnit rootBlockLogicalLeft = max(inlineDirectionOffset(rootBlock, offsetFromRootBlock) + floorToInt(logicalRight), max(logicalLeftSelectionOffset(rootBlock, logicalTop), logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight)));
    34183410    LayoutUnit rootBlockLogicalRight = min(logicalRightSelectionOffset(rootBlock, logicalTop), logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight));
    34193411    LayoutUnit rootBlockLogicalWidth = rootBlockLogicalRight - rootBlockLogicalLeft;
     
    34223414
    34233415    LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
    3424     alignSelectionRectToDevicePixels(gapRect);
    34253416    if (paintInfo)
    3426         paintInfo->context->fillRect(gapRect, selObj->selectionBackgroundColor(), selObj->style()->colorSpace());
     3417        paintInfo->context->fillRect(pixelSnappedIntRect(gapRect), selObj->selectionBackgroundColor(), selObj->style()->colorSpace());
    34273418    return gapRect;
    34283419}
Note: See TracChangeset for help on using the changeset viewer.