MiddleCroppingLabelFrame.cpp (1467B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "MiddleCroppingLabelFrame.h" 8 9 #include "MiddleCroppingBlockFrame.h" 10 #include "mozilla/PresShell.h" 11 #include "mozilla/dom/Element.h" 12 13 nsIFrame* NS_NewMiddleCroppingLabelFrame(mozilla::PresShell* aPresShell, 14 mozilla::ComputedStyle* aStyle) { 15 return new (aPresShell) 16 mozilla::MiddleCroppingLabelFrame(aStyle, aPresShell->GetPresContext()); 17 } 18 19 namespace mozilla { 20 21 void MiddleCroppingLabelFrame::GetUncroppedValue(nsAString& aValue) { 22 mContent->AsElement()->GetAttr(nsGkAtoms::value, aValue); 23 } 24 25 nsresult MiddleCroppingLabelFrame::AttributeChanged(int32_t aNameSpaceID, 26 nsAtom* aAttribute, 27 AttrModType) { 28 if (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::value) { 29 UpdateDisplayedValueToUncroppedValue(true); 30 } 31 return NS_OK; 32 } 33 34 NS_QUERYFRAME_HEAD(MiddleCroppingLabelFrame) 35 NS_QUERYFRAME_ENTRY(MiddleCroppingLabelFrame) 36 NS_QUERYFRAME_TAIL_INHERITING(MiddleCroppingBlockFrame) 37 NS_IMPL_FRAMEARENA_HELPERS(MiddleCroppingLabelFrame) 38 39 } // namespace mozilla