Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp

Issue 2373963002: Support display:flex for 'summary' (Closed)
Patch Set: Support display flex/inline-flex/grid/inline-grid for summary Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/summary-display-inline-grid-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 26 matching lines...) Expand all
37 37
38 HTMLSummaryElement* HTMLSummaryElement::create(Document& document) { 38 HTMLSummaryElement* HTMLSummaryElement::create(Document& document) {
39 HTMLSummaryElement* summary = new HTMLSummaryElement(document); 39 HTMLSummaryElement* summary = new HTMLSummaryElement(document);
40 summary->ensureUserAgentShadowRoot(); 40 summary->ensureUserAgentShadowRoot();
41 return summary; 41 return summary;
42 } 42 }
43 43
44 HTMLSummaryElement::HTMLSummaryElement(Document& document) 44 HTMLSummaryElement::HTMLSummaryElement(Document& document)
45 : HTMLElement(summaryTag, document) {} 45 : HTMLElement(summaryTag, document) {}
46 46
47 LayoutObject* HTMLSummaryElement::createLayoutObject(const ComputedStyle&) { 47 LayoutObject* HTMLSummaryElement::createLayoutObject(
48 const ComputedStyle& style) {
49 EDisplay display = style.display();
50 if (display == EDisplay::Flex || display == EDisplay::InlineFlex ||
51 display == EDisplay::Grid || display == EDisplay::InlineGrid)
52 return LayoutObject::createObject(this, style);
48 return new LayoutBlockFlow(this); 53 return new LayoutBlockFlow(this);
49 } 54 }
50 55
51 void HTMLSummaryElement::didAddUserAgentShadowRoot(ShadowRoot& root) { 56 void HTMLSummaryElement::didAddUserAgentShadowRoot(ShadowRoot& root) {
52 DetailsMarkerControl* markerControl = 57 DetailsMarkerControl* markerControl =
53 DetailsMarkerControl::create(document()); 58 DetailsMarkerControl::create(document());
54 markerControl->setIdAttribute(ShadowElementNames::detailsMarker()); 59 markerControl->setIdAttribute(ShadowElementNames::detailsMarker());
55 root.appendChild(markerControl); 60 root.appendChild(markerControl);
56 root.appendChild(HTMLContentElement::create(document())); 61 root.appendChild(HTMLContentElement::create(document()));
57 } 62 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 140 }
136 141
137 bool HTMLSummaryElement::willRespondToMouseClickEvents() { 142 bool HTMLSummaryElement::willRespondToMouseClickEvents() {
138 if (isMainSummary() && layoutObject()) 143 if (isMainSummary() && layoutObject())
139 return true; 144 return true;
140 145
141 return HTMLElement::willRespondToMouseClickEvents(); 146 return HTMLElement::willRespondToMouseClickEvents();
142 } 147 }
143 148
144 } // namespace blink 149 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/summary-display-inline-grid-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698