HTML5 <details> and <summary>: rendering
[WebKit-https.git] / Source / WebCore / ChangeLog
index 7465c4f..ddf9274 100644 (file)
@@ -1,3 +1,147 @@
+2011-02-28  Luiz Agostini  <luiz.agostini@openbossa.org>
+
+        Reviewed by Dave Hyatt.
+
+        HTML5 <details> and <summary>: rendering
+        https://bugs.webkit.org/show_bug.cgi?id=51071
+
+        Tests: fast/html/details-add-summary-1-and-click.html
+               fast/html/details-add-summary-1.html
+               fast/html/details-add-summary-10-and-click.html
+               fast/html/details-add-summary-10.html
+               fast/html/details-add-summary-2-and-click.html
+               fast/html/details-add-summary-2.html
+               fast/html/details-add-summary-3-and-click.html
+               fast/html/details-add-summary-3.html
+               fast/html/details-add-summary-4-and-click.html
+               fast/html/details-add-summary-4.html
+               fast/html/details-add-summary-5-and-click.html
+               fast/html/details-add-summary-5.html
+               fast/html/details-add-summary-6-and-click.html
+               fast/html/details-add-summary-6.html
+               fast/html/details-add-summary-7-and-click.html
+               fast/html/details-add-summary-7.html
+               fast/html/details-add-summary-8-and-click.html
+               fast/html/details-add-summary-8.html
+               fast/html/details-add-summary-9-and-click.html
+               fast/html/details-add-summary-9.html
+               fast/html/details-mouse-click.html
+               fast/html/details-no-summary1.html
+               fast/html/details-no-summary2.html
+               fast/html/details-no-summary3.html
+               fast/html/details-no-summary4.html
+               fast/html/details-open-javascript.html
+               fast/html/details-open1.html
+               fast/html/details-open2.html
+               fast/html/details-open3.html
+               fast/html/details-open4.html
+               fast/html/details-open5.html
+               fast/html/details-open6.html
+               fast/html/details-position.html
+               fast/html/details-remove-summary-1-and-click.html
+               fast/html/details-remove-summary-1.html
+               fast/html/details-remove-summary-2-and-click.html
+               fast/html/details-remove-summary-2.html
+               fast/html/details-remove-summary-3-and-click.html
+               fast/html/details-remove-summary-3.html
+               fast/html/details-remove-summary-4-and-click.html
+               fast/html/details-remove-summary-4.html
+               fast/html/details-remove-summary-5-and-click.html
+               fast/html/details-remove-summary-5.html
+               fast/html/details-remove-summary-6-and-click.html
+               fast/html/details-remove-summary-6.html
+               fast/html/details-writing-mode.html
+
+        http://www.w3.org/TR/html5/interactive-elements.html#the-details-element
+
+        The main <summary> element is the first <summary> element of a <details> element.
+        All other childs of the <details> element are rendered only if the attribute 'open' is set.
+        Click event toggles the 'open' attribute.
+
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::HTMLDetailsElement::HTMLDetailsElement):
+        (WebCore::HTMLDetailsElement::findMainSummary):
+        (WebCore::HTMLDetailsElement::childrenChanged):
+        (WebCore::HTMLDetailsElement::finishParsingChildren):
+        (WebCore::HTMLDetailsElement::parseMappedAttribute):
+        (WebCore::HTMLDetailsElement::childShouldCreateRenderer):
+        (WebCore::HTMLDetailsElement::defaultEventHandler):
+        * html/HTMLDetailsElement.h:
+        (WebCore::HTMLDetailsElement::mainSummary):
+
+        Method createRenderer added to class HTMLSummaryElement.
+
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::HTMLSummaryElement::createRenderer):
+        * html/HTMLSummaryElement.h:
+
+        The first <summary> element is positioned at the top of its <details> parent.
+        The area occupied by this main <summary> element is the interactive area of the
+        <details> element. If the <details> tag has no <summary> child an OwnedSummaryRenderer
+        is created and added to the corresponding RenderDetails object.
+
+        * rendering/RenderDetails.cpp:
+        (WebCore::RenderDetails::RenderDetails):
+        (WebCore::RenderDetails::destroy):
+        (WebCore::RenderDetails::summaryBlock):
+        (WebCore::RenderDetails::contentBlock):
+        (WebCore::RenderDetails::addChild):
+        (WebCore::RenderDetails::removeChild):
+        (WebCore::RenderDetails::setMarkerStyle):
+        (WebCore::RenderDetails::styleDidChange):
+        (WebCore::RenderDetails::getRenderPosition):
+        (WebCore::RenderDetails::markerDestroyed):
+        (WebCore::RenderDetails::summaryDestroyed):
+        (WebCore::RenderDetails::moveSummaryToContents):
+        (WebCore::RenderDetails::createSummaryStyle):
+        (WebCore::RenderDetails::replaceMainSummary):
+        (WebCore::RenderDetails::createDefaultSummary):
+        (WebCore::RenderDetails::checkMainSummary):
+        (WebCore::RenderDetails::layout):
+        (WebCore::RenderDetails::isOpen):
+        (WebCore::RenderDetails::getParentOfFirstLineBox):
+        (WebCore::RenderDetails::firstNonMarkerChild):
+        (WebCore::RenderDetails::updateMarkerLocation):
+        * rendering/RenderDetails.h:
+        (WebCore::RenderDetails::interactiveArea):
+        (WebCore::RenderDetails::removeLeftoverAnonymousBlock):
+        (WebCore::RenderDetails::createsAnonymousWrapper):
+        (WebCore::RenderDetails::requiresForcedStyleRecalcPropagation):
+
+        A marker is added to the main <summary> element to indicate the current value of the 'open'
+        attribute of the <details> element.
+
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::RenderDetailsMarker):
+        (WebCore::RenderDetailsMarker::destroy):
+        (WebCore::RenderDetailsMarker::lineHeight):
+        (WebCore::RenderDetailsMarker::baselinePosition):
+        (WebCore::RenderDetailsMarker::computePreferredLogicalWidths):
+        (WebCore::RenderDetailsMarker::layout):
+        (WebCore::RenderDetailsMarker::getRelativeMarkerRect):
+        (WebCore::RenderDetailsMarker::isOpen):
+        (WebCore::createPath):
+        (WebCore::createDownArrowPath):
+        (WebCore::createUpArrowPath):
+        (WebCore::createLeftArrowPath):
+        (WebCore::createRightArrowPath):
+        (WebCore::RenderDetailsMarker::orientation):
+        (WebCore::RenderDetailsMarker::getCanonicalPath):
+        (WebCore::RenderDetailsMarker::getPath):
+        (WebCore::RenderDetailsMarker::paint):
+        * rendering/RenderDetailsMarker.h:
+        (WebCore::toRenderDetailsMarker):
+
+        * rendering/RenderSummary.cpp:
+        (WebCore::RenderSummary::RenderSummary):
+        (WebCore::RenderSummary::destroy):
+        (WebCore::RenderSummary::parentDetails):
+        (WebCore::RenderSummary::styleDidChange):
+        * rendering/RenderSummary.h:
+
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::RenderTreeAsText::writeRenderObject):
+
 2011-03-14  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Sam Weinig.