| OLD | NEW |
| 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 Loading... |
| 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 TopToBottomWritingMode: | 37 case WritingMode::HorizontalTb: |
| 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 RightToLeftWritingMode: | 41 case WritingMode::VerticalRl: |
| 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 LeftToRightWritingMode: | 45 case WritingMode::VerticalLr: |
| 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 |
| OLD | NEW |