| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
| 8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #include "AXObjectCache.h" | 32 #include "AXObjectCache.h" |
| 33 #include "BeforeTextInsertedEvent.h" | 33 #include "BeforeTextInsertedEvent.h" |
| 34 #include "CSSPropertyNames.h" | 34 #include "CSSPropertyNames.h" |
| 35 #include "CSSValueKeywords.h" | 35 #include "CSSValueKeywords.h" |
| 36 #include "DateTimeChooser.h" | 36 #include "DateTimeChooser.h" |
| 37 #include "Document.h" | 37 #include "Document.h" |
| 38 #include "ElementShadow.h" | 38 #include "ElementShadow.h" |
| 39 #include "EventNames.h" | 39 #include "EventNames.h" |
| 40 #include "ExceptionCode.h" | 40 #include "ExceptionCode.h" |
| 41 #include "FeatureObserver.h" | 41 #include "UseCounter.h" |
| 42 #include "FileInputType.h" | 42 #include "FileInputType.h" |
| 43 #include "FileList.h" | 43 #include "FileList.h" |
| 44 #include "FormController.h" | 44 #include "FormController.h" |
| 45 #include "Frame.h" | 45 #include "Frame.h" |
| 46 #include "FrameView.h" | 46 #include "FrameView.h" |
| 47 #include "HTMLCollection.h" | 47 #include "HTMLCollection.h" |
| 48 #include "HTMLDataListElement.h" | 48 #include "HTMLDataListElement.h" |
| 49 #include "HTMLFormElement.h" | 49 #include "HTMLFormElement.h" |
| 50 #include "HTMLImageLoader.h" | 50 #include "HTMLImageLoader.h" |
| 51 #include "HTMLNames.h" | 51 #include "HTMLNames.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 // Search field and slider attributes all just cause updateFromElement t
o be called through style recalcing. | 689 // Search field and slider attributes all just cause updateFromElement t
o be called through style recalcing. |
| 690 setAttributeEventListener(eventNames().searchEvent, createAttributeEvent
Listener(this, name, value)); | 690 setAttributeEventListener(eventNames().searchEvent, createAttributeEvent
Listener(this, name, value)); |
| 691 } else if (name == resultsAttr) { | 691 } else if (name == resultsAttr) { |
| 692 int oldResults = m_maxResults; | 692 int oldResults = m_maxResults; |
| 693 m_maxResults = !value.isNull() ? std::min(value.toInt(), maxSavedResults
) : -1; | 693 m_maxResults = !value.isNull() ? std::min(value.toInt(), maxSavedResults
) : -1; |
| 694 // FIXME: Detaching just for maxResults change is not ideal. We should
figure out the right | 694 // FIXME: Detaching just for maxResults change is not ideal. We should
figure out the right |
| 695 // time to relayout for this change. | 695 // time to relayout for this change. |
| 696 if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0)
) | 696 if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0)
) |
| 697 reattachIfAttached(); | 697 reattachIfAttached(); |
| 698 setNeedsStyleRecalc(); | 698 setNeedsStyleRecalc(); |
| 699 FeatureObserver::observe(document(), FeatureObserver::ResultsAttribute); | 699 UseCounter::observe(document(), UseCounter::ResultsAttribute); |
| 700 } else if (name == autosaveAttr) { | 700 } else if (name == autosaveAttr) { |
| 701 setNeedsStyleRecalc(); | 701 setNeedsStyleRecalc(); |
| 702 FeatureObserver::observe(document(), FeatureObserver::AutoSaveAttribute)
; | 702 UseCounter::observe(document(), UseCounter::AutoSaveAttribute); |
| 703 } else if (name == incrementalAttr) { | 703 } else if (name == incrementalAttr) { |
| 704 setNeedsStyleRecalc(); | 704 setNeedsStyleRecalc(); |
| 705 FeatureObserver::observe(document(), FeatureObserver::IncrementalAttribu
te); | 705 UseCounter::observe(document(), UseCounter::IncrementalAttribute); |
| 706 } else if (name == minAttr) { | 706 } else if (name == minAttr) { |
| 707 m_inputType->minOrMaxAttributeChanged(); | 707 m_inputType->minOrMaxAttributeChanged(); |
| 708 setNeedsValidityCheck(); | 708 setNeedsValidityCheck(); |
| 709 FeatureObserver::observe(document(), FeatureObserver::MinAttribute); | 709 UseCounter::observe(document(), UseCounter::MinAttribute); |
| 710 } else if (name == maxAttr) { | 710 } else if (name == maxAttr) { |
| 711 m_inputType->minOrMaxAttributeChanged(); | 711 m_inputType->minOrMaxAttributeChanged(); |
| 712 setNeedsValidityCheck(); | 712 setNeedsValidityCheck(); |
| 713 FeatureObserver::observe(document(), FeatureObserver::MaxAttribute); | 713 UseCounter::observe(document(), UseCounter::MaxAttribute); |
| 714 } else if (name == multipleAttr) { | 714 } else if (name == multipleAttr) { |
| 715 m_inputType->multipleAttributeChanged(); | 715 m_inputType->multipleAttributeChanged(); |
| 716 setNeedsValidityCheck(); | 716 setNeedsValidityCheck(); |
| 717 } else if (name == stepAttr) { | 717 } else if (name == stepAttr) { |
| 718 m_inputType->stepAttributeChanged(); | 718 m_inputType->stepAttributeChanged(); |
| 719 setNeedsValidityCheck(); | 719 setNeedsValidityCheck(); |
| 720 FeatureObserver::observe(document(), FeatureObserver::StepAttribute); | 720 UseCounter::observe(document(), UseCounter::StepAttribute); |
| 721 } else if (name == patternAttr) { | 721 } else if (name == patternAttr) { |
| 722 setNeedsValidityCheck(); | 722 setNeedsValidityCheck(); |
| 723 FeatureObserver::observe(document(), FeatureObserver::PatternAttribute); | 723 UseCounter::observe(document(), UseCounter::PatternAttribute); |
| 724 } else if (name == precisionAttr) { | 724 } else if (name == precisionAttr) { |
| 725 setNeedsValidityCheck(); | 725 setNeedsValidityCheck(); |
| 726 FeatureObserver::observe(document(), FeatureObserver::PrecisionAttribute
); | 726 UseCounter::observe(document(), UseCounter::PrecisionAttribute); |
| 727 } else if (name == disabledAttr) { | 727 } else if (name == disabledAttr) { |
| 728 HTMLTextFormControlElement::parseAttribute(name, value); | 728 HTMLTextFormControlElement::parseAttribute(name, value); |
| 729 m_inputType->disabledAttributeChanged(); | 729 m_inputType->disabledAttributeChanged(); |
| 730 } else if (name == readonlyAttr) { | 730 } else if (name == readonlyAttr) { |
| 731 HTMLTextFormControlElement::parseAttribute(name, value); | 731 HTMLTextFormControlElement::parseAttribute(name, value); |
| 732 m_inputType->readonlyAttributeChanged(); | 732 m_inputType->readonlyAttributeChanged(); |
| 733 } | 733 } |
| 734 #if ENABLE(DATALIST_ELEMENT) | 734 #if ENABLE(DATALIST_ELEMENT) |
| 735 else if (name == listAttr) { | 735 else if (name == listAttr) { |
| 736 m_hasNonEmptyList = !value.isEmpty(); | 736 m_hasNonEmptyList = !value.isEmpty(); |
| 737 if (m_hasNonEmptyList) { | 737 if (m_hasNonEmptyList) { |
| 738 resetListAttributeTargetObserver(); | 738 resetListAttributeTargetObserver(); |
| 739 listAttributeTargetChanged(); | 739 listAttributeTargetChanged(); |
| 740 } | 740 } |
| 741 FeatureObserver::observe(document(), FeatureObserver::ListAttribute); | 741 UseCounter::observe(document(), UseCounter::ListAttribute); |
| 742 } | 742 } |
| 743 #endif | 743 #endif |
| 744 #if ENABLE(INPUT_SPEECH) | 744 #if ENABLE(INPUT_SPEECH) |
| 745 else if (name == webkitspeechAttr) { | 745 else if (name == webkitspeechAttr) { |
| 746 if (renderer()) { | 746 if (renderer()) { |
| 747 // This renderer and its children have quite different layouts and s
tyles depending on | 747 // This renderer and its children have quite different layouts and s
tyles depending on |
| 748 // whether the speech button is visible or not. So we reset the whol
e thing and recreate | 748 // whether the speech button is visible or not. So we reset the whol
e thing and recreate |
| 749 // to get the right styles and layout. | 749 // to get the right styles and layout. |
| 750 detach(); | 750 detach(); |
| 751 m_inputType->destroyShadowSubtree(); | 751 m_inputType->destroyShadowSubtree(); |
| 752 m_inputType->createShadowSubtree(); | 752 m_inputType->createShadowSubtree(); |
| 753 if (!attached()) | 753 if (!attached()) |
| 754 attach(); | 754 attach(); |
| 755 } else { | 755 } else { |
| 756 m_inputType->destroyShadowSubtree(); | 756 m_inputType->destroyShadowSubtree(); |
| 757 m_inputType->createShadowSubtree(); | 757 m_inputType->createShadowSubtree(); |
| 758 } | 758 } |
| 759 setFormControlValueMatchesRenderer(false); | 759 setFormControlValueMatchesRenderer(false); |
| 760 setNeedsStyleRecalc(); | 760 setNeedsStyleRecalc(); |
| 761 FeatureObserver::observe(document(), FeatureObserver::PrefixedSpeechAttr
ibute); | 761 UseCounter::observe(document(), UseCounter::PrefixedSpeechAttribute); |
| 762 } else if (name == onwebkitspeechchangeAttr) | 762 } else if (name == onwebkitspeechchangeAttr) |
| 763 setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAt
tributeEventListener(this, name, value)); | 763 setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAt
tributeEventListener(this, name, value)); |
| 764 #endif | 764 #endif |
| 765 else if (name == webkitdirectoryAttr) { | 765 else if (name == webkitdirectoryAttr) { |
| 766 HTMLTextFormControlElement::parseAttribute(name, value); | 766 HTMLTextFormControlElement::parseAttribute(name, value); |
| 767 FeatureObserver::observe(document(), FeatureObserver::PrefixedDirectoryA
ttribute); | 767 UseCounter::observe(document(), UseCounter::PrefixedDirectoryAttribute); |
| 768 } | 768 } |
| 769 else | 769 else |
| 770 HTMLTextFormControlElement::parseAttribute(name, value); | 770 HTMLTextFormControlElement::parseAttribute(name, value); |
| 771 m_inputType->attributeChanged(); | 771 m_inputType->attributeChanged(); |
| 772 } | 772 } |
| 773 | 773 |
| 774 void HTMLInputElement::finishParsingChildren() | 774 void HTMLInputElement::finishParsingChildren() |
| 775 { | 775 { |
| 776 m_parsingInProgress = false; | 776 m_parsingInProgress = false; |
| 777 HTMLTextFormControlElement::finishParsingChildren(); | 777 HTMLTextFormControlElement::finishParsingChildren(); |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1970 } | 1970 } |
| 1971 | 1971 |
| 1972 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1972 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
| 1973 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1973 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
| 1974 { | 1974 { |
| 1975 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); | 1975 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); |
| 1976 } | 1976 } |
| 1977 #endif | 1977 #endif |
| 1978 | 1978 |
| 1979 } // namespace | 1979 } // namespace |
| OLD | NEW |