img will not be shown unless width and height were both set #73

Closed
axbing opened this Issue Apr 25, 2016 · 2 comments

Projects

None yet

3 participants

@axbing
axbing commented Apr 25, 2016 edited

img will not be shown unless width and height were both set.

<style> .grey {background-color:#888888;} .red {color:#FF0000;} .i { width:20px; height:20px;} .width { width:200;} .height { height:200;} </style>
    <img src='https://www.gstatic.com/webp/gallery/1.sm.webp' />
    <img class='width' src='https://www.gstatic.com/webp/gallery/1.sm.webp' />
    <img class='height' src='https://www.gstatic.com/webp/gallery/1.sm.webp' />

imgs above will not be shown.

@luics luics self-assigned this Apr 25, 2016
@luics
Collaborator
luics commented Apr 25, 2016

try:

    <img src='https://www.gstatic.com/webp/gallery/1.sm.webp' />
    <img class='width' src='https://www.gstatic.com/webp/gallery/1.sm.webp' />
    <img class='height' src='https://www.gstatic.com/webp/gallery/1.sm.webp' />

Change class=".width" to class="width" .
webp or other image formats are suported on the image lib suporting the certain format, so try a png url.

@luics luics assigned sospartan and unassigned luics May 5, 2016
@sospartan
Collaborator
sospartan commented May 5, 2016 edited

The ideal process is change the unspecific size after image load. But that will lead to a relayout ,which probably causing a performance issue when using lots of images inside single page. So we only support image component with both width and height before this hidden danger be solved.

@sospartan sospartan closed this May 5, 2016
@sospartan sospartan added a commit that referenced this issue Dec 20, 2016
@xkli @sospartan xkli + sospartan V0.9.4 playground (#73)
* * [ios] fix border's "Overlapping Curves" not recomputed when relayout

* * [ios] change header comment

* * [ios] remove development_team in sdk configuration

* * [ios] Add -1 support for callAddElement

* + [ios] support targetExecuteQueue on module protocol

* * [ios] simplify dispatch call.

* - [ios] remove unused callback parameter in callNative

* + [ios] bugfix:clipboard callback value not rgiht

* + [ios] add default style backgroundcolor for all compnonet

* + [ios]  add feature that other component can modify default style

* + [ios] update fetchResetStyles method

* * [ios] add annotation for keepAlive callback

* + [ios] update text default color

* * [ios] fix crash on events' copy

* + [ios] add textArea keyboard feature

* + [ios] add textArea keyboard feature

* * [ios] text storage lock seems unnecessary here.

* * [ios] Guard against NaN values with WXPixelType

* + [ios] feature default style

* + [ios] add completeURL method.

* + [ios] add default style

* + [ios] add default style

* + [ios] add default style

* + [ios] fix textarea placeholder bug

* + [ios] add feature default style

* + [ios] add feature default style

* + [ios] add feature default style

* + [ios] add default style

* + [ios] add default style

* + [ios] add feature default style

* * [ios] do not trigger display if frame has zero width or height,  because CALayer's display method can only be triggered once in a drawing circle.

* * [ios] update podfile source

* Revert "* [ios] update podfile source"

This reverts commit 4832776.

* * [ios] Add URL rewrite support for relative/file/local path

* + [ios] keep root view frame when keyboard up

* + [ios] keyboard up bug fix

* * [ios] adapter onclick coordinate

* + [ios] delete no use code

* * [ios] fix tests compile error

* + [ios] set origin root frame to CGRectNull

* + [ios] add feature: freeze root view frame when keyboard pick up and root view frame change

* + [ios] add feature: freeze root view frame when keyboard pick up and root view frame change

* * [ios] fix textinput component inputEvent fired repetitiously

* + [ios] add feature picker

* + [ios] define picker toolbar height

* + [ios] add feature date picker

* * [ios] cancel simulator scanner

* * [ios] support components load relative path resource

* * [ios] use urlRewrite maccro

* * [ios] update pospec

* + [ios] Add URL rewrite tests

* * [ios] bugfix add register component type

* * [ios] remove unused code

* * [ios] bug fix 1664, add resetLoadmore on scroller & list.

* 1.targetQueue;2.unitTests

* * [ios] fix compiler complain about warning

* * [ios] update sdk version to 0.9.4

* bugfix

* * [ios] fix testComponentFactory

* + [ios] fix feature datepicker. 1.Split datePick into pickDate and pickTime. 2. Format code style.

* + [ios] fix feature datepicker. change Chinese annotation to English annotation.

* + [ios] fix feature datepicker. format code style.

* + [ios] combine code to wxutility

* + [ios] WXUtility date function description friendly

* * [ios] bugfix component load rewriteurl

* + [ios] bugfix picker

* * [ios] fix code style

* * [ios] bug fix picker

* * [ios] bug fix picker rescue

* * [ios] bug fix picker :Improved code reuse logic

* + [ios] chinese bug fix in texture

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug default style

* * [ios] fix single picker but

* * [ios] bug fix picker

* * [ios] text set default value

* * [ios] text set default value

* * [ios] change reset css not to private method

* * [ios] fix bug:_updateAttributesOnComponentThread reset styles delete

* * [iox] fix 1782.

* * [ios] fix bug: text area cursor auto go to end .reason: if attributes[@"value"] is exist. _updateAttributesOnMainThread will change textview text.the cursor go to end. solution: save the  textview  selectedRange , when set textview.text ,correct it

* * [ios] updateAttributes will execute in main thread , the _updateAttributesOnMainThread could be delete(by zifan)

* * [ios] texture and input keyboard animation not with component. change UIKeyboardDidShowNotification to UIKeyboardWillShowNotification

* * [ios] bugfix cancel url uft8-encode

* * [ios] bug fix: when style change ,text not set height, text's heigh is same as font . like android

* * [ios] bugfix iconfont load font , support woff

* Revert "* [ios] bugfix cancel url uft8-encode"

* Revert "Revert "* [ios] bugfix cancel url uft8-encode""

This reverts commit 0250453.

* * [ios] use absoluteString as key

* + [ios] when styles change ,height not set , text should show content and height is refer to fantasize . this function is same as android and h5 . I think all default should set next version

* * [ios] bug fix update code style

* * [ios] bug fix: change resetTextCSSNodes to resetTextCSSNode

* * [ios] change resetTextCSSNodes to resetTextCSSNode

* * [ios] change default height to wxcomponent

* * [ios] bug fix setNeedsLayout in every elements. not in once. because elements not contain css node only

* * [ios] image placeholder compatible

* * [ios] change default Process

* * [ios]  update reset styles

* + [ios] delete blank

* * [ios] add reset styles

* * [ios] delete not use code

* * [ios] update reset cssnode

* * [ios] change style to filterstyle

* * [ios] change default value CSS_UNDEFINED to 0.0,because their value is 0.0(float)

* * [ios] set fontsize to default

* * [ios] update _fontsize default WX_TEXT_FONT_SIZE

* add targetqueue to clipboard

* * [ios] -1 will be converted wrong in 32bit devices, so we should convert it to Int 32 first.

* * [ios] force convert

* * [ios] fix bug that setFrame incorrectly when transform has been set

From the UIView's frame documentation:
https://developer.apple.com/reference/uikit/uiview#//apple_ref/occ/instp/UIView/frame
Warning : If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.
So layer's transform must be reset to CATransform3DIdentity before setFrame, otherwise frame will be incorrect

* + [example] fix  1:#1570, update navigator demo. substitute require(xx) for $call(x) and fix the push url error in Html5.

* + [example] fix Update slider-neighbor demo.

* + [ios] fix course bug and add focus for textarea

* * [ios] update view to input view and textview

* * [ios] format code

* + [example] add picker demo for playground

* * [ios] add getComponentRect Example

* * [example] update the input demo

* + [ios] fix bug http://velocity.alibaba-inc.com/issues/3232.  the index of slider component is invalid in less than two entries.

* * [example] update the input demo

* * [example] set autofocus after 1000ms

* * [ios] update podfile and add an interface for weex handler.

* * [ios]  update podfile

* + [ios] add custom environment entry.

* * [ios] update podfile

* * [ios] update podfile

* * [ios] update weex bundle js

* * [example] merger example branche

* *[example] update example

* *[example] add component example slider and process-bar

* *[android] recover main.js

* * [android] update version

* *[android] update inspection version 0.8.0.0

* *[android] update version code

* *[android] update version code

* Revert "*[android] update version code"

This reverts commit 50da9a94666bcf8c39973c41d85a657fb3b13a5f.

* * [ios] enable set neighbor-space for slider-neighbor

* *[android] update WXOkhttpDispatcher.java remove OkHttpInterceptor

* * [ios] allow native notification call JS callback

* * [ios] fix : Compatible non-standard url ("//a.b.example.png")

* * [ios] use weexInstanceId to fireGlobalEvent

* * [ios] in case that userInstanceId exist but the real instance has been dealloced

* * [ios] add annotation about fireglobalEvent

* * [ios] update bundle js

* * [ios] update bundle js

* * [ios] update bundle js

* * [ios] update playground version to 1.3

* * [ios] texture bug fix : when input change . the text content send to change

* * [example] update assets example

* * [example] update index.we

* * [example] update web-demo.we

* * [example] add new show case
4c0405f
@sospartan sospartan added a commit that referenced this issue Dec 20, 2016
@sospartan sospartan V0.10.0 stable feature merge094 (#77)
* * [android] update WXModule.java support ModueEvent

* * [android] update usertracker

* V0.9.4 example (#68)

* * [example] merger example branche

* *[example] update example

* *[example] add component example slider and process-bar

* *[android] recover main.js

* slider-neighbor bug fix. add neighbor-space attr.

* * [android] update WXImage.java

* V0.9.4 playground (#73)

* * [ios] fix border's "Overlapping Curves" not recomputed when relayout

* * [ios] change header comment

* * [ios] remove development_team in sdk configuration

* * [ios] Add -1 support for callAddElement

* + [ios] support targetExecuteQueue on module protocol

* * [ios] simplify dispatch call.

* - [ios] remove unused callback parameter in callNative

* + [ios] bugfix:clipboard callback value not rgiht

* + [ios] add default style backgroundcolor for all compnonet

* + [ios]  add feature that other component can modify default style

* + [ios] update fetchResetStyles method

* * [ios] add annotation for keepAlive callback

* + [ios] update text default color

* * [ios] fix crash on events' copy

* + [ios] add textArea keyboard feature

* + [ios] add textArea keyboard feature

* * [ios] text storage lock seems unnecessary here.

* * [ios] Guard against NaN values with WXPixelType

* + [ios] feature default style

* + [ios] add completeURL method.

* + [ios] add default style

* + [ios] add default style

* + [ios] add default style

* + [ios] fix textarea placeholder bug

* + [ios] add feature default style

* + [ios] add feature default style

* + [ios] add feature default style

* + [ios] add default style

* + [ios] add default style

* + [ios] add feature default style

* * [ios] do not trigger display if frame has zero width or height,  because CALayer's display method can only be triggered once in a drawing circle.

* * [ios] update podfile source

* Revert "* [ios] update podfile source"

This reverts commit 4832776.

* * [ios] Add URL rewrite support for relative/file/local path

* + [ios] keep root view frame when keyboard up

* + [ios] keyboard up bug fix

* * [ios] adapter onclick coordinate

* + [ios] delete no use code

* * [ios] fix tests compile error

* + [ios] set origin root frame to CGRectNull

* + [ios] add feature: freeze root view frame when keyboard pick up and root view frame change

* + [ios] add feature: freeze root view frame when keyboard pick up and root view frame change

* * [ios] fix textinput component inputEvent fired repetitiously

* + [ios] add feature picker

* + [ios] define picker toolbar height

* + [ios] add feature date picker

* * [ios] cancel simulator scanner

* * [ios] support components load relative path resource

* * [ios] use urlRewrite maccro

* * [ios] update pospec

* + [ios] Add URL rewrite tests

* * [ios] bugfix add register component type

* * [ios] remove unused code

* * [ios] bug fix 1664, add resetLoadmore on scroller & list.

* 1.targetQueue;2.unitTests

* * [ios] fix compiler complain about warning

* * [ios] update sdk version to 0.9.4

* bugfix

* * [ios] fix testComponentFactory

* + [ios] fix feature datepicker. 1.Split datePick into pickDate and pickTime. 2. Format code style.

* + [ios] fix feature datepicker. change Chinese annotation to English annotation.

* + [ios] fix feature datepicker. format code style.

* + [ios] combine code to wxutility

* + [ios] WXUtility date function description friendly

* * [ios] bugfix component load rewriteurl

* + [ios] bugfix picker

* * [ios] fix code style

* * [ios] bug fix picker

* * [ios] bug fix picker rescue

* * [ios] bug fix picker :Improved code reuse logic

* + [ios] chinese bug fix in texture

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug height change to zero when style change

* * [ios] fix bug default style

* * [ios] fix single picker but

* * [ios] bug fix picker

* * [ios] text set default value

* * [ios] text set default value

* * [ios] change reset css not to private method

* * [ios] fix bug:_updateAttributesOnComponentThread reset styles delete

* * [iox] fix 1782.

* * [ios] fix bug: text area cursor auto go to end .reason: if attributes[@"value"] is exist. _updateAttributesOnMainThread will change textview text.the cursor go to end. solution: save the  textview  selectedRange , when set textview.text ,correct it

* * [ios] updateAttributes will execute in main thread , the _updateAttributesOnMainThread could be delete(by zifan)

* * [ios] texture and input keyboard animation not with component. change UIKeyboardDidShowNotification to UIKeyboardWillShowNotification

* * [ios] bugfix cancel url uft8-encode

* * [ios] bug fix: when style change ,text not set height, text's heigh is same as font . like android

* * [ios] bugfix iconfont load font , support woff

* Revert "* [ios] bugfix cancel url uft8-encode"

* Revert "Revert "* [ios] bugfix cancel url uft8-encode""

This reverts commit 0250453.

* * [ios] use absoluteString as key

* + [ios] when styles change ,height not set , text should show content and height is refer to fantasize . this function is same as android and h5 . I think all default should set next version

* * [ios] bug fix update code style

* * [ios] bug fix: change resetTextCSSNodes to resetTextCSSNode

* * [ios] change resetTextCSSNodes to resetTextCSSNode

* * [ios] change default height to wxcomponent

* * [ios] bug fix setNeedsLayout in every elements. not in once. because elements not contain css node only

* * [ios] image placeholder compatible

* * [ios] change default Process

* * [ios]  update reset styles

* + [ios] delete blank

* * [ios] add reset styles

* * [ios] delete not use code

* * [ios] update reset cssnode

* * [ios] change style to filterstyle

* * [ios] change default value CSS_UNDEFINED to 0.0,because their value is 0.0(float)

* * [ios] set fontsize to default

* * [ios] update _fontsize default WX_TEXT_FONT_SIZE

* add targetqueue to clipboard

* * [ios] -1 will be converted wrong in 32bit devices, so we should convert it to Int 32 first.

* * [ios] force convert

* * [ios] fix bug that setFrame incorrectly when transform has been set

From the UIView's frame documentation:
https://developer.apple.com/reference/uikit/uiview#//apple_ref/occ/instp/UIView/frame
Warning : If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.
So layer's transform must be reset to CATransform3DIdentity before setFrame, otherwise frame will be incorrect

* + [example] fix  1:#1570, update navigator demo. substitute require(xx) for $call(x) and fix the push url error in Html5.

* + [example] fix Update slider-neighbor demo.

* + [ios] fix course bug and add focus for textarea

* * [ios] update view to input view and textview

* * [ios] format code

* + [example] add picker demo for playground

* * [ios] add getComponentRect Example

* * [example] update the input demo

* + [ios] fix bug http://velocity.alibaba-inc.com/issues/3232.  the index of slider component is invalid in less than two entries.

* * [example] update the input demo

* * [example] set autofocus after 1000ms

* * [ios] update podfile and add an interface for weex handler.

* * [ios]  update podfile

* + [ios] add custom environment entry.

* * [ios] update podfile

* * [ios] update podfile

* * [ios] update weex bundle js

* * [example] merger example branche

* *[example] update example

* *[example] add component example slider and process-bar

* *[android] recover main.js

* * [android] update version

* *[android] update inspection version 0.8.0.0

* *[android] update version code

* *[android] update version code

* Revert "*[android] update version code"

This reverts commit 50da9a94666bcf8c39973c41d85a657fb3b13a5f.

* * [ios] enable set neighbor-space for slider-neighbor

* *[android] update WXOkhttpDispatcher.java remove OkHttpInterceptor

* * [ios] allow native notification call JS callback

* * [ios] fix : Compatible non-standard url ("//a.b.example.png")

* * [ios] use weexInstanceId to fireGlobalEvent

* * [ios] in case that userInstanceId exist but the real instance has been dealloced

* * [ios] add annotation about fireglobalEvent

* * [ios] update bundle js

* * [ios] update bundle js

* * [ios] update bundle js

* * [ios] update playground version to 1.3

* * [ios] texture bug fix : when input change . the text content send to change

* * [example] update assets example

* * [example] update index.we

* * [example] update web-demo.we

* * [example] add new show case

* * [html5] fix h5 build

* * [android] fix build
4d208a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment