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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutDetailsMarker.cpp

Issue 2614883007: Change computed style enums to be prefixed with 'k'. (Closed)
Patch Set: Rebase on ToT. Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2010, 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 16 matching lines...) Expand all
27 27
28 namespace blink { 28 namespace blink {
29 29
30 using namespace HTMLNames; 30 using namespace HTMLNames;
31 31
32 LayoutDetailsMarker::LayoutDetailsMarker(Element* element) 32 LayoutDetailsMarker::LayoutDetailsMarker(Element* element)
33 : LayoutBlockFlow(element) {} 33 : LayoutBlockFlow(element) {}
34 34
35 LayoutDetailsMarker::Orientation LayoutDetailsMarker::getOrientation() const { 35 LayoutDetailsMarker::Orientation LayoutDetailsMarker::getOrientation() const {
36 switch (style()->getWritingMode()) { 36 switch (style()->getWritingMode()) {
37 case WritingMode::HorizontalTb: 37 case WritingMode::kHorizontalTb:
38 if (style()->isLeftToRightDirection()) 38 if (style()->isLeftToRightDirection())
39 return isOpen() ? Down : Right; 39 return isOpen() ? Down : Right;
40 return isOpen() ? Down : Left; 40 return isOpen() ? Down : Left;
41 case WritingMode::VerticalRl: 41 case WritingMode::kVerticalRl:
42 if (style()->isLeftToRightDirection()) 42 if (style()->isLeftToRightDirection())
43 return isOpen() ? Left : Down; 43 return isOpen() ? Left : Down;
44 return isOpen() ? Left : Up; 44 return isOpen() ? Left : Up;
45 case WritingMode::VerticalLr: 45 case WritingMode::kVerticalLr:
46 if (style()->isLeftToRightDirection()) 46 if (style()->isLeftToRightDirection())
47 return isOpen() ? Right : Down; 47 return isOpen() ? Right : Down;
48 return isOpen() ? Right : Up; 48 return isOpen() ? Right : Up;
49 } 49 }
50 ASSERT_NOT_REACHED(); 50 ASSERT_NOT_REACHED();
51 return Right; 51 return Right;
52 } 52 }
53 53
54 void LayoutDetailsMarker::paint(const PaintInfo& paintInfo, 54 void LayoutDetailsMarker::paint(const PaintInfo& paintInfo,
55 const LayoutPoint& paintOffset) const { 55 const LayoutPoint& paintOffset) const {
56 DetailsMarkerPainter(*this).paint(paintInfo, paintOffset); 56 DetailsMarkerPainter(*this).paint(paintInfo, paintOffset);
57 } 57 }
58 58
59 bool LayoutDetailsMarker::isOpen() const { 59 bool LayoutDetailsMarker::isOpen() const {
60 for (LayoutObject* layoutObject = parent(); layoutObject; 60 for (LayoutObject* layoutObject = parent(); layoutObject;
61 layoutObject = layoutObject->parent()) { 61 layoutObject = layoutObject->parent()) {
62 if (!layoutObject->node()) 62 if (!layoutObject->node())
63 continue; 63 continue;
64 if (isHTMLDetailsElement(*layoutObject->node())) 64 if (isHTMLDetailsElement(*layoutObject->node()))
65 return !toElement(layoutObject->node())->getAttribute(openAttr).isNull(); 65 return !toElement(layoutObject->node())->getAttribute(openAttr).isNull();
66 if (isHTMLInputElement(*layoutObject->node())) 66 if (isHTMLInputElement(*layoutObject->node()))
67 return true; 67 return true;
68 } 68 }
69 69
70 return false; 70 return false;
71 } 71 }
72 72
73 } // namespace blink 73 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698