| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return staticBasicQuotes; | 70 return staticBasicQuotes; |
| 71 } | 71 } |
| 72 | 72 |
| 73 PassRefPtr<StringImpl> RenderQuote::originalText() const | 73 PassRefPtr<StringImpl> RenderQuote::originalText() const |
| 74 { | 74 { |
| 75 switch (m_type) { | 75 switch (m_type) { |
| 76 case NO_OPEN_QUOTE: | 76 case NO_OPEN_QUOTE: |
| 77 case NO_CLOSE_QUOTE: | 77 case NO_CLOSE_QUOTE: |
| 78 return StringImpl::empty(); | 78 return StringImpl::empty(); |
| 79 case CLOSE_QUOTE: | 79 case CLOSE_QUOTE: |
| 80 // FIXME: When m_depth is 0 we should return empty string. | 80 return quotesData()->getCloseQuote(m_depth - 1).impl(); |
| 81 return quotesData()->getCloseQuote(std::max(m_depth - 1, 0)).impl(); | |
| 82 case OPEN_QUOTE: | 81 case OPEN_QUOTE: |
| 83 return quotesData()->getOpenQuote(m_depth).impl(); | 82 return quotesData()->getOpenQuote(m_depth).impl(); |
| 84 } | 83 } |
| 85 ASSERT_NOT_REACHED(); | 84 ASSERT_NOT_REACHED(); |
| 86 return StringImpl::empty(); | 85 return StringImpl::empty(); |
| 87 } | 86 } |
| 88 | 87 |
| 89 void RenderQuote::computePreferredLogicalWidths(float lead) | 88 void RenderQuote::computePreferredLogicalWidths(float lead) |
| 90 { | 89 { |
| 91 if (!m_attached) | 90 if (!m_attached) |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 195 } |
| 197 // FIXME: Don't call setNeedsLayout or dirty our preferred widths during lay
out. | 196 // FIXME: Don't call setNeedsLayout or dirty our preferred widths during lay
out. |
| 198 // This is likely to fail anyway as one of our ancestor will call setNeedsLa
yout(false), | 197 // This is likely to fail anyway as one of our ancestor will call setNeedsLa
yout(false), |
| 199 // preventing the future layout to occur on |this|. The solution is to move
that to a | 198 // preventing the future layout to occur on |this|. The solution is to move
that to a |
| 200 // pre-layout phase. | 199 // pre-layout phase. |
| 201 if (oldDepth != m_depth) | 200 if (oldDepth != m_depth) |
| 202 setNeedsLayoutAndPrefWidthsRecalc(); | 201 setNeedsLayoutAndPrefWidthsRecalc(); |
| 203 } | 202 } |
| 204 | 203 |
| 205 } // namespace WebCore | 204 } // namespace WebCore |
| OLD | NEW |