mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 22:09:32 +02:00
* dom.pp: clean up
git-svn-id: trunk@14362 -
This commit is contained in:
parent
c8efa67ac7
commit
14d42da206
@ -2166,13 +2166,9 @@ begin
|
|||||||
|
|
||||||
ID := Attr.Value;
|
ID := Attr.Value;
|
||||||
p := FIDList.FindOrAdd(DOMPChar(ID), Length(ID), Exists);
|
p := FIDList.FindOrAdd(DOMPChar(ID), Length(ID), Exists);
|
||||||
if not Exists then
|
Result := not Exists;
|
||||||
begin
|
if Result then
|
||||||
p^.Data := Attr.OwnerElement;
|
p^.Data := Attr.OwnerElement;
|
||||||
Result := True;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result := False;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// This shouldn't be called if document has no IDs,
|
// This shouldn't be called if document has no IDs,
|
||||||
@ -2951,14 +2947,9 @@ end;
|
|||||||
function TDOMElement.RemoveAttributeNode(OldAttr: TDOMAttr): TDOMAttr;
|
function TDOMElement.RemoveAttributeNode(OldAttr: TDOMAttr): TDOMAttr;
|
||||||
begin
|
begin
|
||||||
Changing;
|
Changing;
|
||||||
Result:=nil;
|
Result:=OldAttr;
|
||||||
// TODO: DOM 2: must raise NOT_FOUND_ERR if OldAttr is not ours.
|
|
||||||
// -- but what is the purpose of return value then?
|
|
||||||
// TODO: delegate to TNamedNodeMap? Nope, it does not have such method
|
|
||||||
// (note) one way around is to remove by name
|
|
||||||
if Assigned(FAttributes) and (FAttributes.FList.Remove(OldAttr) > -1) then
|
if Assigned(FAttributes) and (FAttributes.FList.Remove(OldAttr) > -1) then
|
||||||
begin
|
begin
|
||||||
Result := OldAttr;
|
|
||||||
if Assigned(OldAttr.FNSI.QName) then // safeguard
|
if Assigned(OldAttr.FNSI.QName) then // safeguard
|
||||||
FAttributes.RestoreDefault(OldAttr.FNSI.QName^.Key);
|
FAttributes.RestoreDefault(OldAttr.FNSI.QName^.Key);
|
||||||
Result.FOwnerElement := nil;
|
Result.FOwnerElement := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user