OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
871 return true; | 871 return true; |
872 } | 872 } |
873 | 873 |
874 int AXNodeObject::headingLevel() const | 874 int AXNodeObject::headingLevel() const |
875 { | 875 { |
876 // headings can be in block flow and non-block flow | 876 // headings can be in block flow and non-block flow |
877 Node* node = this->node(); | 877 Node* node = this->node(); |
878 if (!node) | 878 if (!node) |
879 return 0; | 879 return 0; |
880 | 880 |
881 if (roleValue() == HeadingRole && hasAttribute(aria_levelAttr)) | 881 if (roleValue() == HeadingRole && hasAttribute(aria_levelAttr) |
882 && getAttribute(aria_levelAttr).toInt() <= 9) | |
dmazzoni
2014/12/04 08:26:31
This still allows 0 and negative numbers. I'd asse
| |
882 return getAttribute(aria_levelAttr).toInt(); | 883 return getAttribute(aria_levelAttr).toInt(); |
883 | 884 |
884 if (!node->isHTMLElement()) | 885 if (!node->isHTMLElement()) |
885 return 0; | 886 return 0; |
886 | 887 |
887 HTMLElement& element = toHTMLElement(*node); | 888 HTMLElement& element = toHTMLElement(*node); |
888 if (element.hasTagName(h1Tag)) | 889 if (element.hasTagName(h1Tag)) |
889 return 1; | 890 return 1; |
890 | 891 |
891 if (element.hasTagName(h2Tag)) | 892 if (element.hasTagName(h2Tag)) |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1820 float range = maxValueForRange() - minValueForRange(); | 1821 float range = maxValueForRange() - minValueForRange(); |
1821 float value = valueForRange(); | 1822 float value = valueForRange(); |
1822 | 1823 |
1823 value += range * (percentChange / 100); | 1824 value += range * (percentChange / 100); |
1824 setValue(String::number(value)); | 1825 setValue(String::number(value)); |
1825 | 1826 |
1826 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); | 1827 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); |
1827 } | 1828 } |
1828 | 1829 |
1829 } // namespace blink | 1830 } // namespace blink |
OLD | NEW |