[CSS Filters] Refactor filter outsets into a class
https://bugs.webkit.org/show_bug.cgi?id=109330

Source/WebCore:

Reviewed by Dean Jackson.

In filters related code, we're often operating on 4 ints representing the top, right,
bottom, and left filter outsets. These outsets come from a filter like blur or drop-shadow.
This patch packages those ints and their related operations into a class called
IntRectExtent.

Here are some signs that we should make a class to hold those 4 ints:
1) In RenderLayer.cpp, we have a expandRectForFilterOutsets function, which looks like
   feature envy.
2) RenderStyle and other classes have methods like getFilterOutsets which set the 4 ints by
   reference. The calling code has to define 4 ints, which looks bloated.
3) To fix bug 109098, we will need to check if filter outsets changed, which sounds like a
   nice job for an inequality operator. (https://bugs.webkit.org/show_bug.cgi?id=109098)

No new tests. No change in behavior. Just refactoring.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/IntRectExtent.h: Added.
(WebCore):
(IntRectExtent):
(WebCore::IntRectExtent::IntRectExtent):
(WebCore::IntRectExtent::top):
(WebCore::IntRectExtent::setTop):
(WebCore::IntRectExtent::right):
(WebCore::IntRectExtent::setRight):
(WebCore::IntRectExtent::bottom):
(WebCore::IntRectExtent::setBottom):
(WebCore::IntRectExtent::left):
(WebCore::IntRectExtent::setLeft):
(WebCore::IntRectExtent::expandRect):
(WebCore::IntRectExtent::isZero):
(WebCore::operator==):
(WebCore::operator!=):
(WebCore::operator+=):
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::outsets):
* platform/graphics/filters/FilterOperations.h:
(FilterOperations):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::intermediateSurfaceRect):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::FilterEffectRenderer):
(WebCore::FilterEffectRenderer::build):
(WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect):
* rendering/FilterEffectRenderer.h:
(FilterEffectRenderer):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
(WebCore::transparencyClipBox):
(WebCore::RenderLayer::calculateLayerBounds):
* rendering/style/RenderStyle.h:

Source/WebKit/chromium:

Update FilterOperations unit tests to use new interface for getting filter outsets.

Reviewed by Dean Jackson.

* tests/FilterOperationsTest.cpp:
(WebKit::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
getComputedStyle returns truncated value for margin-right
https://bugs.webkit.org/show_bug.cgi?id=109759

Source/WebCore:

Reviewed by Tony Chang.

Due to an unfortunate cast in CSSComputedStyleDeclaration::
getPropertyCSSValue getComputedStyle returns truncated styles
for margin-right in cases where it isn't set to a specific pixel
value.

Test: fast/sub-pixel/computedstylemargin.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
Change type of temporary value variable to float to prevent loss of precision.

LayoutTests:

Reviewed by Tony Chang.

Add test for getComputedStyle with fractional margin values.

* fast/sub-pixel/computedstylemargin-expected.txt: Added.
* fast/sub-pixel/computedstylemargin.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reschedule shared CFRunLoopTimer instead of reconstructing it
https://bugs.webkit.org/show_bug.cgi?id=109765

Reviewed by Andreas Kling and Anders Carlsson.

Using CFRunLoopTimerSetNextFireDate is over 2x faster than deleting and reconstructing timers.

* platform/mac/SharedTimerMac.mm:
(WebCore):
(WebCore::PowerObserver::restartSharedTimer):
(WebCore::sharedTimer):
(WebCore::setSharedTimerFireInterval):
(WebCore::stopSharedTimer):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stronger ElementData pointer typing.
<http://webkit.org/b/109752>

Reviewed by Antti Koivisto.

Use ShareableElementData/UniqueElementData pointers instead of generic ElementData pointers
where possible. Moved some methods from base class into leaf classes that don't make sense
for both classes.

* dom/DocumentSharedObjectPool.cpp:
(WebCore::ShareableElementDataCacheEntry::ShareableElementDataCacheEntry):
(ShareableElementDataCacheEntry):
(WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
* dom/DocumentSharedObjectPool.h:
(DocumentSharedObjectPool):
* dom/Element.cpp:
(WebCore::Element::parserSetAttributes):
(WebCore::Element::setAttributeNode):
(WebCore::Element::removeAttributeInternal):
(WebCore::Element::cloneAttributesFromElement):
(WebCore::Element::createUniqueElementData):
(WebCore::ShareableElementData::createWithAttributes):
(WebCore::UniqueElementData::create):
(WebCore::ElementData::makeUniqueCopy):
(WebCore::UniqueElementData::makeShareableCopy):
* dom/Element.h:
(ElementData):
(ShareableElementData):
(UniqueElementData):
(Element):
(WebCore::Element::ensureUniqueElementData):
* dom/StyledElement.cpp:
(WebCore::StyledElement::rebuildPresentationAttributeStyle):

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