diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/RenderDetailsMarker.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/rendering/RenderDetailsMarker.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderDetailsMarker.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Source/WebCore/rendering/RenderDetailsMarker.cpp b/Source/WebCore/rendering/RenderDetailsMarker.cpp index 455d797b7..a17851c31 100644 --- a/Source/WebCore/rendering/RenderDetailsMarker.cpp +++ b/Source/WebCore/rendering/RenderDetailsMarker.cpp @@ -19,11 +19,11 @@ */ #include "config.h" -#if ENABLE(DETAILS_ELEMENT) #include "RenderDetailsMarker.h" #include "Element.h" #include "GraphicsContext.h" +#include "HTMLDetailsElement.h" #include "HTMLInputElement.h" #include "HTMLNames.h" #include "PaintInfo.h" @@ -32,8 +32,8 @@ namespace WebCore { using namespace HTMLNames; -RenderDetailsMarker::RenderDetailsMarker(DetailsMarkerControl& element, PassRef<RenderStyle> style) - : RenderBlockFlow(element, std::move(style)) +RenderDetailsMarker::RenderDetailsMarker(DetailsMarkerControl& element, RenderStyle&& style) + : RenderBlockFlow(element, WTFMove(style)) { } @@ -123,19 +123,18 @@ void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOf LayoutPoint boxOrigin(paintOffset + location()); LayoutRect overflowRect(visualOverflowRect()); overflowRect.moveBy(boxOrigin); - overflowRect.inflate(maximalOutlineSize(paintInfo.phase)); - if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) + if (!paintInfo.rect.intersects(snappedIntRect(overflowRect))) return; const Color color(style().visitedDependentColor(CSSPropertyColor)); - paintInfo.context->setStrokeColor(color, style().colorSpace()); - paintInfo.context->setStrokeStyle(SolidStroke); - paintInfo.context->setStrokeThickness(1.0f); - paintInfo.context->setFillColor(color, style().colorSpace()); + paintInfo.context().setStrokeColor(color); + paintInfo.context().setStrokeStyle(SolidStroke); + paintInfo.context().setStrokeThickness(1.0f); + paintInfo.context().setFillColor(color); boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop()); - paintInfo.context->fillPath(getPath(boxOrigin)); + paintInfo.context().fillPath(getPath(boxOrigin)); } bool RenderDetailsMarker::isOpen() const @@ -143,9 +142,9 @@ bool RenderDetailsMarker::isOpen() const for (RenderObject* renderer = parent(); renderer; renderer = renderer->parent()) { if (!renderer->node()) continue; - if (renderer->node()->hasTagName(detailsTag)) - return !toElement(renderer->node())->getAttribute(openAttr).isNull(); - if (isHTMLInputElement(renderer->node())) + if (is<HTMLDetailsElement>(*renderer->node())) + return !downcast<HTMLDetailsElement>(*renderer->node()).attributeWithoutSynchronization(openAttr).isNull(); + if (is<HTMLInputElement>(*renderer->node())) return true; } @@ -153,5 +152,3 @@ bool RenderDetailsMarker::isOpen() const } } - -#endif |