2011-04-15 MORITA Hajime <morrita@google.com>
Reviewed by Dimitri Glazkov.
RenderDetailsMarker should belong to shadow element.
https://bugs.webkit.org/show_bug.cgi?id=58591
* Render tree structure has changed.
* Changed style rule on details-writing-mode.html to avoid to hit shadow CSS leak bug.
* fast/html/details-writing-mode.html:
* platform/chromium/test_expectations.txt:
* platform/mac/fast/html/details-add-summary-1-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-1-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-1-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-1-expected.checksum:
* platform/mac/fast/html/details-add-summary-1-expected.png:
* platform/mac/fast/html/details-add-summary-1-expected.txt:
* platform/mac/fast/html/details-add-summary-10-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-10-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-10-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-10-expected.checksum:
* platform/mac/fast/html/details-add-summary-10-expected.png:
* platform/mac/fast/html/details-add-summary-10-expected.txt:
* platform/mac/fast/html/details-add-summary-2-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-2-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-2-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-2-expected.checksum:
* platform/mac/fast/html/details-add-summary-2-expected.png:
* platform/mac/fast/html/details-add-summary-2-expected.txt:
* platform/mac/fast/html/details-add-summary-3-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-3-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-3-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-3-expected.checksum:
* platform/mac/fast/html/details-add-summary-3-expected.png:
* platform/mac/fast/html/details-add-summary-3-expected.txt:
* platform/mac/fast/html/details-add-summary-4-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-4-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-4-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-4-expected.checksum:
* platform/mac/fast/html/details-add-summary-4-expected.png:
* platform/mac/fast/html/details-add-summary-4-expected.txt:
* platform/mac/fast/html/details-add-summary-5-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-5-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-5-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-5-expected.checksum:
* platform/mac/fast/html/details-add-summary-5-expected.png:
* platform/mac/fast/html/details-add-summary-5-expected.txt:
* platform/mac/fast/html/details-add-summary-6-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-6-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-6-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-6-expected.checksum:
* platform/mac/fast/html/details-add-summary-6-expected.png:
* platform/mac/fast/html/details-add-summary-6-expected.txt:
* platform/mac/fast/html/details-add-summary-7-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-7-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-7-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-7-expected.checksum:
* platform/mac/fast/html/details-add-summary-7-expected.png:
* platform/mac/fast/html/details-add-summary-7-expected.txt:
* platform/mac/fast/html/details-add-summary-8-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-8-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-8-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-8-expected.checksum:
* platform/mac/fast/html/details-add-summary-8-expected.png:
* platform/mac/fast/html/details-add-summary-8-expected.txt:
* platform/mac/fast/html/details-add-summary-9-and-click-expected.checksum:
* platform/mac/fast/html/details-add-summary-9-and-click-expected.png:
* platform/mac/fast/html/details-add-summary-9-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-9-expected.checksum:
* platform/mac/fast/html/details-add-summary-9-expected.png:
* platform/mac/fast/html/details-add-summary-9-expected.txt:
* platform/mac/fast/html/details-no-summary1-expected.checksum:
* platform/mac/fast/html/details-no-summary1-expected.png:
* platform/mac/fast/html/details-no-summary1-expected.txt:
* platform/mac/fast/html/details-no-summary2-expected.checksum:
* platform/mac/fast/html/details-no-summary2-expected.png:
* platform/mac/fast/html/details-no-summary2-expected.txt:
* platform/mac/fast/html/details-no-summary3-expected.checksum:
* platform/mac/fast/html/details-no-summary3-expected.png:
* platform/mac/fast/html/details-no-summary3-expected.txt:
* platform/mac/fast/html/details-no-summary4-expected.checksum:
* platform/mac/fast/html/details-no-summary4-expected.png:
* platform/mac/fast/html/details-no-summary4-expected.txt:
* platform/mac/fast/html/details-open-javascript-expected.checksum:
* platform/mac/fast/html/details-open-javascript-expected.png:
* platform/mac/fast/html/details-open-javascript-expected.txt:
* platform/mac/fast/html/details-open1-expected.checksum:
* platform/mac/fast/html/details-open1-expected.png:
* platform/mac/fast/html/details-open1-expected.txt:
* platform/mac/fast/html/details-open2-expected.checksum:
* platform/mac/fast/html/details-open2-expected.png:
* platform/mac/fast/html/details-open2-expected.txt:
* platform/mac/fast/html/details-open3-expected.checksum:
* platform/mac/fast/html/details-open3-expected.png:
* platform/mac/fast/html/details-open3-expected.txt:
* platform/mac/fast/html/details-open4-expected.checksum:
* platform/mac/fast/html/details-open4-expected.png:
* platform/mac/fast/html/details-open4-expected.txt:
* platform/mac/fast/html/details-open5-expected.checksum:
* platform/mac/fast/html/details-open5-expected.png:
* platform/mac/fast/html/details-open5-expected.txt:
* platform/mac/fast/html/details-open6-expected.checksum:
* platform/mac/fast/html/details-open6-expected.png:
* platform/mac/fast/html/details-open6-expected.txt:
* platform/mac/fast/html/details-position-expected.checksum:
* platform/mac/fast/html/details-position-expected.png:
* platform/mac/fast/html/details-position-expected.txt:
* platform/mac/fast/html/details-remove-summary-1-and-click-expected.checksum:
* platform/mac/fast/html/details-remove-summary-1-and-click-expected.png:
* platform/mac/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-1-expected.checksum:
* platform/mac/fast/html/details-remove-summary-1-expected.png:
* platform/mac/fast/html/details-remove-summary-1-expected.txt:
* platform/mac/fast/html/details-remove-summary-2-and-click-expected.checksum:
* platform/mac/fast/html/details-remove-summary-2-and-click-expected.png:
* platform/mac/fast/html/details-remove-summary-2-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-2-expected.checksum:
* platform/mac/fast/html/details-remove-summary-2-expected.png:
* platform/mac/fast/html/details-remove-summary-2-expected.txt:
* platform/mac/fast/html/details-remove-summary-3-and-click-expected.checksum:
* platform/mac/fast/html/details-remove-summary-3-and-click-expected.png:
* platform/mac/fast/html/details-remove-summary-3-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-3-expected.checksum:
* platform/mac/fast/html/details-remove-summary-3-expected.png:
* platform/mac/fast/html/details-remove-summary-3-expected.txt:
* platform/mac/fast/html/details-remove-summary-4-and-click-expected.checksum:
* platform/mac/fast/html/details-remove-summary-4-and-click-expected.png:
* platform/mac/fast/html/details-remove-summary-4-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-4-expected.checksum:
* platform/mac/fast/html/details-remove-summary-4-expected.png:
* platform/mac/fast/html/details-remove-summary-4-expected.txt:
* platform/mac/fast/html/details-remove-summary-5-and-click-expected.checksum:
* platform/mac/fast/html/details-remove-summary-5-and-click-expected.png:
* platform/mac/fast/html/details-remove-summary-5-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-5-expected.checksum:
* platform/mac/fast/html/details-remove-summary-5-expected.png:
* platform/mac/fast/html/details-remove-summary-5-expected.txt:
* platform/mac/fast/html/details-remove-summary-6-and-click-expected.checksum:
* platform/mac/fast/html/details-remove-summary-6-and-click-expected.png:
* platform/mac/fast/html/details-remove-summary-6-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-6-expected.checksum:
* platform/mac/fast/html/details-remove-summary-6-expected.png:
* platform/mac/fast/html/details-remove-summary-6-expected.txt:
* platform/mac/fast/html/details-writing-mode-expected.checksum:
* platform/mac/fast/html/details-writing-mode-expected.png:
* platform/mac/fast/html/details-writing-mode-expected.txt:
2011-04-15 MORITA Hajime <morrita@google.com>
Reviewed by Dimitri Glazkov.
RenderDetailsMarker should belong to shadow element.
https://bugs.webkit.org/show_bug.cgi?id=58591
- Introduced DetailsMarkerControl element, which is a shadow element of <summary>, creates RenderDetailsMarker.
- Removed custom layout code from RenderDetails, RenderDetailsMarker, which is now done by usual CSS layout.
Note that marker size is given via style for -webkit-details-marker pseudo class.
- Converted default summary implementation from pure-renderer style to shadow of HTMLDetailsElement.
Now RenderDetails knows nothing about default summary.
- Moved event handling code from HTMLDetailsElement to HTMLSummaryElement because now the marker is always child of
<summary>, and the clickable area is now <summary> itself.
- Note that the rendering result is changed due to the conversion from custom layout code to usual CSS styling.
* Android.mk:
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/html.css:
(summary::-webkit-details-marker):
* dom/Element.cpp:
(WebCore::Element::attach):
* dom/Node.cpp:
(WebCore::shouldCreateRendererFor):
* dom/Node.h:
(WebCore::Node::canHaveLightChildRendererWithShadow):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::findSummaryFor):
(WebCore::HTMLDetailsElement::findMainSummary):
(WebCore::HTMLDetailsElement::refreshMainSummary):
(WebCore::HTMLDetailsElement::createShadowSubtree):
(WebCore::HTMLDetailsElement::childrenChanged):
(WebCore::HTMLDetailsElement::finishParsingChildren):
(WebCore::HTMLDetailsElement::toggleOpen):
* html/HTMLDetailsElement.h:
(WebCore::HTMLDetailsElement::canHaveLightChildRendererWithShadow):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::create):
(WebCore::HTMLSummaryElement::createShadowSubtree):
(WebCore::HTMLSummaryElement::detailsElement):
(WebCore::HTMLSummaryElement::isMainSummary):
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLSummaryElement.h:
(WebCore::HTMLSummaryElement::canHaveLightChildRendererWithShadow):
* html/shadow/DetailsMarkerControl.cpp: Added.
(WebCore::DetailsMarkerControl::DetailsMarkerControl):
(WebCore::DetailsMarkerControl::createRenderer):
(WebCore::DetailsMarkerControl::rendererIsNeeded):
(WebCore::DetailsMarkerControl::shadowPseudoId):
(WebCore::DetailsMarkerControl::summaryElement):
* html/shadow/DetailsMarkerControl.h: Added.
(WebCore::DetailsMarkerControl::create):
* rendering/RenderDetails.cpp:
(WebCore::RenderDetails::RenderDetails):
(WebCore::RenderDetails::styleDidChange):
(WebCore::RenderDetails::moveSummaryToContents):
(WebCore::RenderDetails::checkMainSummary):
(WebCore::RenderDetails::layout):
* rendering/RenderDetails.h:
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::RenderDetailsMarker):
(WebCore::RenderDetailsMarker::isOpen):
(WebCore::RenderDetailsMarker::getPath):
(WebCore::RenderDetailsMarker::paint):
(WebCore::RenderDetailsMarker::details):
* rendering/RenderDetailsMarker.h:
git-svn-id: svn://svn.chromium.org/blink/trunk@84039 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/Source/WebCore/css/html.css b/Source/WebCore/css/html.css
index 8ef2bce..ecbaef9 100644
--- a/Source/WebCore/css/html.css
+++ b/Source/WebCore/css/html.css
@@ -887,6 +887,13 @@
display: block
}
+summary::-webkit-details-marker {
+ display: inline-block;
+ width: 0.66em;
+ height: 0.66em;
+ margin-right: 0.4em;
+}
+
/* page */
@page {