Closed
Bug 325728
Opened 19 years ago
Closed 18 years ago
changes to markerWidth/markerHeight and orient not handled properly
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
People
(Reporter: longsonr, Assigned: longsonr)
References
Details
Attachments
(3 files, 6 obsolete files)
1.03 KB,
image/svg+xml
|
Details | |
14.43 KB,
patch
|
tor
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
14.39 KB,
patch
|
Details | Diff | Splinter Review |
See bug 320622 comment 10... > And for that matter we should be checking for changes to markerWidth/Height in > DidModifySVGObservable and calling SetCoordCtxRect there too. (And while on the > subject of DidModifySVGObservable it should only be doing the sync mOrientAngle > stuff when 'observable' is mOrientType. Note we aren't currently observing > mMarkerWidth/Height, so you'd need to NS_ADD_SVGVALUE_OBSERVER() them in > Init().) Also orient cannot be changed to an angle. Since it is mapped to an enum, setting to an angle it is rejected by the enum code and the change does not take place.
Assignee | ||
Comment 1•19 years ago
|
||
Assignee | ||
Comment 2•19 years ago
|
||
Assignee | ||
Comment 3•19 years ago
|
||
Attachment #210577 -
Attachment is obsolete: true
Attachment #210582 -
Flags: review?(tor)
Attachment #210577 -
Flags: review?(tor)
Assignee | ||
Comment 4•19 years ago
|
||
Attachment #210582 -
Attachment is obsolete: true
Attachment #210612 -
Flags: review?(tor)
Attachment #210582 -
Flags: review?(tor)
Assignee | ||
Comment 5•19 years ago
|
||
Comment on attachment 210612 [details] [diff] [review] add missing optimisation optimisation breaks things; currently investigating.
Attachment #210612 -
Flags: review?(tor)
Assignee | ||
Comment 6•19 years ago
|
||
GetAttr does not work while the document is loading. Fortunately its possible to get the value directly. Also checked that nsSVGAngle and nsSVGOrient call WillModifySVGObservable and DidModifySVGObservable correctly.
Attachment #210612 -
Attachment is obsolete: true
Attachment #211007 -
Flags: review?(tor)
Assignee | ||
Comment 7•18 years ago
|
||
Comment on attachment 211007 [details] [diff] [review] make it actually work with optimisation need to wait for bug 327437 to be checked in now
Attachment #211007 -
Flags: review?(tor)
Assignee | ||
Updated•18 years ago
|
Attachment #211007 -
Attachment is obsolete: true
Assignee | ||
Comment 8•18 years ago
|
||
Attachment #212734 -
Flags: review?(tor)
Comment on attachment 212734 [details] [diff] [review] update for bug 327437 and with memory reduction Nice. > nsSVGMarkerElement::~nsSVGMarkerElement() > { >+ if (mMarkerWidth) { >+ NS_ADD_SVGVALUE_OBSERVER(mMarkerWidth); >+ } >+ if (mMarkerHeight) { >+ NS_ADD_SVGVALUE_OBSERVER(mMarkerHeight); >+ } You probably meant NS_REMOVE... in those two cases. > NS_IMETHODIMP > nsSVGMarkerElement::DidModifySVGObservable (nsISVGValue* observable, > nsISVGValue::modificationType aModType) > { > #ifdef DEBUG >- printf("markerelement - viewport/viewbox/preserveAspectRatio have been changed\n"); >+ printf("markerelement - markerWidth/markerHeight/viewport/viewbox/preserveAspectRatio have been changed\n"); > #endif > > mViewBoxToViewportTransform = nsnull; > >- // need to sync mOrientAngle >- nsAutoString value; >- nsresult rv = GetAttribute(NS_LITERAL_STRING("orient"), value); >- if (NS_SUCCEEDED(rv)) { >- nsCOMPtr<nsISVGValue> target = do_QueryInterface(mOrientAngle); >- target->SetValueString(value); >- } >+ // sync coordinate context with viewbox: >+ nsIDOMSVGRect *viewbox; >+ mViewBox->GetBaseVal(&viewbox); >+ SetCoordCtxRect(viewbox); Might want to add a test for observable being the viewBox, markerWidth, or MarkerHeight before doing the sync.
Assignee | ||
Comment 10•18 years ago
|
||
Attachment #212734 -
Attachment is obsolete: true
Attachment #212869 -
Flags: review?(tor)
Attachment #212734 -
Flags: review?(tor)
Comment 11•18 years ago
|
||
Comment on attachment 212869 [details] [diff] [review] address review comments > nsSVGMarkerElement::~nsSVGMarkerElement() > { >+ if (mMarkerWidth) { >+ NS_REMOVE_SVGVALUE_OBSERVER(mMarkerWidth); >+ } >+ if (mMarkerHeight) { >+ NS_REMOVE_SVGVALUE_OBSERVER(mMarkerHeight); >+ } > if (mPreserveAspectRatio) { > NS_REMOVE_SVGVALUE_OBSERVER(mPreserveAspectRatio); > } > if (mViewBox) { > NS_REMOVE_SVGVALUE_OBSERVER(mViewBox); > } >- if (mOrientType) { >- NS_REMOVE_SVGVALUE_OBSERVER(mOrientType); >- } > } > > nsresult > nsSVGMarkerElement::Init() > { ... > // add observers -------------------------- : >+ NS_ADD_SVGVALUE_OBSERVER(mMarkerWidth); >+ NS_ADD_SVGVALUE_OBSERVER(mMarkerHeight); > NS_ADD_SVGVALUE_OBSERVER(mViewBox); > NS_ADD_SVGVALUE_OBSERVER(mPreserveAspectRatio); >- NS_ADD_SVGVALUE_OBSERVER(mOrientType); > > return NS_OK; > } I forgot that mapped values are implicitly set as observers, so they don't need to be manually added and removed.
Assignee | ||
Comment 12•18 years ago
|
||
Attachment #212869 -
Attachment is obsolete: true
Attachment #212920 -
Flags: review?(tor)
Attachment #212869 -
Flags: review?(tor)
Comment 13•18 years ago
|
||
Comment on attachment 212920 [details] [diff] [review] address additional review comments and remove misleading debug output > nsSVGMarkerElement::~nsSVGMarkerElement() > { >- if (mPreserveAspectRatio) { >- NS_REMOVE_SVGVALUE_OBSERVER(mPreserveAspectRatio); >- } >- if (mViewBox) { >- NS_REMOVE_SVGVALUE_OBSERVER(mViewBox); >- } >- if (mOrientType) { >- NS_REMOVE_SVGVALUE_OBSERVER(mOrientType); >- } > } If we're going to remove all the guts of the destructor, might as well remove the method entirely. With that change, r=tor.
Attachment #212920 -
Flags: review?(tor) → review+
Assignee | ||
Comment 14•18 years ago
|
||
content has empty destructors in lots of files: nsSVGCircleElement.cpp nsSVGDefsElement.cpp nsSVGTSpanElement.cpp etc, etc. I assume these could/should be fixed throughout but I think that's a separate issue. Can we go with this patch as-is and have a followup bug for the removal of empty destructors from non-inherited classes throughout content.
Comment 15•18 years ago
|
||
Ok, please file a bug about removing those stub methods.
Assignee | ||
Comment 16•18 years ago
|
||
bug 328433 raised for the stub destructor issue.
Assignee | ||
Updated•18 years ago
|
Attachment #212920 -
Flags: superreview?(roc)
Comment on attachment 212920 [details] [diff] [review] address additional review comments and remove misleading debug output + if (aValueAsString.Equals(NS_LITERAL_STRING("auto"))) ... + if (value.Equals(NS_LITERAL_STRING("auto"))) { ... + if (!value.Equals(NS_LITERAL_STRING("auto"))) use EqualsLiteral
Attachment #212920 -
Flags: superreview?(roc) → superreview+
Assignee | ||
Comment 18•18 years ago
|
||
Comment 19•18 years ago
|
||
Checked in for Robert.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•