[webkit-dev] SVG cloneNode?
So I'm looking at cloning SVG nodes in Javascript, and it's looking to me like SVG-specific properties aren't copied on cloning. I don't see SVG properties being stored in an attribute or property map, which suggests to me I'm going to need to modify every single SVG node class, overriding StyledElement's ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] SVG cloneNode?
Sorry for the premature send. StyledElment's void copyNonAttributeProperties(const Element *sourceElement) for every single SVG node. Do you think this is the case or is there a nicer way to do this that doesn't involve my modifying 100+ files? Thanks, Fady On Wed, Jun 30, 2010 at 1:36 PM, Fady Samuel wrote: > So I'm looking at cloning SVG nodes in Javascript, and it's looking to me > like SVG-specific properties aren't copied on cloning. I don't see SVG > properties being stored in an attribute or property map, which suggests to > me I'm going to need to modify every single SVG node class, overriding > StyledElement's > > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] SVG cloneNode?
On Jun 30, 2010, at 10:38 AM, Fady Samuel wrote: > StyledElment's void copyNonAttributeProperties(const Element *sourceElement) > for every single SVG node. Do you think this is the case or is there a nicer > way to do this that doesn't involve my modifying 100+ files? Generally speaking cloning an element and all its attributes as visible in markup does the trick, and other state in the object is not appropriate to clone, and should be regenerated by the element in its new context. It seems unlikely that every SVG element has data that is not stored in an element attribute that needs to be cloned. For comparison, in all of XML and HTML, only one element, , has this. Maybe you could give some specific examples so we can confirm these are all things that should be cloned by cloneNode. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] SVG cloneNode?
Hi Darin, I've attached a sample html file that creates an ellipse and then clones it. The cx, cy, rx, ry properties are not cloned and so we do not see the second ellipse. Fady On Wed, Jun 30, 2010 at 1:41 PM, Darin Adler wrote: > On Jun 30, 2010, at 10:38 AM, Fady Samuel wrote: > > > StyledElment's void copyNonAttributeProperties(const Element > *sourceElement) for every single SVG node. Do you think this is the case or > is there a nicer way to do this that doesn't involve my modifying 100+ > files? > > Generally speaking cloning an element and all its attributes as visible in > markup does the trick, and other state in the object is not appropriate to > clone, and should be regenerated by the element in its new context. > > It seems unlikely that every SVG element has data that is not stored in an > element attribute that needs to be cloned. For comparison, in all of XML and > HTML, only one element, , has this. > > Maybe you could give some specific examples so we can confirm these are all > things that should be cloned by cloneNode. > >-- Darin > > Here is an html paragraph. And below is a svg drawing ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] SVG cloneNode?
Is there a bugzilla bug for this? If not, there should be. Simon On Jun 30, 2010, at 10:47 AM, Fady Samuel wrote: > Hi Darin, > > I've attached a sample html file that creates an ellipse and then clones it. > The cx, cy, rx, ry properties are not cloned and so we do not see the second > ellipse. > > Fady > > > On Wed, Jun 30, 2010 at 1:41 PM, Darin Adler wrote: > On Jun 30, 2010, at 10:38 AM, Fady Samuel wrote: > > > StyledElment's void copyNonAttributeProperties(const Element > > *sourceElement) for every single SVG node. Do you think this is the case or > > is there a nicer way to do this that doesn't involve my modifying 100+ > > files? > > Generally speaking cloning an element and all its attributes as visible in > markup does the trick, and other state in the object is not appropriate to > clone, and should be regenerated by the element in its new context. > > It seems unlikely that every SVG element has data that is not stored in an > element attribute that needs to be cloned. For comparison, in all of XML and > HTML, only one element, , has this. > > Maybe you could give some specific examples so we can confirm these are all > things that should be cloned by cloneNode. > >-- Darin > > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] SVG cloneNode?
As I see it, the issue shown in your test case is that cloning animated attributes does not clone the animation parameters. That’s something we will need to solve. We should not solve it by overriding copyNonAttributeProperties and hand-writing it in each class. I don’t know enough about the SVG animated attributes support to know how to solve the problem myself, but you should make sure we have a bug report in bugs.webkit.org mentioning cloneNode and SVG animated attributes so we can discuss there how to fix it. I imagine the code changes will be in SVGElement.h/cpp and SVGAnimatedProperty.h/cpp. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] SVG cloneNode?
I have just added a bugzilla bug: https://bugs.webkit.org/show_bug.cgi?id=41421 I looked at SVGAnimatedProperty.h briefly but I can't think of a clever way to modify it so that there's a nice, general way to copy these animated attributes to the cloned node. I believe a bunch of files will need to be modified but I could be wrong. Fady On Wed, Jun 30, 2010 at 1:53 PM, Darin Adler wrote: > As I see it, the issue shown in your test case is that cloning animated > attributes does not clone the animation parameters. That’s something we will > need to solve. We should not solve it by overriding > copyNonAttributeProperties and hand-writing it in each class. > > I don’t know enough about the SVG animated attributes support to know how > to solve the problem myself, but you should make sure we have a bug report > in bugs.webkit.org mentioning cloneNode and SVG animated attributes so we > can discuss there how to fix it. > > I imagine the code changes will be in SVGElement.h/cpp and > SVGAnimatedProperty.h/cpp. > >-- Darin > > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] Add WebKit EFL component on Bugzilla
Hi. Could anyone please add a WebKit EFL component on Bugzilla? Thanks, Leandro ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] Integral Type Size of pointer for platform?
Does WebKit define somewhere an integral type that's guaranteed to be the same size as the platform's pointer type? Thanks, Fady Samuel ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] Integral Type Size of pointer for platform?
> Does WebKit define somewhere an integral type that's guaranteed to be the > same size as the platform's pointer type? No, but intptr_t and uintptr_t should work. Geoff ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] Introduction to javascript/DOM api glue code?
Hi all, I am a new comer to webkit and I am looking into adding some new security features to help mitigate XSS attacks and improve mashup security for webkit. I am currently trying to find where the javascript core connects the webcore DOM APIs. For example, upon receiving a piece of script which contains document.write/document.cookie, the javascript core needs to turn to WebCore/dom/Document.cpp. I want to find out how does the glue procedure between Javascript core and webcore go. Also, where is the DOM tree constructed and stored? Can you point me to the related source code is possible? Many thanks in advance. Best, 2010-06-30 Yuchen Zhou Graduate student pursuing PhD degree Computer Engineering Department University of Virginia ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] Introduction to javascript/DOM api glue code?
The interface between JavaScript and the DOM is in WebCore/bindings/js. Much of it is autogenerated from IDL files. The DOM tree is constructed by the parser. You can look at LegacyHTMLTreeBuilder to see how that works. We're current in the process of replacing the tree builder with HTMLTreeBuilder, but it's not done yet. Adam On Wed, Jun 30, 2010 at 3:22 PM, yz8ra wrote: > Hi all, > > I am a new comer to webkit and I am looking into adding some new security > features to help mitigate XSS attacks and improve mashup security for > webkit. > > I am currently trying to find where the javascript core connects the webcore > DOM APIs. For example, upon receiving a piece of script which contains > document.write/document.cookie, the javascript core needs to turn to > WebCore/dom/Document.cpp. I want to find out how does the glue procedure > between Javascript core and webcore go. > > Also, where is the DOM tree constructed and stored? Can you point me to the > related source code is possible? > > Many thanks in advance. > > Best, > > 2010-06-30 > > Yuchen Zhou > Graduate student pursuing PhD degree > Computer Engineering Department > University of Virginia > ___ > webkit-dev mailing list > webkit-dev@lists.webkit.org > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev > > ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev