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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h

Issue 1681273003: Add CSS parser support for break-after, break-before and break-inside. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master Created 4 years, 10 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) 2007 Alexey Proskuryakov <ap@nypop.com>. 2 * Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 4 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 5 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 case CSSValueWebkitPagedY: 1748 case CSSValueWebkitPagedY:
1749 return OPAGEDY; 1749 return OPAGEDY;
1750 default: 1750 default:
1751 break; 1751 break;
1752 } 1752 }
1753 1753
1754 ASSERT_NOT_REACHED(); 1754 ASSERT_NOT_REACHED();
1755 return OVISIBLE; 1755 return OVISIBLE;
1756 } 1756 }
1757 1757
1758 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e) 1758 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EBreak e)
1759 : CSSValue(PrimitiveClass) 1759 : CSSValue(PrimitiveClass)
1760 { 1760 {
1761 init(UnitType::ValueID); 1761 init(UnitType::ValueID);
1762 switch (e) { 1762 switch (e) {
1763 case PBAUTO: 1763 default:
1764 ASSERT_NOT_REACHED();
1765 case BreakAuto:
1764 m_value.valueID = CSSValueAuto; 1766 m_value.valueID = CSSValueAuto;
1765 break; 1767 break;
1766 case PBALWAYS: 1768 case BreakAlways:
1767 m_value.valueID = CSSValueAlways; 1769 m_value.valueID = CSSValueAlways;
1768 break; 1770 break;
1769 case PBAVOID: 1771 case BreakAvoid:
1770 m_value.valueID = CSSValueAvoid; 1772 m_value.valueID = CSSValueAvoid;
1771 break; 1773 break;
1774 case BreakAvoidPage:
1775 m_value.valueID = CSSValueAvoidPage;
1776 break;
1777 case BreakPage:
1778 m_value.valueID = CSSValuePage;
1779 break;
1780 case BreakLeft:
1781 m_value.valueID = CSSValueLeft;
1782 break;
1783 case BreakRight:
1784 m_value.valueID = CSSValueRight;
1785 break;
1786 case BreakRecto:
1787 m_value.valueID = CSSValueRecto;
1788 break;
1789 case BreakVerso:
1790 m_value.valueID = CSSValueVerso;
1791 break;
1792 case BreakAvoidColumn:
1793 m_value.valueID = CSSValueAvoidColumn;
1794 break;
1795 case BreakColumn:
1796 m_value.valueID = CSSValueColumn;
1797 break;
1772 } 1798 }
1773 } 1799 }
1774 1800
1775 template<> inline EPageBreak CSSPrimitiveValue::convertTo() const 1801 template<> inline EBreak CSSPrimitiveValue::convertTo() const
1776 { 1802 {
1777 ASSERT(isValueID()); 1803 ASSERT(isValueID());
1778 switch (m_value.valueID) { 1804 switch (m_value.valueID) {
1805 default:
1806 ASSERT_NOT_REACHED();
1779 case CSSValueAuto: 1807 case CSSValueAuto:
1780 return PBAUTO; 1808 return BreakAuto;
1809 case CSSValueAvoid:
1810 return BreakAvoid;
1811 case CSSValueAlways:
1812 return BreakAlways;
1813 case CSSValueAvoidPage:
1814 return BreakAvoidPage;
1815 case CSSValuePage:
1816 return BreakPage;
1781 case CSSValueLeft: 1817 case CSSValueLeft:
1818 return BreakLeft;
1782 case CSSValueRight: 1819 case CSSValueRight:
1783 case CSSValueAlways: 1820 return BreakRight;
1784 return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right t o always." 1821 case CSSValueRecto:
1785 case CSSValueAvoid: 1822 return BreakRecto;
1786 return PBAVOID; 1823 case CSSValueVerso:
1787 default: 1824 return BreakVerso;
1788 break; 1825 case CSSValueAvoidColumn:
1826 return BreakAvoidColumn;
1827 case CSSValueColumn:
1828 return BreakColumn;
1789 } 1829 }
1790
1791 ASSERT_NOT_REACHED();
1792 return PBAUTO;
1793 } 1830 }
1794 1831
1795 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e) 1832 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)
1796 : CSSValue(PrimitiveClass) 1833 : CSSValue(PrimitiveClass)
1797 { 1834 {
1798 init(UnitType::ValueID); 1835 init(UnitType::ValueID);
1799 switch (e) { 1836 switch (e) {
1800 case StaticPosition: 1837 case StaticPosition:
1801 m_value.valueID = CSSValueStatic; 1838 m_value.valueID = CSSValueStatic;
1802 break; 1839 break;
(...skipping 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after
4627 default: 4664 default:
4628 break; 4665 break;
4629 } 4666 }
4630 ASSERT_NOT_REACHED(); 4667 ASSERT_NOT_REACHED();
4631 return ContainsNone; 4668 return ContainsNone;
4632 } 4669 }
4633 4670
4634 } // namespace blink 4671 } // namespace blink
4635 4672
4636 #endif 4673 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698